Why is the Body Sensor giving wrong results when I am working with respect to the LOCAL Coordinate System?
1 view (last 30 days)
Show older comments
I have encountered a dilemma while simulating a complicated pendulum using SimMechanics. I have plotted the position of the center of gravity of the pendulum with respect to both the absolute coordinate system and the local body coordinate system.
The position of the pendulum with respect to the local coordinate system is not correct. I believe that the position of the center of gravity of the pendulum with respect to the local coordinate system should be (0,0,0) throughout the simulation. This is not demonstrated by the plot.
Additionally, all four plots exhibit fine structure not present in the physical system.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This is not a bug. When you decide to sense with respect to World for position, p(t), velocity, v(t), or acceleration, a(t), then you get the pos, vel, or acc of the origin of the connected Coordinate System (CSys) with respect to the world CSys. If you select with respect to Local then you get R'(t)*p(t), R'(t)*v(t), and R'(t)*a(t), where R(t) maps vectors in the local frame to the corresponding vector in the World frame. R'(t) is the transpose, or inverse, of this map. It therefore represents World vectors in Local coordinates.
0 Comments
More Answers (0)
See Also
Categories
Find more on Assembly in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!