12 Integrator with Full State Feedback

12.1 Theory

In the previous chapter we derived a full state feedback controller that stabilized the system and ensured that the DC gain from the reference \(r(t)\) to the reference output \(y_r(t)\) is equal to one. If the model is precise, meaning that we know all of the parameters exactly and we have not neglected any dynamics, or if there are no disturbances on the system, then the output will track the reference as time goes to infinity. However, models are never precise, and there are almost always disturbances on the system, which implies that there will be steady-state error in the response. In Chapter 12 we showed that adding an integrator to the controller is an effective way of eliminating steady-state error caused by model mismatch and input/output disturbances. In this section we will show how to add an integrator to the full state feedback controller derived in Chapter 14.

A block diagram of the system with full state feedback and an integrator is shown in Fig. 12.1.

Full state feedback with integrator.

Let the state of the integrator be defined as \(x_I\), as shown in Fig. 12.1. Then \[\dot{x}_I = r-y_r = r-C_rx.\] In Appendix 30 we argue, using the root locus, that adding an integrator after the other gains are selected will change all of the pole locations. Since the pole placement design methods described in Part III were limited to second-order systems, we did not have an effective method for placing the system poles and the integrator pole simultaneously. On the other hand, the pole placement technique described in Chapter 14 was not limited to second-order systems. As such, there should be a way to use the methods of Chapter 14 to simultaneously place both the system poles and the integrator pole. To do so, we augment the states of the original system with the integrator state \(x_I\). Since the dynamics of the original system are given by \(\dot{x}=Ax+Bu\), the dynamics of the augmented system are given by \[\tag{12.1} \begin{pmatrix} \dot{x} \\ \dot{x}_I \end{pmatrix} = \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0}\end{pmatrix} \begin{pmatrix} x \\ x_I \end{pmatrix} + \begin{pmatrix} B \\ \mathbf{0} \end{pmatrix} u + \begin{pmatrix} 0 \\ 1 \end{pmatrix} r,\] where the state of the augmented system is \((x^\top, x_I)^\top\), the interaction matrix, or the “\(A\)-matrix,” of the augmented system is \[A_1 = \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0}\end{pmatrix},\] and the “\(B\)-matrix” of the augmented system is \[B_1=\begin{pmatrix} B \\ \mathbf{0}\end{pmatrix}.\] The first question that might be asked is whether the augmented system \((A_1,B_1)\) is controllable when the original system \((A,B)\) is controllable. Since the original system is controllable, we know that the controllability matrix \[\mathcal{C}_{A,B} = \begin{pmatrix} B & AB & \dots & A^{n-1}B \end{pmatrix}\] has rank \(n\). For the augmented system, the controllability matrix is \[\mathcal{C}_{A_1,B_1} = \begin{pmatrix} B & AB & A^2B & \dots & A^{n-1}B & A^nB \\ 0 & -C_rB & -C_rAB & \dots & -C_rA^{n-2}B & -C_rA^{n-1}B \end{pmatrix},\] which is guaranteed to have rank \(n+1\) if \(C_rA^{n-1}B \neq 0\). When the augmented system is controllable, we can use the pole placement technique described in Chapter 14 to place the system poles and the pole of the integrator simultaneously using the augmented system. For example, letting \(A_1\) and \(B_1\) represent the augmented system, and using the Python place command

import control as cnt
K1 = cnt.place(A1,B1, [p1,...,pn,pI])

where \(p_I\) is the integrator pole. The resulting controller is \[\begin{aligned} u(t) &= -K_1\begin{pmatrix}x \\ x_I \end{pmatrix} = -\begin{pmatrix} K & k_I \end{pmatrix}\begin{pmatrix}x \\ x_I \end{pmatrix} =-Kx-k_Ix_I\\ &= \underbrace{-Kx(t)}_{\text{state feedback}} - \underbrace{k_I \int_0^t(r(\tau)-y_r(\tau))d\tau}_{\text{integral feedback}} \quad. \end{aligned}\]

