Inverse Dynamics and constraint forces

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Tom Lintern
Posts: 61
Joined: Mon Dec 13, 2010 5:43 pm

Inverse Dynamics and constraint forces

Post by Tom Lintern » Wed Jun 06, 2012 12:13 am

Hi all,

I am wondering how constraint forces influence reuslts in an inverse dynamics analysis. I have a model (attached) where the intermediate bodies are kinematically constrained to the pose of the end effector. A simple test case is attached where each joint is just a pin joint and no muscle forces are included in the model.

I apply a load and the moments on the joints are not what I would expect analytically. I suspect the differences are due to constraint forces but are they due to the kinematic constraints or due to the reduced dof constraint imposed by the pin joint?

I wish to find the realtionship between the joint moments and the joint angles for each of the joints with a given set of kinematic constraints. Would a JointReaction analysis be appropriate? If so, is it possible to run an analysis without any muscles (or active components) in the model? It seems that when I run the analyze_setup file in the folder attached, the model does not move from its default position?

Any help would be much appreciated.
Thanks,
Tom
Attachments
files.zip
(15.19 KiB) Downloaded 22 times

User avatar
Tom Lintern
Posts: 61
Joined: Mon Dec 13, 2010 5:43 pm

Re: Inverse Dynamics and constraint forces

Post by Tom Lintern » Sun Jun 10, 2012 4:53 pm

Hi all,

I seem to have half solved my problem. I can get the correct joint moments if I express the force and point in the ground reference frame. I needed to omit the <external_loads_model_kinematics_file> tag in the external_loads set up file. The problem was specifying the external loads correctly rather than forces due to any constraints.

How would I instead apply the force and point in the "sk" body reference frame? I have tried to specify the <external_loads_model_kinematics_file> to match the ik results but the inverse dynamics results are incorrect. Can you quickly explain the way to apply a force and point NOT in the ground frame and also the format of the <external_loads_model_kinematics_file> necessary to do this?

Thanks,
Tom

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

Re: Inverse Dynamics and constraint forces

Post by Ayman Habib » Mon Jun 11, 2012 11:00 am

Hi Tom,

More than likely you don't need to specify external_loads_model_kinematics_file, and it's used only to transform the point of force application from ground frame to a specific body frame based on the provided kinematics. I'd try to do without it and use the settings in the external loads definition to describe what frame are the forces/application-point in and which bodies it applies to and the ExternalLoads will take care of the rest for you.

Can you explain how the data is collected and what frame(s) are the point of application and the force vectors expressed in?

Please let us know so we can help you further and also so that we can beef up the documentation for future reference.

Best regards,
-Ayman

User avatar
Tom Lintern
Posts: 61
Joined: Mon Dec 13, 2010 5:43 pm

Re: Inverse Dynamics and constraint forces

Post by Tom Lintern » Tue Jun 12, 2012 12:06 am

Hi Ayman,

Eventually I will be obtaining force and torque date using a force sensor mounted to the head, meaning that the measurements will always be applied at a fixed point in the head reference frame and the force vectors expressed in the head reference frame.

However, I am still having problems expressing forces not in the ground frame. I know I could just transform everything but it would be easier not to. To test this I created the following test case with 2 unit length bodies and 2 pin joints:

Image

I have applied a 100N load in the ground CS perpindicaular to the 2nd link pointing downwards i.e. F = [0,-100N,0] and expressed the point in the ground CS (which I know is correct as I can visualise the force). The inverse dynamic results are correct with the moment about both joints being 170.7Nm and 100Nm respectively (nb this is a static case and gravity has been excluded).

These do not agree with my results when I express the force in the 2nd link ref frame. The force vector was [100N,0,0] (expressed in link2) and the point was [0,0.5m,0] (expressed in link 2). The force_setup file was also changed to reflect this. The moments about the joints were now 200Nm and 100Nm respectively. I have attached my setup files and I would really appreciate if you can see any reason for this discrepancy? I have spent a fair bit of time on this now and it would be great to find out if it is a problem with my model or a bug before I move on to analysing my real system.

Thanks,
Tom
Attachments
files.zip
(10.81 KiB) Downloaded 26 times

User avatar
Tom Lintern
Posts: 61
Joined: Mon Dec 13, 2010 5:43 pm

Re: Inverse Dynamics and constraint forces

Post by Tom Lintern » Mon Jun 18, 2012 4:12 pm

FIXED!

The errors were due to including a free joint between the base and ground (see https://simtk.org/forums/viewtopic.php? ... 7794#p7794). I have been assured that the bug has been fixed for the next opensim release.

By replacing this joint with a 6dof custom joint, the id results found by expressing the force in the ground and link2 ref frames now match up with my analytical predictions.

Cheers
Tom

POST REPLY