TExcelTAD
Home › Control Systems & Automation › State Feedback and Pole Placement

State Feedback and Pole Placement

A small DC motor turns a camera mount, and the specification reads: move 1 rad1\ \text{rad} with no more than 5 % overshoot, settle within 50 ms50\ \text{ms}, never ask the 12 V12\ \text{V} driver for more than its supply. A PID loop on the angle measurement has three knobs and a root locus that only bends so far. If the drive also measures the motor current and the encoder gives the speed, every state of the motor is available, and then something stronger is possible: state feedback puts every closed-loop pole wherever you want, provided the plant is controllable.

The idea

With the whole state measured, the control law is a weighted sum of the states plus a scaled reference:

u=−Kx+Nr⟹x˙=(A−BK) x+BN ru = -K x + N r \quad \Longrightarrow \quad \dot{x} = (A - BK)\,x + BN\,r

The closed-loop poles are the eigenvalues of A−BKA - BK. For a single input, KK is a row of nn gains, and the characteristic polynomial det⁡(sI−A+BK)\det(sI - A + BK) has nn coefficients that depend linearly on them. Matching it to a desired polynomial ∏(s−pi)\prod (s - p_i) gives nn equations for nn unknowns: a unique solution exactly when the plant is controllable. Ackermann's formula writes it in closed form,

K=[0⋯01]C−1 Δd(A),Δd(s)=∏i=1n(s−pi)K = \begin{bmatrix} 0 & \cdots & 0 & 1 \end{bmatrix} \mathcal{C}^{-1}\, \Delta_d(A), \qquad \Delta_d(s) = \prod_{i=1}^{n} (s - p_i)

and ct.acker(A, B, poles) evaluates it; ct.place(A, B, poles) uses a numerically better algorithm and also handles several inputs. Use place in practice.

Reference scaling. State feedback alone regulates xx to zero. To follow rr with zero steady-state error, scale the reference so the DC gain from rr to yy is one:

N=−[ C (A−BK)−1B ]−1N = -\left[\,C\,(A - BK)^{-1} B\,\right]^{-1}

NN depends on the model being exact. A load disturbance or a model error leaves a steady-state error, just like a P controller. The cure is the same as in PID: integral action, here as an extra state x˙I=r−y\dot{x}_I = r - y added to the model and fed back like the others.

Choosing the poles

The specification picks the dominant pair through the second-order formulas of Second-Order Systems: overshoot ≤5 %\le 5\,\% needs ζ≥0.69\zeta \ge 0.69; settling within 50 ms50\ \text{ms} needs ζωn≥4/0.05=80 s−1\zeta\omega_n \ge 4/0.05 = 80\ \text{s}^{-1}; choosing ζ=0.7\zeta = 0.7, ωn=150 rad/s\omega_n = 150\ \text{rad/s} (ζωn=105 s−1\zeta\omega_n = 105\ \text{s}^{-1}) leaves a margin for the approximations. The other poles go further left, but not too far: every pole moved a long way from its open-loop position costs gain, and gain costs actuator effort and noise amplification. A good habit is to move only the poles you must and leave fast, well-damped ones near where they are.

-200 -100 100 -100 Re s Im s placed: -105 +/- j107 open loop: 0, -106 zeta = 0.7 lines, Re s = -80 off plot: -1894 (open), -2000 (placed)

Worked example: motor position control

Given: the motor of State-Space Models with the angle added as a state, x=[ θ, ω, ia ]Tx = [\,\theta,\ \omega,\ i_a\,]^T:

A=[0100−b/Jk/J0−k/La−Ra/La]=[0100−0.510 0000−20−2000],B=[001000],C=[100]A = \begin{bmatrix} 0 & 1 & 0 \\ 0 & -b/J & k/J \\ 0 & -k/L_a & -R_a/L_a \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 \\ 0 & -0.5 & 10\,000 \\ 0 & -20 & -2000 \end{bmatrix}, \quad B = \begin{bmatrix} 0 \\ 0 \\ 1000 \end{bmatrix}, \quad C = \begin{bmatrix} 1 & 0 & 0 \end{bmatrix}

Find: KK and NN for a dominant pair with ζ=0.7\zeta = 0.7, ωn=150 rad/s\omega_n = 150\ \text{rad/s}, third pole at −2000 s−1-2000\ \text{s}^{-1}; the step overshoot, the settling time and the largest voltage for a 1 rad1\ \text{rad} step.

Solve:

  • Open-loop eigenvalues: 00 (the angle integrates the speed), −106.1-106.1 and −1894.4 s−1-1894.4\ \text{s}^{-1}.
  • Desired: −ζωn±jωn1−ζ2=−105±j107.1-\zeta\omega_n \pm j\omega_n\sqrt{1 - \zeta^2} = -105 \pm j107.1, and −2000-2000, close to the fast electrical pole, so the current gain stays small.
  • Expected: overshoot about e−π⋅0.7/0.714=4.6 %e^{-\pi \cdot 0.7/0.714} = 4.6\,\%, settling about 4/105=38 ms4/105 = 38\ \text{ms} by the 4/σ4/\sigma rule.
  • At t=0+t = 0^+ the states are still zero, so u=Nru = N r: the reference scale is also the first voltage step. The code finds N=4.5 V/radN = 4.5\ \text{V/rad}, so a 1 rad1\ \text{rad} step asks for 4.5 V4.5\ \text{V}, inside the 12 V12\ \text{V} supply.

