PID Without a PhD, Finally

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Embedded Systems Design (or whatever they call themselves) kept moving  
this around -- so I've revamped it, updated it, and posted it on the web.

Take a gander.  Please comment on anything you like/don't like.  I'm not  
sure if the way that I'm setting off the math is a Really Good Idea or a  
Really Bad Idea -- I'm trying to make it easy for the math-averse to skip  
over it, without breaking up the flow too much for folks who can read  
math without breaking stride.

http://wescottdesign.com/articles/pid/pidWithoutAPhd.pdf

--  

Tim Wescott
Wescott Design Services
We've slightly trimmed the long signature. Click to see the full one.
Re: PID Without a PhD, Finally
On 15/04/16 08:03, Tim Wescott wrote:
Quoted text here. Click to load it

Thanks - passed on to folk who might benefit.

One thing - in the text for Figure 5, you say "magnet is attached
to the stage, which moves with an acceleration proportional to the
coil current."

I've done exactly this with a large voice coil (4" diameter, 4" throw)
with a constant *voltage*, and you get a *speed* proportional to the
voltage, although the current quickly settles to a constant (-ish).
I'm sure I don't need to explain why - but it might be worth
mentioning back EMF at some point. It was a surprise to me, initially.

Clifford Heath.

Re: PID Without a PhD, Finally
On Fri, 15 Apr 2016 03:37:58 +1000, Clifford Heath wrote:

Quoted text here. Click to load it

I think maybe I should write a white paper on how motors work.  The  
principle of voice-coil motor behavior is pretty much the same as motors  
that turn in circles.

--  

Tim Wescott
Wescott Design Services
We've slightly trimmed the long signature. Click to see the full one.
Re: PID Without a PhD, Finally
Quoted text here. Click to load it

Thanks Tim. That last sentence rang a bell in my head and turned on a
light. I guess I officially "learned something" today.  


Re: PID Without a PhD, Finally
On 04/14/2016 06:03 PM, Tim Wescott wrote:
Quoted text here. Click to load it

I could have gotten the required PhD in the meantime...

Haha no just kidding that would be lame-o. Looks great! :)

Re: PID Without a PhD, Finally

You leave out math but include C code, I think that's defeating the
purpose.  If you can't explain it in non-technical words or a simple
picture... well, try harder :-)

You spend only one page on tuning, and give no examples of "If you see
this, try this" which is much more useful to the practical user.

You don't mention feed-forward terms at all.

In short, it looks much like all the other PID papers out there, and
wouldn't have helped me "get" PID back when I was trying to figure it
out.

The section on I - the last paragraph should go first, since the point
of the I term is to correct for long-term errors, and you don't even
mention it in the first paragraph.

The second paragraph in D should be first, and is probably the most
useful paragraph in the paper, if you don't already understand PID.

The other thing I always hated about PID papers is that they never gave
solid examples of the difference between controlling speed and
controlling position, or the more complicated case of
torque/speed/position nested PID loops for CNC control.

I'm reminded of a YouTube video about how NOT to weld - the guy would
intentionally do it wrong various ways so you could compare his results
with your results, so you could figure out what you were doing wrong and
how to fix it.  Something like that for PID would be more useful than
showing an ideal situation.

Re: PID Without a PhD, Finally
On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie wrote:

Quoted text here. Click to load it

Good points.

The intended audience is writers of software for embedded processors, so  
the 'C' code may be easier to understand than English for some readers.  
This was implied when it was in its original context -- I think I'll at  
least put in an expanded forward.

--  

Tim Wescott
Wescott Design Services
We've slightly trimmed the long signature. Click to see the full one.
Re: PID Without a PhD, Finally

Quoted text here. Click to load it

Can you remember the guy--and find the link to that video series?



Re: PID Without a PhD, Finally
Quoted text here. Click to load it

ChuckE2009


https://www.youtube.com/watch?v=PJDv7Y6dUi0
mig welding

https://www.youtube.com/watch?v=akvv4ApYMVE
stick welding

