SimMechanics Inverse and Forward Dynamics

18 views (last 30 days)
Hello everyone,
I beg your help, because I've been fighting this problem for more than a week without any particular result...
So, I have a Simulink block-diagram representing 5-links with 5 revolute joints robot-manipulator. First I solve Inverse Dynamics, motion is given to the model as a Nx3 vector with motion, velocity and acceleration, N - is number of steps. Normally I take 1 sec time period with 100 steps. In a simpliest case motion is rotation of 1st joint for pi/2 radians with acceleration within first 0.1 sec, constant motion within interval [0.1, 0.9], and decelearation within last 0.1 sec.
The result of Inverse Dynamics is a portion of computed torques on every joint. This part of simulation goes smoothly. Next I want to perform Forward Dynamics with torques I recieved in previous step, just to check if model works well. And here I have a problem. Results of Forward Dynamics do not match initial motion I set in the beginning, although if I put a sensor on a joint drawing torques, the torques on output match torques on input. So I quess that everything should work... But it doesn't.
Please someone help me. Many thanks in advance.
PS: Here is the link for the model (for a reduced model actually - only 3 joints).
File Initial_motion.mat contains Nx3 vector of motion for the first joint. Load this file first. File robomy_q123 contains simulink model for Inverse Dynamics. After running it, run file Q_fnc.m, which converts torques in function of time. Than run Simulink file robomy_q123_torq, which solves Forward dynamics.
Maybe it would help.

Accepted Answer

Arnaud Miege
Arnaud Miege on 2 Mar 2011
You won't generally get a similar motion when applying torques measured from inverse dynamics. Since torque is 2 levels of integration from position, a very small difference (within the solver and assembly tolerance) will quickly make the position drift away.
Depending on the stability of the system, the difference in results will change significantly. In these example models, if you remove gravity in both models, the system becomes stable and only drifts by a fraction of a degree.
  1 Comment
Peter
Peter on 3 Mar 2011
Yea, removing gravity really helps, but I certainly should consider gravity in my work... Do you think that it is not possible to stabilize system with gravity turned on?

Sign in to comment.

More Answers (1)

Guy Rouleau
Guy Rouleau on 7 Mar 2011
Hi Peter,
In your question you mention that the reason for doing this is "just to check if model works well". I do not think it is a good way to "check if model works well"
The Inverse dynamics mode should be used for design. You provide a motion and SimMechanics returns the torque necessary to obtain this motion. You can then use this torque in your design, for example to select a motor and gearbox.
SimMechanics is a numerical solver with a tolerance, not an analytical solver. This is why it is not always possible to go back and forth between inverse and forward dynamics... especially for a system in an unstable configuration like yours.
This phenomenon is explained in the SimMechanics documentation, using the four-bar mechanism:
http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/mech/ug/f0-6046.html
  1 Comment
Serhii Bahdasariants
Serhii Bahdasariants on 17 Nov 2021
Hi Guy,
Can I please ask you to post a link to explanation again? I cannot find it in a new version.
Thanks in advance!!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!