RIP PID

Thread Starter

Jerry-Hat-Trick

Joined Aug 31, 2022
822
Best if I cushion this thread at the beginning - maybe I'll be seeing a few responses which don't agree - that's okay, I'm genuinely interested to get reactions, ideally well argued, both for and against.

Proportional Integral Differential control systems were developed over 100 years ago. By developed, I mean both mathematics and actual implementation. They apply to linear systems. The mathematics is interesting - I learnt it 50 years ago. And the concept of the three terms is possible to explain in simple terms. Proportional because the further you are from a setpoint the bigger the effort to get there, Differential because you need to damp the change to avoid excessive overshoot and Integral to close in on the setpoint. (PID just sounds better than PDI - Light Oscillators are called Light Amplifiers for a similar reason)

But how often are PID control systems genuinely used these days? With the availability of cheap processing power most control systems are effectively state machines. Temperature control is a classic example. To get to a set point quickly you might as well turn the heater full on. If the controller is still in learning mode it could stop heating for a while half way to the set point and note how the temmperature rise continues for a while and flattens. This would give it a first approximation of the measured temperature it needs to reach before the setpoint at which it can turn the heater off. By this time it has sufficient information to know what mark/space heater on/off it needs to hold the temperature within the acceptable limits - PWM if it's electronic. Algorithm for holding temperature quite different from the one to reach the setpoint.

So why do learned articles and temperature control manufacturers constantly waffle on about PID control as if it's still state of the art? It was brilliant in its day, as was the slide rule, but it's not actually relevant to most physical (low bandwidth) control systems in 2022
 

Alec_t

