Forums Anyscript.org AnyKinEqFourierDriver: Sinus driver Modification
 Register FAQ Calendar Search Today's Posts Mark Forums Read

 Notices Meet us !

#1
10-09-2015, 01:14 PM
 tpeteler Junior Member Join Date: Aug 2015 Posts: 10
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.

regards
Tobi
Attached Images
 Sinus driver_wanted.jpg (8.2 KB, 4 views) 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
#2
10-09-2015, 03:38 PM
 toerholm AnyBody Support Join Date: Feb 2009 Posts: 940

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 = {
Type = Sin;
Freq = 1.0/2;
A = { {0, 1} };
B = { {0.0, -3.14/2 } };

Reaction.Type = {Off};
};

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.

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.
#3
10-12-2015, 12:38 PM
 tpeteler Junior Member Join Date: Aug 2015 Posts: 10

Hey Søren,

thanks a lot! It is working perfectly!

Best regards
Tobi

 Tags drivers, fourierdriver, motion

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Professional Forum     AnyBody Managed Model Repository     Gallery of user models and videos     AnyGait     AnyBody Exporter for SOLIDWORKS     Debug model General Forum     AnyBody Modeling System     Wish list for AMS and AMMR     Announcements Self-Supported Forum     AnyBody Model Repository     Debug model Archive     AnyScript Message Archive

All times are GMT +2. The time now is 10:56 AM.