Torque-driven simulation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Gerus Pauline
Posts: 12
Joined: Mon Dec 10, 2007 6:28 am

Torque-driven simulation

Post by Gerus Pauline » Sun Jul 22, 2012 10:26 pm

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

User avatar
Rudolf Klemetti
Posts: 48
Joined: Thu Jul 15, 2010 3:09 pm

Re: Torque-driven simulation

Post by Rudolf Klemetti » Sun Jul 22, 2012 10:58 pm

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

User avatar
Gerus Pauline
Posts: 12
Joined: Mon Dec 10, 2007 6:28 am

Re: Torque-driven simulation

Post by Gerus Pauline » Tue Jul 24, 2012 5:30 pm

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

User avatar
Ayman Habib
Posts: 2244
Joined: Fri Apr 01, 2005 12:24 pm

Re: Torque-driven simulation

Post by Ayman Habib » Wed Jul 25, 2012 9:51 am

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

User avatar
Gerus Pauline
Posts: 12
Joined: Mon Dec 10, 2007 6:28 am

Re: Torque-driven simulation

Post by Gerus Pauline » Sun Jul 29, 2012 11:00 pm

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
Attachments
FD_test.zip
(1016.41 KiB) Downloaded 96 times

User avatar
Rudolf Klemetti
Posts: 48
Joined: Thu Jul 15, 2010 3:09 pm

Re: Torque-driven simulation

Post by Rudolf Klemetti » Mon Jul 30, 2012 4:48 am

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

User avatar
Gerus Pauline
Posts: 12
Joined: Mon Dec 10, 2007 6:28 am

Re: Torque-driven simulation

Post by Gerus Pauline » Mon Jul 30, 2012 4:40 pm

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

User avatar
Rudolf Klemetti
Posts: 48
Joined: Thu Jul 15, 2010 3:09 pm

Re: Torque-driven simulation

Post by Rudolf Klemetti » Tue Jul 31, 2012 3:26 am

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

User avatar
Gerus Pauline
Posts: 12
Joined: Mon Dec 10, 2007 6:28 am

Re: Torque-driven simulation

Post by Gerus Pauline » Tue Jul 31, 2012 4:14 pm

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

User avatar
Rudolf Klemetti
Posts: 48
Joined: Thu Jul 15, 2010 3:09 pm

Re: Torque-driven simulation

Post by Rudolf Klemetti » Wed Aug 01, 2012 1:24 am

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
Attachments
Pauline.zip
An example setup and results
(1.22 MiB) Downloaded 118 times

POST REPLY