Joined Sep 17, 2013
15,117
As I see it (I've no practical experience of PID control, so feel free to shoot me down), your proposed arrangement still amounts to PID control of a sort:
" turn the heater full on" = D,
" note how the temperature rise continues for a while and flattens." = I (through thermal inertia),
" to know what mark/space heater on/off it needs to hold the temperature within the acceptable limits " = P
 

Thread Starter

Jerry-Hat-Trick

Joined Aug 31, 2022
822
As I see it (I've no practical experience of PID control, so feel free to shoot me down), your proposed arrangement still amounts to PID control of a sort:
" turn the heater full on" = D,
" note how the temperature rise continues for a while and flattens." = I (through thermal inertia),
" to knoheat w what mark/space heater on/off it needs to hold the temperature within the acceptable limits " = P
Nice idea, anything to keep PID alive but....

"turning the heater full on" is closer to P, the main variable taking the system from its current state to its desired state. Arguably, instead of being proportional using numbers in real low bandwith applications it's either 1, 0 or -1

"through thermal inertia" - combined with the rate of heat loss to the environment is a way of replacing the D term in the control system. The differential term in a PID system effectively clamps the proportional signal to stop excessive overshoot which helps prevent oscillation, especially when the P variable is increased to maximise the speed at which the system attempts to reach the setpoint. I say "excessive" because the fastest way to get to the setpoint is usually with one overshoot, called "critically damped".

"heater on/off it needs to hold the temperature within the acceptable limits" is closest to the I term. As in PID it's influence becomes relevant when the system is close to its setpoint so P and D are both small whilst the integral continues to accumulate when there is a small difference between actual position and set point. In PID systems there is usually a small "deadband" where small errors from setpoint are not processed to prevent the system from "hunting"

It's worth googling PID control systems (not to be confused with Pulmonary Inflammatory Disease) to see how much misinformation is out there. I urge those interested to follow the maths.
 

LowQCab

Joined Nov 6, 2012
5,101
As long as "Rate-of-Change" is a factor in any process,
the PID concept will remain valid.
But the implementation of PID may
evolve into new forms and methods,
that were previously impractical, or un-imagined.

A good application for "Fuzzy-Logic".
.
.
.
 

Ian0

Joined Aug 7, 2020
13,131
I still use it to derive the trigger angle to control the voltage and current in a thyristor battery charger.
Is there a better way?
PID corresponds exactly to the various capacitors and resistors in a type III compensation network for a buckregulator.
 

BobTPH

Joined Jun 5, 2013
11,515
Okay, let’s follow the math, as you say.

We know the results of control theory, an overdamped system takes longer than necessary to reach the set point, an underdamped system oscillates around the set point, and a critical damped system reaches the set point as fast as possible without oscillation.

Can you show the math of an alternate system that improves upon this?

I understand that a learning system can potentially fine tune the system automatically, but I agree with Alec, that it is likely still going to reduce to what we might call an adaptive PID control.
 

Thread Starter

Jerry-Hat-Trick

Joined Aug 31, 2022
822
Can you show the math of an alternate system that improves upon this?
Not exactly, but some years ago I built an Arduino based system to control the temperature of water in a kettle keeping it within +/- 1.0 degrees Celsius of 85 degrees. Just done with a relay - could easily have got it tighter using PWM.

Turn on the system from cold and the water starts to heat. The thermal lag in the system is evident from the initial delay in the rise in temperature - the slope of the curve increases, but it peaks and starts to tail off as the energy loss to ambient increases. Easily sufficient information to turn off the power at just the right point for the temperature to flatten at exactly the target temperature and to know what mark/space is needed to hold it there and the timing of on/off to hold it within the allowed window. Worked well for different amounts of water in the kettle. Allowed for fine tuning to maximise the period of the on/off cycle. In practice, even with a full kettle, the slope of the temperature curve hardly flattens but with a lower powered element it might. Sorry if this isn't the maths you were looking for but as I indicated, it's more of a state machine.
 

Papabravo

Joined Feb 24, 2006
22,082
SMPS (Switch-Mode Power Supplies) use PI control in a hybrid strategy where they are controlling both maximum current and the output voltage. In this application, the "D" term appears to be unnecessary.
 

crutschow

Joined Mar 14, 2008
38,503
Yes, PID was developed when the only way to control a system was some form of mechanical/hydraulic analog feedback.

Look at Fuzzy Logic control, as LQC mentioned.
It's designed to use a digital controller (instead of the controller emulating the linear analog PID functions) and can generally more readily control systems with non-linearity and/or hysteresis.
(Note that the article is from the Seattle Robotics Society.)
 
Last edited:

nsaspook

Joined Aug 27, 2009
16,321
Almost every PMSM motor controller has some version of a PI(D) control in the feedback loops for speed, torque and position.

https://www.hindawi.com/journals/jcse/2014/471609/
PMSM is a multivariable, nonlinear, time-varying, and strongly coupled system. With the development of control theory, various alternative control methods, including feedback linearization, feedback-feedforward, sliding mode variable structure, neural network control, adaptive control, fuzzy control, H∞, and antistep control, have been proposed [5–12]. However, some advanced control techniques are too complex to implement in practical control due to the problem of instantaneity or memory size. Therefore, PID is the most popular controller in the motor control. It provides proportional, integral, and derivative actions for the feedback control system. PID controller has the advantage of simple structure, good stability, and high reliability [13, 14]. In the process industry, more than 90% of the controllers are PID controllers [15]. Although the number of parameters to adjust in a PID is very small, there are many tuning rules [1]. It has been experimentally checked that more than 30% of controllers are operating in manual mode and 65% of the loops operating in automatic mode are poorly tuned because of the inappropriate parameters [16]. Currently, most of the current-speed closed-loop control in the PMSM servo system adopts PID controller [17]. Nevertheless, the PID controller has poor performance in PMSM control due to the inappropriate parameters.

Mr. PID is alive and well.
 
Last edited:

crutschow

Joined Mar 14, 2008
38,503
Mr. PID is alive and well.

65% of the loops operating in automatic mode are poorly tuned because of the inappropriate parameters

Nevertheless, the PID controller has poor performance in PMSM control due to the inappropriate parameters.
From that it would appear Mr. PID is still alive, but not particularly well. :rolleyes:

Just because a control technique has been used for a 100 plus years, doesn't mean it's the best method.
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
I have worked with CNC systems for the past 4 decades and am used to using PID servo control, the DIY systems I use such as Galil Motion still use it in their controllers.
 

Ian0

Joined Aug 7, 2020
13,131
Yes, PID was developed when the only way to control a system was some form of mechanical/hydraulic analog feedback.

Look at Fuzzy Logic control, as LQC mentioned.
It's designed to use a digital controller (instead of the controller emulating the linear analog PID functions) and can generally more readily control systems with non-linearity and/or hysteresis.
(Note that the article is from the Seattle Robotics Society.)
Interesting paper, but it seems to involve more computation than a PID controller.
Sorting responses into "too high", "much too high", "about right", "too low" and "much too low" would need more code to be written and take longer to execute than simply deriving a number that is the "error"; and integrating the error only takes a couple more instructions.
Fuzzy logic also seems to rely more on derivatives than integrals, and derivatives in a sampled system can be noisy whereas integrals tend to reduce the noise.
 

crutschow

Joined Mar 14, 2008
38,503
Sorting responses into "too high", "much too high", "about right", "too low" and "much too low" would need more code to be written and take longer to execute than simply deriving a number that is the "error"; and integrating the error only takes a couple more instructions.
If would think that the "If-Then-Else" commands of a Fuzzy Logic program would execute faster than calculating the emulated analog equations for the differential and integral signals of a PID.

This thread has a post (17) where he achieved better results with Fuzzy Logic for a non-linear control system than he previously had with a PID loop.
It's a small example, but it suggests that Fuzzy Logic should be seriously considered for microprocessor control loops.
 

Ian0

Joined Aug 7, 2020
13,131
If would think that the "If-Then-Else" commands of a Fuzzy Logic program would execute faster than calculating the emulated analog equations for the differential and integral signals of a PID.
For a sampled system, the integral is easy - just sum the error which takes three instructions, including the load and store.
A simple differential can just be the difference between the error on this sample and the error on the previous sample.
This thread has a post (17) where he achieved better results with Fuzzy Logic for a non-linear control system than he previously had with a PID loop.
It's a small example, but it suggests that Fuzzy Logic should be seriously considered for microprocessor control loops.
Unfortunately, it's a 404 error.
 
Top