View Single Post
  #3   Spotlight this post!  
Unread 03-07-2011, 21:48
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,995
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: PID controllers help

The first step is to understand what a PID controller is trying to do.

A simple example is a cruise control on a car. The PID controller there wants to keep the car's speed constant, and correct any changes to the speed within a reasonably brief time..

Let's say you want to maintain 55 MPH, which we call the "setpoint". If the car's speed is 25 MPH, we have an "error" of -30 MPH. If we allow the P (proportional) factor to do its thing, it asks the car to accelerate, in proportion to the error - bigger error, more acceleration.

But we don't want to accelerate at full throttle, so we? That much power might cause the car to be unstable on the road, so we limit the maximum acceleration regardless of the "error" to some value - this is the D (derivative) factor.

OK, once we get to 54 MPH, the error is small, but not yet zero. The acceleration requested by P is less than the D limit, but the car might take an unreasonably long time to finally reach 55 MPH. So what we do is use the I (integral) factor to add up the error over time, so that in a relatively brief time even a small error is handled and brought to zero.

I hope this helps. In the real world, we often don't even need D or I, with P being sufficient for many tasks.

Programming PID is actually quite simple, but tuning the P, I and D factors can take some tedious trial and error.
__________________

I am N2IRZ - What's your callsign?
Reply With Quote