[ODE] proportional derivative controller

Tyler Streeter tylerstreeter at yahoo.com
Tue Apr 27 23:13:39 MST 2004


I am trying to implement a proportional derivative
controller.  I had been using the desired velocity
function of the motored joints for a while, but now I
want to use a PD.

The base equation for a single DOF is this:

torque = springConstant*(desiredAngle - currentAngle)
- dampingConstant*angularVelocity

I think it's working, but sometimes things fly out of
control.  I'm using it for the joints in a ragdoll, so
there are lots of joints.  Everything was perfectly
solid before using the joints' desired velocities.

My main question is this: Can I simply call
dHingeAddTorque with the torque calculated above?  At
first I thought no since that equation calculates the
current torque, and dHingeAddTorque would be adding a
torque every time step.  Then I realized that it would
be the same thing since ODE will zero the torque every
time step.  So, I think I can still use the above
torque value in dHingeAddTorque.  Is that right?

Has anyone else implemented proportional derivative or
proportional integral derivative controllers in ODE? 
Do you have any advice or sample code? 

Thanks.

Tyler Streeter


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 


More information about the ODE mailing list