Forums

PID Without a PhD, Finally

Started by Tim Wescott April 14, 2016
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
http://www.wescottdesign.com
On Thursday, April 14, 2016 at 3:04:00 PM UTC-7, Tim Wescott wrote:
> 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 > http://www.wescottdesign.com
"In addition, the electrical requirements to build a good current-output amplifier and non-contact transducer interface can be chal-lenging. You can expect that if you are doing a project like this you are a member of a fairly talented team (Note 4)." "Note 4: Or that you're heading toward a very educational disaster." Hahahahaha :) It's great! So much better than the Process Control text our professor wrote and used in our class. Michael
On Thursday, April 14, 2016 at 3:04:00 PM UTC-7, Tim Wescott wrote:
> 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 > http://www.wescottdesign.com
Page 20, Figure 18 has an... interesting... X-axis. Michael
On Thu, 14 Apr 2016 15:39:39 -0700, mrdarrett wrote:

> On Thursday, April 14, 2016 at 3:04:00 PM UTC-7, Tim Wescott wrote: >> 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 http://www.wescottdesign.com > > > > Page 20, Figure 18 has an... interesting... X-axis. > > Michael
That's as it came out of Scilab. Argh -- Scilab can be coerced to make more human-readable output, but it's a pain. Thanks, though. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Thu, 14 Apr 2016 15:09:14 -0700, mrdarrett wrote:

> On Thursday, April 14, 2016 at 3:04:00 PM UTC-7, Tim Wescott wrote: >> 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 http://www.wescottdesign.com > > > "In addition, the electrical requirements to build a good current-output > amplifier and non-contact transducer interface can be chal-lenging. You > can expect that if you are doing a project like this you are a member of > a fairly talented team (Note 4)." > > "Note 4: Or that you're heading toward a very educational disaster." > > Hahahahaha :) > > It's great! So much better than the Process Control text our professor > wrote and used in our class. > > Michael
Glad you like it. I feel that embedding little tid-bits like that in a document helps to keep people on their toes. Without, I hope, detracting too much from the content. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On 04/14/2016 06:03 PM, Tim Wescott wrote:
> 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 >
I could have gotten the required PhD in the meantime... Haha no just kidding that would be lame-o. Looks great! :)
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.
On 4/14/2016 6:03 PM, Tim Wescott wrote:
> 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
I don't know if color is something that will be preserved, but that bright green for links actually hurts for me to look at. Hard to miss though. The PDF page numbering is off 1 from the text page numbers. I'm pretty sure there is a way to deal with that. Page 2 (text page number) paragraph 2, "Some command is given to a controller, and the determines a drive signal to be applied to the plant." Is "the" the word you want? Page 4, equation 1, you might explain the basis of this equation. I assume the voltage actually controls the torque. Friction force is a result of velocity and the acceleration is from the excess force until the motor speeds up. Contrasted to the equation for the frictionless platform. Page 6, paragraph 1, figure 5, you write "The magnet is attached to the stage", but the diagram calls it a "platform". That is not hugely distracting, but if I know nothing about optical systems (which I don't) I might be thinking the "stage" is something different and start looking for what it means (I did). Just for completeness, you might include the "position transducer" in your diagram. I assume it measures the position of the platform rather than the magnet. Page 6, paragraph 2, showing my ignorance I don't understand, "With this arrangement the force on the magnet is independent of the stage motion." Doesn't a magnet moving in the coil create a current/voltage that interacts with the applied current/voltage? Are we assuming the "good current-output amplifier" deals with this? Page 6, equation 2, I don't see where Vp is defined. It does not seem to be used anywhere else in the paper. Page 8, equation 3, you define Th twice but don't say what units. I assume it needs to be absolute temperature, Kelvin? Two time constants are given, but no explanation for why two or what is different about them. I don't know about others, but I have a hard time considering an equation I don't understand. It keeps me from getting an understanding of how the controller would work. I need to go now. Please take this for what it is worth, free advice. -- Rick
On 4/14/2016 6:39 PM, mrdarrett@gmail.com wrote:
> On Thursday, April 14, 2016 at 3:04:00 PM UTC-7, Tim Wescott wrote: >> 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 >> http://www.wescottdesign.com > > > > Page 20, Figure 18 has an... interesting... X-axis.
I don't have a problem with that. In fact I often make graphs in LTSpice that way to make the data easily visible rather than obscured by the axis. -- Rick
On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie wrote:

> 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.
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 http://www.wescottdesign.com