Jump to content

What's your favorite book/tutorial on PID tuning?


Stobber

Recommended Posts

Even after thre semesters of controls study in my BSEE program and multiple projects with manually tuned PID systems, I still feel like it's something of a black art. I've met oldschool engineers at my clients' offices with a preternatural talent for tuning PIDs, but when I asked them what their approach was, they couldn't really describe it. Just "intuition".

 

What's your favorite book, tutorial, or other resource on tuning PIDs by hand? I've read all the Wikipedia articles and free online tutorials presented by college undrgrads or companies with a product to sell. I'm looking for the real deal here, the authentic guide to tuning mastery!

Edited by Stobber
  • Like 1
Link to comment
Even after thre semesters of controls study in my BSEE program and multiple projects with manually tuned PID systems, I still feel like it's something of a black art. I've met oldschool engineers at my clients' offices with a preternatural talent for tuning PIDs, but when I asked them what their approach was, they couldn't really describe it. Just "intuition".

What's your favorite book, tutorial, or other resource on tuning PIDs by hand? I've read all the Wikipedia articles and free online tutorials presented by college undrgrads or companies with a product to sell. I'm looking for the real deal here, the authentic guide to tuning mastery!

 

It is a black art because it depends on the load and the symmetry of (in the case of temperature controllers) the heat/cool cycles (try an oven with nitrogen injection cooling!). It is always a trade-off since some systems cannot tolerate any overshoot and therefore require different parameters to those that can even though they behave the same in relation to transients.

You can formally calculate PID parameters but they are, at best, a "first best guess" in real world applications and unless you are dealing with an ideal load, will need to be tweaked with things like prop-band and dead-band.

This is all you need to know about calculating PID.

http://www.dcnz.com/resources/tutorials/pid.pdf

The rest is knowledge of the system and experience with similar systems which give you the Control Engineers equivalent of "Code Smell". It is similar in many ways to debugging which is why it is difficult to explain by the experienced engineer.

Edited by ShaunR
  • Like 2
Link to comment

In general I agree with ShaunR's comments. However, I wouldn't say that the "all you need to know" link is comprehensive. It looks like a good resource for tuning heaters and similar systems, but that's not the only application of PID. Servo controllers in motion control systems often use PID as well, but are tuned differently because they have a different response. For example, in a heating or cooling situation, you almost always need some constant output in order to maintain the desired temperature, otherwise the process starts to drift towards ambient. However, in motion control, once you reach your target, you shut off the output (or reduce the power dramatically to a holding current). If you have a slight offset from the target position, you may not want to correct it with integral control, because integral control can cause a sudden jump after the system appears to have stopped (the output will increase slowly until it's sufficient to cause motion, and then probably overshoot the target location). Servos are often tuned with proportional and derivative control alone.

 

I don't think PID tuning is as much intuition as it is getting a feel for the effect of different gains, although maybe that feels like intuition after a while. Try setting up some simple simulated processes in LabVIEW and then tuning them. Studying the math behind it can help, too. For simple systems like heaters, where the response is generally slow, the feedback isn't noisy, and it's difficult to drive the system to instability, a basic understanding of PID equations is enough. If you're working in systems that can go unstable (and potentially cause damage), you may want to study the math in more detail, looking at stability criteria, frequency response and Bode plots. Unfortunately I can't offer a good resource on those topics, it's one of those things that I would love to understand in more depth but haven't had the right combination of need and opportunity to learn it.

Link to comment

ned, I've studied the math formally. While useful for understanding, it's largely worthless without a model of the plant, and what I'm looking for is advice on how to tune without models. ShaunR's link is good at putting all the parameters into this context once you're familiar with the math and the lingo. Yes, it focuses on temperature control...it'd be nice to find something analagous for servomotor control.

Link to comment
...it's largely worthless without a model of the plant...

 

This is my beef with PID control theory reference material as well. I find it's pretty trivial to do PID if I have a well characterized plant and can get "close enough" with a model calculation, leaving the PID to take up the slack. The "intuition" part comes in when I'm working with systems where the plant is not well understood.

Link to comment
For example, in a heating or cooling situation, you almost always need some constant output in order to maintain the desired temperature, otherwise the process starts to drift towards ambient. However, in motion control, once you reach your target, you shut off the output (or reduce the power dramatically to a holding current).

 

I don't think it is as different as you might think.

