# What is the "observer" in PID control?

• PainterGuy
This is referring to when the controller is "locked on" to the command, meaning that it's not correcting for errors anymore.f

#### PainterGuy

Hi,

The sentence in red confused me. I've basic knowledge of control theory so, if you can, please keep it simple.

I understand that with pole-placement regulator (LPR) and linear quadric regulator (LQR) one can use an observer to estimate the system's internal states rather than measuring them directly. One can use Kalman Filter as one of the observers. What kind of observer is used with PID? Does PID need all the states of a system to function?

I'm sorry but it's been some time and even my basic understanding is flawed. Thanks for the help, in advance!

If you design, install, or troubleshoot motion control systems, you’re probably familiar with PID (proportional-integral-derivative) control, which uses feedback to detect errors between the desired position and the actual position and applies corrective commands to compensate for those errors. Although PID control is the most common type of industrial controller, it does have limitations. First, PID control is generally not suitable for systems with multiple inputs and multiple outputs (MIMO), as the transfer functions and differential equations used to represent the system become overly complex when more then one input (or output) is involved. Second, PID control is based on constant parameters, so its effectiveness in controlling non-linear systems is limited.

An alternative control method is state space control. The key difference between PID control (aka “transfer control”) and state space control is that the state space method takes into account the internal state of the system, through what are referred to as “state variables.” These state variables describe the system and its response to any given set of inputs. PID control, on the other hand, relies on an “observer,” which estimates the internal state of the system based on measured inputs and outputs.
Source: https://www.motioncontroltips.com/what-is-state-space-control/

Hi,

The sentence in red confused me. I've basic knowledge of control theory so, if you can, please keep it simple.

I understand that with pole-placement regulator (LPR) and linear quadric regulator (LQR) one can use an observer to estimate the system's internal states rather than measuring them directly. One can use Kalman Filter as one of the observers. What kind of observer is used with PID? Does PID need all the states of a system to function?

I'm sorry but it's been some time and even my basic understanding is flawed. Thanks for the help, in advance!

Source: https://www.motioncontroltips.com/what-is-state-space-control/
This doesn't make sense to me. As you know, in modern control the observer gives you the state information. But PID, as I know it, doesn't use the internal state information, just the output. Maybe what he says makes sense, but not to me. I'd ignore this reference. They either don't know what they're doing, or, more likely, just don't explain things well.

PID just takes a single measurement, compares it to a desired setpoint, to generate an error signal. That error signal is then compensated with, in order of low to high frequency, an integrator, then a constant (proportional) region, then a differentiator. The assumption is that the plant has a low pass response, so the differentiator at high frequencies isn't as horrible as it sounds. But, in reality, even the compensator has additional higher frequency poles that people don't talk about.

Honestly, anyone that's studied modern controls, doesn't really give any credence to PID. It's just a simplified control system with a predetermined number and type of poles & zeros. You can invent your own, which BTW, might be a PID format, or not.

If you haven't figured it out yet, I hate "PID". It's just a dumb simplification that doesn't actually make anything simpler in practice.

PainterGuy
Thank you, @DaveE!

As you know, in modern control the observer gives you the state information. But PID, as I know it, doesn't use the internal state information, just the output.

This is what I was thinking that, in simple terms, PID uses the output value to affect the input to get a desired value at the output.

State variables are variables whose values evolve over time in a way that depends on the values they have at any given time and on the externally imposed values of input variables. Output variables’ values depend on the values of the state variables.
Source: https://en.wikipedia.org/wiki/State-space_representation

An observer is used to estimate the state variables which are system's internal variables. According to the definition above, state variables, input variables and output variables are different from each other. Then, I don't see how a PID controller can use an observer when its operation doesn't even depend upon the state variables.

Could you please correct me if anything I said above is wrong?

Anyway, I was watching a video on PID and needed to clarify a simple point. It's more of a hairsplitting.

Between and 05:39 and 05:46, it says the following.
"Once the drone gets above the command, the error term becomes negative, and the integral output starts to decrease. However, it's coming down from a value of 2,000 RPM."

The following picture is a capture from the video and I drew the red dot and dashed line. I think that once the error becomes negative, the drone is coming down from a value which is somewhat larger than 2000 RPM. The dot represents the peak value of RPM and looking at the picture it lies at a position which has a value little bit larger than 2000 RPM. Do you agree with me?

Last edited:
An observer is used to estimate the state variables which are system's internal variables. According to the definition above, state variables, input variables and output variables are different from each other. Then, I don't see how a PID controller can use an observer when its operation doesn't even depend upon the state variables.
State variable(s) could also be the output(s). They are treated in general as internal, but can sometimes be outputs or directly observable.

The "PID controller" isn't really the whole system, it's just a description of a particular form of compensation. It is the system design that determines what the error signal is that is used for feedback. Then the feedback signal is modified by the PID compensator and fed back for control. The observer (if there is one) is about generating the signals used for feedback. This is (mostly) separate from the compensation method (PID). Yes you could have an observer estimate a state and use that to feed a PID algorithm if that made sense for your goals.

You are trying to mix different concepts here, I think. Concepts like state vectors, Controllability, Observers, etc. require Modern Control Theory. PID doesn't. I don't recall PID being part of any of my Modern Control classes, except mentioned in passing. I would think of PID as simply a mathematical operation done on a 1-D feedback signal, like gain, integration etc. Unfortunately it is portrayed as some special system to people that aren't comfortable enough with feedback systems to construct their own compensation function.

I also think that Observers (State Estimators) is a pretty complex subject compared to most control systems. If you aren't really comfortable with the math of linear state space systems (ABCD matrix equations, etc.), I would ignore it for now. It is basically imbedding another feedback system into your feedback system.

