[ODE] applying forces

Nate W coding at natew.com
Wed Jul 21 21:50:16 MST 2004


On Wed, 21 Jul 2004, Rüdiger Koch wrote:

> Instead I am supposed to use a motor which, as I understand, is
> setting a velocity. Now a real hydraulic cylinder is applying a force,
> not a velocity. The velocity of the piston is a function of the oil
> pressure and whatever is getting pushed by the piston.
> 
> How to get out of this?

Update the velocity every time-step, sort of like this:

dReal error = desired_position - actual_position;
dReal gain = 0.1f;
dReal velocity = error * gain;

So, when the joint's actual position is equal to the desired position,
you're setting the velocity to zero, so the joint stays in the desired
position.  Small changes from the desired position result in small
velocities, so the error is corrected gently; larger changes result in
larger velocity so the error is corrected quickly.  You will probably want
to adjust the 'gain' parameter a little bit, but 0.1 works for just about
everything I've built.

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com/
http://www.featherforum.com/   <== free photo albums for birds




More information about the ODE mailing list