Pedal Movement

#1

Hi, I’m currently trying to make a simple pedal movement based on the sitting position of a Formula style car. However whenever I try to run it, the whole position moves. I’ve used the base tutorial for the pedal in this test.

https://www.mediafire.com/file/x8zgmsdnmv460f9/MyHuman.zip/file

#2

Hi

Please update your personal page so includes your affiliation.

Please describe how you have modified the standard model.

Please note that the loaded position may change when you try to run the model, this is normal. This happens if the initial load position is different from the position in the first frame. The load position can be changed in the mannequin.any file.

Does the model solve kinematics?

Best regards
Søren

#3

I’ve changed the location of the hpoint and the location for the hinge. I have also changed the direction in which the hinge pivots. However, whenever i run it, the model reverts back to the position before i modified it and the hinge seems to be acting in a strange way.

I have ran the kinematics it works if i leave the pedals as is but when i change the pedal to be depressed the same way you would in a formula style car it just breaks itself.

AnyFolder Joints = {
  
  AnyStdJoint SeatPelvis = //Joining Seat to pelvis
  {
    AnyRefFrame& Seat = Main.Model.Environment.GlobalRef.Hpoint;
    AnyRefFrame& Pelvis = Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg;
  };
  
  AnySphericalJoint PedalFoot = //Connecting foot to pedal
  {
    AnyRefFrame& Pedal = Main.Model.Environment.Pedal.FootNode;
    AnyRefFrame& Foot = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.ToeJoint;
  };
  

};

AnyFolder Drivers = {
  
  AnyKinEqSimpleDriver PelvisThoraxDriver = //Locking rotation of pelvis and neck
  {
    AnyKinMeasure& ref0 = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxExtension;
    AnyKinMeasure& ref1 = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxLateralBending;
    AnyKinMeasure& ref2 = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxRotation;

    DriverPos = pi/180*{0,0,0};
    DriverVel = pi/180*{0,0,0};
    Reaction.Type = {Off, Off, Off};
  };
  
  AnyKinEqSimpleDriver SkullThoraxDriver = //Locking rotation of skull and neck
  {
    AnyKinMeasure& ref0 = ...HumanModel.BodyModel.Interface.Trunk.SkullThoraxFlexion;
    AnyKinMeasure& ref1 = ...HumanModel.BodyModel.Interface.Trunk.SkullThoraxLateralBending;
    AnyKinMeasure& ref2 = ...HumanModel.BodyModel.Interface.Trunk.SkullThoraxRotation;

    DriverPos = pi/180*{0,0,0};
    DriverVel = pi/180*{0,0,0};
    Reaction.Type = {Off, Off, Off};
  };
  
//  AnyKinEqSimpleDriver HipDriver = //Lock hip movement
//  {
//    AnyKinLinear lin ={
//      
//    AnyRefFrame &ref0 = Main.Model.Environment.GlobalRef;
//    AnyRefFrame &ref1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.HipJoint;
//    
//    Ref = 0;
//  };
//  
//  MeasureOrganizer = {2}
//  DriverPos = {0};
//  DriverVel = {0};
//  Reaction.Type = {Off};
//  
//  };

    
  AnyKinEqSimpleDriver AnkleDriver = //Lock rotation of ankle
  {
//    AnyKinLinear lin ={
//      AnyRefFrame &ref0 = Main.Model.Environment.GlobalRef;
//      AnyRefFrame &ref1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.AnkleJointComplexAnatomicalFrame;
//      Ref = 0;
//    };
//    
//    MeasureOrganizer = {2}
//    DriverPos = {30};
//    DriverVel = {45};
//    Reaction.Type = {Off};
  
    AnyKinMeasure& ref0 = Main.HumanModel.BodyModel.Interface.Right.AnklePlantarFlexion;
    AnyKinMeasure& ref1 = Main.HumanModel.BodyModel.Interface.Right.SubTalarEversion;
    
    DriverPos = pi/180*{0,0};
    DriverVel = pi/180*{0,0};
    Reaction.Type = {Off, Off};
  };
  
  AnyKinEqSimpleDriver KneeDriver = //Lock Z movement of knee
  {
    AnyKinLinear lin =
    {
      AnyRefFrame& ref0 = Main.Model.Environment.GlobalRef;
      AnyRefFrame& ref1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint;
      Ref = 0;
    };
    
    MeasureOrganizer = {2};
    DriverPos = {0};
    DriverVel = {0};
    Reaction.Type = {Off};
  };
  
  AnyKinEqSimpleDriver PedalDriver = //Defines pedal movement
  
  {
//    AnyKinLinear lin = 
//    {
//      AnyRefFrame &ref0 = Main.Model.Environment.HingeJoint;
//      Ref = 0;
//    };
//    
//    MeasureOrganizer = {2};
//    DriverPos = {30};
//    DriverVel = {45};
//    Reaction.Type = {Off};

    AnyKinMeasure &ref0 = Main.Model.Environment.HingeJoint;
    
    DriverPos = pi/180*{30};
    DriverVel = pi/180*{45};
    Reaction.Type = {Off};
  };
};  

