View Single Post
  #12   Spotlight this post!  
Unread 12-01-2007, 15:44
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: Potentiometer PID

Quote:
Originally Posted by Robby View Post
Correct. Although the way PID loops are generally created is by adjusting the P portion until it almost works and then adding the I portion until it is almost there and then adding the D portion to make it work better. A lot of the time, depending of what you are doing and how much precision you need, you'll find that the P control may be all that you need.
AND you may find the I and D are fraught with peril when implemented in a relatively low resolution discrete CPU. There is integral windup to deal with. Taking derivatives will amplifying noise - perhaps causing bad behavior. If that wasn't bad enough then there is the whole sampling delay causing instability issue.

Let's also not forget extra the care and feeding a PID loop needs that a P loop does not (for example if you don't turn off the integrator when your robot disabled it is very likely to do some violent action as soon as it is enabled*).

Bottom line for me: if you can get acceptable performance using a P loop, use a P loop. If not, add an I and finally if needed add a D.

Oh yeah, one more thing, if you are using a feedback loop on a clearly non-linear system (like a robot arm), you can really help yourself by adding in a term that corrects for KNOWN non-linear disturbances. For example, gravity. It is quite easy to know what effect that gravity has on your arm given that you know the position of the arm joints. You can simply calculate the moment due to gravity as mg*L*cos(theta). Once you have this term it is pretty easy calculate an added term that you output to your motors that will add the right about a torque to the motor to just cancel the gravity torque. In this way, your feedback loop only has to deal with unknown disturbances (like more fiction or a tube being on your arm, etc.)

On a similar note, you will have much better control of your arm if you can use counterbalance (e.g. lots of latex tubing) to cancel gravity without your feedback loop having to do anything. In general, anything you do to make your arm easier to control for your drivers in "open loop" mode will help your feedback loop (PID or otherwise).

Finally, a higher gear ratio is another huge help to making feedback loops more controllable -- this helps for many reasons, too many to go into here, but as a rule of thumb I try to design arms to have a gear ratio such that my worst case expected load on the motor is about 1/5 to 1/4 of the stall torque of the motor (worst case does not include another robot hanging my arm but my worst case geometry with my heaviest payload)

Good luck.

Joe J.

*if you have a PID control you are living on the edge if you don't have routines in your C code called "JustEnabled" and "justDisabled" You should have those routines anyway but you REALLY need them with PID control. JJ
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2

Last edited by Joe Johnson : 12-01-2007 at 15:52.