We can show that adding the integrator ensures that the DC gain of the closed-loop system is equal to one. Indeed, from Equation 12.1 the augmented closed-loop system is \[\begin{aligned} \begin{pmatrix} \dot{x} \\ \dot{x}_I \end{pmatrix} &= \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0}\end{pmatrix} \begin{pmatrix} x \\ x_I \end{pmatrix} - \begin{pmatrix} B \\ \mathbf{0} \end{pmatrix} \begin{pmatrix} K & k_I \end{pmatrix}\begin{pmatrix} x \\ x_I \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} r \\ &= \begin{pmatrix} A-BK & -Bk_I \\ -C_r & 0\end{pmatrix}\begin{pmatrix} x \\ x_I \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} r, \end{aligned}\] where the reference output equation is \[y_r = \begin{pmatrix} C_r & 0 \end{pmatrix} \begin{pmatrix} x \\ x_I \end{pmatrix}.\] Therefore, the transfer function from \(R(s)\) to \(Y_r(s)\) is \[Y_r(s) = \begin{pmatrix} C_r & 0 \end{pmatrix} \left(sI - \begin{pmatrix} A-BK & -Bk_I \\ -C_r & 0\end{pmatrix}\right)^{-1} \begin{pmatrix} 0 \\ 1 \end{pmatrix} R(s),\] which implies that the DC gain is \[\begin{aligned} k_{DC} &= -\begin{pmatrix} C_r & 0 \end{pmatrix} \begin{pmatrix} A-BK & -Bk_I \\ -C_r & 0\end{pmatrix}^{-1} \begin{pmatrix} 0 \\ 1 \end{pmatrix}. \end{aligned}\] Defining \(M\stackrel{\triangle}{=}(A-BK)^{-1}\), and using the Matrix inversion formula for block matrices given in Appendix 31 Equation P.7.2 we get \[\begin{aligned} k_{DC} &= -\begin{pmatrix} C_r & 0 \end{pmatrix} \begin{pmatrix} M-MBk_I(C_rMBk_I)^{-1}C_rM & -MBk_I(C_rMBk_I)^{-1} \\ -(C_rMBk_I)^{-1}C_rM & (C_rMBk_I)^{-1}\end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \\ &= C_rMBk_I(C_rMBk_I)^{-1} \\ &= 1. \end{aligned}\]

12.1.1 Integral Feedback for Linearized Systems

Suppose that the state-space model is from a linearized system, i.e., suppose that \(x\in\mathbb{R}^n\) is the state, \(x_e\in\mathbb{R}^n\) is the equilibrium state, and that \(\tilde{x}=x-x_e\) is the state linearized around the equilibrium. Similarly, suppose that \(u\in\mathbb{R}^m\) is the input, that \(u_e\in\mathbb{R}^m\) is the input at equilibrium, and that \(\tilde{u}=u-u_e\) is the input linearized around equilibrium, and that \(y_r\in\mathbf{R}^p\) is the reference output, \(y_{re}=C_rx_e\in\mathbf{R}^p\) is the reference output at equilibrium, \(\tilde{y}_r=y_r-y_{re}\) is the reference output linearized about equilibrium, and the reference input is given by \(\tilde{r}=r-y_{re}\). In this case the integral state is selected as \(\tilde{x}_I=\int(\tilde{r}-\tilde{y}_r)d\tau\), and the augmented system is given by \[\begin{pmatrix} \dot{\tilde{x}} \\ \dot{\tilde{x}}_I \end{pmatrix} = \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0}\end{pmatrix} \begin{pmatrix} \tilde{x} \\ \tilde{x}_I \end{pmatrix} + \begin{pmatrix} B \\ \mathbf{0} \end{pmatrix} \tilde{u} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \tilde{r}.\] The pole placement design proceeds as in the previous section with the resulting controller being \[\tilde{u} = -K\tilde{x} - k_I \int_{-\infty}^t \tilde{e}(\tau)d\tau.\] Noting that \[\tilde{e} = \tilde{r}-\tilde{y} = (r-y_{re})-(y_r-y_{re}) = r-y_r\] we get that the controller for the linearized system is given by \[u = u_e - K(x-x_e) - k_I \int_{-\infty}^t (r(\tau)-y_r(\tau))d\tau.\]

12.2 Summary of Design Process - State Feedback with Integrator

