Forums Anyscript.org  

Go Back   Forums Anyscript.org > General Forum > AnyBody Modeling System

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2019, 09:37 AM
Mckay Mckay is offline
Junior Member
 
Join Date: Jan 2019
Posts: 6
Default Pedal Movement

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/x8zgm...Human.zip/file
Reply With Quote
  #2  
Old 01-03-2019, 10:49 AM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 955
Default

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
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #3  
Old 01-03-2019, 11:01 AM
Mckay Mckay is offline
Junior Member
 
Join Date: Jan 2019
Posts: 6
Default

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.

Code:
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};
  };
};

Last edited by Mckay; 01-04-2019 at 03:54 AM. Reason: Adding code used
Reply With Quote
  #4  
Old 01-04-2019, 04:01 PM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 955
Default

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

Code:
    AnyRefNode Hinge = {
      
      sRel = {0, -0.15, 0}; //Pedal hinge relative to origin
    };
it runs again.


Best regards
Søren
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #5  
Old 01-07-2019, 08:06 AM
Mckay Mckay is offline
Junior Member
 
Join Date: Jan 2019
Posts: 6
Default

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.

Last edited by toerholm; 01-07-2019 at 03:21 PM. Reason: removed link
Reply With Quote
  #6  
Old 01-07-2019, 03:21 PM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 955
Default

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
Attached Files
File Type: any Environment.any (1.2 KB, 5 views)
File Type: any JointsAndDrivers.any (1.5 KB, 2 views)
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #7  
Old 01-08-2019, 02:55 AM
Mckay Mckay is offline
Junior Member
 
Join Date: Jan 2019
Posts: 6
Default

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.
Reply With Quote
  #8  
Old 01-09-2019, 09:37 AM
Mckay Mckay is offline
Junior Member
 
Join Date: Jan 2019
Posts: 6
Default

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.
Code:
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
  
};

Last edited by Mckay; 01-09-2019 at 09:41 AM. Reason: Clarifying problem
Reply With Quote
  #9  
Old 01-09-2019, 09:49 AM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 955
Default

Hi Mckay,

I have looked quickly through the code and spotted these issues:
  1. 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.
  2. The reaction on the pedal driver should be off now there is an engine supplying the force you have added. use Reaction.Type={Off}
  3. 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
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #10  
Old 01-09-2019, 11:31 AM
Mckay Mckay is offline
Junior Member
 
Join Date: Jan 2019
Posts: 6
Default

Hi,

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:27 PM.