Prescribed knee motion

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Snehal Shetye
Posts: 10
Joined: Thu Oct 14, 2010 12:25 pm

Prescribed knee motion

Post by Snehal Shetye » Tue Mar 01, 2011 6:29 am

Hello all,

I have prescribed subject-specific experimentally derived knee motion (ab/add,int/ext, tx and tz) as a cubic spline function of knee flexion angle in the .osim model file.
My question is: Will OpenSim follow this motion exactly for all algorithms (IK, RRA and CMC)?
Also, is there anyway to check the predicted ty motion?

Thank you,
Snehal Shetye

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

RE: Prescribed knee motion

Post by Ayman Habib » Tue Mar 01, 2011 10:42 am

Hi Snehal,

Yes, the prescribed motion is treated as a constraint that is always enforced. If you perform any simulation or make a motion file that advances through your range of knee flextion angles, you should see other coordinates change accordingly.

Hope this helps and please let me know if that answers your question.

Good luck,
-Ayman

User avatar
Snehal Shetye
Posts: 10
Joined: Thu Oct 14, 2010 12:25 pm

RE: Prescribed knee motion

Post by Snehal Shetye » Tue Mar 01, 2011 11:10 am

Hi Ayman,

Thanks for the quick response.
This does answer my question.
However, just to clarify, I have not created new coordinates. I just provided new values for all rotations/translations functions of knee flexion as is done in the default 2392 OpenSim model. Does your answer still apply?

As a follow-up, I understand OpenSim will calculate the 6th DOF given the other five. Is there any way to extract the 6th DOF values?

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

RE: Prescribed knee motion

Post by Ayman Habib » Tue Mar 01, 2011 11:29 am

Hi,

There are different ways to "prescribe" coordinates. For example if you want the value of the coordinate to be a fixed function of time you would do it using the Coordinate's <prescribed_function> tag. My understanding is that what you're doing is more like coupling coordinates (using <CoordinateCouplerConstraint> as done in the BothLegs.osim file used by the tutorials). If not then please let me know how you're defining your splines in the osim file.

Normally we wouldn't put out values for constrained coordinates as this can lead to inconsistencies or configurations that can't be satisfied but it should be possible to report the values using some custom plugin.

Hope this helps,
-Ayman

User avatar
Snehal Shetye
Posts: 10
Joined: Thu Oct 14, 2010 12:25 pm

RE: Prescribed knee motion

Post by Snehal Shetye » Tue Mar 01, 2011 11:45 am

Hi Ayman,

I am not using any of those methods.
Here is a snippet from my .osim file:

<TransformAxis name="rotation1"> <function> <LinearFunction name=""> <coefficients> 1.00000000 0.00000000 </coefficients> </LinearFunction> </function> <coordinates> knee_angle_r </coordinates> <axis> 1.00000000 0.00000000 0.00000000 </axis> </TransformAxis> <TransformAxis name="rotation2"> <function> <NaturalCubicSpline name=""> <x> 0.03882827 0.052280256 0.065436862 0.076966489 0.088187351 0.10228551 0.122105311 0.149117406 0.18279034 0.220805094 0.260089593 0.296870959 0.327355665 0.349418215 0.365009102 0.378146579 0.391442829 0.404981714 0.417118367 0.426030437 0.431368789 0.434490868 0.437574778 0.442612112 0.450494368 0.460750307 0.472826013 </x> <y> 0.011538284 0.010612457 0.010569627 0.010855861 0.010503514 0.00895593 0.006288474 0.002957443 -0.000972812 -0.004950958 -0.00809838 -0.009806988 -0.010214522 -0.010143068 -0.010150783 -0.010219618 -0.010003983 -0.009222006 -0.00813957 -0.007215837 -0.006741753 -0.007097713 -0.008630112 -0.011511075 -0.015279659 -0.019152528 -0.022835958 </y> </NaturalCubicSpline> </function> <coordinates> knee_angle_r </coordinates> <axis> 0.00000000 0.00000000 1.00000000 </axis> </TransformAxis>

'rotation1' is flexion angle and I have defined 'rotation2" as a natural cubic spline function of flexion angle.

