Problem with muscle activity data

Hi

My participant is doing a load carriage task and is walking over one type 2 forceplate. After inverse dynamics is run, the muscle activity is not equal for both legs (both legs completed full gait cycles in the model). Does this suggest I can only analyze the leg which has direct contact with the force plate?

I have attached two graph of the muscle activity for the rectus femoris (right and left leg) and I have attached my model. Both are within the Zip File attached.

For the lifting task the participant stands on the one force plate. Is this ok?

Regards,
Kirsten

Kirsten,
Yes, you can use only the gait cycle where the subject is in contact with the forceplate.

Hi Amir

Thanks for the reply.

With regards to a lifting and lowering task. Is it ok if the participant stands with both feet on one force plate? or should it only be one leg on the forceplate?

Would there need to be extra coding for the forceplate or does AnyBody detect two feet on the forceplate?

Regards,
Kirsten

No, if both feet are on one forceplate, AnyBody does NOT know how much force goes into which foot/leg.

Hi Amir

How would I go about attaching the feet to the ground in the mocap model?

Regards,
Kirsten

What sort of motion will it be, just picking something up, or lifting like a squat or deep knee bend?

Ideally, you have 2 forceplates, and each foot in contact with one forceplate.

If it is close to symmetric motions (left and right), you could use “conditional contact” to have AnyBody predict the ground reaction forces without forceplates. This is more complex when you have motions like gait (but still doable). It is straight forward for motions like a deep kneebend, when both legs are always on the ground. There is a model in teh repositoru calles StandingLift that uses this for the feet.

It will be lifting in a semi-stooped posture. We unfortunately only have one forceplate. If only one forceplate is used with one leg on the forceplate will it accurately predict the kinetic data for that side of the body and the trunk?

The motions are symmetric so I should be able to use conditional contact. I will look at the model suggested. Where would I insert the conditional contact coding into the Mocap Model?

It’s this code:

AnyFolder ConditionalContact={

/*
ConditionalContactFootPlaneClass (
BaseObject = //Object which delivers the forces
Foot = //Reference to the foot segment where 3 forces are applied 
DisplayTriggerVolume = //Draw the cylinder around the Base node where the contact is active
DisplayTargetNode = //Draw the Target node
) = {
UserDefinedLimitLow = //low limit for the strength measure function, if the distance measured along Direction[0] is below this val. the strength will be zero (negative)
UserDefinedLimitHigh = //high limit for the strength measure function, if the distance measured along Direction[0] is above this val. the strength will be zero
UserDefinedRadiusLimit = //high limit for the strength measure function, if the radius measured along the plane with Direction[0] as normal is above this val. the strength will be zero
Strength = //strength of muscles
StaticFrictionCoefficient = //Friction coefficient
NormalDirection = //The axis (X, Y or Z) corresponding to the normal direction
FrictionDirection1 = //The axis (X, Y or Z) corresponding to the first friction direction
FrictionDirection2 = //The axis (X, Y or Z) corresponding to the second friction direction
};
*/

ConditionalContactFootPlaneClass LeftFootSupport (
BaseObject = Main.Model.EnvironmentModel.GlobalRef,
Foot = ..LegL.Seg.Foot,
DisplayTriggerVolume = 1,
DisplayTargetNode =1
) = {
  UserDefinedLimitLow = -0.05;
  UserDefinedLimitHigh = 0.05;
  UserDefinedRadiusLimit = 0.4;
  Strength = 2000;
  StaticFrictionCoefficient = 0.8;
  NormalDirection = Y;
  FrictionDirection1 = X;
  FrictionDirection2 = Z;
};


ConditionalContactFootPlaneClass RightFootSupport (
BaseObject = Main.Model.EnvironmentModel.GlobalRef,
Foot = ..LegR.Seg.Foot,
DisplayTriggerVolume = 0,
DisplayTargetNode =1
) = {
  UserDefinedLimitLow = -0.05;
  UserDefinedLimitHigh = 0.05;
  UserDefinedRadiusLimit = 0.4;
  Strength = 2000;
  StaticFrictionCoefficient = 0.8;
  NormalDirection = Y;
  FrictionDirection1 = X;
  FrictionDirection2 = Z;
};

};

Maybe add it in the Environment File and change the paths of
BaseObject = Main.Model.EnvironmentModel.GlobalRef,
Foot = …LegR.Seg.Foot,

