フィルターのクリア

Problem with joint angular initial condition in SimMechanics.

1 回表示 (過去 30 日間)
Dave
Dave 2012 年 11 月 1 日
回答済み: Steve Miller 2018 年 3 月 6 日
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
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
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

カテゴリ

Help Center および File ExchangeAssembly についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by