I was watching a video on PID
This isn't really about PID as much as integrator wind-up, which is really it's own subject, not necessarily part of PID.

I think that once the error becomes negative, the drone is coming down from a value which is somewhat larger than 2000 RPM. The dot represents the peak value of RPM and looking at the picture it lies at a position which has a value little bit larger than 2000 RPM. Do you agree with me?
I think you have confused the explanation. Blue is the command input which is asking the motor to spin faster than allowed. The motor is never faster than 1000 RPM. Watch the video again and ask if you have questions. I don't want to guess about what confuses you.

BTW, as an aside. I like his description of the clamping issues with integrators, since it explicitly explains some of the issues. But in the real world, there are simpler implementations that are (sort of like) making the integrator the output, so when you limit the output you are also clamping the integrator.

PainterGuy
Thank you, @DaveE!

I think you have confused the explanation. Blue is the command input which is asking the motor to spin faster than allowed. The motor is never faster than 1000 RPM. Watch the video again and ask if you have questions. I don't want to guess about what confuses you.

I don't think I've confused it but I did use the wrong wording. I've tried to fix it by adding more phrases in blue.

Between and 05:39 and 05:46, it says the following.
"Once the drone gets above the command, the error term becomes negative, and the integral output starts to decrease. However, it's coming down from a value of 2,000 RPM."

The following picture is a capture from the video and I drew the red dot and dashed line. I think that once the error becomes negative, the command line is coming down from a value which is somewhat larger than 2000 RPM. The dot represents the peak value of RPM demanded by command line, and looking at the picture it lies at a position which has a value little bit over 2000 RPM.

Where in the video, it says, "it's coming down from a value of 2,000 RPM", "it" refers to the value of RPM which had been demanded by the command line of integrator.

Do you agree with me?

Thank you, @DaveE!

I don't think I've confused it but I did use the wrong wording. I've tried to fix it by adding more phrases in blue.

Between and 05:39 and 05:46, it says the following.
"Once the drone gets above the command, the error term becomes negative, and the integral output starts to decrease. However, it's coming down from a value of 2,000 RPM."

The following picture is a capture from the video and I drew the red dot and dashed line. I think that once the error becomes negative, the command line is coming down from a value which is somewhat larger than 2000 RPM. The dot represents the peak value of RPM demanded by command line, and looking at the picture it lies at a position which has a value little bit over 2000 RPM.

Where in the video, it says, "it's coming down from a value of 2,000 RPM", "it" refers to the value of RPM which had been demanded by the command line of integrator.

Do you agree with me?

View attachment 289363

No, I didn't have a question about it. Just wanted to make sure what I was saying was correct. Yes, he did a great job explaining the PID.

Note:
The author of the original text states "...PID control is based on constant parameters."

Not necessarily. I've implemented many PID loops where the gains were a function of the PV (or some other parameter/combination).

Note:
The author of the original text states "...PID control is based on constant parameters."

Not necessarily. I've implemented many PID loops where the gains were a function of the PV (or some other parameter/combination).
Yes, because it's a whole lot easier for them to teach linear systems, and you need that knowledge first. But there are many examples in the real world of non-linear plants and controllers.

PainterGuy and Dullard
Note:
The author of the original text states "...PID control is based on constant parameters."

Not necessarily. I've implemented many PID loops where the gains were a function of the PV (or some other parameter/combination).
I would also argue, based on my general disdain for "PID", that if you are going to constrain your feedback compensation to "PID" pole/zero placement, it would be wise to also constrain yourself/students to fixed gains and linear systems.

Many questions about PID systems can be traced to a lack of fundamental knowledge of feedback compensation or legitimate questions caused by the confusion of an overly constrained canonical form for these systems. PID isn't a very helpful construct, except for people that have no intention of actually understanding feedback control systems. Plus, if we must have it, I would have defined it as a PI systems. The D term is almost always set to zero (effectively), and when it's not it's likely to causes problems. The D term is also theoretically inconsistent, there is no such thing as a differentiator that doesn't have higher frequency poles.

\end of rant

PainterGuy
It is rare in industrial controls (where PID is very common) to have a differential equation describing the behavior of the system in question (now what?). As a practical matter, PID is a very useful construct. Physical (as opposed to electronic) systems have inertia - that usually moots the limitations of PID at practical execution speeds. I understand your disdain (really) - I just don't think it would survive very long at an extrusion plant, shingle factory, etc.

jrmichler and anorlunda
Very good post by @Dullard. I'll add that nonlinearities in the process (especially limits) often make linear models temporarily invalid. "Best" performance of a control loop is a compromise between many operational and risk avoidance factors, and often can not be expressed as a mathematical function. Compare it to the "best" way to live happily with your spouse, or the "best" way to implement flight controls on the 737MAX.

It is rare in industrial controls (where PID is very common) to have a differential equation describing the behavior of the system in question (now what?). As a practical matter, PID is a very useful construct. Physical (as opposed to electronic) systems have inertia - that usually moots the limitations of PID at practical execution speeds. I understand your disdain (really) - I just don't think it would survive very long at an extrusion plant, shingle factory, etc.
I think you misunderstand my disdain. It's not that you shouldn't choose pole/zero placement that implements the same control as PID. It's that people shouldn't limit their compensation to PID. It is sold as something simple or special when it's just a subset of the potential compensation responses. Choose the best compensation for your application, if it ends up the same as PID, great. But don't start off thinking you only have three degrees of freedom. In particular, zeros in the transfer function can be very useful, even commonplace; but they will come with associated poles which is a bit more complex than just calling it a derivative term.

BTW, electronic systems have a nearly exact equivalent to inertia, usually described as inductance.