Problem with joint angular initial condition in SimMechanics.

조회 수: 11 (최근 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 CenterFile Exchange에서 Assembly에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by