ECE 486 Control Systems
Lecture 19
State-Space Design
We finished our discussion of frequency domain design method in Lecture 17 and Lecture 18. In this lecture, we will pick up the introduction to state-space representation of a system in Lecture 2 and further introduce other basic notions of state-space control. We will talk about different state-space realizations of the same transfer function; several canonical forms of state-space systems and controllability matrix.
The state-space approach reveals internal system architecture for a given transfer function. And most importantly, the mathematical machinery is very different — there is a lot of use of linear algebra. As it stands in ECE 486, it is just a short introduction; ECE 515 would be a proper follow-up on theory of linear systems.
Important: Frequency-Domain versus State-Space
- About \(90\%\) of industrial controllers are designed using frequency-domain methods since PID is a popular architecture.
- About \(90\%\) of current research in systems and control is done in the state-space framework.
To be able to talk to control engineers and follow progress in the field, we need to know both methods and understand the connections between them.
A General State-Space Model
Recall from Lecture 2, we introduced state vector \(x\), input vector \(u\) and output vector \(y\),
\begin{align*} \text{state } x &= \left( \begin{matrix} x_1 \\ \vdots \\ x_n \end{matrix}\right) \in \RR^n, \\ \text{input } u &= \left( \begin{matrix} u_1 \\ \vdots \\ u_m \end{matrix}\right) \in \RR^m, \\ \text{output } y &= \left( \begin{matrix} y_1 \\ \vdots \\ y_p \end{matrix}\right) \in \RR^p. \end{align*}So a system representation can be written as
\begin{align*} \dot{x} &= Ax + Bu, \\ y &= Cx + Du, \end{align*}where
- \(A\) is the system matrix of size \(n \times n\);
- \(B\) is the input matrix of size \(n \times m\);
- \(C\) is the output matrix of size \(p \times n\); and
- \(D\) is the feed through matrix of size \(p \times m\).
From State-Space to Transfer Function
Let us derive the transfer function from \(u\) to \(y\) corresponding to the state-space model
\begin{align*} \dot{x} &= Ax + Bu, \\ y &= Cx + Du. \end{align*}In the scalar case where \(x,y,u \in \RR\), we took the Laplace transform. We can mimic the same strategy here when working with vectors. We apply Laplace transform component-wise.
Recall matrix-vector multiplication
\begin{align*} \dot{x}_i &= (Ax)_i + (Bu)_i \\ \tag{1} \label{d19_eq1} &= \sum^n_{j=1}a_{ij}x_j + \sum^m_{k=1}b_{ik}u_k, \\ y_\ell &= (Cx)_\ell + (Du)_\ell\\ \tag{2} \label{d19_eq2} &= \sum^n_{j=1}c_{\ell j}x_j + \sum^m_{k=1} d_{\ell k}u_k. \end{align*}Now we take the Laplace transform on both sides of Equation \eqref{d19_eq1}.
\begin{align*} \dot{x}_i &= \sum^n_{j=1}a_{ij}x_j + \sum^m_{k=1}b_{ik}u_k \\ &\qquad \qquad \downarrow {\mathscr L} \\ sX_i(s) - x_i(0) &= \sum^n_{j=1}a_{ij}X_j(s) + \sum^m_{k=1}b_{ik}U_k(s), \forall~ i = 1,\ldots,n. \end{align*}Reassemble these \(n\) equations in matrix-vector form, we have
\begin{align*} sX(s) - x(0) &= AX(s) + BU(s) \\ (sI-A)X(s) &= x(0) + BU(s) \\ \implies X(s) &= (sI-A)^{-1}x(0) + (sI-A)^{-1}BU(s), \end{align*}where \(I\) is the \(n\times n\) identity matrix.
By the same token, we derive the Laplace transform of \(y\) using Equation \eqref{d19_eq2}.
\begin{align*} y_\ell &= \sum^n_{j=1}c_{\ell j}x_j + \sum^m_{k=1} d_{\ell k}u_k \\ &\qquad \qquad \downarrow {\mathscr L} \\ Y_\ell(s) &= \sum^n_{j=1}c_{\ell j}X_j(s) + \sum^m_{k=1} d_{\ell k}U_k(s), \forall~ \ell = 1,\ldots,p. \end{align*}Reassemble these \(p\) equations in matrix-vector form, we have
\begin{align*} Y(s) &= CX(s) + DU(s) \\ &= C\left[ (sI-A)^{-1}x(0) + (sI-A)^{-1}BU(s)\right] + DU(s) \\ &= C(sI-A)^{-1}x(0) + \left[C(sI-A)^{-1}B + D\right]U(s). \end{align*}To find the input-output relationship, i.e., transfer function, we set the initial conditions to \(0\),
\begin{align*} Y(s) &= G(s)U(s), \, \text{where } G(s) = C(sI-A)^{-1}B + D, \end{align*}i.e., the transfer function from \(u\) to \(y\) associated with state-space model \((A,B,C,D)\) is
\[ G(s) = C(Is-A)^{-1}B + D. \tag{3} \label{d19_eq3} \]
Note that \(G(s)\) is composed of all four matrices that contain information about the state-space model.
Remarks:
- \(G(s)\) would be undefined if the \(n\times n\) matrix \(sI-A\) is singular or noninvertible, i.e., precisely when \(\det(sI-A) = 0\).
\(A\) is \(n\times n\), \(\det(sI-A)\) is a polynomial of degree \(n\), called the characteristic polynomial of \(A\).
\[ \det(sI-A) = \det \left( \begin{matrix} s-a_{11} & -a_{12} & \ldots & -a_{1n} \\ -a_{21} & s-a_{22} & \ldots & -a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ -a_{n1} & -a_{n2} & \ldots & s-a_{nn} \end{matrix} \right), \]
The roots of characteristic polynomial are the eigenvalues of \(A\).
- \(G(s)\) is open loop stable if all eigenvalues of \(A\) lie in the Left Half Plane.
Example 1: Consider the state-space model in Controllable Canonical Form (CCF)\(^*\)
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &= \underbrace{\left(\begin{matrix} 0 & 1 \\ -6 &-5\end{matrix}\right)}_{A}\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \underbrace{\left(\begin{matrix} 0 \\ 1\end{matrix}\right)}_{B} u, \\ y &= \underbrace{\left(\begin{matrix} 1 & 1 \end{matrix}\right)}_{C} \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right). \end{align*}Compute the transfer function from \(u\) to \(y\).
\(^*\) We will explain this terminology later.
Solution: This is a single-input, single-output (SISO) system with \(u,y \in \RR\) even though the state \(x\) is two-dimensional.
Here \(D = 0\) is a zero matrix. By our derivation for \(G(s)\) in Equation \eqref{d19_eq3} above,
\begin{align*} \tag{4} \label{d19_eq4} G(s) &= C(Is-A)^{-1}B, \hspace{2.5cm}\text{($D=0$)} \\ \text{ where }\, sI-A &= \left( \begin{matrix} s & -1 \\ 6 & s+5 \end{matrix}\right). \end{align*}To compute \((sI-A)^{-1}\), recall the inverse formula for \(2\times2\) matrix \(M\),
\begin{align*} M = \left( \begin{matrix} a & b \\ c & d \end{matrix}\right), \, \det M \neq 0 \quad \Longrightarrow \quad M^{-1} &= \frac{1}{\det M}\left( \begin{matrix} d & - b \\ -c & a \end{matrix}\right). \end{align*}Applying the formula, we get
\begin{align*} (sI-A)^{-1} &= \frac{1}{\det(sI-A)} \left( \begin{matrix} s+5 & 1 \\ -6 & s \end{matrix}\right) \\ &= \frac{1}{s^2 + 5s + 6} \left( \begin{matrix} s+5 & 1 \\ -6 & s \end{matrix}\right). \end{align*}Substitute \(B, C\) matrices, \(G(s)\) in Equation \eqref{d19_eq4} becomes
\begin{align*} G(s) &= C(sI-A)^{-1}B \\ &= \left(\begin{matrix} 1 & 1 \end{matrix}\right) \frac{1}{s^2 + 5s + 6} \left( \begin{matrix} s+5 & 1 \\ -6 & s \end{matrix}\right) \left(\begin{matrix} 0 \\ 1\end{matrix}\right) \\ &= \frac{1}{s^2 + 5s + 6} \left(\begin{matrix} 1 & 1 \end{matrix}\right) \left(\begin{matrix} 1 \\ s\end{matrix}\right) \\ &= \frac{s+1}{s^2 + 5s + 6}. \end{align*}The given state-space model in this example is called a realization of this resulting transfer function.
Further we notice the coefficients \(5\) and \(6\) in \(A\) matrix appear in reverse order in \(G(s)\).
State-Space Realizations of Transfer Functions
In the previous section, we computed the transfer function based off of given state-space model. Conversely, we can also realize a state-space model according to a transfer function.
Using the above example, say
\[ G(s) = \frac{s+1}{s^2 + \color{red}{5}s + \color{blue}{6}} \]
is given, then the state-space model
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &= \underbrace{\left(\begin{matrix} 0 & 1 \\ -\color{blue}{6} &-\color{red}{5}\end{matrix}\right)}_{A}\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \underbrace{\left(\begin{matrix} 0 \\ 1\end{matrix}\right)}_{B} u, \\ y &= \underbrace{\left(\begin{matrix} 1 & 1 \end{matrix}\right)}_{C} \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) \\ \end{align*}is one realization. At least in this example, information about the state-space model \((A,B,C)\) is contained in \(G(s)\).
Are there other realizations for such a given transfer function \(G(s)\)?
There are infinitely many. (They are the same up to a linear transform.)
For example, with the one realization that is already obtained,
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &= \underbrace{\left(\begin{matrix} 0 & 1 \\ -{6} &-{5}\end{matrix}\right)}_{A}\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \underbrace{\left(\begin{matrix} 0 \\ 1\end{matrix}\right)}_{B} u, \\ y &= \underbrace{\left(\begin{matrix} 1 & 1 \end{matrix}\right)}_{C} \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) \end{align*}consider a new state-space model with transposed \(A, B, C\) matrices
\begin{align*} \dot{x} &= \bar{A} x + \bar{B}u, \\ y &= \bar{C}x, \end{align*}where
\begin{align*} \bar{A} = A^T = \left( \begin{matrix} 0 & -6 \\ 1 & -5 \end{matrix}\right), \, \bar{B} = C^T = \left(\begin{matrix} 1 \\ 1 \end{matrix}\right), \, \bar{C} = B^T = \left( \begin{matrix} 0 & 1 \end{matrix}\right). \end{align*}This is a different state-space model but it is easy to check that \(G(s) = \bar{C}(sI-\bar{A})^{-1}\bar{B}\).
Indeed, we can prove the following claim.
Claim: The state-space model
\begin{align*} \dot{x} &= \bar{A} x + \bar{B}u, \\ y &= \bar{C}x, \end{align*}where
\begin{align*} \bar{A} = A^T, \, \bar{B} = C^T, \, \bar{C} = B^T \end{align*}has the same transfer function as the original model with \((A,B,C)\).
Proof: This is just a simple exercise of algebra. Indeed, for a single-input, single-out system,
\begin{align*} \bar{C}(sI-\bar{A})^{-1}\bar{B} &= B^T\left(sI - A^T\right)^{-1} C^T \\ &= B^T\left[(sI-A)^T\right]^{-1} C^T \\ &= B^T \left[\left(sI-A\right)^{-1}\right]^T C^T \\ &= \left[ C(sI-A)^{-1}B\right]^T \\ &= C(sI-A)^{-1}B. \end{align*}Therefore, by the above claim, for the state-space model in controller in Example 1, a state-space model is derived, called Observable Canonical Form (OCF).
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &= \left(\begin{matrix} 0 & -6 \\1 &-{5}\end{matrix}\right)\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \left(\begin{matrix} 1 \\ 1\end{matrix}\right) u, \\ y &= \left(\begin{matrix} 0 & 1 \end{matrix}\right) \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right). \end{align*}Yet another realization of \(G(s) = \dfrac{s+1}{s^2+5s+6}\) can be extracted from the partial fractions decomposition.
\begin{align*} G(s) &= \frac{s+1}{(s+2)(s+3)} \\ &= \frac{2}{s+3} - \frac{1}{s+2}. \tag{5} \label{d19_eq5} \end{align*}The interpretation of Equation \eqref{d19_eq5} is that we treat \(G(s)\) as the sum of two first order transfer functions, each of them can be realized by scalars in \((A, B, C)\) model.
This is called Modal Canonical Form (MCF) since different modes (by eigenvalues of \(A\)) are decoupled.
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &=\left(\begin{matrix} -3 & 0 \\0 &-{2}\end{matrix}\right)\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \left(\begin{matrix} 1 \\ 1\end{matrix}\right) u, \\ y &= \left(\begin{matrix} 2 & -1 \end{matrix}\right) \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right). \end{align*}It can be verified that it indeed gives the same transfer function as Controllable and Observable Canonical Forms do.
\begin{align*} C(Is-A)^{-1}B &= \left(\begin{matrix} 2 & -1 \end{matrix}\right) \left(\begin{matrix} s+3 & 0 \\0 &s+{2}\end{matrix}\right)^{-1} \left(\begin{matrix} 1 \\ 1\end{matrix}\right) \\ &= \left(\begin{matrix} 2 & -1 \end{matrix}\right) \left(\begin{matrix} \frac{1}{s+3} & 0 \\0 &\frac{1}{s+2}\end{matrix}\right) \left(\begin{matrix} 1 \\ 1\end{matrix}\right) \\ &= \left(\begin{matrix} 2 & -1 \end{matrix}\right) \left( \begin{matrix} \frac{1}{s+3} \\ \frac{1}{s+2}\end{matrix}\right) \\ &= \frac{2}{s+3}-\frac{1}{s+2}. \end{align*}Upshot: From the above discussion, we notice
- A given transfer function \(G(s)\) can be realized using infinitely many state-space models.
- Certain properties make some realizations preferable to others, e.g., controllable, observable, modal etc.
Controllability Matrix
Consider a single-input system with \(u \in \RR\), \(x \in \RR^n\).
\begin{align*} \dot{x} &= Ax + Bu, \\ y &= Cx. \end{align*}The Controllability Matrix is defined as
\begin{align*} {\cal C}(A,B) = \left[ B \, | \, AB \, | \, A^2 B \, | \, \ldots \, | \, A^{n-1}B \right]. \end{align*}Recall that \(A\) is \(n \times n\) and \(B\) is \(n \times 1\), so \({\cal C}(A,B)\) is \(n \times n\). The controllability matrix only involves \(A\) and \(B\), not \(C\).
We say that the above system is completely controllable if its controllability matrix \({\cal C}(A,B)\) is invertible.
This definition is only true for the single-input case. It can be generalized to the multiple-input case using the rank of controllability matrix \({\cal C}(A,B)\).
- As we will see later, if the system is completely controllable, then we may assign arbitrary closed loop poles by state feedback controller of the form \(u = -Kx\).
- Whether or not the system is controllable depends on its state-space realization.
Example 2: Computing the controllability matrix \({\cal C}(A,B)\) of the state-space model given in Example 1.
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &= \underbrace{\left(\begin{matrix} 0 & 1 \\ -{6} &-{5}\end{matrix}\right)}_{A}\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \underbrace{\left(\begin{matrix} 0 \\ 1\end{matrix}\right)}_{B} u, \\ y &= \underbrace{\left(\begin{matrix} 1 & 1 \end{matrix}\right)}_{C} \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right). \end{align*}Solution: Here \(x \in \RR^2\) and \(A \in \RR^{2 \times 2}\) \(\implies\) \({\cal C}(A,B) \in \RR^{2 \times 2}\).
\begin{align*} {\cal C}(A,B) &= [B\, | \, AB], \\ \text{ where }\, AB &= \left(\begin{matrix} 0 & 1 \\ -{6} &-{5}\end{matrix}\right)\left(\begin{matrix} 0 \\ 1\end{matrix}\right) = \left(\begin{matrix}1 \\ -5\end{matrix}\right) \\ \implies {\cal C}(A,B) &=\left( \begin{matrix} 0 & 1 \\ 1 &-5\end{matrix}\right). \end{align*}Check system controllability by testing the invertibility of \(\mathcal{C}(A, B)\),
\begin{align*} \det {\cal C} = -1 \neq 0 \implies \text{system is completely controllable.} \end{align*}Controllable Canonical Form
A single-input state-space model
\begin{align*} \dot{x} &= Ax + Bu, \\ y &= Cx \end{align*}is said to be in Controller Canonical Form (CCF) if the matrices \(A,B\) are of the form
\begin{align*} A &= \left( \begin{matrix} 0 & 1 & 0 & \ldots & 0 & 0 \\ 0 & 0 & 1 & \ldots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \ldots & 0 & 1 \\ * & * & * & \ldots & * & * \end{matrix} \right), \, B = \left( \begin{matrix} 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{matrix}\right) \end{align*}Note that a state-space model in CCF is always completely controllable.
The proof of this for \(n > 2\) uses the Jordan canonical form, we shall not worry about this. Interested readers can follow the underlined link.
CCF with Arbitrary Zeros
In our example, we had \(G(s) = \dfrac{s+1}{s^2 + 5s + 6}\) with a minimum-phase zero at \(z=-1\).
Let’s consider a general zero location \(s=z\),
\begin{align*} G(s) = \frac{s-z}{s^2 + 5s+6}. \end{align*}This gives us a CCF realization
\begin{align*} \left(\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \end{matrix}\right) &= \underbrace{\left(\begin{matrix} 0 & 1 \\ -{6} &-{5}\end{matrix}\right)}_{A}\left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right) + \underbrace{\left(\begin{matrix} 0 \\ 1\end{matrix}\right)}_{B} u, \\ y &= \underbrace{\left(\begin{matrix} -z & 1 \end{matrix}\right)}_{C} \left(\begin{matrix} x_1 \\ x_2 \end{matrix}\right). \end{align*}Since \(A,B\) are the same as before as in Example 2, \({\cal C}(A,B)\) is the same \(\implies\) the system is still completely controllable. (Zeros only enter \(C\) matrix which is not involved in controllability matrix.)
Upshot: A system state-space model in CCF is controllable for any locations of the zeros.