abnormal results after running c3d gait data

Hi,

I loaded my c3d gait data into GaitLowerExtremity and ran the kinematic optimization and inverse dynamics, and I am forcusing on the hip contact forces.

Generally, for a gait cycle, I think the trend of the contact force for the hip joint should be similiar with the trend of the ground reaction force, just like the data in Bergmann experiment. However, the trend of the hip contact force of my model is quit different from the trend of the ground reaction force which can be seen in my c3d files.
Although my c3d file contains the ground reaction force data only for one force plate, this may not be a big problem for inverse dynamics.

In the attached word file are the picture for the ground reaction force along vertical axis, left hip contact force and right contact force.
You can see from the picture that during the time when the left foor hit the force plate, the contact force for the left hip joint is much smaller than the contact force for the right hip joint. This is not reasonable because by that period, the left foot is bearing the body weight while the right foot is swinging.

Another question: you can see from picture for the left and right hip contact force that Fout[1] is markedly higher than the other two values (Fout[0], Fout[2]). I think Fout [1] is for y direction. But my model stands along z direction so the contact force along z direction should be the highest.

The attached file contains the .any file I changed, a word file for the pictures and the c3d file.

Any help will be greatly appreciated.

Regards,
Jerry

Hi,

In your EnvrironmentAutoDetection.any file, you have to set the global vertical direction correctly like this:

ForcePlateType2AutoDetection Plate2 (
PlateName = Plate2,
Folder =Main.ModelSetup.C3DFileData,
Limb1=  .HumanModelRef.Right.Leg.Seg.Foot,
Limb2=  .HumanModelRef.Left.Leg.Seg.Foot,
No=1,
VerticalDirection ="Z",
HeightTolerance=0.07,
VelThreshold=2.2,
Fx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fx2,
Fy=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fy2,
Fz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fz2,
Mx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Mx2,
My=Main.ModelSetup.C3DFileData.Analog.DataFiltered.My2,
Mz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Mz2)
={
  
};

Then if you run the inverse dynamics again, you can see that the Hip_ProximoDistalForce of left leg is bigger than that of right leg.

Main.Studies.HumanModel.BodyModel.SelectedOutput.Left.Leg.JointReactionForce.Hip_ProximoDistalForce

And to understand the joint reaction forces, first you should understand how the joint was defined using existing reference nodes.
Here is a tip how to understand the reaction forces of AnyStdJoint(fixed joint).
http://wiki.anyscript.org/index.php/Tips_and_tricks#How_to_understand_the_reactions_listed_in_a_AnyStdJoint.3F
From this, you can guess how to understand the reaction forces of hip joints.

It is good to memorize that ‘All forces and moments are acting on the second mentioned coordinate system and measured wrt to the first mentioned coordinate system in the measure’.

I hope this may help to you.

Best regards,
Moonki

Hi,

Many thanks for your kind reply. After changing VerticalDirection =“Y”,
to VerticalDirection =“Z”, the results seem to be reasonable.

As for the output of joint reaction forces. I took a look at the link you sent to me. The hip joint is defined by one node on the tigh and one node on the pelvis, just as followed:
[SIZE=3]AnySphericalJoint[/SIZE] Hip = {
[SIZE=3]AnyRefNode[/SIZE] &ThighNode = …Seg.Thigh.HipJoint;
[SIZE=3]AnyRefNode[/SIZE] &PelvisNode = …HipNodeRef;

};

If, like you said, 'All forces and moments are acting on the second mentioned coordinate system and measured wrt to the first mentioned coordinate system in the measure’, forces and moments should act on the pelvis and the outputs (forces and moments) should be based on the coordinate system of the tigh. Am I right?

I followed the instructions on Measure the reaction force in a joint in a certain coordinate system and tried to measure the hip reaction forces and moments in global reference. I put the following lines in AnyBodyStudy[SIZE=3] InverseDynamicStudy [/SIZE]

[SIZE=3][COLOR=#0000ff][SIZE=3][COLOR=#0000ff]AnyForceMomentMeasure[/SIZE]JointReactionMeasure={
[SIZE=3]AnyForceBase[/SIZE]&ref1=Main.Studies.HumanModel.BodyModel.Left.Leg.Jnt.Hip.Constraints;[SIZE=3]AnyRefFrame[/SIZE]&Ref=Main.Studies.InverseDynamicStudy.EnvironmentModel.GlobalRef;
};

[/SIZE]