https://www.youtube.com/watch?v=CVAByfuZXIY
tig welding

Re: PID Without a PhD, Finally
On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie wrote:

Quoted text here. Click to load it

D'oh -- why, of course I'll include an appendix or something on how to do  
this with op-amps.  It should have occurred to me immediately.

--  
www.wescottdesign.com

Re: PID Without a PhD, Finally
Quoted text here. Click to load it

Indeed I've been wondering whether this stuff was ever done with purely
analog electronics.  I don't know how far back it goes historically but
I imagine quite a way.  Optimal control is from the 1940s and I'd expect
PID to be much older?  I'm clueless though.

Re: PID Without a PhD, Finally
On 26.04.2016 09:30, Paul Rubin wrote:
Quoted text here. Click to load it

I think the 1st generation of CD players had pretty analog control loops  
for focus and track. This is not too long ago...

Re: PID Without a PhD, Finally
On Tue, 26 Apr 2016 00:30:18 -0700, Paul Rubin wrote:

Quoted text here. Click to load it

The first PID controllers, to my knowledge, were purely mechanical  
systems.  The seminal papers were written in the 1860's, but they were to  
describe and analyze what had already been in use in industry.  

Pneumatic systems were a great innovation in the 1930's (or 20's, or  
teens).

Electronics doing PID control is a johnny come lately.

Here's Maxwell's paper (yes, James Clerk Maxwell of E&M fame).  There was  
a Russian -- Tchebychev, I think.  I can't remember who, nor have I found  
any papers.

https://upload.wikimedia.org/wikipedia/commons/b/b1/On_Governors.pdf

--  

Tim Wescott
Wescott Design Services
We've slightly trimmed the long signature. Click to see the full one.
Re: PID Without a PhD, Finally
Tim Wescott wrote:
Quoted text here. Click to load it


The writing on that is superb. Thanks for the link.

--  
Les Cargill

Re: PID Without a PhD, Finally
On 04/26/2016 03:30 AM, Paul Rubin wrote:
Quoted text here. Click to load it

Sure thing.  About three weeks ago for me. ;)

Cheers

Phil Hobbs

Re: PID Without a PhD, Finally
Paul Rubin wrote:
Quoted text here. Click to load it


The first PID was used for steering ships and was mostly mechanical:

http://www.pcbheaven.com/wikipages/PID_Theory/

--  
Les Cargill

Re: PID Without a PhD, Finally

Quoted text here. Click to load it


Engineers tend to do

  Actuator = error * (Kp + Ki + Kd)

whereas old-time analog controllers did

  Actuator = Kp * (1 + Ki + Kd)

with the idea being that it's easier to tune on-site.


--  

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement  

We've slightly trimmed the long signature. Click to see the full one.
Re: PID Without a PhD, Finally
On 4/26/2016 8:07 PM, John Larkin wrote:
Quoted text here. Click to load it

I think you mean,

Actuator = error * Kp * (1 + Ki + Kd)

In other words, the Ki and Kd terms were normalized to Kp.

--  

Rick C

Re: PID Without a PhD, Finally
rickman wrote:
Quoted text here. Click to load it


No, he didn't do that properly. Otherwise, there'd be no need
for three Kx constants.

The integrator term accumulates the error per sample by some law/filter
and the Kd is multiplied by a filtered version of the difference
between the error this sample and the error of the previous sample.

Actuator = (error * Kp)
            + ( filter1(sum(error)) * Ki )
            + ( filter2(delta(error,lastError)) * Kd)

where the filters are very likely extremely stateful and not very  
filter-ey.

Forms exist for continuous linear PID and they're about what you'd expect.


--  
Les Cargill

Re: PID Without a PhD, Finally
John Larkin wrote:
Quoted text here. Click to load it

Uhhhhh... no.

Actuator = (error * Kp)
            + ( filter1(sum(error)) * Ki )
            + ( filter2(delta(error,lastError)) * Kd)

Quoted text here. Click to load it

Because trimpots are awesome.

--  
Les Cargill

Site Timeline