Back to PI(D) school

Hi all, a simple PI(D) control loop question. (I?m going to ignore D, for now) When doing PI loops I use the ?standard? equation. Out= Gain*(e + 1/Ti(int(e))) Where e is the error, Ti is the integral time, and int(e) is the integral of e for a time Ti. In analog land, for long times this means big resistors and capacitors. I then noticed that people do not always keep the gain in the P and I branches the same. So I can reduce Ti, and then attenuate the integral term by the same amount, and keep the response the same. (Say I reduce Ti by ten,by cutting down integrating resistor) Out= Gain*(e + 10/Ti(int(e))*1/10)

What effect does this choose have on the control loop? The only thing I see is a dynamic range change in the integrating term.

(I assume I can do the same sort of thing with the D term.)

Thanks, George H.

Reply to
George Herold
Loading thread data ...

I'm assuming you mean to decrease the gain of the integrator on the output side, or into a summing junction, or something -- not to decrease it by reducing the signal on the input (which is just tantamount to increasing the input resistance).

In the language I prefer I'd say that you aren't changing the behavior of the controller in its linear range of operation, but as you reduce Ti and final gain you are reducing the authority of the integrator at the point that it limits.

So it's actually a good thing if you're interested in jiggering with the integrator saturation point for the purposes of anti-windup. The ONLY thing you're saving on other than anti-windup properties is the capacitor size -- any issues of op-amp offsets or whatnot are still the same.

At some point, no matter what, as your loop speed goes down you will get to the point that your op-amp + capacitor is bigger than a microprocessor with decent ADC capabilities. Just sayin'...

--
www.wescottdesign.com
Reply to
Tim Wescott

Right,

OK, so it might be a good thing. Thanks Tim... you know I'm having a bit of a brain re-program. I was sitting in bed picturing a bode plot of an integrator... and "drew" it as a lowpass, with a corner. With the integrating time (Ti) related to the corner. Wrong Wrong Wrong!!!

Yeah I said that too about this project... potentially long time scales... It was rejected.

George H.

Reply to
George Herold

I will say, the least likely population of people you're likely to find are those that are both analog circuit designers and are facile with embedded processors. So from a management perspective I could understand some pushback in favor of an all-analog board with one humongous capacitor on it, particularly if said management is an analog circuit designer.

Having said that -- I think that with new college grads going forward, you may find more and more overlap between analog chops and embedded chops.

--
www.wescottdesign.com
Reply to
Tim Wescott

I
e

Grin, well mostly because it would be me who would have to develop the embedded chops, having only done the analog thing in the past. (changing the subject a bit.) I've been very lazy about control loops, I've done the simple Zeigler Nichols tuning thing, tweaked the gain as needed and it was good enough. (Most with a TEC as the plant.) This is a heater, weak thermal link to bath. Dang thing oscillated with a period of about 10 seconds, but the "time constant", (step the heater power and find the 1/e (63%) point), is closer to 40 seconds. Hence I had to think more... exposing all my misconceptions.

(I'm always looking for a good PID book, I'm reading this which can be found as a pdf online.) PID Controllers , Theory , Design and Tuning (2nd Edition) - K.J.Astrom & T .Hagglund

George H.

Reply to
George Herold

I couldn't write out the dynamic equations for something like that without thinking a bit, but I suspect that the lag twixt heater and bath is enough to work with your proportional gain and make oscillation happen.

The best thing to do when an actuator isn't tightly coupled to a load is to put a sensor on the actuator, or at some intermediate spot, then wrap an inner loop around the actuator, which is commanded by an outer loop that gets its feedback from the plant. Not only should it be easier to stabilize, but then you can then do things like put an upper limit on the temperature of the heater, or on the difference in temperature between heater and bath (to avoid overshoot).

Failing that, if you have a pretty good idea of the behavior of the heater itself you can simulate it and wrap a virtual inner loop around it. You'll be taking a round-about route to some derivative action in the system, and it'll be sensitive to noise and to environmental and manufacturing variations, but it may be easier to wrap your head around.

That book, at least in print form, has a very good reputation. It's a bit odd to have a book that's _just_ about PID controllers, because in general there's a lot more to successful control loops than just a PID controller.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com 

I'm looking for work -- see my website!
Reply to
Tim Wescott

.
h
s
e
l
d
g
.
t
e

. Huh, OK I can check that.

OK.. First perhaps a misunderstanding, The weak link is between the bath and everything else. That said, I think putting my temp sensor right on top of the heater might be a good idea...

I'm a bit confused by the outer loop that gets feedback from the plant. Seems to me the outer loop has to bring the error signal to zero,

Oh I'm not opposed to derivative action, it's just that I don't understand it very well. (I'll hopefully be getting there soon.)

OK, I guess I asked the wrong question, I'm always looking for a good control loop book. The Astrom, Hagglund text does introduce what they call the "interacting form" of the PID algorithm, where the error signal is first summed with a derivative term and then sent through a P+I block.

So far they haven't talked about negative feedback around the plant... (which I want to try.)