Check:

python · try it yourself
import numpy as np
import control as ct

Ra, La, k, J, b = 2.0, 1e-3, 0.02, 2e-6, 1e-6
A = np.array([[0, 1, 0], [0, -b / J, k / J], [0, -k / La, -Ra / La]])
B = np.array([[0], [0], [1 / La]])
C = np.array([[1, 0, 0]])
print("controllable:", np.linalg.matrix_rank(ct.ctrb(A, B)) == 3)

zeta, wn = 0.7, 150.0
wd = wn * np.sqrt(1 - zeta**2)
poles = [complex(-zeta * wn, wd), complex(-zeta * wn, -wd), -2000.0]
K = ct.place(A, B, poles)
Acl = A - B @ K
N = -1.0 / (C @ np.linalg.solve(Acl, B)).item()
print("K =", np.round(K, 4), f" N = {N:.3f} V/rad")
print("closed-loop poles:", np.round(np.sort_complex(np.linalg.eigvals(Acl)), 1))

cl = ct.ss(Acl, B * N, np.vstack([C, -K]), [[0], [N]])     # outputs: angle, voltage
t = np.linspace(0, 0.1, 10001)
y = ct.forced_response(cl, T=t, U=np.ones_like(t)).outputs
info = ct.step_info(ct.ss(Acl, B * N, C, 0), T=t)
print(f"overshoot {info['Overshoot']:.1f} %, 2 % settling {1e3 * info['SettlingTime']:.1f} ms, "
      f"max |voltage| {np.abs(y[1]).max():.2f} V")
controllable: True
K = [[4.5    0.0241 0.2095]]  N = 4.500 V/rad
closed-loop poles: [-2000.  +0.j   -105.-107.1j  -105.+107.1j]
overshoot 4.6 %, 2 % settling 40.4 ms, max |voltage| 4.50 V

The simulation gives 4.6 %4.6\,\% and 40.4 ms40.4\ \text{ms}: the 4/σ4/\sigma rule is an estimate, and the result is still inside the 50 ms50\ \text{ms} specification.

Integral action against a load

The camera mount has an unbalanced load torque of 1 mN⋅m1\ \text{mN} \cdot \text{m}, entering the speed equation as −TL/J-T_L/J. With u=−Kx+Nru = -Kx + Nr the angle ends short of the target. Adding the integral state xI=∫(r−θ) dtx_I = \int (r - \theta)\,dt and a fourth pole at −300 s−1-300\ \text{s}^{-1} removes the error:

python · try it yourself
import numpy as np
import control as ct

Ra, La, k, J, b = 2.0, 1e-3, 0.02, 2e-6, 1e-6
A = np.array([[0, 1, 0], [0, -b / J, k / J], [0, -k / La, -Ra / La]])
B = np.array([[0], [0], [1 / La]])
C = np.array([[1, 0, 0]])
E = np.array([[0], [-1 / J], [0]])                        # load torque input
wd = 150 * np.sqrt(1 - 0.7**2)
p3 = [complex(-105, wd), complex(-105, -wd), -2000.0]

K = ct.place(A, B, p3)
N = -1.0 / (C @ np.linalg.solve(A - B @ K, B)).item()
plain = ct.ss(A - B @ K, np.hstack([B * N, E]), C, 0)

Aa = np.block([[A, np.zeros((3, 1))], [-C, np.zeros((1, 1))]])   # x_I' = r - theta
Ba = np.vstack([B, [[0]]])
Ka = ct.place(Aa, Ba, p3 + [-300.0])
integ = ct.ss(Aa - Ba @ Ka, np.hstack([[[0], [0], [0], [1]], np.vstack([E, [[0]]])]),
              np.hstack([C, [[0]]]), 0)
print("Ka =", ", ".join(f"{v:.4g}" for v in Ka.ravel()))

t = np.linspace(0, 0.1, 10001)
U = np.vstack([np.ones_like(t), np.where(t >= 0.05, 1e-3, 0.0)])   # 1 rad step, load at 50 ms
for name, sys in (("N-scaled state feedback", plain), ("with integral state", integ)):
    th = np.atleast_2d(ct.forced_response(sys, T=t, U=U).outputs)[0]
    print(f"{name:24s}: angle at 50 ms {th[5000]:.4f} rad, at 100 ms {th[-1]:.4f} rad")
Ka = 17.77, 0.09042, 0.5095, -1350
N-scaled state feedback : angle at 50 ms 1.0014 rad, at 100 ms 0.9755 rad
with integral state     : angle at 50 ms 1.0066 rad, at 100 ms 1.0002 rad

Without the integrator the load pushes the angle 0.025 rad0.025\ \text{rad} (2.5 %) short of the target for good; with it the error is gone 50 ms50\ \text{ms} later, as with a PI controller. The price is a fourth state in the controller, one more pole to choose, and an integrator that can wind up when the drive saturates (Anti-Windup).

