Page 1 of 2

Torque-driven simulation

Posted: Sun Jul 22, 2012 10:26 pm
by paulinegerus
Hi,

I am trying to create a forward dynamics using only torque without muscles.
It seems that it's possible by using the Forward Dynamics tool but I don't know how can I create the xml files containing the joint torque at each time.

https://simtk.org/forums/viewtopic.php?f=91&t=1295

Is it possible to drive a simulation using torque in the GUI, or do I need to use API mode ?
Do you have an example of actuator xml file containing the torque to drive the simulation ?

Thanks,

Cheers,

Pauline Gerus

Re: Torque-driven simulation

Posted: Sun Jul 22, 2012 10:58 pm
by rudi
Hi Pauline,

You can create a torque-driven forward simulation, for example, by using RRA actuators, controls, and states as inputs to Forward tool.

Hope this helps!

Rudi

Re: Torque-driven simulation

Posted: Tue Jul 24, 2012 5:30 pm
by paulinegerus
Hi Rudi,

thanks for your reply. I've tried to drive Forward dynamics by using RRA outputs (3DgaitModel2354).

However, it didn't work, the simulation became crazy. I have no idea to solve my problem.
Any example ?
Thanks,

Cheers,

Pauline

Re: Torque-driven simulation

Posted: Wed Jul 25, 2012 9:51 am
by aymanh
Hi Pauline,

Please make sure you apply ground reaction forces the same way you did in RRA and also that the same Actuators and Controls are used. Generally speaking, without a feedback controller to handle deviations due to numerics, this may not be stable for a long time.

Hope this helps,
-Ayman

Re: Torque-driven simulation

Posted: Sun Jul 29, 2012 11:00 pm
by paulinegerus
Hi Ayman,

I have tried to run the Forward dynamics with the ground reaction forces, the Actuators, States and Controls from RRA, and it didn't work.

I attached the setup file and all the input files that I used for the Forward dynamics.

Could you tell me if I missed something ?

Do I need to change the osim file and remove all the muscles or something else?

Thanks,

Pauline

Re: Torque-driven simulation

Posted: Mon Jul 30, 2012 4:48 am
by rudi
Hi Pauline,

I found quickly at least one error; you should check "Replace model's force set" in Actuators - just like in a RRA setup - in order to use RRA actuators. In your setup, you tried to use muscles, which made the simulation crazy.

Good luck,

Rudi

Re: Torque-driven simulation

Posted: Mon Jul 30, 2012 4:40 pm
by paulinegerus
Hi Rudi,

Thanks for your reply.

I tried to run FD with "Replace model's force set", the simulation was crazy.
After that I removed the muscles in the osim file, the simulation was again crazy.

I don't know where is the problem.

Pauline

Re: Torque-driven simulation

Posted: Tue Jul 31, 2012 3:26 am
by rudi
Hi Pauline,

Actually, you had not applied ground reaction forces; your external loads .xml file did not include any forces or torques. Also, kinematics for external loads was missing. You can find help for creating external loads files online. In addition, I recommend to check "Use time steps from states file" in Integrator Settings. And there is no need to remove muscles.

Good luck,

Rudi

Re: Torque-driven simulation

Posted: Tue Jul 31, 2012 4:14 pm
by paulinegerus
Hi Rudi,

the external load and kinematic are included in forces_grf.xml. It's not the problem.
I have tried a lot of different things.

Is it really possible to run Foward Dynamics based on Torque by using the GUI ? Do I need to develop my own code in API mode?

Thanks,

Pauline

Re: Torque-driven simulation

Posted: Wed Aug 01, 2012 1:24 am
by rudi
Hi Pauline,

I am sorry, I had viewed your setup file in OpenSim 2.2.1 which did not show the external loads you had specified. In OpenSim 2.4 it is fine. I changed the external loads kinematics file. I think your biggest problem was too long integration time. As Ayman wrote, the simulation won't be stable for a long time. I run the simulation for 0.05 s, and one can already see deviation.

I attached the edited setup file, and results.

You really don't need API to do this!

Rudi