[ODE] Simple Spring

Remi Ricard remi.ricard at simlog.com
Mon Apr 10 09:59:36 MST 2006


Hi,

> Hi ODE-Community,
>
> I would like to model a simple spring with ODE. I know this could be 
> done with CFM and ERP. But how can I set it for a single joint (e.g. a 
> fixed joint). My spring works fine when I set world ERP and CFM but 
> then, of course, the rest of the simulation is rubbish.
> Note: I'm still using the 'latest' release with only very few fixes. 
> Would it be necessary to switch to the trunk or unstable?
>   
I'm modelling the spring with dJointAddHingeTorque

Where Torque = -k*(Angle - Angle_init) -  d*angular_velocity;

Using CFM and ERP will give you a spring like behaviour only at the limit.

Let say you have something like following with the Hi and lo limits set 
to 45 to -45deg
You are at equilibrium

Wall     Hinge
 |
 |---------*----------
 |

then you had a mass
Wall     Hinge  -----
 |             |=====|
 |---------*----------
 |

You should have some thing like this after a while.
The damping has done its work.
N.B. The rest angle is not -45deg. It depends on you k

Wall     Hinge
 |              _____
 |---------*\__|=====|
 |                \__


Remi


More information about the ODE mailing list