What for the "D" in a PID control loop?

I=92ve built several PID control loops, mostly for temperature control, but sometimes for other things. I=92ve always used the all three PID parameters. I use to think that the D term was there to help reduce the ringing. (As stated in the wiki PID article.) And was needed to get critical damping of the loop.

But this misunderstanding was corrected a few years ago by a colleague. For thermal loops you=92ve got one pole in the thermal time constant of the system and can add another with PI control and with proper tuning can have critical damping of the loop with just P and I control.

Hence my question, What=92s the D for? Is it helping or only making things worse?

George H.

Reply to
George Herold
Loading thread data ...

In the hands of the inexperienced, it is raising management's hopes, destroying production's peace of mind, and generating potential revenue for me.

The use of the differentiator in a PID controller is problematical. In general, the differentiator acts as a 'predictor' to let the controller anticipate future behavior of the plant. This lets you get snappier response out of the system, because the controller knows in advance when to 'put on the brakes'. But its action as a predictor is imperfect, so if you depend on it too much you just get oscillation at a much higher frequency than you could with proportional control alone.

So it _does_ help to damp the system, but only when you were pushing your proportional gain a bit too hard.

Differential action predicts, but it does so by looking at the past. If you plot the action of a differentiator as response vs. frequency, the amplitude of the response goes up and up and up with frequency. This is an undesirable trait, as just about any plant's behavior gets less and less predictable as the frequency gets higher. Push your derivative gain too hard, and you'll find your plant ringing like a bell, or outright singing.

If you use a differentiator you really want to band-limit its response -- but to do this right you really need to understand more about control theory than just cookbook PID implementations.

Here's an article that has some examples of tuning systems with and without differential action:

formatting link

If you _really_ want to go overboard, particularly if you're implementing your controllers in software, you'll be interested in my book:

formatting link

HTH

--
www.wescottdesign.com
Reply to
Tim Wescott

PID

the

et

g
f
s

in

g/pidwophd.html.

Hi Tim, Thanks for the response.

I'm not sure I get your 'predictor' analogy. But if you want to say that the D gives you more gain at higher frequencies then I agree. I guess I tend to look at PID controllers from the frequency domain. P has a flat response at all frequencies, I gives you lots of gain at DC but then goes away, and D is all at the high frequency end. (Oh and I do always roll the D back off.. typically at frequencies that are about ten times greater than were it 'turns on'.)

"

formatting link
" Thanks for the link. Thanks for the link. I'm afraid I've got a PhD... can I still read your article?? :^)

I guess I'm wondering if, given the simple thermal control loops I'm typically using, if it would be better to throw away the D on the next project. Saves an opamp and a few big caps. I'm not much of a computer guy and make only analog PI(D) loops. I've always hated the dead band you get with commercial Digital controllers, from say Omega or others.

George H.

Reply to
George Herold

I didn't know how much you knew, so I was using the time-domain analogy that's easier to grasp if you don't understand frequency domain stuff. The differential term predicts because it measures velocity. It's the difference between being parked in front of a brick wall, and hurtling toward that same brick wall at 60 miles an hour -- if you're not moving (D term = 0), one foot away from the wall is merely 'close'. If you're moving fast (D term = +60MPH), 50 feet away is 'oh my gawd!!!'. Why? Because the controller in your brain is calculating speed and distance vectors, and predicting a noisy and maybe painful crash.

Well, that depends. Some thermal plants tend to pile all of their phase shift in one place, so there's only so much you can buy with differential control. In that case there's certainly reason to think about a cost/ benefit tradeoff. If you can measure the frequency response of the plant you can do all of this ahead of time, including tuning, before you commit to a board. Or you can just prototype a controller, of course.

Commercial digital controllers are, as near as I can tell, designed and implemented by Oog and Og using methods and technology -- other than the communications bells and whistles -- that was obsolete decades ago.

If you're controlling a temperature you can do the whole job of control with an 8-pin microprocessor connected to an 8-pin 24-bit ADC; at worst you'll need a level shifter and low pass filter before you go to your drive electronics, and you may well use less board space than one of your big caps. _And_ your controller's response time will be well within the response time of your plant, so you won't see any discernible change in performance.

But don't let that keep you from your appointed path.

--
www.wescottdesign.com
Reply to
Tim Wescott

I

=A0

re

=A0

Hmm, Yeah most of the time the 'plant' is just sitting there at the setpoint and the D is not doing anything. (At least in my applications this is the case.) I'm not quite sure what a 'plant' is. Most of the time I dragging little (100 gram) pieces of 'stuff' around with ~10 Watts of power. (The last thermal project was temperature control of a ~1kg permanent magnet used for NMR.)

an I

e

nt

Hmm I'm not quite sure what the phase shift is in this case. Are you talking about how distributed the thermal mass is?

d

Yeah they suck! Someone should make something better then. We pay almost $300 for these POS's.

e

Well it's the whole learning curve thing. Your micro and ADC are replacing a few opamps and caps. I then just have to choose and tweak some R's. Still I'd like learn more about micro's and all.