The design process for adding an integrator to state feedback can be summarized as follows. Given the plant \[\begin{aligned} \dot{x} &= Ax + Bu \\ y_r &= C_rx, \end{aligned}\] where we desire that \(y_r\) tracks the reference \(r\) using integral action using the controller \[u(t) = -Kx(t) - k_I\int_{-\infty}^t (r(\tau)-y_r(\tau))d\tau,\] with desired closed-loop gains at \(p_1, p_2, \dots, p_n\), \(p_I\).

Step 1.
Augment the state evolution equation as \[\begin{pmatrix}\dot{x} \\ \dot{x}_I \end{pmatrix} = \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0} \end{pmatrix} \begin{pmatrix}x \\ x_I\end{pmatrix} + \begin{pmatrix}B \\ \mathbf{0}\end{pmatrix}u + \begin{pmatrix}\mathbf{0} \\ I\end{pmatrix}r,\] and let \[\begin{aligned} A_1 &= \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0} \end{pmatrix} \\ B_1 &= \begin{pmatrix}B \\ \mathbf{0}\end{pmatrix} \end{aligned}\]

Step 2.
Follow the pole placement procedure outlined in Chapter 14 to find \(K_1\) that places the poles of the augmented system at \(p_1, p_2, \dots, p_n\), and \(p_I\).

Step 3.
Find the gains \(K\) and \(k_I\) as \[\begin{aligned} K &= K_1(1:n) \\ k_I &= K_1(n+1). \end{aligned}\]

Using Python, these steps can be implemented using the following script.

import numpy as np
import control as cnt

# augment the system matrices
A1 = np.vstack((
    np.hstack((A, np.zeros((np.size(A,1),1)))),
    np.hstack((-Cr, 0)) ))
    
B1 = np.vstack((
    B, 0))

# Compute the gains if the system is controllable
if np.linalg.matrix_rank(cnt.ctrb(A1, B1)) != np.size(A1,1):
    print("The system is not controllable")
else:
    K1 = cnt.acker(A1, B1, [p1, p2, ..., pn, pI])

    #extract the state feedback gains and the integral gain
    K = K1[0,0:-1]
    ki = K1[0,-1]

print('K: ', K)
print('ki: ', ki)

12.2.1 Simple example

Given the system \[\begin{aligned} \dot{x} &= \begin{pmatrix} 0 & 1 \\ 2 & 3 \end{pmatrix} x + \begin{pmatrix} 0 \\ 4 \end{pmatrix} u \\ y_r &= \begin{pmatrix} 5 & 0 \end{pmatrix} x \end{aligned}\] find the feedback gain \(K\) to place the closed-loop poles at \(-1\pm j\), and the reference gain \(k_r\) so that the DC gain is one, and add an integrator with gain at \(p_I=-0.1\).

Step 1.
Form the augmented system \[\begin{aligned} A_1 &= \begin{pmatrix} A & \mathbf{0} \\ -C_r & \mathbf{0} \end{pmatrix} = \begin{pmatrix} 0 & 1 & 0 \\ 2 & 3 & 0 \\ -5 & 0 & 0 \end{pmatrix} \\ B_1 &= \begin{pmatrix} B \\ \mathbf{0} \end{pmatrix} = \begin{pmatrix} 0 \\ 4 \\ 0 \end{pmatrix} \end{aligned}\]

Step 2.
To place the poles at \(p_1=-1+j\), \(p_2=-1-j\), \(p_I=-0.1\), we first form the controllability matrix \[\mathcal{C}_{A_1,B_1} = [B_1, A_1B_1, A_1^2B_1] = \begin{pmatrix} 0 & 4 & 12 \\ 4 & 12 & 44 \\ 0 & 0 & -20 \end{pmatrix}.\] The determinant is \(det(\mathcal{C}_{A_1,B_1})=320\neq 0\), therefore the system is controllable.

