Forward Dynamics only works for short intervals

The Question and Answer and Support Forum for the 2017 Fall Virtual Workshop.
POST REPLY
User avatar
Míriam Febrer-Nafría
Posts: 26
Joined: Thu Apr 18, 2013 4:14 am

Forward Dynamics only works for short intervals

Post by Míriam Febrer-Nafría » Wed Oct 25, 2017 2:12 am

Hi all,

I have some questions regarding Forward Dynamics. I’m running it from the GUI.

My model is based on the Gait2354_Simbody, scaled to a subject and modified by adding two KAFOs (attached using weld joints to foot, shank and thigh respectively), and adding the mass of a backpack at the torso. When I run IK and ID, the residuals values are inside the values referred as “OKAY” in the user’s guide.

The orthoses are only actuated at the knee, and at ankle level they have some stiffness. I want to model the orthosis ankle stiffness and the actuator of the knee motor, and test or validate these elements by running a torque-driven simulation (I don’t need to descend to muscle level).

The first step is to run Forward Dynamics, without modelling yet the orthosis joints. So I have run RRA, and I have obtained the controls for each of the ideal and reserve torques (six for pelvis DOFs, and one per each other DOF). I have read that locking the subtalar and mtp joints works well, so I’ve done this. I have also checked the pelvis COM location in the Actuators files, to match the pelvis COM of the scaled model.

When I run Forward Dynamics for a duration of 0.2s, everything works OK. I have tried different time intervals, and the model follows closely the experimental motion. But when I try to run it for a greater duration, the model “goes crazy” and the bodies do more than two or three complete circles.

The options I have selected are:
- Controls: the obtained from RRA
- Initial state: I put the model in the initial position (I have the motion loaded in the model and I select the initial time)
- Actuators: the same file as for RRA, and I have checked “Replace model’s force set”
- External loads: the GRFs from the experimental capture
- Integrator settings: what is in the Tool by default

I suppose that the problem may be related with the accumulated error from the integration, but how can I solve this? Running “short” FDs and “join” the results will lead to a correct solution?

Thanks in advance,
Míriam Febrer

User avatar
Míriam Febrer-Nafría
Posts: 26
Joined: Thu Apr 18, 2013 4:14 am

Re: Forward Dynamics only works for short intervals

Post by Míriam Febrer-Nafría » Wed Oct 25, 2017 4:25 am

Now I've tried to apply the GRFs to the pelvis, instead than to the feet. In this case, the Forward Dynamics Tool works ok for the complete gait cycle.

So perhaps the problem is that I have something wrong in the definition of the GRFs? But since ID gives good values for residuals, I think that they are well defined.

I attach the model, and the setup and input files for both cases: “GRF applied at calcaneous”, “GRF applied at pelvis”.

Thanks
Attachments
GRF_pelvis.rar
(203.74 KiB) Downloaded 72 times
GRF_calcn.rar
(228.85 KiB) Downloaded 60 times

User avatar
Thomas Uchida
Posts: 1777
Joined: Wed May 16, 2012 11:40 am

Re: Forward Dynamics only works for short intervals

Post by Thomas Uchida » Wed Oct 25, 2017 4:35 am

I suppose that the problem may be related with the accumulated error from the integration
Yes, it sounds like this is the issue. In general, numerical errors will accumulate in such a simulation without closed-loop control.
how can I solve this? Running “short” FDs and “join” the results will lead to a correct solution?
That strategy might work but it is not recommended. You might consider tracking experimental kinematics using Static Optimization or CMC; there are several examples of this workflow on Confluence (https://simtk-confluence.stanford.edu/d ... +Tutorials).

User avatar
Míriam Febrer-Nafría
Posts: 26
Joined: Thu Apr 18, 2013 4:14 am

Re: Forward Dynamics only works for short intervals

Post by Míriam Febrer-Nafría » Wed Oct 25, 2017 1:50 pm

Thanks, Tom,

I am working on the examples on SO and CMC.

But I would like to stay at torque level, without descending at muscles. It is possible to run a FD without considering muscles? What should I do for that?

Thanks again,
Míriam Febrer

User avatar
Apoorva Rajagopal
Posts: 5
Joined: Wed Aug 05, 2009 3:25 pm

Re: Forward Dynamics only works for short intervals

Post by Apoorva Rajagopal » Wed Oct 25, 2017 2:42 pm

Hi Miriam,

What quantities are you aiming to compute using your forward dynamics solutions? This may determine what tool is best suited for your application.

The RRA tool essentially runs a closed-loop tracking forward simulation that roughly tracks desired kinematics. Running an open-loop forward simulation using kinematics and controls from RRA will, as you suspected, lead to accumulated numerical error and will tend to go unstable.

- Apoorva

User avatar
Míriam Febrer-Nafría
Posts: 26
Joined: Thu Apr 18, 2013 4:14 am

Re: Forward Dynamics only works for short intervals

Post by Míriam Febrer-Nafría » Wed Oct 25, 2017 5:09 pm

Hi Apoorva,

What I want to do is to model the ankle stiffness and the knee motor actuation. For trying different values, what I thought was to run different FD simulations (with different values for these two elements, and the controls for joint torques computed from the experimental motion through RRA) and compare the resulting motion with the experimental one.

But now I am not sure about this workflow, so what I'm trying now is to solve an optimal control using direct collocation. The scheme that we use in our lab is like a residual reduction algorithm, where motion can be changed (coordinates, velocities and accelerations are optimization variables), and also torques can be predicted. Inside the optimization we perform an ID with the motion predicted at each iteration, and we impose as a constraint that the residuals are near zero, and the torques predicted equal the torques obtained from the ID.

Initially, I wanted to perform all the simulations in the OpenSim GUI, but I will try to work with this second approach. I have to think a little bit more about how to take into account in this scheme the motor actuation.

Do you have any idea?

Thanks,
Míriam

POST REPLY