George H.

Reply to
George Herold

I have that one, but haven't read it all the way through.

I normally design fancy(*) control loops using frequency-compensation ideas (phase margin and so on) and then look after the windup. That method is probably harder to do adaptively, but I've never needed an adaptive loop, apart from acquisition aids (if those even count).

One super-useful technique that I learned from Phelan (whose book I wouldn't otherwise recommend) is to wrap the plant with a local proportional-only loop to speed it up and make it better behaved, then do the outer loop. It's widely useful in analogue design, but I didn't connect the dots till Phelan mentioned it. (Must be the mystique exuded by control guys like Tim--you can feel it watching his videos.) ;)

For small temperature controllers such as TECs used near room temperature, you can get a good first crack at the loop compensation using the delay + integrator model. Hit the TEC with a step function, and measure how long it takes for the temperature sensor to rise and the initial slope. The approximate transfer function is then

H(f) ~= exp(-j omega tau) * dT/dt / (j omega Vstep)

which is usually close enough to get a nice stable loop that you can tweak up afterwards.

A dynamic signal analyzer is the bee's knees for doing slow feedback loops.

Cheers

Phil Hobbs

(*) "Fancy" meaning temperature controllers, laser frequency lockers, and phase-locked loops, mostly. Acquisition aids are fun--you get to sprinkle a bit of MSI logic on a nearly all-analogue board. Takes me back, sure an' it does.

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

I

or

e
t
e

the

d

and

& T..Hagglund

Yeah I've only got a pdf version, and have only sampled pieces here and the re.

Yeah I'm set up to try that..(negative feedback around the plant.) But I haven't done it yet. (I've read Phelan, one good idea, but otherwise not worth it.)

I noticed that the wiki article has both derivative and proportional control based on the PV (process variable)

formatting link

Which I heard about first from Tim.

Right.. That's what I did once the oscillation method failed. tau is the RC time constant? (where do you put the delay into there?) (at the moment my system has very little delay compared to the RC time.)

George H.

s.

Reply to
George Herold
[snip]
[snip]

Delay == excess phase shift, commonly modeled improperly in most Spice OpAmp models. ...Jim Thompson

-- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | STV, Queen Creek, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at

formatting link
| 1962 |

I'm looking for work... see my website.

Reply to
Jim Thompson

No, tau is the time delay. I stick the above into Mathcad to choose the bandwidth of the local feedback loop. It then gives me the closed-loop transfer function so I can do the frequency compensation thing. IME that's often good for a factor of 10 in speed, or very nearly.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

One interesting alternate to proportional+integral is proportional+up/down counter, or just up/down counter. That handles slew limiting and windup nicely. It's nonlinear, so is better simulated than analyzed analytically.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

Damn. Here I thought I was being reasonably down-home.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com 

I'm looking for work -- see my website!
Reply to
Tim Wescott

So, is the temperature sensor part of "everything"? What is it tightly coupled with?

I was advocating having _a_ temperature sensor on the heater, and the important temperature sensor on the bath. I'm now not sure about your physical arrangement, but that's what my comments were based on.

Yes, it should. I'm not sure if I'm making things clear -- basically, make a control loop around the temperature of the heater as if it were the only thing in the world. That's the inner loop. Then use the outer controller to generate a command for that inner loop.

This isn't going to be useful at all unless you either have more than one sensor or more than one actuator. If, from the point of view of your controller, the plant only has one input and one output, then having multiple loops is really just a fiction.

Well, there's this little man inside of a box. And he's been taking Lots and Lots of speed...

I'd like to see a diagram that corresponds to your "negative feedback around the plant". Ultimately, if a controller is going to work it's providing negative feedback around the plant -- that's what closed-loop control is about.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com 

I'm looking for work -- see my website!
Reply to
Tim Wescott

As long as you're using saturating arithmetic!

Interesting, thanks.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

Just yanking your chain. I've only watched one, which I thought was good.

DFH wants me to do some TIA videos to sell products.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

ion.

P
t
f
n
e
r
d
n

Oh dear, I've not been very clear, sorry. The bath is where the heat will get dumped. In this case it will be liquid nitrogen, (though there is talk of using liquid water at higher temperatures... I don't really like the water idea.)

OK thanks.. at the moment one heater and one temp sensor. one loop.

g

Ahh it was you who drew the diagram for me! This is just using the process variable (PV) in the P and D terms rather than the error, (Set point - PV) The Astrom and Hagglund text call this set point weighting . (so many words for the same thing.)

George H.

Reply to
George Herold

OK. That one. It only changes how the thing responds to set point changes, not how it responds to disturbances. But, if you want a relaxed response to the set point, it's the way to go.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com 

I'm looking for work -- see my website!
Reply to
Tim Wescott

Right, thanks.

George H.

Reply to
George Herold

d I

ior

ce

at

h

he

e

the

e
l

nd

tand

e

m & T..Hagglund

ps.

Huh, so your counter is the integrator, you check the error every time step and adjust up or down. A smaller time step is more integral gain. That's kinda cute.

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.