Forums Anyscript.org  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2015, 01:14 PM
tpeteler tpeteler is offline
Junior Member
 
Join Date: Aug 2015
Posts: 10
Default AnyKinEqFourierDriver: Sinus driver Modification

Hello everybody

For my model I want to drive a joint in a "realistic" way, meaning inital velocity of 0, smooth acceleration phase, maximum velocity in mid phase, smooth deceleration phase to final velocity of 0.
To implement this in an easy way my first idea was to use AnyKinEqFourierDriver with a Sin function like that:

AnyKinEqFourierDriver SinDriver = {
AnyRevoluteJoint &Jnt = Main.ModelDef.Jnts.Shoulder;
Type = Sin;
Freq = 1.0/2;
A = { {0.0, 1} };
B = { {0.0, -3.14/2 } };

Reaction.Type = {Off};
};

The results can be find attached as "sinus driver_current"

Everything looks great, but the inital starting point. As you can see on the plot (and as expected), the motion is starting from -1 instead of 0.
Thus, is there a way to shift the sin function in y-direction? How could i implement it in Anybody (e.g. using differnent driver class).
Attached you will find an image of the desired motion task profile.

Looking forward to your answers!

regards
Tobi
Attached Images
File Type: jpg Sinus driver_wanted.jpg (8.2 KB, 4 views)
File Type: jpg Sinus driver_current.jpg (17.1 KB, 6 views)

Last edited by tpeteler; 10-09-2015 at 01:25 PM. Reason: Images were not displayed in the post
Reply With Quote
  #2  
Old 10-09-2015, 03:38 PM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 943
Default

Hi Topi,

There might be more elegant ways to this by using the Fourier in another way, my solution below is making use of the a linear combination measure which simply add an offset of 1.

Code:
Main ={
  
  
  
  AnyFolder model ={
    
    AnyFixedRefFrame GlobalRef ={  };
    
    AnySeg  Mass ={
      Mass=10;
      Jii={0,0,0};
      AnyDrawRefFrame drw ={};
    };
    
    AnyRevoluteJoint jnt ={
      AnyFixedRefFrame GlobalRef ={  };
      AnySeg &ref2=.Mass;
      Axis=z;
    };
    
    AnyKinEqFourierDriver SinDriver = {
      AnyRevoluteJoint &Jnt = .AddOffset ;
      Type = Sin;
      Freq = 1.0/2;
      A = { {0, 1} };
      B = { {0.0, -3.14/2 } };
      
      Reaction.Type = {Off};
    };
    
    AnyKinMeasureLinComb  AddOffset ={
      AnyRevoluteJoint &Jnt = .jnt;
      Coef ={{1}};
      Const={-1};
      OutDim=1;
    };
  };
  
  AnyBodyStudy study={
    AnyFolder &ref=.model;
    Gravity ={0,0,0};
  };
};

Please have a look, i think it does what you need...

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 10-12-2015, 12:38 PM
tpeteler tpeteler is offline
Junior Member
 
Join Date: Aug 2015
Posts: 10
Default

Hey Søren,

thanks a lot! It is working perfectly!

Best regards
Tobi
Reply With Quote
Reply

Tags
drivers, fourierdriver, motion

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 09:24 PM.