Including Integral Action

A standard LQR controller minimizes a cost function and provides state feedback, but it does not guarantee that the output y(t)y(t) will converge to a desired constant reference ryr_y.

This leads to steady-state error.

By augmenting the system with a new state z(t)z(t) that integrates the error between y(t)y(t) and ry(t)r_y(t), 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 xp()x_p() for perturbations, we write δx(t)\delta x(t) for deviations.

Our final system will look like the following:

ddt[δx(t)δz(t)]=[A0−C0][δx(t)δz(t)]+[B0]δu(t),\frac{d}{dt} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} = \begin{bmatrix} A & 0 \\ -C & 0 \end{bmatrix} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} + \begin{bmatrix} B \\ 0 \end{bmatrix} \delta u(t),

Concept

Intuition

δx(t)\delta x(t)

How far the system's state is from where we want it to be

δz(t)\delta z(t)

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:

x˙(t)=Ax(t)+Bu(t),y(t)=Cx(t)\dot{x}(t)=Ax(t)+Bu(t)\quad,\quad y(t)=Cx(t)

To this:

ddt[δx(t)δz(t)]=[A0−C0][δx(t)δz(t)]+[B0]δu(t)\frac{d}{dt} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} = \begin{bmatrix} A & 0 \\ -C & 0 \end{bmatrix} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} + \begin{bmatrix} B \\ 0 \end{bmatrix} \delta u(t)

δy(t)=[C0][δx(t)δz(t)]\delta y(t) = [C \quad 0] \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix}

---

1. Standard LQR Feedback Law

We start with the standard state feedback law:

u(t)=Kx(t)+r(t)u(t) = Kx(t) + r(t)

- u(t)u(t): control input vector.

- x(t)x(t): state vector.

- KK: state feedback gain matrix.

- r(t)r(t): 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 D=0D = 0, leading to:

x˙(t)=Ax(t)+Bu(t),y(t)=Cx(t)\dot{x}(t) = Ax(t) + Bu(t) \quad,\quad y(t) = Cx(t)

- AA, BB, and CC: system matrices.

- y(t)y(t): output of the system.

---

3. Adding Integral Action

To ensure the output y(t)y(t) tracks the desired output ry(t)r_y(t), we introduce an integral of the output error:

z(t)=∫0t(ry(τ)−y(τ))dτz(t) = \int_0^t \left( r_y(\tau) - y(\tau) \right) d\tau

- z(t)z(t): integral of the error (used for integral action).

- ry(t)r_y(t): desired reference output.

- This leads to:

z˙(t)=ry(t)−y(t)=ry(t)−Cx(t)\dot{z}(t) = r_y(t) - y(t) = r_y(t) - Cx(t)

---

4. Steady-State Analysis (we need a few values before the linearisation)

For a constant reference ryr_y, steady state is reached when x˙(t)=0\dot{x}(t) = 0, hence:

0=Axˉ+Buˉ0 = A\bar{x} + B\bar{u}

- xˉ\bar{x}, uˉ\bar{u}: steady-state values of xx and uu.

0=Axˉ+Buˉ⇒uˉ=−B−1Axˉ0 = A\bar{x} + B\bar{u} \Rightarrow \bar{u} = -B^{-1}A\bar{x} (this result will be useful at the end)

Also, the steady-state output becomes:

yˉ=Cxˉ\bar{y} = C\bar{x}

At steady state, we also require z˙(t)=0\dot{z}(t) = 0 (since if not, z(t)z(t) would diverge):

0=ry−yˉ⇒ry=Cxˉ0 = r_y - \bar{y} \Rightarrow r_y = C\bar{x}

---

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:

x(t)=xˉ+δx(t),u(t)=uˉ+δu(t),y(t)=yˉ+δy(t)x(t) = \bar{x} + \delta x(t), \quad u(t) = \bar{u} + \delta u(t), \quad y(t) = \bar{y} + \delta y(t)

Substituting these into the dynamics:

a. For the state equation:

x˙(t)=A(xˉ+δx(t))+B(uˉ+δu(t))\dot{x}(t) = A(\bar{x} + \delta x(t)) + B(\bar{u} + \delta u(t))

Expanding:

=Axˉ+Aδx(t)+Buˉ+Bδu(t)= A\bar{x} + A\delta x(t) + B\bar{u} + B\delta u(t)

Since Axˉ+Buˉ=0A\bar{x} + B\bar{u} = 0 from steady-state,

x˙(t)=Aδx(t)+Bδu(t)⇒δx˙(t)=Aδx(t)+Bδu(t)\dot{x}(t) = A\delta x(t) + B\delta u(t) \Rightarrow \dot{\delta x}(t) = A\delta x(t) + B\delta u(t)

