DPRG List  

[DPRG] PID Loop Question

Subject: [DPRG] PID Loop Question
From: Dale Wheat dale at dalewheat.com
Date: Mon Feb 22 13:03:59 CST 2010


There you go again, stirring things up with controversial subjects  :D

If you have any analog electronics experience, it helps to think of a "PID loop" 
as a "PID filter".  There are three separate filters, P, I & D.  They all tie 
back in together to adjust the output.  Each has adjustable, or tunable, 
coefficients.  Tuning those coefficients is where the magic comes into play.

I'm assuming you have a clear understanding of the classic "control loop" 
theory, where a feedback path is modified by various, simultaneous filters.  If 
not, ignore what follows.  As you're quite the subject matter expert on motor 
control, IMHO, I would suspect that you will understand.

P = NOW:  Think of "P" as the "immediate" error.  That's what's wrong *right 
now*.  Too little of that kind of feedback works very slowly to correct the 
error.  Too much causes over-correction and can lead to oscillation or ringing. 
  Sometimes P is all you need.

I = PAST:  You're right on the money with the "I" portion.  It is the 
accumulated error over time.  It's the sum total of everything done wrong in the 
past.  It's like a mother-in-law that never forgets anything you ever did 
wrong... ever.  And likes to remind you of it.  Always.  So maybe your aim is 
only 1.2% off... the "I" term reminds you that you are now 500 yards off the 
track, to give a simple example.  Some PID implementations support "integral 
windup" limits that ignore any integrated error past a certain level (e.g., 
because there's nothing you can do about it).

D = FUTURE:  The "D" is the anticipated future error, based on the current "rate 
of change in error".  If you're only off course a little bit, it stays low.  If 
you're suddenly way too far one way or the other, it kicks in.  It is a 
predictor of future error based on past performance.

There are some really simple ways to implement PID without any calculus.  It 
helps, but is not required, if you have floating point math available.

Error = where you want to be - where you are
P = error (instantaneous error)
I += error (accumulated error over time)
D = this error - previous error (rate of change in error)

One of my many "future projects" is a completely analog PID filter circuit with 
lots of knobs to illustrate how PID works, by giving you a "hands-on" experience 
with it.  Short of that, the best way to learn about it is to start trying out 
some implementations yourself and see what works.  This is one of those 
semi-complex areas where you really don't want to wait to understand it all 
before proceeding.  Jump in!


Dale Wheat

(972) 486-1317

Quinones, Jose wrote:
> Hi Group,
> I am trying to get a better understanding of the PID Loop. I have some, 
> but want to understand it as good as I understand tying up my shoes. I 
> want this to be as clear in my head as it is counting from 1 to 10 in 
> Spanish.
> So far, I think I understand the Proportional aspect this good. If the 
> error is big, correct a lot. If the error is not so big, correct just a 
> little bit.
> I think I have an idea of what Integral is. If the error has been big 
> for a long time, correct for a longer period of time. If the error has 
> not been too large for a long period of time, then apply a correction 
> only for a small period of time.
> Not certain if I follow Derivative as well, but my impression is that it 
> tells us how quick the error is changing and if so, then apply a correction.
> And then it comes to putting it all together and knowing which component 
> caused which occurrence of what.
> I know there is a bunch of tutorials out there, but they are all of the 
> style “if 1 + 1 = 2, what is the molecular constitution of binary star 
> system XT394-MY if the two suns collapse at the neocortex of the 
> meridian divesture?” In other words, WHAT???
> What explanations can you offer or what tutorials can you point me to? 
> Thanks in advance for expanding my mind with your knowledge!
> Best regards,
> ------------------------------------------------------------------------
> _______________________________________________
> DPRGlist mailing list
> DPRGlist at dprg.org
> http://list.dprg.org/mailman/listinfo/dprglist

More information about the DPRG mailing list