#4

Hi Mckay,

I have looked at the code, and found an error.

In the environment.any file you are using the same location for the Hinge and the FootNode. So the location of the hinge and the location of the contact between foot and pedal is the same, this is not meaningful it will run kinematically but inverse dynamic analysis will, for natural reasons.

If you change the hinge point to be

    AnyRefNode Hinge = {
      
      sRel = {0, -0.15, 0}; //Pedal hinge relative to origin
    };

it runs again.

Best regards
Søren

#5

Hi,

I’ve managed to rerun it but i still couldnt get the position to be equivalent to the initial. As the initial loaded model is closer to how a person would sit in a formula style car.

I decided to redo the code which I have provided but am still unable to solve the issue where the pedals wouldnt stay where I want it to and the model doesnt run at all now giving me constraint errors.

All I want to test out is the pedal moving forward in the positive x-axis simulating how the pedal would move while still pivoting on the Z-axis with the human model only moving the foot. I’m still new to this software so I’m slowly trying to understand it.

#6

Hi McKay,

I have change the model a good deal, please review the two files attached carefully.

The motion looks somewhat real, from what i understood of the description.

I have not tested anything related to forces there are surely reactions in there between foot and pedal which are not yet ok, secondly there are no loads applied to the pedal.

Please delete the zip file you have uploaded in the previous post it contains the entire human model.

Best regards
Søren

#7

Hi,

Thank you so much. I will review the code and understand the differences with mine as well.

I will play around with the reaction and forces at the foot and pedals and see what I can achieve.

#8

Hi,

I’ve had a play around and am trying to lock the initial position as before running the kinematics bu when I do that the entire body does stay at the set location but ends up rotating and twisting when running the study.

Here’s what i added.

AnyFolder Joints = {
  
  //Reference for mannequin position
  AnyFolder &JntPos = Main.HumanModel.Mannequin.Posture;
  AnyFolder &JntVel = Main.HumanModel.Mannequin.PostureVel;
  
  
  AnyKinLinear PelvisSeatLin = 
  {
    AnyRefFrame &Seat = Main.Model.Environment.GlobalRef.HPoint;
    AnyRefFrame &Pelvis = Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg;
    Ref = 0;

  }; //Fixing of pelvis to seat linearly
  
  AnyKinRotational PelvisSeatRot = 
  {
  AnyRefFrame &Seat = Main.Model.Environment.GlobalRef.HPoint;
  AnyRefFrame &Pelvis = Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg;
  Type = RotVector;
  AngVelOnOff = Off;
}; //Fixing of pelvis and seat rotation

  AnyKinEqSimpleDriver PelvisSeatEq = 
  {
  AnyKinLinear &LinearMeasure = .PelvisSeatLin;
  AnyKinRotational &RotMeasure = .PelvisSeatRot;
  MeasureOrganizer = {0,2,3,2,4,2};
  DriverPos = {0,0,0,0,0,0};
  DriverVel = {0,0,0,0,0,0};
  Reaction.Type = {Off,Off,Off,Off,Off,Off};
};

 };
 
 AnyFolder KinematicMeasures =
 {
   AnyKinLinear FootPos =
   {
     AnyFixedRefFrame &Ground = Main.Model.Environment.GlobalRef;
     AnyRefNode &HeelNode = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.SubTalarJoint;
     Ref = 0;
   };
   
 }; //Produces a graph on foot position over time

