Full body landing motion

Hello,

I am trying to implement a landing motion on the full body model so I can see the effect on the ACL and other ligaments. For this to happen, I have constrained the metatarsal right (i am only using the right leg for this, I turned off the left one) on X,Y,Z translation and X,Y rotation, and I have turned off some other drivers which were turned on before so I have the proper constraints. I have left the Z rotation Off so the model can rotate about the metatarsal.

I first tried to implement a simple driver using the already existent AnyKinEqSimpleDriver PelvisGroundDriverPosY to see if the drivers I chose are correctly turned On or Off. For this, it is working perfectly.

Now my problem starts when I try to implement a AnyKinEqFourierDriver. I thought this might be a good driver since I want an oscillating motion to be made starting from an upright position to a flexed one, and back up again. Although maybe this can be switched with a polynomial driver so I can control the accelerations for different phases, but first I would like to make this one work since they are similar and it is easy to check if the model is working with this motion.

So when I switch the AnyKinEqSimpleDriver with AnyKinEqFourierDriver, then suddenly my model tells me that ERROR(OBJ.MCH.KIN3) : InverseDynamicsMoSyn.any(136) : InverseDynamicStudy.InitialConditions : Kinematic analysis failed in time step 0 : Failed to solve position constriants. I undestand what the error is saying, so I tried to give the model different initial positions to start so it can solve the constraints, but the result is the same. Now my question is: why does one work and the other not since I only switched the driver type and how can I solve this?

Here is my code where I made the changes for the driver (the numbers inside the A and B coeff. are random, I just placed them there so I see if it works):

#if MANNEQUIN_DRIVER_PELVIS_POS_Y
  /// Default mannequin driver. Control with:
  /// #define BM_MANNEQUIN_DRIVER_PELVIS_POS_Y ON/OFF
  /// 
  AnyKinLinear lin = {
     #if GLOBAL_REFERENCE_FRAME_SWITCH == 0
        AnyFixedRefFrame &ref1 =.GenericGRF;
      #else
        AnyFixedRefFrame &ref1 = GLOBAL_REFERENCE_FRAME;
      #endif
      
      AnyRefFrame &ref2 =..BODYMODEL_FOLDER.Trunk.SegmentsLumbar.PelvisSeg.AnatomicalFrame;
    };
  AnyKinEqFourierDriver PelvisGroundDriverPosY ={
    AnyKinLinear &Jnt = .lin;
    MeasureOrganizer = {1};
    Type = Cos;
    Freq = 2;
    A = {{0.5}};
    B = {{0}};

    Reaction = {#var Type={Off};};
  
    #if MANNEQUIN_DRIVER_WEAK_SWITCH == 1
      #var AnyVar WeakDriverWeight = .DefaultWeakDriverWeight;
      AnyFolder Weights = 
      {
        AnyFunConst Fun = {
          #var Value = {..WeakDriverWeight};
        };
      };
      #var WeightFun = {&Weights.Fun};
      #var CType = {Soft};
    #endif
  };
  #endif

Thanks in advance,
Diana

Sorry, I forgot to add the configuration I used for the drivers. They are as follow:

    #define BM_MANNEQUIN_DRIVER_PELVIS_POS_X ON
    #define BM_MANNEQUIN_DRIVER_PELVIS_POS_Y ON
    #define BM_MANNEQUIN_DRIVER_PELVIS_POS_Z OFF
    #define BM_MANNEQUIN_DRIVER_PELVIS_ROT_Y ON
    #define BM_MANNEQUIN_DRIVER_PELVIS_ROT_X ON
    #define BM_MANNEQUIN_DRIVER_PELVIS_ROT_Z ON
    
    #define BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_POS_X ON
    #define BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_POS_Y ON
    #define BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_POS_Z ON
    #define BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_ROT_Z OFF
    #define BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_ROT_Y ON
    #define BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_ROT_X ON
    
    #define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_RIGHT ON
    #define BM_MANNEQUIN_DRIVER_ANKLE_FLEXION_RIGHT OFF
    #define BM_MANNEQUIN_DRIVER_HIP_ABDUCTION_RIGHT ON
    #define BM_MANNEQUIN_DRIVER_HIP_EXTERNAL_ROTATION_RIGHT ON
    #define BM_MANNEQUIN_DRIVER_HIP_FLEXION_RIGHT OFF
    #define BM_MANNEQUIN_DRIVER_KNEE_FLEXION_RIGHT OFF

Hi Dianam

Here are some comments.

  1. I do notunderstand why you are trying to drive pelvis y coordinate and then simultaneously have a mannequindriver ON for this direction (you have Z OFF instead )
  2. In do not understand the statements "BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_X" these defines are not part of AMMR and will have no effect unless this is something you have implemented into the model.
  3. The Fourier driver seem to start at 0.5 at t=0 maybe this causing the trouble. Try to do a small model with one segment a prismatic joint and apply the Fourier driver on the model and in this why get familiar with the coefficients.

Best regards
Søren

Hi Søren,

Thank you for your reply.

  1. I am having the driver for Y On because I have modified it to contain the driver inside the drivers class (I wrote the modifications I added in my first post). I have turned Z Off because otherwise the following error would appear: "Model is kinematically over-constrained". Bt turning the Z Off, the system would not be over-constrained. Should I have done this in a different way?
  2. As I have said before (sorry if I wasn't clear enough), I have constrained the metatarsals in the X,Y,Z translations and X,Y rotations so I can make the mannequin rotate about the Z axis. So I have added the constrains in the form of "BM_MANNEQUIN_DRIVER_METATARSAL_RIGHT_X", etc. They are indeed not part of the AMMR, but I have implemented them in the driver class folder and used similar notations to be easy to turn On/Off the drivers/constraint.
  3. From what I have read here I understood that A is the amplitude, and not the starting of the driver. I have looked into the Demo in the reference manuals (ClassExamples.AnyKinMeasureOrgAndAnyKinEq) but it is only a simple driver and does not contain a Fourier Driver as an example. I have tried to also give A = {{0,0.5}}; B = {{0,0}}; but the error is the same.

Best,
Diana

I have realized I miss-understood the A coefficient. The first one is at the time step 0, right? So it should be 0.

I have modified it to be A = {{0,0.1}}; B = {{0,0}}; and now it is working, but I do have a question regarding this. If I make it start at 0.5 (A={0,0.5}), wouldn't that mean that I would be setting the amplitude or is it like meddling with the initial positions? Why does this have such a big impact?

Best,
Diana

I have replaced the Cos with Sin in the driver and placed a minus in the A term and now it works as intended, even if I give it an amplitude of 0.5.

Best,
Diana

Hi Diana,

Sounds good that you have solved the problem, note that the reference manual for this object contains an equation which helps explain how this drivers works.

Best regards
Søren

Hi Søren,

Yes, I looked on the AB reference website for the tutorial. I realized I did not put the proper link earlier.

I did look at first at the equation, but the example was with CosSin and not with a simple Cos or simple Sin, so I was a bit confused what happens if I only have the Cos or Sin in the AnyKinEqFourierDriver.

Best,
Diana

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.