limits of analog electronic pid? - Page 1
Forum section: electronics / projects

author: coppercone2
author_rank: Super Contributor
timestamp: September 19, 2018, 12:55:06 am
content: For low frequency PID control, say of a large mechanical system, how does it compare to a digital system from a performance perspective?Looking at a simple PID circuit with the best capacitors and resistors, it still looks like you would get at least a 50ppm/c setpoint drift with temperature.But anyway, are there places where they are still used?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 19, 2018, 01:03:14 am
content: How does a PID loop's quiescent output depend on RC values?Assuming P is very small.Explicit analog PID controllers are never used, but a variant is common, like the pole-zero or lead-lag compensators. The difference is having the high frequency zero without limiting DC gain.Tim

author: coppercone2
author_rank: Super Contributor
timestamp: September 19, 2018, 01:46:47 am
content: Quote from: T3sl4co1l on September 19, 2018, 01:03:14 amI guess you are right that the actual setpoint does not appear to be effected since its really outside of the loop on the first op-amp *you can use thermally matched resistors*, but the equation terms drift so the response drifts, so the best case tuned oscillation will vary I think.I think this means the average 'power' will be the same but the weeble wobble will vary as the circuit changesHow come they are never used? D-term noise?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 19, 2018, 02:24:46 am
content: Quote from: coppercone2 on September 19, 2018, 01:46:47 amWhat?QuoteBecause a type 2 compensator is an op-amp, two resistors and a capacitor.Tim

author: radioactive
author_rank: Regular Contributor
timestamp: September 19, 2018, 05:34:56 am
content: You might find this paper interesting. They point out the advantages of an analog PID as well as performance compared to digital for their application. I've always implemented PID digitally, but I can see where there are probably many cases where a programmable-analog approach like this would be highly preferable.https://aip.scitation.org/doi/pdf/10.1063/1.5010181

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 19, 2018, 05:49:01 am
content: Quote from: T3sl4co1l on September 19, 2018, 01:03:14 ami think what he meant is this...http://www.ecircuitcenter.com/Circuits/op_pid/op_pid.htmQuote from: coppercone2 on September 19, 2018, 01:46:47 ami guess because tuning is easier made in mcu than on analog circuit. mcu's are cheap nowadays, you just snap in a single pic10f206 or attiny10 and voila! there goes your pid controller.

author: KE5FX
author_rank: Super Contributor
timestamp: September 19, 2018, 06:01:20 am
content: QuoteI wouldn't say they're "never used." What about boxes likethis one?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 19, 2018, 06:09:13 am
content: Quote from: Mechatrommer on September 19, 2018, 05:49:01 amYes, that's what I had in mind. Thank you for adding a visual reference!QuotePID is popular because it's easily done digitally, even if it has drawbacks like noise sensitivity or poor DC stability (when P is used). Noise can be dealt with using a small FIR filter, say a 1-2-2-1.Quote from: KE5FX on September 19, 2018, 06:01:20 amIt's not PCB mount.Tim

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 19, 2018, 06:18:10 am
content: Quote from: T3sl4co1l on September 19, 2018, 06:09:13 amyes it is, take a look insideanyway that one is general purpose controller.

author: IanB
author_rank: Super Contributor
timestamp: September 19, 2018, 06:19:12 am
content: Quote from: coppercone2 on September 19, 2018, 12:55:06 amDid you know that in the old days analog PID controllers were not even electronic, but were pneumatic and operated on instrument air?https://visaya.solutions/article/pneumatic-pid-controller/I've always thought it would be amusing to model one of these electronically. What is the smallest number of op amps you would need to do so? I have a sense that a single op amp would be sufficient, but I have never really tried to work through it. (The single lever balance system corresponds to an op amp, and the various bellows correspond to direct/lead/lag feedback loops.)

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 19, 2018, 06:29:00 am
content: Quote from: IanB on September 19, 2018, 06:19:12 amnot even pneumatic, the first recorded close loop control system is just bare metal some sort of inverted pendulum regulating boiler pressure. mechanical air-gas mixture regulator is still in existence today the last time i saw it in low cost electric generator's gas engine.