[/COLOR][/COLOR]But I always got error messages.

Please give me some clue on how to measure forces and moments (say hip joint) in the global reference.

Thanks in advance.

Regards,
Jerry

Hi,

When you see the description of AnyForceMomentMeasure object in the reference manual, you can see the following sentence:
‘Only forces that are applied directly to this reference frame will be included.’

So in your code, because those reaction forces are not acting on the global reference node, it would be false.

And what I want to let you know is that the resultant forces and moments of AnyForceMomentMeasure are expressed in global, not local.

So, I’d like to recommend you to put this code into your model.

AnyFolder ReactionForceAnalysis =
{
    AnyForceMomentMeasure Right_Hip_Joint_Force =
    {
      AnyForceBase& force1 = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints.Reaction;
      AnyRefFrame& ref = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.PelvisNode;
    };
    
    AnyVec3 reacForceLocal = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints.Reaction.Fout;
    AnyFloat refNodeAxes = Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Thigh.HipJoint.Axes;
    AnyFloat reacForceGlobal = refNodeAxes * reacForceLocal' ;    
};

Then you can compare ‘Right_Hip_Joint_Force’ and ‘reacForceGlobal’.

Because the ‘Hip.Constraints.Reaction.Fout’ is expressed in local with respect to the ‘Right.Leg.Seg.Thigh.HipJoint’,
so it can be converted to values in global by multiplying the Axes of the reference node and the force written in local.
You can see this concept when you see the description of ‘AnyRefFrame’ in the reference manual.

When you compare those two values(‘Right_Hip_Joint_Force’ and ‘reacForceGlobal’),
it will be same because both of them are expressed in global.

I hope this may help to you.

Best regards,
Moonki

Hi,

in Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints.Reaction, there are only Fin and Fout. I think there is no information about joint moment in this class.

What shall I do to see the hip joint moment (or the total muscle moment around the hip joint) in global system ?

After adding the code below, I guess the moment can be found in ReactionForceAnalysis. Left_Hip_Joint_Force.M . But it is zero everywhere.

AnyFolder ReactionForceAnalysis ={ AnyForceMomentMeasure Right_Hip_Joint_Force = { AnyForceBase& force1 = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints.Reaction; AnyRefFrame& ref = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.PelvisNode; }; AnyVec3 reacForceLocal = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints.Reaction.Fout; AnyFloat refNodeAxes = Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Thigh.HipJoint.Axes; AnyFloat reacForceGlobal = refNodeAxes * reacForceLocal’ ; };

Can someone provide the code to view the hip joint moment (total muslce moment around the hip) please.

Thanks.

Regards,
Jerry

Hi,

In the GaitFullBody example, you can see the ‘SelectedOutput’ folder that contains joint reaction forces and moments(by muscles).

For instance, you can see the following values.
Main.Studies.HumanModel.BodyModel.SelectedOutput.Right.Leg.JointMomentMeasure.HipFlexion

If you can see the ‘\AMMRV1.4\Body\AAUHuman\LegTD\RightLegSimpleMusclesSelectedOutput.any’ file:

AnyFolder JointMomentMeasure = {
  AnyVar HipAbduction = ....Right.Leg.MomentMeasure.HipNetMomentMuscle.MHipAbduction;				  
  [b]AnyVar HipFlexion = ....Right.Leg.MomentMeasure.HipNetMomentMuscle.MHipFlexion;[/b]
  AnyVar HipExternalRotation = ....Right.Leg.MomentMeasure.HipNetMomentMuscle.MHipExternalRotation;
  // HipNodeRef.RotNode ref
  AnyVar KneeFlexion = -....Right.Leg.MomentMeasure.KneeNetMomentMuscle.MKneeFlexion;
  // Shank.KneeJoint.RotNode ref
  AnyVar AnklePlantarFlexion = ....Right.Leg.MomentMeasure.AnklePlantarFlexionNetMomentMuscle.MPlantarFlexion;
  // Shank.AnkleJoint ref
  AnyVar SubTalarEversion = ....Right.Leg.MomentMeasure.SubTalarEversionNetMomentMuscle.MSubTalarEversion;
  // Talus.SubTalarJoint ref
}; //End JointMomentMeasure

Those joint moment values come from the following AnyScript file:
“…\AMMRV1.4\Body\AAUHuman\LegTD\LegMoments.any”

And let’s see a portion of the LegMoments.any file.