The open-loop characteristic polynomial \[\begin{aligned} \Delta_{ol}(s)&=\text{det}(sI-A_1) = \text{det}\begin{pmatrix} s & -1 & 0 \\ -2 & s-3 & 0 \\ 5 & 0 & s\end{pmatrix} \\ &= s^3 - 3s^2 -2s, \end{aligned}\] which implies that \[\begin{aligned} \mathbf{a}_{A_1} &= \begin{pmatrix}-3, & -2, & 0\end{pmatrix} \\ \mathcal{A}_{A_1} &= \begin{pmatrix} 1 & -3 & -2 \\ 0 & 1 & -3 \\ 0 & 0 & 1 \end{pmatrix}. \end{aligned}\]

The desired closed-loop polynomial \[\begin{aligned} \Delta_{cl}^d(s) &= (s+1-j)(s+1+j)(s+0.1) \\ &=s^3+2.1s^2+2.2s+0.2, \end{aligned}\] which implies that \[\boldsymbol{\alpha} = \begin{pmatrix}2.1, & 2.2, & 0.2\end{pmatrix}.\]

The augmented gains are therefore given as \[\begin{aligned} K_1 &= (\boldsymbol{\alpha}-\mathbf{a}_{A_1})\mathcal{A}_{A_1}^{-1}\mathcal{C}_{A_1,B_1}^{-1} \\ &= \left( (2.1, 2.2, 0.2) - (-3, -2, 0) \right) \cdot \\ &\qquad \begin{pmatrix}1 & -3 & -2 \\ 0 & 1 & -3 \\ 0 & 0 & 1\end{pmatrix}^{-1}\begin{pmatrix}0 & 4 & 12 \\ 4 & 12 & 44 \\ 0 & 0 & -20 \end{pmatrix}^{-1} \\ &= \begin{pmatrix} 1.05, & 1.275, & -0.01 \end{pmatrix} \end{aligned}\]

Step 3.
The feedback gains are therefore given by \[\begin{aligned} K &= K_1(1:2) = \begin{pmatrix} 1.05, & 1.275 \end{pmatrix} \\ k_I &= K_1(3) = -0.01 \end{aligned}\]

Alternatively, we could have used the following Python script

import numpy as np
import control as cnt

# define original state-space system and desired poles
A = np.array([[0.0, 1.0], [2.0, 3.0]])
B = np.array([[0.0], [4.0]])
Cr = np.array([5.0, 0])

p1 = -1.0 - 1.j
p2 = -1.0 + 1.j
pI = -0.1

# augment the system matrices
A1 = np.vstack((
    np.hstack((A, np.zeros((np.size(A,1),1)))),
    np.hstack((-Cr, 0)) ))
B1 = np.vstack((
    B, 0))

# Compute the gains if the system is controllable
if np.linalg.matrix_rank(cnt.ctrb(A1, B1)) != np.size(A1,1):
    print("The system is not controllable")
else:
    K1 = cnt.acker(A1, B1, [p1, p2, pI])

    #extract the state feedback gains and the integral gain
    K = K1[0,0:-1]
    ki = K1[0,-1]

Chapter 12 guided activity

Work through a second integrator-augmented design

Use the same procedure as the simple example above. For the system below, compute each quantity in order and click Check before moving on. The solution for each step is revealed only after that step is checked.

x = 0 1 -2 -3 x + 0 1 u Cr = 1 0

Desired augmented closed-loop poles: -1 and -2 ± j.

Step 1. Augmented system

Form A1 = (A, 0; -Cr, 0) and B1 = (B; 0). Enter A1 row by row and B1 from top to bottom.

A1 =
B1 =

Step 2. Augmented controllability matrix

Compute CA1,B1 = \[B1, A1B1, A12B1\]. Enter the matrix row by row and the determinant.

CA1,B1 =

Step 3. Open-loop augmented polynomial

Compute det(sI - A1) = s3 + a2s2 + a1s + a0.

a =

Step 4. Desired augmented polynomial

Compute (s + 1)((s + 2)2 + 1) = s3 + alpha2s2 + alpha1s + alpha0.

α =

Step 5. Augmented feedback gain

Use K1 = (alpha - a) AcalA1-1CA1,B1-1. Enter the three entries of K1.

K1 =

Step 6. Extract the gains

Separate K1 into the state-feedback gain K and the integrator gain kI.

K =
kI =

12.3.1 image Example Problem 3.1.15

Modify the state feedback solution developed in Homework 3.1.14 to add an integrator with anti-windup.