author: jbb
author_rank: Super Contributor
timestamp: September 19, 2018, 06:57:21 am
content: Obviously it will depend on a lot of factors, but I think there are a lot of places for analog PID. Or at least analog PI.It's very common to see PI or PI + lead-lag in power supply control circuits. Some of them add a feedforward capacitor to the feedback path to provide something like derivative action (specifically, they add a zero toH(s)).I think that analog PID (or similar all-analog methods) can do well in the following situations:Fixed P, I, D gainsTime constants of a few seconds or less (guesstimate)No processor in the box already.Especially important for high bandwidths (>1MHz is possible, and rather awful to do digitally)Don't need super-fine gain settingsCan live with some unit-to-unit variationThe following would push me towards digital:Variable gainsHigh precision gain settingsLong time constants greater than a few seconds. (Time constants are achieved with R*C, and there's a limit to how much C can be reasonably deployed. This means that large Rs may be required, at which point bias and leakage currents will come into play and cause DC or low frequency drift.)Large control systems with many parametersSelf tuningAdvanced control features like dead-time compensation, state estimators or parameter estimatorsHope that's helpful.

author: coppercone2
author_rank: Super Contributor
timestamp: September 19, 2018, 11:00:44 am
content: ah the high value problem.I wonder if there is a suitable precision capacitance multiplier or gyrator circuit that can be used to deal with the C term. It might end up having better specifications then a gigantic resistor.Also, what do people mean when a PID controller has a 'complicated' response? Do they mean one that uses higher order calculus operations? Or has some kind of peicewise response (2 PID sections or PID that overlap?)If you wanna add a jerk, crack, snap, pop, do you just put another parallel analog circuit into the summer (like the math equation?)

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: September 19, 2018, 01:02:19 pm
content: AFAIK, analog PID just as shown in the schematic above has been used all over, certainly "never used" isn't right, though today it's probably less common. PID is great until you have a system with a dead-band, say loose mechanical joints, hysterisis or a few other problems. Then it can be a nightmare to get right and (IMHO) digital solutions may do better because you can add "complications" to deal with special conditions.

author: rstofer
author_rank: Super Contributor
timestamp: September 19, 2018, 02:01:33 pm
content: Quote from: coppercone2 on September 19, 2018, 11:00:44 amIn terms of analog computing, you rewrite the differential equation with the highest derivative, by itself, on the left hand side of the equation and divide off any coefficient.Now, assume you actually have that derivative in your hands (you don't, but you soon will!). You add a series of integrators to work your way back up to the variable itself and you deal with the coefficients as they come up with adders, multipliers, coefficient pots, whatever. Eventually, you will form the entire right hand side of the equation.And then there is the magic of the '=' sign... In the beginning we assumed we had the highest order derivative and now we just created it on the right hand side. Just add a jumper wire (the '=' sign) to close the loop.Initial conditions can be applied at any stage but usually it will be the variable itself that has an initial condition, not the 3rd derivative.This solution of ordinary differential equations was invented by Lord Kelvin.

author: rstofer
author_rank: Super Contributor
timestamp: September 19, 2018, 02:20:22 pm
content: I wonder how many PID loops there are in a nuclear power plant? Initially, these were all analog and I doubt that they have been changed. Newer plants are probably digital.How about the carburetor on a car (when they had them). It had P and D terms but no I term if we assume that the accelerator pump was somehow responsive to a change in throttle position (which it was).Pneumatic controls for HVAC systems are still pretty common. The loops aren't usually very tight and intalling pneumatic tubing is fairly simple. Integration is a piece of large diameter pipe.This is a really good presentation on HVAC control systems:http://www.caee.utexas.edu/prof/Novoselac/classes/CE397b/Notes/389H_NO_24_Control.ppt

author: LaserSteve
author_rank: Super Contributor
timestamp: September 19, 2018, 02:32:41 pm
content: I often work on galvanometer scanners used for positioning laser beams. Some of them scan at 4-6 KHz small angle with harmonic components in the drive amplifier in the 10s of KHz. Until the last year, the cost of DSP based control systems was too expensive for most users, so everything is analog. We use a P-I-D-D loop with separate high frequency and low frequency damping. We have two feedback paths, one from the coil current series resistor and one from the capacitive or optical position sensors that get weighed and summed.Usually we have one to three notch filters in the feedback path as well to handle shaft torsional and bending resonances that are often in the tens of kilohertz.As our scan velocity is a complex function based on angle and time, the loop equations are very complex. Still we have fast discrete jumps over a sixty degree mechanical angle if we want, with settling times in the 10s to hundreds of microseconds depending on jump size and mirror mass for the fastest of devices.We love non technical beginners in the laser show and marking industry who are suddenly confronted with 12 ten turn pots for adjusting each axis. The control interactions are complex, but can be conquered by starting with the basics and using a scope and test patterns. Often users get frustrated and go to EE school or get a degree in Physics to try to understand what they are working on, and no I'm not kidding, I've nominated more then a few laser show folks for undergraduate or graduate school.As you can actually see subtle changes in the PID settings in your projected images or marking, they can be quite fun to work on once you get the hang of the adjustments. Some wags have referred to galvos as the fastest production analog PID loops on the planet, but I'm more then aware of other applications, often automotive or aerospace, that are considerably faster.A good galvo with a low mass load is between 10 and 100 times faster in terms of angular velocity then the fastest hard drive positioner arm...Steve

author: coppercone2
author_rank: Super Contributor
timestamp: September 19, 2018, 04:02:17 pm
content: do the digital systems you use now outperform the analog loop you described or are they simply cheaper and easier?if they outperform, can you see analog engineering surpassing the currently accepted digital solution?And since its outdated, can you post some schematics?

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 19, 2018, 04:41:51 pm
content: Quote from: coppercone2 on September 19, 2018, 04:02:17 pmiirc you usually discuss on generalized topic. you cant make a conclusion to the whole or applicable to the whole. each system will be suitable for certain condition. you cant snap HDD arm at 6KHz something might have been broken, or moment of inertia is too great control servo will unable to catch up. engineering is about learning many techniques and applying one particular (or few combinations) technique to a particular problem.

author: Kleinstein
author_rank: Super Contributor
timestamp: September 19, 2018, 05:39:00 pm
content: The linear part of a PID regulator can be done quite well in the analog domain, at least if there are no very long time constants. There usually is no need to have the time constants very accurate, so something like capacitor drift is usually not a problem (unless one uses the wrong type of MLCC).For the long time constants one can avoid the very large resistors / capacitors a little longer by having a divider after the integrator. Dividing the integrator output by 100 corresponds to a 100 times longer time constant. This limits the possible vales of the integral contribution, but this is often more of a good thing than a problem. One problem with the analog PID is integrator windup, thus a rather slow response when coming out of the limits of linear operation (e.g. after an actuator reached saturation).Today digital PID essentially always includes some kind of good anti-windup, as in a DSP / µC implementation this is easy and really helps at the bounds. The more normal implementation may not even need another parameter, except the actuator limits. Another advantage of digital regulators is that one can include nonlinear transfer-functions of the sensor or actuator. Quite a few commercial digital PID controllers include some kind of tuning tools / auto-tune.

author: LaserSteve
author_rank: Super Contributor
timestamp: September 19, 2018, 05:52:43 pm
content: Here you go, with a few things removed. This is a simple one without notch filters or digital inputs. Feedback is from a pair of opposed photodiodes excited with a current source driven LED. A a sensor linearity enhancing circuit has been removed as has the active current source.Yes, with care and careful compensation, an LM3886 makes a great DC coupled power opamp as long as your gain is more then 20...You can learn here as well:http://www.ecircuitcenter.com/Circuits/op_pid/op_pid.htmAll this is covered in a basic EE controls class the first week of class, no magic...Steve

author: rstofer
author_rank: Super Contributor
timestamp: September 19, 2018, 06:00:14 pm
content: Quote from: coppercone2 on September 19, 2018, 04:02:17 pmThere is new interest in analog computing. There are videos and articles all over Google including:Apparently, analog computing does a better job of pattern recognition among other things. Neural networks are the current research topic.QuoteDoes anybody think the 1017FLOPS is a staggering number?from:https://users.ece.cmu.edu/~pgrover/teaching/files/NeuromorphicComputing.pdfSo, it we want to do artificial intelligence and if neural networks are the path, analog is the way to get there. There is a lot of work being done with advanced analog computing. It's all over Google!

author: chris_leyson
author_rank: Super Contributor
timestamp: September 19, 2018, 07:08:52 pm
content: @LaserSteve. The Cambridge Technology analog galvo controller is a classic bit of design. I had to design a new galvo driver as part of a product redesign and the spec was you have to use a 5V power supply !. It was more or less a copy of the classic CT galvo driver but with a fully differential opamp, LT6362, driving a pair of OPA567's for the output stage. It worked OK for small galvos like CT 6100H and a Chinese PT40 galvo but wouldn't drive anything bigger like a CT 6810. I think I got it down to 4 adjustable pots and one of those was for the notch center frequency, I was about to change the design to use digital pots with an aim to make it auto tuning and then the company went belly up.It was good fun building an analog galvo controller and I even managed to build a reasonable Spice model for the galvo, didn't get around to modeling bearing stiction but the simulated and actual results were very close. I even started work on a digital control loop but didn't really pursue the idea because you still need a lot of analog electronics for the interface, a digital controller would have saved maybe 4 op-amps. It would have been a nice project if I had the chance to see it through to the end though. Galvo controllers are just one application where a digital control loop would probably out perform an analog loop just because it's so easy to tweak the control algoritms.

author: coppercone2
author_rank: Super Contributor
timestamp: September 19, 2018, 07:12:37 pm
content: That circuit is very interestingIt probably belongs in the art of electronics if something similar is not there already. I like the power limiter going into the JFET, where the JFET is like a AGC type deal.

author: coppercone2
author_rank: Super Contributor
timestamp: September 19, 2018, 07:16:40 pm
content: on a note irrelevant to PID, how do you come up with 20k/0.1uF to earth ground on the right side?was that somehow designed in or did you use some kind of measurement to come up with that? Those semi-floated connections freak me out (not safety just design)

author: chris_leyson
author_rank: Super Contributor
timestamp: September 19, 2018, 07:40:44 pm
content: Nice one Steve, thanks for posting the schematicIt's a classic and coppercone2 spotted the the jfet limiter, a nice touchThis controller has been around for quite a while and it should really be part of the "Art of Electronics". There is also a separate controller for the LED current and a few subtle linearity tweaks which I had forgotten about.

author: chris_leyson
author_rank: Super Contributor
timestamp: September 19, 2018, 08:01:53 pm
content: Nice one Steve, thanks for posting the schematicIt's a classic and coppercone2 spotted the the jfet limiter, a nice touchThis controller has been around for quite a while and it should really be part of the "Art of Electronics". There is also a separate controller for the LED current and a few subtle linearity tweaks which I had forgotten about. I think think the 0.1u cap and 20k resistor are for RF decoupling the interconection cable to the galvo. The feedback from the photo diodes is low current and high impedance, so electrostacic screening is important, more useful material for the "Art of Electronics".

author: LaserSteve
author_rank: Super Contributor
timestamp: September 19, 2018, 10:48:22 pm
content: Mike Thanos, I believe, is the one responsible for that amp.Steve

author: coppercone2
author_rank: Super Contributor
timestamp: September 20, 2018, 01:15:52 am
content: do you ever have circuits that turn off various unnecessary mathematical operations to make it more stable and less noisy when it gets real close and the process is not being disturbed? i.e. temperature control.this has more to do with general control theory, but these various factors have something to do with dynamic range right? then only turn em on when a particular disturbance is expected?say for a refrigerator

author: LaserSteve
author_rank: Super Contributor
timestamp: September 20, 2018, 03:02:59 pm
content: Yes, adaptive control is used in many systems when you get close to the setpoint. I have one very expensive Omron controller at work that does that.Steve

author: Kleinstein
author_rank: Super Contributor
timestamp: September 20, 2018, 05:56:22 pm
content: Quote from: coppercone2 on September 20, 2018, 01:15:52 amUsually one needs all 3 terms of the PID regulator together and can not just turn away one part. If for some reason one want's to use a regulator without the D term to reduce higher frequency noise, this usually required to adjust the other terms as well. With a correctly tuned PID regulator (including HF roll-off, see below) there is hardly a need to turn of the D term. Analog implementations rarely use extensions to the pure PID. That secret box in the schematics might be a kind of approximate anti windup - it's possible analog, but often tricky. So extensions beyond pure PID are often a reason to go digital. Digital control can include other targets like reduced switching.One point to observe is that a true pure PID regulator is not possible, as the D term would have diverging high frequency gain. So a real regulator (analog or digital) will always have another high frequency roll off of some kind. In digital implementations this is often the sampling rate and AA filtering. So a real PID regulator will have an additional 4 th parameter to tune. A lot of classical control theory about a pure PID is thus ignoring real life limitations.

author: coppercone2
author_rank: Super Contributor
timestamp: September 20, 2018, 06:09:30 pm
content: what should I search for to learn about the extra tuning required because of the D-term in an analog pid?Roll off pid brings up too much stuff about quad coptersAlso, does anyone know anything about the higher order integrals and where they are useful. I heard stuff about flow control. I am interested in precision constant flow control with fluid or gas pumps or valves/regulators that deliver flow from a tank.Does anyone have like diagrams that show what kind of sensor readings would need what kind of math to deal with? Like example of things like ramp perturbation or whatever that causes situations which require more complex circuits

author: IanB
author_rank: Super Contributor
timestamp: September 20, 2018, 06:59:58 pm
content: Quote from: coppercone2 on September 20, 2018, 06:09:30 pmI think the problem is the same in digital implementations. The problem is that the D term amplifies the rate of change of the input signal. Higher frequencies (including noise) have higher rates of change in the signal, so they tend to introduce unstable responses. A typical mitigation is to filter the input to the D term (or both P and D terms) using a first order lag. A first order lag is a low pass filter with a soft roll off, so it has a mild and non-aggressive effect on the overall control function.

author: IanB
author_rank: Super Contributor
timestamp: September 20, 2018, 07:08:16 pm
content: Quote from: coppercone2 on September 20, 2018, 06:09:30 pmA rule of thumb is that if the process is non-integrating then the controller can support a lot of integral action. However, if the process is integrating you should keep integral control action to a minimum. Thus, flow loops can have a lot of "I" and moderate "P", while level controllers will tend to have significant "P" and almost no "I".The amount of "P" in a flow loop depends heavily on the scan rate of a digital controller. The faster the scan rate the more proportional action you can have. (The scan interval is a dead time, and too much proportional action in conjunction with dead times leads to instability.)

author: coppercone2
author_rank: Super Contributor
timestamp: September 20, 2018, 07:13:49 pm
content: what if its an analog sensor connected to an analog loop? What is scan rate equal to? Is it the stable zone of operation for the D term frequency response in an analog controller?

author: IanB
author_rank: Super Contributor
timestamp: September 20, 2018, 08:09:55 pm
content: Quote from: coppercone2 on September 20, 2018, 07:13:49 pmScan rate is an artifact of digital controllers. Analog loops do not have a scan rate.Theory says that for a process with a first order response it will be stable for any value of proportional action. This is in the mathematical, ideal case. The real world is not ideal.Flow controllers tend to be noisy. Put your ear against a pipe with water flowing through it. You will likely hear a hissing noise and feel a rumbling vibration. Many flow instruments work by measuring the pressure drop across a restriction in the flow line. All that noise and rumbling will appear in the pressure transducers. So if you wind up the gain too much you will amplify the noise and cause the output to jitter. Some input filtering will be needed, and you will need to decrease the gain while increasing the integral action. Integral action has an averaging effect, so it will inherently have noise immunity. Since a flow loop is a non-integrating process you can increase the integral action a lot to get tight control.Derivative action is not really needed in flow loops. PI controllers will be fine.