Is is acceptable?

Thanks a lot,
Snehal

User avatar
Snehal Shetye
Posts: 10
Joined: Thu Oct 14, 2010 12:25 pm

RE: Prescribed knee motion

Post by Snehal Shetye » Tue Mar 01, 2011 11:56 am

Sorry, that did not turn out to be readable.
retrying...

<SpatialTransform name="">
<!--3 Axes for rotations are listed first.-->
<TransformAxis name="rotation1">
<function>
<LinearFunction name="">
<coefficients> 1.00000000 0.00000000 </coefficients>
</LinearFunction>
</function>
<coordinates> knee_angle_r </coordinates>
<axis> 1.00000000 0.00000000 0.00000000 </axis>
</TransformAxis>
<TransformAxis name="rotation2">
<function>
<NaturalCubicSpline name="">
<x> 0.03882827 0.052280256 0.065436862 0.076966489 0.088187351 0.10228551 0.122105311 0.149117406 0.18279034 0.220805094 0.260089593 0.296870959 0.327355665 0.349418215 0.365009102 0.378146579 0.391442829 0.404981714 0.417118367 0.426030437 0.431368789 0.434490868 0.437574778 0.442612112 0.450494368 0.460750307 0.472826013 </x>
<y> 0.011538284 0.010612457 0.010569627 0.010855861 0.010503514 0.00895593 0.006288474 0.002957443 -0.000972812 -0.004950958 -0.00809838 -0.009806988 -0.010214522 -0.010143068 -0.010150783 -0.010219618 -0.010003983 -0.009222006 -0.00813957 -0.007215837 -0.006741753 -0.007097713 -0.008630112 -0.011511075 -0.015279659 -0.019152528 -0.022835958 </y>
</NaturalCubicSpline>
</function>
<coordinates> knee_angle_r </coordinates>
<axis> 0.00000000 0.00000000 1.00000000 </axis>
</TransformAxis>


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

RE: Prescribed knee motion

Post by Ayman Habib » Tue Mar 01, 2011 2:09 pm

Snehal,

If you build the motion you want into the joint (Mobilizer in Simbody/OpenSim lingo) that would work too, and is more efficient than using constraints since there's no separate constraint to enforce (which tends to slow things down).

Constraints though are more general since they can relate coordinates from different Joints.

To exercise the mobilizers, all you need is to open the model in the GUI and move the coordinate sliders around.

-Ayman

User avatar
Snehal Shetye
Posts: 10
Joined: Thu Oct 14, 2010 12:25 pm

RE: Prescribed knee motion

Post by Snehal Shetye » Tue Mar 01, 2011 2:39 pm

Hello Ayman,

Thanks a lot for your help.
I successfully implemented the <CoordinateCouplerConstraint> option and I get similar results as compared to my initial approach.
It would be great to validate the 6th DOF since I have experimental values for it, but unfortunately I am not using the OpenSim API.

Thanks again,
Snehal

User avatar
Ajay Seth
Posts: 136
Joined: Thu Mar 15, 2007 10:39 am

RE: Prescribed knee motion

Post by Ajay Seth » Tue Mar 01, 2011 10:49 pm

You can use the CustomJoint as you did, driving the spatial (6dofs) of the relative (child in parent) body motion with 1 to 6 coordinates. For modeling a joint this method is highly recommended over the use of constraints, since the motion is enforced exactly and does not introduce extraneous coordinates (and associated equations).
To verify that your joint behaves as you expect you can perform a BodyKinematics analysis (AnalyzeTool) which will give you the spatial motion of the bodies expressed in ground. You can also associate points on the body and use a PointKinematics analysis. Perhaps one of these will be helpful.

User avatar
Snehal Shetye
Posts: 10
Joined: Thu Oct 14, 2010 12:25 pm

RE: Prescribed knee motion

Post by Snehal Shetye » Thu Mar 03, 2011 1:33 pm

Hello Ajay,

Thanks a lot for your suggestions. The PointKinematics tool seems what I need to verify my results. I will try it out and let you know.

Thanks,
Snehal

POST REPLY