AnyFolder Drivers = {
  
  //Reference for mannequin position
  AnyFolder &JntPos = Main.HumanModel.Mannequin.Posture;
  AnyFolder &JntVel = Main.HumanModel.Mannequin.PostureVel;
  
    AnyKinEqSimpleDriver PelvisThoraxDriver = //Locking rotation of pelvis and back
  {
    AnyKinMeasure& ref0 = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxExtension;
    AnyKinMeasure& ref1 = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxLateralBending;
    AnyKinMeasure& ref2 = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxRotation;

    DriverPos = pi/180*{0,0,0};
    DriverVel = pi/180*{0,0,0};
    Reaction.Type = {Off, Off, Off};
  };
  
   AnySphericalJoint PedalFoot =
  {
    AnyRefFrame& Pedal = Main.Model.Environment.Pedal.FootNode;
    AnyRefFrame& Foot = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.MetatarsalJoint2Node;
  }; //Connection of pedal to the foot for rotation
  
  AnyKinEqSimpleDriver HeelPedal = {

    AnyKinLinear lin =
    {
      AnyRefFrame& ref0 = Main.Model.Environment.Pedal;
      AnyRefFrame& ref1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.ToeMedialContactNode;
      Ref = 0;
    };

    
    MeasureOrganizer = {0};
    DriverPos = {0};
    DriverVel = {0};
}; //Linear connection of heel to pedal for forward movement

 AnyForce3D FootForce = 
  {
    //RefFrames = ;
    //Surfaces = ;
    //KinMeasureArr = {..Linear, ..Linear, ..Linear};
    //KinMeasureIndexArr = {0, 1, 2};
    //F = {0.0, 0.0, 0.0};
    Flocal = {80.0, 0.0, 0.0};
    AnyRefFrame &ForceA = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.ToeLateralContactNode;
    AnyDrawVector drF = {
           Vec = {0,0,0};
           Line = {
             Style = Line3DStyleFull;
             Thickness = 0.01;
             RGB = {1, 0, 0};
             End = {
               Style = Line3DCapStyleArrow;
               RGB = {1, 0, 0};
               Thickness = 0.02;
               Length = 0.05;
             };
           };
           AnyRefFrame &Foot = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.ToeLateralContactNode;
  };
}; //Reaction force from foot onto pedal
  

    AnyKinEqSimpleDriver PedalDriver =
  {
    AnyKinMeasure &ref0 = Main.Model.Environment.HingeJoint;
    DriverPos = pi/180*{-5};
    DriverVel = pi/180*{-25};
  }; //Driving the pedal
  
};



#9

Hi Mckay,

I have looked quickly through the code and spotted these issues:

[ol]
[li]The measureorganizer is wrong it says {0,2,3,2,4,2} should be excluded entirely so that it would do the default {0,1,2,3,4,5} what you have is a driver on linx,linz,rotz,linz,roty,linz please see the manual for explanation on anykinmeasure organizer.
[/li]
[li]The reaction on the pedal driver should be off now there is an engine supplying the force you have added. use Reaction.Type={Off}
[/li]
[li]I would supply the force to the pedal directly nd not to the foot, this would be more in line with reality, though it is not entirely wrong to just put in on the foot
[/li][/ol]

#10

Hi,

Thanks for the help, the forces are working and the position is not set in place.

closed #11

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