AnyForceMomentMeasure2 HipNetMomentMuscle = {
  AnyRefNode &ref = ..HipNodeRef.RotNode;
  
  AnySeg &seg1=..Seg.Shank;      
  AnySeg &seg2=..Seg.Foot;      
  AnySeg &seg3=..Seg.Thigh;  
  AnySeg &seg4=..Seg.Talus;
  AnySeg &seg5=..Seg.Patella;
  #include  "LegMuscleNames.any"  
  [b]AnyVec3 Mlocal=M*ref.Axes;[/b]
  AnyVar MHipAbduction=Mlocal[0];
  [b]AnyVar MHipFlexion=Mlocal[2];[/b]
  AnyVar MHipExternalRotation=Mlocal[1];
};

If you can see the description of AnyForceMomentMeasure2 class,
then the ‘M’ value is calculated in global.

But for the SelectedOutput values, there are some code to transform this M(global) value into Mlocal(local).

So if you want a hip moment with respect to the global coordinate system,
then you can just use this M value of a AnyForceMomentMeasure2 class.

I hope this can be helpful to your question.

Best regards,
Moonki

1 Like

Hi,

Thank you for your reply.
Like you said, the moments in (Main.Studies.HumanModel.BodyModel.SelectedOutput.R ight.Leg.JointMomentMeasure.HipFlexion
) are in the local system.

The moments in that folder is from LegMoments.any. If I want to change the force in (Main.Studies.HumanModel.BodyModel.SelectedOutput.R ight.Leg.JointMomentMeasure.HipFlexion
) to global system, I think I can change the following lines in LegMoments.any:

AnyVar MHipAbduction=Mlocal[0];
AnyVar MHipFlexion=Mlocal[2];
AnyVar MHipExternalRotation=Mlocal[1];

to:

AnyVar MHipAbduction=M[0];
AnyVar MHipFlexion=M[2];
AnyVar MHipExternalRotation=M[1];

Then I can see the moment in Main.Studies.HumanModel.BodyModel.SelectedOutput.R ight.Leg.JointMomentMeasure.HipFlexion
from global system.

Am I right?

Cheers,
Jerry

1 Like

Hi,

Yes, you are right.

But I would rather add a new measurement instead of modifying the existing one as follows:

AnyForceMomentMeasure2 HipNetMomentMuscle_Global = {
  AnyRefNode &ref = ..HipNodeRef.RotNode;
  
  AnySeg &seg1=..Seg.Shank;      
  AnySeg &seg2=..Seg.Foot;      
  AnySeg &seg3=..Seg.Thigh;  
  AnySeg &seg4=..Seg.Talus;
  AnySeg &seg5=..Seg.Patella;
  #include  "LegMuscleNames.any"  
  //AnyVec3 Mlocal=M*ref.Axes;
  AnyVar MHipAbduction=M[0];
  AnyVar MHipFlexion=M[2];
  AnyVar MHipExternalRotation=M[1];
};

It depends on your preference.

Regards,
Moonki

Hi,

In LegMoments.any (LowerGaitExtremity), is AnyVec3 Mlocal=M*ref.Axes based on the pelvis coordinate system, rather than the thigh system? If so, it means that ref.Axes equals to
Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Thigh.HipJoint.Axes. Am I right?

Please could you also explain why it is AnyVEc3 Mlocal=M * ref.Axes. rather than M’ * ref.Axes? What’s the difference between M and M’ in AnyBody?

Also, in the model view of GaitLowerExtremity, the pelvis system and the thigh system is not shown. How can I see those two local systems?

Many thanks.

Cheers,
Jerry

Hi,

When you see the code of ‘LegMoments.any’ file, then you can find :

ref = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.HipJointRightTD.RotNode

And about the vector transformation from Global to Local, it will be helpful for you to see the description of ‘AnyRefFrame’ class in the reference manual.

In the manual, you can see like this:
GlobalVector = LocalVector * Axes’

So, if you want to get the LocalVector from the GlobalVector, then
LocalVector = GlobalVector * Axes

So it makes sense:
AnyVec3 Mlocal(Local) = M(Global) * ref.Axes;

M’ means a trasposed matrix of M.

And also there are some information about coordinate transformation on wiki:
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Coordinate_transformations_local_to_global_and_visa_versa

So I would suggest you to refer to manual and wiki first :slight_smile:

And if you want to draw a coordinate system of a AnySeg, you can use the ‘AnyDrawRefFrame’ class.

Best regards,
Moonki