---

b. For the output (y - y_steady becomes y_deviation):

y(t)=C(xˉ+δx(t))=Cxˉ+Cδx(t)⇒δy(t)=Cδx(t)y(t) = C(\bar{x} + \delta x(t)) = C\bar{x} + C\delta x(t) \Rightarrow \delta y(t) = C\delta x(t)

---

c. For the integral state:

z˙(t)=ry−Cx(t)=ry−C(xˉ+δx(t))=ry−Cxˉ−Cδx(t)\dot{z}(t) = r_y - Cx(t) = r_y - C(\bar{x} + \delta x(t)) = r_y - C\bar{x} - C\delta x(t)

But recall that ry=Cxˉ⇒z˙(t)=−Cδx(t)r_y = C\bar{x} \Rightarrow \dot{z}(t) = -C\delta x(t)

⇒δz˙(t)=−Cδx(t)\Rightarrow \dot{\delta z}(t) = -C\delta x(t)

---

6. State-Space Model with Integral Action

Now, we combine the deviations into an augmented state vector:

δξ(t)=[δx(t)δz(t)]\delta \xi(t) = \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix}

The dynamics are:

ddt[δx(t)δz(t)]=[A0−C0][δx(t)δz(t)]+[B0]δu(t)\frac{d}{dt} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} = \begin{bmatrix} A & 0 \\ -C & 0 \end{bmatrix} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} + \begin{bmatrix} B \\ 0 \end{bmatrix} \delta u(t)

Output equation:

δy(t)=[C0][δx(t)δz(t)]\delta y(t) = [C \quad 0] \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix}

---

Define a state feedback law for this system as

δu(t)=K[δx(t)δz(t)]\delta u(t) = K \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix}

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 KK can be found by solving the infinite time LQR that minimises

J=∫0∞{[δx(t)δz(t)]⊤[Qc00ηI][δx(t)δz(t)]+δu⊤(t)Rcδu(t)}dtJ = \int_0^\infty \left\{ \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix}^\top \begin{bmatrix} Q_c & 0 \\ 0 & \eta I \end{bmatrix} \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix} + \delta u^\top(t) R_c \delta u(t) \right\} dt

where η∈R\eta \in \mathbb{R} is a positive scalar which adjusts the relative weighting that is applied to integral action in the controller.

The feedback gain matrix KK is partitioned as:

K=[KPKI],K = \begin{bmatrix} K_P & K_I \end{bmatrix},

where:

- KPK_P is the proportional feedback gain acting on the state deviation δx(t),\delta x(t), and

- KIK_I is the integral feedback gain acting on the integral of the error δz(t).\delta z(t).


Defining the feedback law

The initial law is:

u(t)=Kx(t)+r(t)u(t) = Kx(t) + r(t)

This is pure proportional control (state feedback) plus a reference input.


With Integral Action

To include integral action, the controller is adapted as follows:

δu(t)=K[δx(t)δz(t)],\delta u(t) = K \begin{bmatrix} \delta x(t) \\ \delta z(t) \end{bmatrix},

u(t)=uˉ+δu(t)=uˉ+KPδx(t)+KIδz(t)u(t) = \bar{u} + \delta u(t) = \bar{u} + K_P \delta x(t) + K_I \delta z(t)

Here’s how the terms break down:

  • uˉ\bar{u}: The steady-state input, i.e., the value of the input required to keep the system at the desired steady-state operating point, 0=Axˉ+Buˉ⇒uˉ=−B−1Axˉ0 = A\bar{x} + B\bar{u} \Rightarrow \bar{u} = -B^{-1}A\bar{x}

  • δx(t)\delta x(t), δz(t)\delta z(t): Deviations from steady state for the state and the integrated error, respectively.

  • KPK_P: The gain on the state deviation (like the original feedback).

KIK_I: The gain on the integrated error (the new integral term)


Interpretation of uˉ\bar{u}

  • uˉ\bar{u} is a constant determined from solving the steady-state equations of your system.

  • It replaces the term r(t)r(t) in the original law. Now, instead of having a time-varying reference term r(t)r(t), you embed the reference through deviation variables and design around that.


The structure of the control law is a P+I controller:

- KPδx(t)K_P \delta x(t) is Proportional control on the state error.

- KIδz(t)K_I \delta z(t) is Integral control on the accumulated output error.


The proportional-plus-integral (P+I) controller is tuned by adjusting η\eta, which controls the weight of the integral term δz(t)\delta z(t) in the cost function.

- A larger η\eta increases the emphasis on integral action, reducing steady-state error but potentially increasing control effort.

- A smaller η\eta reduces the emphasis on integral action, prioritizing proportional control and potentially faster system response.