Problem with joint angular initial condition in SimMechanics.
1 次查看(过去 30 天)
显示 更早的评论
I have a simple pendulum system in SimMechanics, the pendulum body block is connected to a revolute block which is attached to a initial condition block. Everything is fine dynamics-wise.
However let's say I want to initialize the pendulum at an angle of 1.1*pi, all angles are positive measured anticlockwise from the bottom position, and negative in the clockwise direction. The problem arises when the simulation runs. When I print out the angle of the pendulum at each time step, I discover that the pendulum was initialized with an angle of MINUS 0.9*pi, i.e the model takes my initial condition angle and returns the angle between -pi and +pi which corresponds to the same point. I don't want this to happen! Is there a way to get the solver to treat my initial condition as exactly what it is?
NOTE: I am aware of the "Continuous Angle" block which I am using when I measure the angle, this works fine once the simulation is under way (i.e there are no discontinuities in angle measurement when my pendulum makes a loop) but it doesn't help the fact that the angle is initialized incorrectly...
Any help would be greatly appreciated!
1 个评论
SAMAR
2013-2-25
dude, try to take the modulus value of the angle and then integrate with respect to time., so after 360 degree of rotation, make ur initial value to zero by making any conditional subsystem.
回答(1 个)
Steve Miller
2018-3-6
You should add the proper offset to the measured value so that your measurements start with the value you expected.
--Steve
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assembly 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!