๐ Documents (GitHub)
ยฉ๏ธ License CC BY 4.0
๐ | Code | ๐ | Worked Example |
๐ | Graph | ๐งฉ | Exercise |
๐ท๏ธ | Definition | ๐ป | Numerical Method |
๐ | Theorem | ๐งฎ | Analytical Method |
๐ | Remark | ๐ง | Theory |
โน๏ธ | Information | ๐๏ธ | Hint |
โ ๏ธ | Warning | ๐ | Solution |
When the system
\[ \dot{x} = A x, \; x \in \mathbb{R}^n \]
is not asymptotically stable at the origin, maybe there are some inputs \(u \in \mathbb{R}^m\) such that
\[ \dot{x} = A x + Bu \]
that we can use to stabilize asymptotically the system?
We search for \(u\) as a linear feedback:
\[ u(t) = -K x(t) \]
for some \(K \in \mathbb{R}^{m \times n}\).
In this scheme
โ ๏ธ The full system state \(x(t)\) must be measured.
๐ท๏ธ This information is then fed back into the system.
๐ท๏ธ The feedback closes the loop.
When
\[ \begin{array}{rcl} \dot{x} &=& Ax + B u \\ u &=& - K x \end{array} \]
the state \(x \in \mathbb{R}^n\) evolves according to:
\[ \dot{x} = (A - B K) x \]
The closed-loop system is asymptotically stable iff every eigenvalue of the matrix
\[ A - B K \]
is in the open left-hand plane.
Multisets remember the multiplicity of their elements. Itโs convenient to describe the spectrum of matrices:
\[ A := \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 2 \end{array} \right] \, \Rightarrow \, \sigma(A) = \{1, 1, 2\} \]
\[ 0 \not \in \sigma(A), \, 1 \in \sigma(A), \, 1 \in^2 \sigma(A), \, 1 \not \in^3 \sigma(A) \]
\[ 2 \in \sigma(A), \, 2 \not \in^2 \sigma(A) \]
The system
\[ \dot{x} = A x + B u, \, x \in \mathbb{R}^n, \,u\in\mathbb{R}^p \]
is controllable.
\(\Lambda\) is a symmetric multiset of \(n\) complex numbers:
\[ \Lambda = \{\lambda_1, \dots, \lambda_n\} \subset \mathbb{C} \; \mbox{ and } \; \lambda \in^k \Lambda \, \Rightarrow \, \overline{\lambda} \in^k \Lambda. \]
\(\Rightarrow\) There is a matrix \(K \in \mathbb{R}^{n \times m}\) such that
\[ \sigma(A - B K) = \Lambda. \]
Consider the double integrator \(\ddot{x} = u\)
\[ \frac{d}{dt} \left[\begin{array}{c} x \\ \dot{x} \end{array}\right] = \left[\begin{array}{cx} 0 & 1 \\ 0 & 0\end{array}\right] \left[\begin{array}{c} x \\ \dot{x} \end{array}\right] + \left[\begin{array}{c} 0 \\ 1 \end{array}\right] u \]
(in standard form)
โ The place_poles
function rejects eigenvalues whose
multiplicity is higher than the rank of \(B\).
In the previous example, \(\mbox{rank}\, B = 1\), so
โ poles = [-1, -1]
wonโt work.
โ๏ธ poles = [-1, -2]
will.
Consider the system with dynamics
\[ \begin{array}{ccr} \dot{x}_1 &=& x_1 - x_2 + u \\ \dot{x}_2 &=& - x_1 + x_2 + u \end{array} \]
We apply the control law
\[ u = -k_1 x_1 - k_2 x_2. \]
Can we assign the poles of the closed-loop system freely by a suitable choice of \(k_1\) and \(k_2\)?
Explain this result.
\[ \begin{split} A - B K &= \left[ \begin{array}{rr} 1 & -1 \\ -1 & 1 \end{array} \right] - \left[ \begin{array}{r} 1 \\ 1 \end{array} \right] \left[ \begin{array}{rr} k_1 & k_2 \end{array} \right] \\ &= \left[ \begin{array}{rr} 1-k_1 & -1-k_2 \\ -1-k_1 & 1-k_2 \end{array} \right] \end{split} \]
\[ \begin{split} \det A- BK &= \det \left( \left[ \begin{array}{rr} s - 1+k_1 & 1+k_2 \\ 1+k_1 & s-1+k_2 \end{array} \right] \right) \\ &= (s - 1+k_1)(s-1+k_2) - (1+k_1)(1+k_2) \\ &= s^2 + (k_1+k_2) s - 2 (k_1 + k_2) \end{split} \]
\[ \begin{split} \sigma(A - BK) &= \{ \lambda_1, \lambda_2 \} \\ &= \{\lambda \in \mathbb{C} \, | \, s^2 + (k_1+k_2) s - 2 (k_1 + k_2) = 0\}. \end{split} \]
Since the characteristic polynomial is also \[ (s-\lambda_1)(s-\lambda_2) \] we get \[ k_1 + k_2 = - \lambda_1 - \lambda_2, \; -2 (k_1 + k_2) = \lambda_1 \lambda_2 \]
Thus we have
\[ \lambda_1 \lambda_2 = 2 (\lambda_1 + \lambda_2) \Rightarrow \lambda_2 = \frac{2\lambda_1}{\lambda_1 - 2} \]
and both poles cannot be assigned freely; for example if we select \(\lambda_1 =1\), we end up with \(\lambda_2 = -2\).
We have not checked the assumptions of ๐ Pole Assignment yet.
The commandability matrix is \[ \left[B, AB \right] = \left[ \begin{array}{rr} 1 & 0 \\ 1 & 0 \end{array} \right] \] whose rank is \(1 < 2\).
Since the system is not controllable, pole assignment may fail and it does here.
Consider the pendulum with dynamics:
\[ m \ell^2 \ddot{\theta} + b \dot{\theta} + mg \ell \sin \theta = u \]
Numerical Values:
\[ m = 1.0, \, \ell = 1.0, \, b = 0.1,\, g = 9.81 \]
Compute the linearized dynamics of the system around the equilibrium \(\theta=\pi\) and \(\dot{\theta} = 0\) (\(u=0\)).
Design a control law \[ u = -k_{1} (\theta - \pi) - k_{2} \dot{\theta} \] such that the closed-loop linear system is asymptotically stable, with a time constant equal to \(10\) sec.
Simulate this control law on the nonlinear systems when \(\theta(0) = 0.9 \pi\) and \(\dot{\theta}(0) = 0\).
Let \(\Delta \theta = \theta - \pi\), \(\omega = \dot{\theta}\), \(\Delta \omega = \omega\), \(\Delta u = u\).
We notice that \[ \begin{split} \sin \theta &= \sin (\pi + \Delta \theta) \\ &= -\sin \Delta \theta \\ &\approx -\Delta \theta \end{split} \]
The system dynamics can be approximated around \((\theta,\omega) = (\pi , 0)\) by
\[ (d/dt) \Delta \theta = \Delta \omega \] and \[ m \ell^2 (d/dt) \Delta \omega + b \Delta \omega - mg \ell \Delta \theta = \Delta u. \]
or in standard form
\[ \frac{d}{dt} \left[ \begin{array}{c} \Delta \theta \\ \Delta \omega \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ g / \ell & - b / (m \ell^2) \end{array} \right] \left[ \begin{array}{c} \Delta \theta \\ \Delta \omega \end{array} \right] + \left[ \begin{array}{c} 0 \\ 1 / (m \ell^2) \end{array} \right] \Delta u \]
Consider the dynamics:
\[ \begin{array}{rcl} m_1 \ddot{x}_1 & = & -k_1 x_1 - k_2 (x_1 - x_2) - b_1 \dot{x}_1 \\ m_2 \ddot{x}_2 & = & -k_2 (x_2 - x_1) - b_2 \dot{x}_2 + u \end{array} \]
Numerical values: \[ m_1 = m_2 = 1, \; k_1 = 1, k_2 = 100, \; b_1 = 2, \; b_2 = 20 \]
Compute the poles of the system.
Is the origin asymptotically stable?
Use a linear feedback to:
kill the oscillatory behavior of the solutions,
โspeed upโ the dynamics.
Let \(v_1 = \dot{x}_1\), \(v_2 = \dot{x}_2\). With the state \((x_1, v_1, x_2, v_2)\):
\[ A = \left[ \begin{array}{cccc} 0 & 1 & 0 & 0 \\ -(k_1+k_2)/m_1& -b_1/m_1& k_2/m_1& 0 \\ 0 & 0 & 0 & 1 \\ k_2/m_2& 0 & -k_2/m_2 & -b_2/m_2\\ \end{array} \right] \]
\[ B = \left[ \begin{array}{c} 0 \\ 0 \\ 0 \\ 1/m_2 \end{array} \right] \]
>>> eigenvalues
array([-15.64029062 +0.j ,
-3.15722141+11.45767938j,
-3.15722141-11.45767938j,
-0.04526657 +0.j ])
Since all eigenvalues have a negative real part, the double-spring system is asymptotically stable.
figure()
x = [real(s) for s in eigenvalues]
y = [imag(s) for s in eigenvalues]
plot(x, y, "kx")
plot(0.0, 0.0, "k.")
gca().set_aspect(1.0)
title("Spectrum of $A$"); grid(True)
>>> eigenvalues
array([-15.64029062 +0.j ,
-3.15722141+11.45767938j,
-3.15722141-11.45767938j,
-1. +0.j ])
figure()
x = [real(s) for s in eigenvalues]
y = [imag(s) for s in eigenvalues]
plot(x, y, "kx")
plot(0.0, 0.0, "k.")
gca().set_aspect(1.0)
title("Spectrum of $A - B K$"); grid(True)
>>> eigenvalues
array([-15.64029062+0.j,
-12.5 +0.j,
-11.11111111+0.j,
-10. +0.j])
figure()
x = [real(s) for s in eigenvalues]
y = [imag(s) for s in eigenvalues]
plot(x, y, "kx")
plot(0.0, 0.0, "k.")
ylim(-12, 12)
gca().set_aspect(1.0)
title("Spectrum of $A - B K$"); grid(True)