You also need to include in the class file

//class template for conditional contact
#include “<ANYBODY_PATH_TOOLBOX>\FrictionContactMuscles\ConditionalContactClass.any”
#include “<ANYBODY_PATH_TOOLBOX>\FrictionContactMuscles\ConditionalContactFootPlaneClass.any”

To check if it works fine with only one Force plate you can check the residual of the model:

Main.Studies.InverseDynamicStudy.Output.ModelEnvironmentConnection.JointsAndDrivers.JntDriverTrunk.Reaction.Fout

The residual force is a force between the trunk and the global environment. This is a safety feature that can produce a force if necessary to balance everything. If this force is small <10N the model is doing fine; if it is in the area of several hundreds N it is not good.

Hi Amir

Thanks for the response. I will try this out now.

Regards,
Kirsten

Hi Amir

Must I also insert this code or just the conditional contact coding?

[SIZE=3]// Position the Ankles right above the z axis
[/SIZE][SIZE=3]AnyKinEqSimpleDriver[/SIZE] RAnkleX = {
[SIZE=3]AnyKinLinear[/SIZE] AnklePos = {
[SIZE=3]AnyFixedRefFrame[/SIZE] &Ground = Main.Model.EnvironmentModel.GlobalRef;
[SIZE=3]#if[/SIZE] BM_LEG_RIGHT == CONST_LEG_MODEL_Leg
[SIZE=3]AnyRefNode[/SIZE] &Ankle = …LegR.Seg.Foot.AnkleJoint;
[SIZE=3]#else
[/SIZE][SIZE=3]AnyRefNode[/SIZE] &Ankle = …LegR.Seg.Talus.AnkleJoint;
[SIZE=3]#endif
[/SIZE]};
MeasureOrganizer = {0}; [SIZE=3]// Only the x coordinate
[/SIZE]DriverPos = {0.0};
DriverVel = {0.0};
Reaction.Type = {Off};
};

[SIZE=3]AnyKinEqSimpleDriver[/SIZE] LAnkleX ={
[SIZE=3]AnyKinLinear[/SIZE] AnklePos = {
[SIZE=3]AnyFixedRefFrame[/SIZE] &Ground = Main.Model.EnvironmentModel.GlobalRef;
[SIZE=3]#if[/SIZE] BM_LEG_LEFT == CONST_LEG_MODEL_Leg
[SIZE=3]AnyRefNode[/SIZE] &Ankle = …LegL.Seg.Foot.AnkleJoint;
[SIZE=3]#else
[/SIZE][SIZE=3]AnyRefNode[/SIZE] &Ankle = …LegL.Seg.Talus.AnkleJoint;
[SIZE=3]#endif
[/SIZE]};
MeasureOrganizer = {0}; [SIZE=3]// Only the x coordinate
[/SIZE]DriverPos = {0.0};
DriverVel = {0.0};
Reaction.Type = {Off};
};

[SIZE=3]//Constrain the collective CoM to be right above the GlobalRef
[/SIZE][SIZE=3]AnyKinEqSimpleDriver[/SIZE] CoMDriver = {
[SIZE=3]AnyKinCoM[/SIZE] CoM = {
[SIZE=3]AnyFolder[/SIZE] &Body = Main.Model.HumanModel;
[SIZE=3]AnyFolder[/SIZE] &Environment = Main.Model.EnvironmentModel;
};
MeasureOrganizer = {0,2}; [SIZE=3]// Only the x and z directions
[/SIZE]DriverPos = {0.1, -0.05};
DriverVel = {0.0, 0.1};
Reaction.Type = {Off,Off};
};

