About AnyReacForce

I would like to apply ground reaction force to the foot such like AnyGait model.
I found AnyReacForce function in AnyGait model to apply ground force to the model and then I added codes as below in FreePostureMove model.

AnyFolder ReactionForce4 = {

AnySeg &Limb =.HumanModel.Right.Leg.Seg.Foot;

AnySeg ReactionNodes = {
Mass=0;
Jii={0.0,0.0,0.0};
AnyRefNode node = {
sRel={0.0,0.0,0.0};
AnyDrawNode drw={ScaleXYZ={0.015,0.015,0.015}; RGB={1,0,0};};
};
};

AnyKinLinear Lin={
AnyRefFrame &ref1=Main.Model.EnvironmentModel.GlobalRef;
AnyRefFrame &ref2=.ReactionNodes;
Ref=-1;
};

AnyKinRotational Rot={
AnyRefFrame &ref1=Main.Model.EnvironmentModel.GlobalRef;
AnyRefFrame &ref2=.ReactionNodes;
Type=RotAxesAngles;
};

AnyKinEqInterPolDriver LinDriver = {
Type = PiecewiseLinear ;
FileName = “COP4_lin.txt”;
AnyKinMeasure &ref = .Lin;
Reaction.Type = {Off,Off,Off};
};

AnyKinEqInterPolDriver RotDriver = {
Type = PiecewiseLinear ;
FileName = “COP4_rot.txt”;
AnyKinMeasure &ref = .Rot;
Reaction.Type = {Off,Off,Off};
};

AnyReacForce PlateFootReaction={
AnyKinLinear Lin={
Ref=0;
AnySeg &ref2=…ReactionNodes;
AnySeg &ref1=…Limb;
};

AnyKinRotational Rot={
  AnySeg &ref2=..ReactionNodes;
  AnySeg &ref1=..Limb;
  Type=RotAxesAngles;
};

};

AnyForce3D Force ={
AnyFunInterpol load ={
Type=PiecewiseLinear;
FileName = “ForceR4.txt”;
};

AnyRefNode  &ref=.ReactionNodes.node;
F= load(t); 

};

AnyMoment3D Moment ={
AnyFunInterpol moment ={
Type=PiecewiseLinear;
FileName = “MomentR4.txt”;
};
AnyRefFrame &ref=.ReactionNodes;
M=moment(t);
};
};

I could complete InvereseDynamics study with this model, but I’m not sure about AnyReacForce function.

I inputted +500 N(vertical direction) force as Force3D force and obtained +500N(vertical direction) force as Fout of AnyReacForce in this model, although when I inputted about +500 N(vertical direction) force as Force3D force and obtained -500N(vertical direction) force as Fout of AnyReacForce in AnyGaitModel.

  1. Where is the reference frame of AnyReacForce?

  2. Where is the refference frame of Fout outputted from AnyReacForce?

  3. What AnyReacForce output as Fout? For example in my model, Fout of AnyRefForce expresses
    a. Reaction force from ReactionNodes segment to Foot segment?
    b. Reaction force from Foot segment to ReactionNodes segment?
    c. Both of a. and b.?

I use AMMRV1.4.1 repository [SIZE=3]and AnyBody 5.1

[SIZE=3]Regards,
Yuka
[/SIZE][/SIZE]

Hi Yuka,

I’ve had a quick look on your script here.

  1. AnyReacForce is always used with some kinematic measures in AnyScript.
    So if you want to understand the Fout values of AnyReacForce,
    you can just see what kinds of kinematic measures are used with the AnyReacForce object.
AnyReacForce PlateFootReaction=
{
     AnyKinLinear Lin=
     {
         Ref=0; 
         AnySeg &ref2=..ReactionNodes;
         AnySeg &ref1=..Limb;
     };
    
     AnyKinRotational Rot=
     {
         AnySeg &ref2=..ReactionNodes;
         AnySeg &ref1=..Limb;
         Type=RotAxesAngles;
     };
  };

So in this case, the Fout values of AnyReacForce means the forces and moments from ‘ReactionNodes’ to ‘Limb’.

  1. For your code about external forces and moments,
AnyForce3D Force ={ 
    AnyFunInterpol load ={
      Type=PiecewiseLinear;
      FileName = "ForceR4.txt";
    };       
    
    AnyRefNode  &ref=.ReactionNodes.node;
    F= load(t); 
  };
  
  AnyMoment3D Moment ={
    AnyFunInterpol moment ={
      Type=PiecewiseLinear;
      FileName = "MomentR4.txt";
    }; 
    AnyRefFrame &ref=.ReactionNodes;
    M=moment(t);
  };   
};

Are you sure that the force and moment values are recorded with respect to the global coordinate system?
If those values were recorded with respect to local coordinate system(ReactionNodes),
then you should use ‘Flocal’ term instead of ‘F’ term in AnyForce3D and AnyMoment3D classes.

If you still feel unclear about your model, then I would suggest you to upload your model in the debug section.
http://forum.anyscript.org/forumdisplay.php?f=21

I hope this may help you.

Best regards,
Moonki

Hi Moonki,

Thank you for your quick reply!
I didn’t noticed that the effect of kinematic measures.
But I understood AnyReacForce at last with your explanation.
And I’m sure that force and moment were recorded in global coordinate system, then no problem.

Thanks a lot!