Anti-windup for PID control | Understanding PID Control, Part 2
Summary
TLDRThis video expands on PID controllers, focusing on real-life issues like actuator saturation and integral windup. It explains how the integral component can accumulate errors over time, causing excessive actuator commands when the system saturates. The video uses an example of a drone held near the ground to show how this can result in overshooting when released. To prevent such issues, it introduces anti-windup techniques, like clamping, to limit the integrator's output and improve system performance. Future videos will discuss the derivative path and sensor limitations.
Takeaways
- 🔧 PID controllers combine proportional, integral, and derivative paths to control a system, with each branch serving a different purpose.
- 📈 The integral path in a PID controller helps eliminate steady-state error but can cause issues in practical scenarios, such as actuator saturation.
- ⚙️ Actuators, like motors and heaters, aren't perfect; they have limitations such as backlash, rate constraints, and saturation.
- 🚫 Actuator saturation occurs when the actuator cannot follow the commanded output, which can lead to problems like integral windup.
- ⏳ Integral windup happens when the integrator in the PID controller continues to increase output, even when the actuator has reached its maximum capacity.
- 🚁 In the drone example, if the propeller motors reach their maximum speed, the integral will keep increasing the speed command, even though the motors can’t go faster.
- 🔄 To fix integral windup, an anti-windup method like clamping can be used, which temporarily shuts off the integrator when saturation occurs.
- 📊 Clamping checks if the system is saturating and if the integrator is contributing to the problem, then shuts down the integrator when necessary.
- 🔧 The clamping threshold should be set conservatively below the physical limit of the actuator to avoid future performance issues.
- 🔍 Anti-windup methods, like clamping, improve the performance of PID controllers, especially in real-world systems with nonlinear behaviors like actuator saturation.
Q & A
What is a PID controller and what are its three branches?
-A PID controller is a control loop feedback mechanism widely used in industrial control systems. It has three branches: proportional, integral, and derivative. The proportional branch responds to the current error, the integral branch accumulates the error over time to eliminate steady-state errors, and the derivative branch anticipates future error based on the rate of change of the error.
Why can the integral path in a PID controller cause problems?
-The integral path in a PID controller can cause problems because it can lead to 'integral windup' when the actuator saturates. This happens when the integrator continues to increase the command even after the actuator has reached its maximum capacity, leading to a large overshoot when the error changes sign.
What is an actuator in the context of a control system?
-An actuator in a control system is a device that generates force or energy to change the system's state. Examples include motors, heaters, and other devices that can apply a physical action in response to a control signal.
What is meant by 'saturation' in actuators?
-Saturation in actuators refers to the point at which the actuator can no longer respond to an increase in command signal because it has reached its maximum or minimum operating limit. For example, a motor can only spin at a certain maximum RPM, regardless of how high the command signal is.
How does saturation affect the performance of a PID controller?
-Saturation affects the performance of a PID controller by limiting the actuator's response to the control signal. This can cause the controller to overestimate the required control action, leading to overshoot or oscillations when the saturation is released.
What is integral windup and why is it problematic?
-Integral windup occurs when the integral term in a PID controller continues to increase (or decrease) the control signal even after the actuator has reached its saturation limit. This can cause a large overshoot or undershoot when the error changes sign and the actuator can finally respond to the control signal again.
How can clamping be used as an anti-windup method?
-Clamping can be used as an anti-windup method by limiting the output of the integral term to a specified maximum or minimum value. This prevents the integral term from increasing past the actuator's saturation point, ensuring that the control signal can respond quickly when the error changes sign.
Why is it important to set the saturation limit conservatively in an anti-windup algorithm?
-It is important to set the saturation limit conservatively in an anti-windup algorithm to account for variations in the actuator's performance over time or due to environmental factors. Setting the limit too close to the physical limit can lead to windup if the actuator's capacity decreases.
What is conditional integration in the context of PID controllers?
-Conditional integration refers to the practice of temporarily disabling the integral term in a PID controller when certain conditions are met, such as when the actuator is saturating and the error is of the same sign as the controller output. This helps to prevent integral windup.
How does the clamping method determine whether to clamp the integral term?
-The clamping method determines whether to clamp the integral term by checking if the output of the PID controller is saturating and if the error is of the same sign as the controller output. If both conditions are met, the integral term is clamped to prevent further windup.
What are some other anti-windup methods besides clamping?
-Other anti-windup methods besides clamping include rate limiting, where the rate of change of the integral term is limited; and state augmentation, where an additional state variable is introduced to represent the effect of the integrator on the system.
Outlines
🔧 PID Controllers: Overview and Real-World Challenges
This paragraph introduces the key aspects of a PID controller, breaking down how each of its branches—Proportional, Integral, and Derivative—contribute to system control. It highlights the simplicity of theory vs. practical challenges, particularly focusing on how real-world systems, unlike ideal ones, have nonlinearities like saturation and rate constraints, which can affect the performance of a PID controller.
⚙️ Understanding Actuator Saturation in Real Systems
The discussion expands on how actuators, like motors or heaters, interact with processes. Actuators are inherently nonlinear, meaning they can't always follow a command perfectly. The paragraph gives examples of actuator limitations, such as motor speed saturation or the current limit of a battery, and introduces the issue that PID controllers face when working with these real-world limitations, especially when the integral component doesn't account for saturation.
🚁 A Drone Example: How Integral Windup Occurs
This paragraph provides an example using a drone, illustrating how holding the drone near the ground creates a persistent error in the control system. The integral component continues to increase the motor speed command even when the motors hit their limit, a phenomenon known as 'integral windup.' This windup becomes a problem when the drone is released, leading to excessive overshooting because the motors continue at maximum speed until the integral command reduces to match the physical limits.
🔄 Unwinding Integral Windup: A Critical Challenge
This paragraph explains why integral windup is problematic, specifically when an actuator saturates and then the error reverses. Using the drone example, it shows how the motors take time to reduce speed because the integral command remains too high. This causes the system to overshoot before the command unwinds to within the actuator's operational limits, underscoring the need for anti-windup mechanisms.
🛑 Anti-Windup Methods: Clamping Explained
This paragraph introduces the concept of anti-windup strategies, focusing on clamping as a popular method. It explains how clamping prevents the integrator from increasing the command past a certain limit, reducing the overshoot when the system switches error signs. The discussion also describes how clamping compares the PID controller output with the saturation check to decide when to clamp the integral path, effectively turning off integration until conditions are safe.
🔧 Implementing Clamping in PID Controllers
Here, the mechanics of clamping are further elaborated. The paragraph details how clamping works within a PID controller, using an AND gate and switch to determine when to stop integrating based on error sign and saturation status. The importance of setting conservative saturation limits to account for physical actuator variabilities like motor wear or temperature changes is emphasized.
🚀 Summary and Looking Ahead to Derivative Path
The final paragraph wraps up by emphasizing the value of clamping as an anti-windup method, particularly in systems that operate outside their linear regions. It teases the next video, which will explore how imperfect sensors affect the derivative path in PID controllers, and encourages viewers to subscribe to the channel for more control theory content.
Mindmap
Keywords
💡PID Controller
💡Proportional Control
💡Integral Control
💡Derivative Control
💡Actuator
💡Saturation
💡Integral Windup
💡Anti-Windup
💡Clamping
💡Linear System
Highlights
Introduction to PID controller branches and how they work together to control a system (proportional, integral, and derivative).
Explanation of the purpose of the integral controller in removing steady-state error.
Introduction of the problem of actuator saturation in real-world systems.
The concept of nonlinearity in actuators, including limitations like backlash, rate constraints, and saturation.
Discussion on how continuous nonzero error through the integrator can cause the output to rise over time.
Description of the integral windup problem when actuators hit their maximum capacity, causing performance issues.
Real-world example using a drone’s altitude control to explain integral windup and actuator saturation.
Demonstration of how the drone’s motors reach maximum RPM but the integrator continues to increase the command, causing windup.
Introduction of the anti-windup method to protect against actuator saturation, ensuring proper control.
Explanation of the clamping method as an effective anti-windup technique, shutting down integration when needed.
The concept of conditional integration, where the integrator is disabled under certain conditions to prevent windup.
The importance of setting a saturation limit lower than the physical actuator limit to avoid integrator windup.
Discussion on using a conservative clamping limit for improved controller performance and safety.
Conclusion on how anti-windup methods improve the performance of PID controllers in real-world systems.
Preview of the next topic focusing on the derivative path and the impact of imperfect sensors on PID control.
Transcripts
In the last video, we described the PID controller
and how each of the three branches
contribute to controlling your system.
We started with a simple proportional controller
and then added an integral to remove
the steady-state error and then a derivative
to increase performance and to keep
the system from overshooting.
And that seemed simple enough, and it appeared to work,
in theory at least.
But there are a few problems that a PID controller
introduces in practice, and, in this video,
we're going to focus on how the integral path, in particular,
can get us into trouble.
To start we need to expand the system we call the plant.
The plant can be thought of as two separate systems.
The first is the actuator or actuators.
These are the devices that are generating the force or energy
to change the system.
A motor or a heater are example of actuators.
The second system is the process or the thing
that the actuator is pushing against or trying
to affect in some way.
If your actuator is a heater, then
the thing you are heating up is the process.
So here's the problem.
In real life, actuators aren't linear systems.
They can't perfectly follow any arbitrary command
given to them.
There's backlash and rate constraints and saturation
to name just a few.
And these limitations can wreak havoc
through an ideal PID controller like the one
we described in the last video.
So, if you stick around, we're going
to expand beyond a simple integral
and make a few changes that will protect your system against one
of the more common nonlinear problems found
in real-life situations.
I'm Brian, and welcome to a MATLAB Tech Talk.
We begin by looking at the path the error takes
through the integral to generate an actuator command
and then through an actuator to get its response.
Imagine a scenario where the actuator can saturate
or, another way of putting it, where
the actuator is not able to follow the command it's given.
Picture this.
A system is subjected to some continuous nonzero error.
When that error goes through the integrator,
the output will continue to rise over time.
And if our actuator is, say, a motor, then we
can think of this value as the commanded RPM.
If we command a motor with this ever-increasing request,
it will spin up and follow the command at first,
but, eventually, it will hit its maximum RPM
and won't go any faster, even if the actuator
is being commanded to do so.
This is saturation.
The motor can't run any faster.
And it's not just motors that experienced saturation.
It's all real actuators.
For example, a battery can only supply so much current,
and a speaker can only produce a sound so loudly.
When you are developing your PID controller,
if all you interact with are linear models of your system,
you might not think this is a big deal.
After all, there is no such thing as saturation
in a linear system.
Any output value is achievable.
So you'll never come across this situation.
You want to spin a motor at 100 RPM, 1,000, a million?
This is possible in a linear system.
But real-life systems are not linear,
and, if you only think about how your PID controller will
behave in this sense, that can get you into trouble.
We can figure out why by asking the question how does our PID
integral handle an actuator that saturates.
Assume we have the drone from the last video,
and we're trying to control its altitude with a PID control
law.
The altitude error goes through the three PID branches
and then sum together to get a propeller command.
The propellers are the actuators,
and they react to that command and spin up or down
to some speed.
The propellers generate a force that
lifts the drone, the process, into the air
and changes its altitude.
Again, for this example, we're going
to see what happens only within the integral path,
but there's a catch.
After we turn on the drone and tell it to fly up to 50 meters,
we don't let go.
We continue to hold on to it for a little while,
keeping it near the ground.
I don't know.
Maybe we wanted to inspect the operation before letting it go,
or maybe this was a test of a construction drone
that attempted to lift something heavier than it can handle.
Either way, there is a constant error
of 50 meters in the control loop,
and this will enter the integral and start adding up, increasing
the command to the propellers, telling them to spin faster
because the system needs more force to take off.
The propellers will keep up with the command, spinning faster
to fight against you at first, but you're
strong and holding it down.
And, since the drone isn't rising,
the error is still there.
Eventually, the integral will request
a speed that is faster than the propeller
motors are able to spin, and they will stop accelerating.
However, the integral, not knowing
that the propellers have given up,
will continue to increase the command.
You might think this isn't much of a problem
since the motors themselves are, essentially, ignoring
the command.
So it's not like something will break
if you command too high a value, but winding up
the integral command in this way or commanding
a value over the saturation limit isn't the problem.
The problem comes from trying to remove or unwind
the excess command from the integral.
Let's imagine this situation.
The maximum motor speed for this drone is 1,000 RPM,
but we've held onto the drone until the output
of the integrator is requesting 2,000 RPM.
The motors are only spinning at 1,000
since that's the fastest that they can go.
At this point, we let go of the drone,
and it rockets up towards the commanded altitude,
and the error begins to decrease.
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.
So, when it's at 1,900, the motors
are still spinning at 1,000.
When the command is 1,500, the motors
are still spinning at 1,000.
We have to wait until the integral unwinds back to 1,000
RPM before the propellers actually start slowing down.
And, during that entire time, the drone
is skyrocketing upwards and out of your sight.
This is called integral windup, and it's
something we need to protect against in our PID controller
because you never know if you're going to get into a situation
where an actuator saturates.
And, when something does saturate,
we want to minimize the time it takes
to reverse the command when the error changes signs.
So we need to implement some kind of anti-windup method.
There are multiple ways to implement integrator
anti-windup, but the idea in each of them
is to keep the integrated value from increasing
past some specified limit so that it will immediately
respond in the opposite direction
when the error changes sign.
Clamping can, basically, be thought of as
turning the integrator off whenever you don't
want it integrating anymore.
And I'm going to talk about this method in more detail
because it's popular, and I think
it will help you visualize how anti-windup
can be accomplished in general.
We'll start with our familiar PID control
law that acts on the loop error and generates an actuator
command.
But, as we just learned, sometimes, an actuator
can't follow the given command, and it saturates.
So, even if a large actuator command comes in,
the output will be capped at some value.
So the first thing we want to do with our PID controller
is make sure that it doesn't output a value outside of what
the actuator can handle.
We can do that by simply limiting
the output of the controller with its own saturation check.
Now we know the actuator command won't be too high,
but we haven't removed the windup problem just yet.
The clamping method has two separate checks
that it's doing.
The first is to compare the output of the PID controller
before and after the saturation check.
If the values are equal, then no saturation took place,
and this block outputs a 0.
If they're not equal, then we are in saturation,
and the block outputs a 1.
The second check is to compare the sign of the controller
output with the sign of the error.
If both the error and the controller output are positive,
then we know that the integrator is still adding to the output
to make it more positive.
And, if they're both negative, then we
know that the integrator is trying
to make it more negative.
So we're looking to see if the output is currently saturating,
and the integrator is attempting to make things worse.
From this, we can tell whether to clamp or not to clamp.
If the decision is to clamp--
that is the output of the AND gate is a 1--
then a switch is triggered, and the error term
in just the integral path is set to 0, effectively,
shutting down integration.
And, once the error changes sign or the controller
is no longer in saturation, the input into the integral
is restored, and the value immediately begins to decrease.
This is also referred to as conditional integration
because our controller will shut down the integrator
if it meets certain conditions.
One, the output is saturating, and, two, the error
is the same sign of the controller output.
If we had an anti-windup method on the drone
that we were holding in saturation,
then, as soon as the drone got to the commanded altitude,
the error would switch signs and the integral path
would immediately start to decrease the propeller
speed, limiting the overshoot.
And that's pretty awesome.
All right, one quick side note before we wrap up here,
when setting the saturation limit
for your anti-windup algorithm, you have
to be a little conservative.
For example, you wouldn't want to set the clamping limit
to exactly 1,000 RPM because that is way
too close to the physical limit of the actuator.
If the motor temperature changes,
the motors slow down with age, or if the propellers
get dented or bent, then that might limit the maximum motor
speed to a lower RPM.
And then our clamping algorithm will still
allow some integrator windup.
So it's a good idea to set the controller limit to a value
lower than the physical limit.
How much lower?
Well, that depends on how well you know your system
and how much you trust your modeling of it.
But, overall, clamping is a relatively lightweight,
anti-windup method that can improve performance of your PID
controller when it's controlling a system that
is operating outside of its linear region
or when it's saturated.
OK, in the next video, we're going
to focus on the derivative path and how non-perfect sensors can
impact our ideal PID controller.
So, if you don't want to miss the next Tech Talk video,
don't forget to subscribe to this channel.
Also, if you want to check out my channel, Control System
Lectures, I cover more control theory topics there as well.
Thanks for watching, and I'll see you next time.
Weitere ähnliche Videos ansehen
Noise Filtering in PID Control | Understanding PID Control, Part 3
PID Controller Explained
What is a PID Controller?
How Pneumatic Control Valve Works | Control Valve Actuator Types | Control Valve Positioner Types
Yocto Devtool Tutorial - 38 Create Recipe with Devtool | add & build Commands
INTEGRATION OF SENSOR AND ACTUATORS WITH ARDUINO-I
5.0 / 5 (0 votes)