What appointed path. I think my life is more like the blind pig finding an acorn.

But still I think you implied that simple 'approximately single pole' thermal systems may not need the Derivative term. Hmm maybe I should try doing some thermal modeling on LTspice ala John L.

George H.

Reply to
George Herold

"Plant" == "thing my controller is responsible for". It comes, I think, from "steam plant" back in the days when control theory was being invented.

I've heard lots of scary stories about how hard it is to control temperature, but the few times I've done it things have acted like straightforward single-order low pass filters.

Yes.

Yes, depending on how well they have to reject disturbances they may well not need it.

--
www.wescottdesign.com
Reply to
Tim Wescott

: :I?ve built several PID control loops, mostly for temperature control, :but sometimes for other things. I?ve always used the all three PID :parameters. I use to think that the D term was there to help reduce :the ringing. (As stated in the wiki PID article.) And was needed to :get critical damping of the loop. : :But this misunderstanding was corrected a few years ago by a :colleague. For thermal loops you?ve got one pole in the thermal time :constant of the system and can add another with PI control and with :proper tuning can have critical damping of the loop with just P and I :control. : :Hence my question, What?s the D for? Is it helping or only making :things worse? : :George H.

See

formatting link

Reply to
Ross Herbert

We always use a little "D" to slow down the approach to zero error, other wise, uncontrolled over shoot normally takes place! Especially when the driving system is reaching max output.. This works especially well on dancer and heat control systems.

I have found how ever, that some devices (design of) do not implement the "D" the same way. So experience is needed to tune these devices.

Jamie.

Reply to
Jamie

ID

o
e

Thanks Ross, I've never had any problems with the the PID's I've built. Turn off the I and D. Crank up the gain till it oscillates, find the critical point and use the #'s for the Nichols- Zeigler (or some such name) tuning methdod, I then usually back the numbers off to get a nice looking step response.

But this doesn't seem to give me any information on how to choose D.

George H.

Reply to
George Herold

,

PID

to

ime

ent

Yeah, Thanks Jamie. I always throw in a bit of D and look at the step response. I guess the next time I tune one up I'll have to play around a bit and look at the difference.

As I understand the theory, If I've got a two pole system I should be able to set things to have critical damping... or oscillation... and thing in between. It's like a damped harmonic oscillator.

George H.

Reply to
George Herold

.

ay

=A0I

=A0P

h
y

he

g

ou're

hy?

ns

the

a

hink,

a
k
d
.
l
t
k

ing

Thanks Tim, Yeah I've only got simple thermal control tasks to take care of.

George H.

Reply to
George Herold

Like I said before, "D" is implemented differently depending on the device..

For example, an Analog PID may label the "D" as a "LEAD" function, which is really what's all about..

Basically, the faster the reference signal changes, the more charged a capacitor gets to develop a lead (90 degrees) which then drives a circuit that sums it's value to advance it early or even put it into a negative state for retreat.

This Lead circuit adds to the final out put. So in short, the output of the PID may see the desired results or even over shoot the desired results before the input reference actually gets there. This can slow things down and we have a nice soft cushion when the error reaches 0. Because the nearer it gets to zero error, the smaller the "D"/Lead value will be due to the fact that it has already been slowing down before hand.

In digital systems, at least most of them, the value is set in time which really means that its the time between samples. The Differential of the error value is used to add to the sum to bring it closer to the desire value.. If the time value is large, the input reference may have a chance to produce a high DT and thus, the SUMMED value will be high, this can lead to oscillation or it'll just over shoot on the PID output and start slowing things down. Keep this in mind that this value will use the error value and creates a reference from the last error value with the time indicated.

In some systems. The D value does not reference the error point, it simply creates a DT from the time window and uses that to put the PID output into a negative state. So if the PID output is at MAX due to the input REF not being satisfied by a large margin, you'll see a negative effect on the PID output and is simply measuring the value of the ReF DT and not the error value. This method has been used many times to create a slow crawl speed for a device, even if the error is at 100% because the input REF will have a changing value as it goes along. 0..10 Volts for example.

Hope that cleared some things up..

Reply to
Jamie

The structured way to do this is to model the plant, refine the model with measurements, then design a controller to the model.

You can use frequency sweeps (this is time consuming with a thermal plant, but you can maybe still do it), or you can use step responses and fit an s-domain model. Then you design a robust controller to your model, and hope that it is more robust than your model is erroneous.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
Reply to
Tim Wescott

l,

e PID

e

d to

time

h
g
,

Yup, I've got 'RC' schematics of my last thermal project. The various time constants seemed to work out pretty well. (The 'worst' part was the steel yoke on the magnet with like 1 hour time constant.) But when I close the loop to control it I've just been following some 'cook book' recipe for choosing D.

e quoted text -

I love looking at the step response. The pulse response is 'cool' too. Though I've never tried it with a thermal system.

Hey, if you want to measure the frequency response of the plant all at once you can hit it with white noise and look at the response.

Still, I figure the next 'plant' I tune I'll try just P and I first and then add some D.

Thanx again, George H.

Reply to
George Herold

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.