With temp controllers you reduce power approaching setpoint since you only need to put enough energy in to compensate for heat loss (synonymous with your holding current and, generally, it is a current unless they are gas heaters). You need far less energy to maintain a temperature than you need to get there (overcome thermal inertia). Similarly with motors. You need more energy to drive to position (overcome mechanical inertia) than hold it for exactly the same reasons.

That's the thing about PID tuning. It doesn't matter what the system is (3 fat ladies on a see-saw). It's an empirical method to map a systems final output solely in terms of its input to arrive at an approximate model of the system - regardless of what the units may be (deg/C, deg/rad, or lemons).

  • Like 1
Link to comment
ned, I've studied the math formally. While useful for understanding, it's largely worthless without a model of the plant, and what I'm looking for is advice on how to tune without models. ShaunR's link is good at putting all the parameters into this context once you're familiar with the math and the lingo. Yes, it focuses on temperature control...it'd be nice to find something analagous for servomotor control.

 

There is a lot of material about transfer functions and Laplace transforms and precise mathematical models of the system. That's not what I meant. I meant the PID calculation itself - which is amazingly simple given how many places it can be used. I like to think about PID in terms of real units (maybe you do this already too). The Proportional gain is the ratio between a change in input and the corresponding change in output. The integral and derivative times likewise have real meanings - they're not just numbers. You likely know this already, but I'm always surprised at the number of people who have trouble explaining PID because they don't think about the physical meaning of the gains. I found that PID tuning suddenly made more sense to me when I started thinking about it the gains corresponding directly to units in the process, and it doesn't require a detailed mathematical model.

Link to comment
I like to think about PID in terms of real units (maybe you do this already too). The Proportional gain is the ratio between a change in input and the corresponding change in output. The integral and derivative times likewise have real meanings - they're not just numbers. You likely know this already, but I'm always surprised at the number of people who have trouble explaining PID because they don't think about the physical meaning of the gains. I found that PID tuning suddenly made more sense to me when I started thinking about it the gains corresponding directly to units in the process, and it doesn't require a detailed mathematical model.

I like to go a step further and try and represent things graphically.  For temperature control I plot the "Proportional Band”, the range of temperatures where the heater output would be between zero and 100%, on the same graph as the process variable.  Tuning is still by intuition, but with more visual information to go on.  You can see the effects of the PID parameters in the twists of the proportional band.

Link to comment
I like to go a step further and try and represent things graphically. For temperature control I plot the "Proportional Band”, the range of temperatures where the heater output would be between zero and 100%, on the same graph as the process variable. Tuning is still by intuition, but with more visual information to go on. You can see the effects of the PID parameters in the twists of the proportional band.

I'm also a very visual person (hence my preference for LabVIEW). Combine what you are saying with Taguchi analysis and it takes a lot of the intuition out of it.

https://controls.engin.umich.edu/wiki/index.php/Design_of_experiments_via_taguchi_methods:_orthogonal_arrays

 

Damn. What is it with links?

Edited by ShaunR
Link to comment

It doesn't help trying to tune when the implementation does not match the learned theory. Take, for example, tuning drives. The few times that I've been involved with the tuning, the proportional and derivative have been unit-less values and the integral in milliseconds (specifically, the rate at which the PID was calculated).

 

As an aside, I just got out of a sales pitch during which the hardware expert described the controls drawing of their PID controller as "something the Austrians came up with while drinking one night".

  • Like 1
Link to comment

Oscillate it (P).  Critically damp it (PD).  Trim the offset (PID).  I am a stickler for anti-windup as well.  I have found that to work great to get things very hot, very cold, very magnetic, and very stable. 

 

To me the problem is not that the underlying physical system is crazy, because surprisingly many are approximated very well by relatively simple transfer functions.  The problems I encounter usually involve conditioning the feedback signal so I am not chasing the noise while not adding an excessive time delay into the feedback system (that is a real bandwidth killer).

 

If something will blow up and blowing up costs $$$ then you had better model the heck out of it.  Otherwise I would study the math on the back of an envelope to estimate a range for each parameter and then tune away.

 

I liken these things to the Wright brother's plane, hard to fly, but much harder to explain how to fly it. 

Link to comment

This guy really knows his stuff...

 

www(dot)controlguru(dot)com

 

I have found that understanding the open loop response of a system is a good first step.  Try to use this knowledge to develop a FeedForward model of the system and then the PID portion will be able to deal with the smaller (and hopefully linear) error left over.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.