Including Integral Action
A standard LQR controller minimizes a cost function and provides state feedback, but it does not guarantee that the output will converge to a desired constant reference .
This leads to steady-state error.
By augmenting the system with a new state that integrates the error between and , and then feeding this into the controller, we can:
- Drive the integral of the output error to zero.
- Ensure that the system output tracks the reference exactly at steady state.
- Achieve zero steady-state error even in the presence of disturbances.
To put simply, imagine we included a state into our system that integrated the error. Then we include that integral in our LQR cost function so that the input penalises the error integral. However, our integral is non-linear and the LQR only works with linear systems - we must linearise.
What does it mean to linearise? It means choosing a point around which we decide to model our system. Intuitively, we would choose to linearise our system around the steady-state values, so that we can then describe any changes as “deviations” from the target value. This is not much different to how we normally linearise a system, where instead of writing for perturbations, we write for deviations.
Our final system will look like the following:
Concept | Intuition |
|---|---|
How far the system's state is from where we want it to be | |
How much output error has accumulated over time (integral error) | |
Linearisation | Let us zoom in around a steady point where math is linear and easier |
Augmented model | Captures both the plant and the integral of the output error |
Goal | Feed this into LQR so it minimizes both: state deviation and accumulated error (integral) |
We finally feed our new states into an LQR. and minimise!
The following is a derivation for this system. We start with determining a few values before we jump into the linearisation.
We should go from this:
To this:
---
1. Standard LQR Feedback Law
We start with the standard state feedback law:
- : control input vector.
- : state vector.
- : state feedback gain matrix.
- : external input or reference signal.
In Linear Quadratic Gaussian (LQG), a similar structure is used but with state estimates.
---
2. State-Space System Without Noise
We simplify the system by assuming no noise and using a state-space model with , leading to:
- , , and : system matrices.
- : output of the system.
---
3. Adding Integral Action
To ensure the output tracks the desired output , we introduce an integral of the output error:
- : integral of the error (used for integral action).
- : desired reference output.
- This leads to:
---
4. Steady-State Analysis (we need a few values before the linearisation)
For a constant reference , steady state is reached when , hence:
- , : steady-state values of and .
(this result will be useful at the end)
Also, the steady-state output becomes:
At steady state, we also require (since if not, would diverge):
---
5. Deviation Variables (where we actually linearise)
We now linearize the system around the steady-state by defining deviation variables. Note how we’ve also linearised the input, which we will use to create a new feedback law:
Substituting these into the dynamics:
a. For the state equation:
Expanding:
Since from steady-state,
---
b. For the output (y - y_steady becomes y_deviation):
---
c. For the integral state:
But recall that
---
6. State-Space Model with Integral Action
Now, we combine the deviations into an augmented state vector:
The dynamics are:
Output equation:
---
Define a state feedback law for this system as
The way to think about this, is let’s say you used an observer system to help formulate an input to the main system. Here instead, we use an integral system we’ve constructed to make the input (this is only part of it for now). We then use an LQR to choose our gain, just like in an LQG.
The can be found by solving the infinite time LQR that minimises
where is a positive scalar which adjusts the relative weighting that is applied to integral action in the controller.
The feedback gain matrix is partitioned as:
where:
- is the proportional feedback gain acting on the state deviation and
- is the integral feedback gain acting on the integral of the error
Defining the feedback law
The initial law is:
This is pure proportional control (state feedback) plus a reference input.
With Integral Action
To include integral action, the controller is adapted as follows:
Here’s how the terms break down:
: The steady-state input, i.e., the value of the input required to keep the system at the desired steady-state operating point,
, : Deviations from steady state for the state and the integrated error, respectively.
: The gain on the state deviation (like the original feedback).
: The gain on the integrated error (the new integral term)
Interpretation of
is a constant determined from solving the steady-state equations of your system.
It replaces the term in the original law. Now, instead of having a time-varying reference term , you embed the reference through deviation variables and design around that.
The structure of the control law is a P+I controller:
- is Proportional control on the state error.
- is Integral control on the accumulated output error.
The proportional-plus-integral (P+I) controller is tuned by adjusting , which controls the weight of the integral term in the cost function.
- A larger increases the emphasis on integral action, reducing steady-state error but potentially increasing control effort.
- A smaller reduces the emphasis on integral action, prioritizing proportional control and potentially faster system response.