Add a 0.25 Newton disturbance to the system and allow the system parameters to change up to 20%.

Tune the integrator pole (and other gains if necessary) to get good tracking performance.

Design Study A guided exercise

Add integral action

Augment the state with the integral of tracking error and place the added pole deliberately.

Step 1. Augmented system size

Step 2. Integrator pole placement

Step 3. Gain partition

Pseudocode

The complete solution includes state-feedback-with-integrator code. Before opening it, outline how you would update the integrator state, compute the augmented feedback input, and apply anti-windup if needed.

This prompt is ungraded. It is intended to connect the augmented-state design to the implementation code in the complete solution.

12.4 Design Study B. Inverted Pendulum

12.4.1 image Example Problem 3.2.15

(a) Modify the state feedback solution developed in Homework 3.2.14 to add an integrator with anti-windup to the position feedback.

(b) Add a constant input disturbance of 0.5 Newtons to the input of the plant and allow the system parameters to change up to 20%.

(c) Tune the integrator pole (and other gains if necessary) to get good tracking performance. You may need to make the gains less aggressive (slower rise time) to get stable performance.

Design Study B guided exercise

Add cart-position integral action

Augment the system with an integrator on z tracking error.

Step 1. Integrated output

Step 2. Augmented size

Step 3. Gain partition

Pseudocode

The complete solution includes implementation code. Before opening it, outline the algorithm in your own words.

This prompt is ungraded. It is intended to connect the derivation to the implementation code in the complete solution.

12.5 Design Study C. Satellite Attitude Control

12.5.1 image Example Problem 3.3.15

Modify the state feedback solution developed in Homework 3.3.14 to add an integrator with anti-windup to the feedback loop for \(\phi\).

Add a constant input disturbance of 1 Newton-meter to the input of the plant and allow the plant parameters to vary up to 20%.

Tune the integrator pole (and other gains if necessary) to get good tracking performance.

Design Study C guided exercise

Add satellite integrator feedback

The augmented controller integrates panel-angle tracking error while handling disturbance, uncertainty, and actuator limits.

Step 1. Choose the integrator error

Step 2. Robustness challenge

Step 3. Anti-windup purpose

12.6 Interactive Augmented-State Check

Chapter 12 activity

Integrator pole tradeoff

Adding integral action creates one extra state and one extra pole to place. Move the integrator pole and disturbance level to see the qualitative speed/effort tradeoff. The readouts use the book’s pole-placement idea: a farther-left integrator pole increases the response rate associated with the added integrator state, but it also tends to require larger control action and can make the transient more aggressive.

Estimated settling effect Relative control effort Overshoot tendency Tuning note

The augmented matrices add one integrator state with xI dot = r - yr. That is why the bottom row contains -Cr in A1 and why controllability must be checked again. In this activity, |pI| is the selected integrator-pole magnitude and d is the constant disturbance size.

12.7 Knowledge Check

Q1. Augmented state

Adding an integrator to state feedback introduces:

Q2. Integrator row

The integrator row in the augmented A1 matrix contains:

Q3. Augmented dimension

If the original plant has two states and one tracking integrator is added, enter the augmented system order.

Show solution

Answer: 3. The augmented system contains the two physical states plus one integrator state.

Q4. Augmented matrix sign

For Cr = (1, 0) and xI′ = r - Crx, enter the first entry of the integrator row in A1.

Show solution

Answer: -1. The row is -Cr, so (1, 0) becomes (-1, 0).

Q5. Purpose of integral action

Integral action is primarily added to remove what kind of error or bias?

Show solution

Answer: Steady-state tracking error or constant bias. The integrator keeps acting until the accumulated error is driven down.

Q6. Purpose of the augmented integrator

In state feedback with integral action, what does the added integrator state represent?

Q7. Augmented A row

If xI = r - y = r - Cx, which row appears in the augmented A matrix for the integrator equation?

Q8. Slow integrator pole

What is a likely consequence of choosing the integrator pole much slower than the rest of the closed-loop poles?

12.8 Notes and References

Integral control for linear state-space systems is a well-established technique. Additional examples can be found in [4, 5, 19]. A nice introduction to integral control for nonlinear systems is given in [20].