[SIZE=3]//Constrain the feet to be symmetrical about the xy plane
[/SIZE][SIZE=3]AnyKinEqSimpleDriver[/SIZE] FeetXDriver = {
[SIZE=3]AnyKinCoM[/SIZE] CoM = {
[SIZE=3]AnySeg[/SIZE] &rf = Main.Model.HumanModel.Right.Leg.Seg.Foot;
[SIZE=3]AnySeg[/SIZE] &ff = Main.Model.HumanModel.Left.Leg.Seg.Foot;
};
MeasureOrganizer = {2}; [SIZE=3]// Only the z direction
[/SIZE]DriverPos = {0};
DriverVel = {0};
Reaction.Type = {Off}; [SIZE=3]// Carried by friction muscles.
[/SIZE]};
[SIZE=3][SIZE=3]// Place the right toe and heel on the ground
[/SIZE][SIZE=3]AnyKinEq[/SIZE] RToeGroundConstraint ={
[SIZE=3]AnyKinLinear[/SIZE] ToePos = {
[SIZE=3]AnyFixedRefFrame[/SIZE] &Ground = Main.Model.EnvironmentModel.GlobalRef;
[SIZE=3]AnyRefNode[/SIZE] &Ball = Main.Model.HumanModel.Right.Leg.Seg.Foot.ToeJoint;
};
MeasureOrganizer = {1}; [SIZE=3]// Only the y coordinate
[/SIZE]Reaction.Type={Off};
};

[SIZE=3]AnyKinEqSimpleDriver[/SIZE] RHeelGroundConstraint ={
[SIZE=3]AnyKinLinear[/SIZE] HeelPos = {
[SIZE=3]AnyFixedRefFrame[/SIZE] &Ground = Main.Model.EnvironmentModel.GlobalRef;
[SIZE=3]AnyRefNode[/SIZE] &Ball = Main.Model.HumanModel.Right.Leg.Seg.Foot.HeelJoint;
};
MeasureOrganizer = {1}; [SIZE=3]// Only the y coordinate
[/SIZE]DriverPos = {0.0};
DriverVel = {0.0};
Reaction.Type = {Off}; [SIZE=3]// Provide ground reaction forces
[/SIZE]};

[SIZE=3]// Place the left toe and heel on the ground
[/SIZE][SIZE=3]AnyKinEq[/SIZE] LToeGroundConstraint ={
[SIZE=3]AnyKinLinear[/SIZE] ToePos = {
[SIZE=3]AnyFixedRefFrame[/SIZE] &Ground = Main.Model.EnvironmentModel.GlobalRef;
[SIZE=3]AnyRefNode[/SIZE] &Ball = Main.Model.HumanModel.Left.Leg.Seg.Foot.ToeJoint;
};
MeasureOrganizer = {1}; [SIZE=3]// Only the y coordinate
[/SIZE]Reaction.Type={Off};
};

[SIZE=3]AnyKinEqSimpleDriver[/SIZE] LHeelGroundConstraint ={
[SIZE=3]AnyKinLinear[/SIZE] HeelPos = {
[SIZE=3]AnyFixedRefFrame[/SIZE] &Ground = Main.Model.EnvironmentModel.GlobalRef;
[SIZE=3]AnyRefNode[/SIZE] &Ball = Main.Model.HumanModel.Left.Leg.Seg.Foot.HeelJoint;
};
MeasureOrganizer = {1}; [SIZE=3]// Only the y coordinate
[/SIZE]DriverPos = {0.0};
DriverVel = {0.0};
Reaction.Type = {Off}; [SIZE=3]// Do not Provide ground reaction
[/SIZE]};
[/SIZE]

Hi Amir

I did the following so far.

Added the following code just before the main file:

[SIZE=3][SIZE=2]#include[/SIZE][/SIZE] “<ANYBODY_PATH_TOOLBOX>\FrictionContactMuscles\ConditionalContactClass.any”
#include “<ANYBODY_PATH_TOOLBOX>\FrictionContactMuscles\ConditionalContactFootPlaneClass.any”

I then added the following coding into both the Kinematic and Invesrse dynamic Eniromental Connection Folder:

AnyFolder ConditionalContact={

/*
ConditionalContactFootPlaneClass (
BaseObject = //Object which delivers the forces
Foot = //Reference to the foot segment where 3 forces are applied
DisplayTriggerVolume = //Draw the cylinder around the Base node where the contact is active
DisplayTargetNode = //Draw the Target node
) = {
UserDefinedLimitLow = //low limit for the strength measure function, if the distance measured along Direction[0] is below this val. the strength will be zero (negative)
UserDefinedLimitHigh = //high limit for the strength measure function, if the distance measured along Direction[0] is above this val. the strength will be zero
UserDefinedRadiusLimit = //high limit for the strength measure function, if the radius measured along the plane with Direction[0] as normal is above this val. the strength will be zero
Strength = //strength of muscles
StaticFrictionCoefficient = //Friction coefficient
NormalDirection = //The axis (X, Y or Z) corresponding to the normal direction
FrictionDirection1 = //The axis (X, Y or Z) corresponding to the first friction direction
FrictionDirection2 = //The axis (X, Y or Z) corresponding to the second friction direction
};
*/

ConditionalContactFootPlaneClass LeftFootSupport (
BaseObject = Main.EnvironmentModel.GlobalRef,
Foot = Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Foot,
DisplayTriggerVolume = 1,
DisplayTargetNode =1
) = {
UserDefinedLimitLow = -0.05;
UserDefinedLimitHigh = 0.05;
UserDefinedRadiusLimit = 0.4;
Strength = 2000;
StaticFrictionCoefficient = 0.8;
NormalDirection = Z;
FrictionDirection1 = X;
FrictionDirection2 = Y;
};

ConditionalContactFootPlaneClass RightFootSupport (
BaseObject = Main.EnvironmentModel.GlobalRef,
Foot = Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Foot,
DisplayTriggerVolume = 0,
DisplayTargetNode =1
) = {
UserDefinedLimitLow = -0.05;
UserDefinedLimitHigh = 0.05;
UserDefinedRadiusLimit = 0.4;
Strength = 2000;
StaticFrictionCoefficient = 0.8;
NormalDirection = Z;
FrictionDirection1 = X;
FrictionDirection2 = Y;
};

};

Do I need to add in more coding? Also is the joint moment data in Nm or Nm/kg. when I run the model with this coding only the values appear to be quite low for the joint moments in the legs.

I have attached the model.

Kirst

One more thing, I noticed when reading up on conditional contact on the wiki page that the mocap model has a residual in the thrunk driver which should be switched off in order to use conditional contact. Where do I locate this?

Kirsten,

yes you are right with switching off the residual, I have done that in the JointsAndDriversOptimized:

old:
// Reaction.Type={On,On,On,On,On,On,Off,Off,Off,Off};
new:
Reaction.Type={Off,Off,Off,Off,Off,Off,Off,Off,Off,Off};

I increased the radius of the conditional contact, so that both feet are in the grey area.

I also deleted the forces and conditional contact in the kinematic study (MotionAndParameterOpti). Having the loads there will only slow down the simualtion. Everything is about kinematics in there so no need for adding loads!

I ran a couple steps and it looked fine. You can see the predicted GRF as 3 blue lines visually below the grey area.

Hi Amir

Thanks for the help so far.

I inserted in another data set and during inverse dynmaics the following error appears:

[SIZE=1]ERROR(OBJ.MCH.MUS4)[/SIZE] : [SIZE=1]C:/U…s/k…n/D…s/A…y/K…g/A…o/A…n/E…s/K…g/M…l/InverseDynamics.any(30)[/SIZE] : [SIZE=1]InverseDynamicStudy.InverseDynamics[/SIZE] : Muscle recruitment solver : solver aborted due to singular KKT matrix

[SIZE=2]During this task the person was expected to lift 10kg opposed to 5kg in the previous model. [/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]When force plates data was used (eventhough incorrect data) the model never failed. I ran other data sets and they all failed during inverse dynmaics. [/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Please help[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Kirsten
[/SIZE]

This error message means that this “conditional contact” which uses artifical muscle like to predict the ground reaction force couldn’t find a solution. This is usually the case when the the subject is little out of balance = center of mass not over the feet. I think you model fails in exactly that case.

In your recordings, does the subject have one foot on the forceplate or both?

Hi Amir

How do I go about solving this problem as a couple of models have failed including the lowering and overhead tasks data?

Subjects unfortunately have both feet on the forceplate.

Regards,
Kirsten

Hi Amir

I have tried running the new model with different participanta data and the model will keep failing with the same error as previously mentioned.

Are you sure the problem is the participant being off balance? If so do you have any solutions to solve this issue.

Regards,
Kirsten

Kirsten,
this is getting a lot more than usual online support, I made a new model for you. That should run for all subjects and trials:

  • created a dummy segment which is driven to the forceplate location without reactions
  • forceplate is included again: forceplate transfers loads to dummy segment
  • dummy segment transfers loads using conditional contact to both feet

I also changed the loads in the hands, with only using a force, you are neglegting inertia of the box

  • so I have 2 more dummy segments with a mass in the environment file that are connected to the left and right hands/gloves

  • I included a box for visualization, but that looks little stupid