Guided lab: a position servo on the bench

Hand calculation. The worked example asks for at most 4.5 V4.5\ \text{V} for a 1 rad1\ \text{rad} step and settles in about 40 ms40\ \text{ms}. Your motor's kk, JJ and RaR_a differ: measure them first (Modelling a DC Motor), then rerun ct.place with your numbers.

Simulation. Change poles in the first program to ωn=300 rad/s\omega_n = 300\ \text{rad/s}: the voltage peak grows roughly with ωn2\omega_n^2 and soon exceeds the supply, so the real loop saturates and the linear design no longer holds.

What you would measure. Motor with an incremental encoder (e.g. 1000 lines, 4000 counts per revolution: 1.6 mrad1.6\ \text{mrad} resolution), an H-bridge driver from a 12 V12\ \text{V} current-limited supply (limit 2 A2\ \text{A}), a shunt for the current, and a microcontroller running the control law at 5–10 kHz5\text{–}10\ \text{kHz} (fast compared with the 2000 s−12000\ \text{s}^{-1} pole; see Sampled-Data Loops). The speed state comes from differentiating the encoder count, which is noisy at low speed: expect a measured overshoot within a few percent of the predicted 4.6 %4.6\,\% and a settling time within ±20 %\pm 20\,\%, mostly from friction and the estimated JJ.

Hazards and safe setup. Clamp the motor; limit the travel mechanically or in software; nothing loose on the shaft; set the supply current limit before enabling the drive; an encoder sign error turns negative feedback positive and the motor runs away at full speed, so test with a low voltage limit first.

Pitfalls

  • Placing poles far to the left "for speed": gains, voltage peaks and noise sensitivity grow quickly, and the unmodelled dynamics (driver bandwidth, sampling) bite.
  • Forgetting NN: state feedback alone regulates to zero, not to rr.
  • Relying on NN for accuracy under load: only integral action gives zero error for a constant disturbance.
  • Assuming all states are measured: usually they are not, and the missing ones come from an observer.

Practice

  1. A double integrator y¨=u\ddot{y} = u (A=[0100]A = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, B=[ 0, 1 ]TB = [\,0,\ 1\,]^T): find KK for closed-loop poles at −2±j2-2 \pm j2.
  2. What ζ\zeta and ωn\omega_n satisfy "overshoot at most 10 %, settling within 0.5 s0.5\ \text{s}" with the smallest ωn\omega_n?
  3. A pendulum balanced upright, linearised about the top (Linearisation), with a torque input scaled to an angular acceleration: θ¨=glθ+u\ddot{\theta} = \frac{g}{l}\theta + u, l=0.5 ml = 0.5\ \text{m}. Show that it is unstable and find KK for poles at −5±j5 s−1-5 \pm j5\ \text{s}^{-1}.
Answer
  1. A−BK=[01−k1−k2]A - BK = \begin{bmatrix} 0 & 1 \\ -k_1 & -k_2 \end{bmatrix}, characteristic polynomial s2+k2s+k1s^2 + k_2 s + k_1; desired (s+2)2+4=s2+4s+8(s + 2)^2 + 4 = s^2 + 4s + 8: K=[ 8, 4 ]K = [\,8,\ 4\,].
  2. 10 % overshoot: ζ=0.59\zeta = 0.59; ζωn≥4/0.5=8 s−1\zeta\omega_n \ge 4/0.5 = 8\ \text{s}^{-1} gives ωn≥13.5 rad/s\omega_n \ge 13.5\ \text{rad/s}.
  3. A=[0119.620]A = \begin{bmatrix} 0 & 1 \\ 19.62 & 0 \end{bmatrix} has eigenvalues ±4.43 s−1\pm 4.43\ \text{s}^{-1}: one in the right half-plane. With u=−k1θ−k2θ˙u = -k_1\theta - k_2\dot{\theta} the polynomial is s2+k2s+(k1−19.62)s^2 + k_2 s + (k_1 - 19.62); matching s2+10s+50s^2 + 10s + 50 gives K=[ 69.62, 10 ]K = [\,69.62,\ 10\,] (in s−2\text{s}^{-2} and s−1\text{s}^{-1}).

Test yourself

With full state feedback u=−Kxu = -Kx, the closed-loop poles are

  1. the eigenvalues of AA
  2. the eigenvalues of A−BKA - BK
  3. the zeros of C(sI−A)−1BC(sI - A)^{-1}B
  4. fixed by the plant

Arbitrary pole placement by state feedback is possible exactly when

  1. the plant is stable
  2. the plant is controllable
  3. the plant is observable
  4. D=0D = 0

Why does u=−Kx+Nru = -Kx + Nr leave a steady-state error under a constant load torque?

  1. NN is computed for the nominal model without the disturbance; there is no integrator
  2. KK is too small
  3. the observer is missing
  4. the poles are complex

In the motor example, what sets the voltage the drive applies at the instant of a reference step?

  1. KK times the final state
  2. the reference scale NN times the step
  3. the supply voltage always
  4. zero, because the integrator starts at zero