%\setcounter{chapter}{1}
\chapter{Controller Design for Linear Systems}
In this chapter we discuss methods for a feedback controller design for linear systems. The design process involves three steps. The first step is the design of a state-feedback control law. In this step we assume that we have all states available to us for feedback purposes. In general, this may not be the case. The assumption that all the states are available allows us to proceed with the state-feedback control law design. We then proceed with the second step that involves the design of an estimator, also referred to as an observer of the state vector. The estimator should use only the input and output of the plant to be controlled to generate an estimate of the plant state. The last step is to combine the first two steps in that the control law, designed in the first step, uses the state estimate instead of the true state vector. The result of this step is a combined controller-estimator compensator. In the next section we discuss the problem of designing a linear state-feedback control law.

\section{Linear State-Feedback Control}
The linear state-feedback control law, for a system modeled by $\dot{\b x}=\b A\b x+\b B\b u$, is the feedback of a linear combination of all the state variables, and has the form
\[
\b u=-\b K\b x,
\]
where $\b K \in \mb{\Bb R}^{m \times n}$ is a constant matrix. The closed-loop system then is
\[
\dot{\b x}=\left( \b A-\b B\b K \right)\b x.
\]
The poles of the closed-loop system are the roots of the characteristic equation
\[
\det\left(s\b I_n-\b A+\b B\b K\right)=0.
\]
The linear state-feedback control law design consists of selecting the gains
\[
k_{ij},\quad i=1,2,\ldots,m,\quad j=1,2,\ldots,n,
\]
so that the roots of the closed-loop characteristic equation
\[
\det\left(s\b I_n-\b A+\b B\b K\right)=0
\]
are in desirable locations in the complex plane. We assume that a designer has made the selection of the desired poles of the closed-loop system and they are:
\[
s_1,s_2,\ldots,s_n.
\]
The desired closed-loop poles can be real or complex. If they are complex, then they must come in complex conjugate pairs. This is because we use only real gains $k_{ij}$. Having selected the desired closed-loop poles we can form the desired closed-loop characteristic polynomial $\alpha_c(s)$. It has the form:
\begin{eqnarray*}
\alpha_c(s) &=& (s-s_1)(s-s_2)\cdots(s-s_n)\\
&=& s^n + \alpha_{n-1}s^{n-1}+\cdots+\alpha_1s+\alpha_0.
\end{eqnarray*}
Our goal is to select a feedback matrix $\b K$ such that
\[
\det\left(s\b I_n-\b A+\b B\b K\right)=s^n + \alpha_{n-1}s^{n-1}+\cdots+\alpha_1s+\alpha_0.
\]
The above problem is also referred to as the {\em pole placement\/} problem. We first discuss the pole placement problem for the single-input plants. In this case $\b K=\b k\in \mb{\Bb R}^{1\times n}$. The solution to the problem is easily obtained if the pair $(\b A,\b b)$ is already in the controller companion form. In such a case we have
\[
\b A-\b b\b k =\left[\begin{array}{cccccc}
0 & 1 & 0 & \cdots & 0 & 0\\
0 & 0 & 1 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& {}& \vdots\\
0 & 0 & 0 & \cdots & 0 & 1\\
-a_0-k_1 & -a_1-k_2 & -a_2-k_3 & \cdots & -a_{n-2}-k_{n-1}& -a_{n-1}-k_n
\end{array}\right]. 
\]
Hence, the desired gains are
\begin{eqnarray*}
k_1 &=& \alpha_0-a_0,\\
k_2 &=& \alpha_1-a_1,\\
{}&\vdots&{}\\
k_n &=& \alpha_{n-1}-a_{n-1}.
\end{eqnarray*}
If the pair $(\b A,\b b)$ is not in the controller companion form, we first transform it into the companion form, and then compute the gain vector $\tilde{\b k}$ such that
\[
\det\left(s\b I_n-\tilde{\b A}+\tilde{\b b}\tilde{\b k}\right)=s^n + \alpha_{n-1}s^{n-1}+\cdots+\alpha_1s+\alpha_0.
\]
Thus,
\[
\tilde{\b k}=\left[\begin{array}{cccc}
\alpha_0-a_0 & \alpha_1-a_1 & \cdots & \alpha_{n-1}-a_{n-1}
\end{array}\right].
\]
Then,
\[
\b k=\tilde{\b k}\b T,
\]
where $\b T$ is the transformation that brings the pair $(\b A,\b b)$ into the controller companion form.

We can represent the above formula for the gain matrix in an alternative way. For this note that
\begin{eqnarray*}
\tilde{\b k}\b T &=& \left[\begin{array}{cccc}
\alpha_0-a_0 & \alpha_1-a_1 & \cdots & \alpha_{n-1}-a_{n-1}
\end{array}\right]\left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\vdots\\
\b q_1\b A^{n-1}
\end{array}\right]\\
&=& \b q_1\left( \alpha_0 \b I_n+\alpha_1\b A+\cdots +\alpha_{n-1}\b A^{n-1}\right)\\
&{}&-\b q_1\left( a_0 \b I_n+a_1\b A+\cdots +a_{n-1}\b A^{n-1}\right).
\end{eqnarray*}
By the Cayley-Hamilton theorem
\[
\b A^n=-\left( a_0\b I_n+a_1\b A+\cdots+a_{n-1}\b A^{n-1} \right).
\]
Hence,
\[
\b k=\b q_1 \alpha_c\left( \b A \right).
\]
The above expression for the gain row vector was proposed by Ackermann in 1972, and is now referred to as {\em Ackermann's formula} for pole placement.

We now generalize the above pole placement algorithm to the case of multi-input systems. If the pair $(\b A,\b B)$ is already in the controller companion form, then we may proceed as follows. First, represent the matrix $\b B$ as
\begin{eqnarray*}
\left[\begin{array}{ccccc}
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
1 & x & x& x& x\\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0 & 1 & x& x& x\\ \hline
\vdots & {} & {} & {}& \vdots \\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0& 0 & 0& 0& 1
\end{array}\right]&=&\left[\begin{array}{ccccc}
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
1 & 0 & 0& 0& 0\\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0 & 1 & 0& 0& 0\\ \hline
\vdots & {} & {} & {}& \vdots \\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0& 0 & 0& 0& 1
\end{array}\right]\left[\begin{array}{ccccc}
1 & x & \cdots & x & x\\
0 & 1 & \cdots & x & x\\
\vdots & {} & \ddots & {} & \vdots\\
0 & 0 & \cdots & 1 & x\\
0 & 0 & \cdots & 0 & 1
\end{array}\right]\\
&=& \hat{\b B}\b \Gamma.
\end{eqnarray*}
Next, let
\[
\hat{\b K}=\b \Gamma \b K.
\]
Notice that
\[
\hat{\b B}\hat{\b K}=\left[\begin{array}{ccccc}
0 & 0 & \cdots & 0 & 0\\
0 & 0 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
\hat{k}_{11} & \hat{k}_{12} & \cdots & \hat{k}_{1\,n-1}& \hat{k}_{1n}\\ \hline
0 & 0 & \cdots & 0 & 0\\
0 & 0 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
\hat{k}_{21} & \hat{k}_{22} & \cdots & \hat{k}_{2\,n-1}& \hat{k}_{2n}\\ \hline
\vdots & {} & {}& {}& \vdots\\ \hline
0 & 0 & \cdots & 0 & 0\\
0 & 0 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
\hat{k}_{m1} & \hat{k}_{m2} & \cdots & \hat{k}_{m\,n-1}& \hat{k}_{mn}
\end{array}\right],
\]
that is, the nonzero rows in the product $\hat{\b B}\hat{\b K}$ match the nonzero rows of the matrix $\b A$ in the controller companion form. We can then, for example, select the gains $k_{ij}$, $i=1,2,\ldots,m$, $j=1,2,\ldots,n$, so that
\begin{eqnarray*}
\b A-\b B\b K &=& \b A-\hat{\b B}\hat{\b K}\\
&=&\left[\begin{array}{cccccc}
0 & 1 & 0 & \cdots & 0 & 0\\
0 & 0 & 1 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& {}& \vdots\\
0 & 0 & 0 & \cdots & 0 & 1\\
-\alpha_0 & -\alpha_1 & -\alpha_2 & \cdots & -\alpha_{n-2}& -\alpha_{n-1}
\end{array}\right], 
\end{eqnarray*}
where
\[
\b K=\b \Gamma^{-1}\hat{\b K}.
\]
If the pair $(\b A, \b B)$ is not in the controller companion form, we first transform it into this form, then compute the gain matrix
\[
\tilde{\b K}=\b \Gamma^{-1}\hat{\b K}
\]
that allocates the closed-loop poles into the desired locations for the pair $(\b A, \b B)$ in the controller form. The gain matrix $\b K$ that allocates the closed-loop poles into the prespecified locations for the pair $(\b A, \b B)$ in the original coordinates is then given by
\[
\b K=\b \Gamma^{-1}\hat{\b K}\b T,
\]
where $\b T$ is the transformation matrix that brings the pair $(\b A, \b B)$ into the controller companion form.
\begin{example}\rm
For the pair
\[
\b A=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
1 & 0 & 2 & 0\\
0 & 1 & 3 & 0\\
0 & 0 & -21 & 5
\end{array}\right],\quad \b B=\left[\begin{array}{cc}
1 & 0\\
0 & 0\\
0 & 0\\
0 & 1
\end{array}\right],
\]
we will use its controller companion form to find the matrix $\b K\in \mb{\Bb R}^{2\times4}$ so that closed-loop poles are located at
\[
-2,-3+j,-3-j,-4.
\]

We first transform the pair $(\b A,\b B)$ into its controller companion form. We begin by forming the controllability matrix
\[
\left[\begin{array}{cccccc}
\b b_1, & \b b_2, & \b A\b b_1, & \b A\b b_2, & \b A^2\b b_1,&\cdots
\end{array}\right]=\left[\begin{array}{cccccc}
1& 0 & 0 & 0 & 0 &\cdots\\
0 & 0 & 1 & 0 & 0 & \cdots\\
0 & 0 & 0 & 0 & 1 & \cdots\\
0 & 1 & 0 & 5 & 0 & \cdots
\end{array}\right].
\]
We then select, proceeding from left to right, the first four linearly independent columns from the above controllability matrix. We obtain
\[
\left[\begin{array}{cccc}
\b b_1, & \b b_2, & \b A\b b_1, & \b A^2\b b_1
\end{array}\right].
\]
Thus, the controllability indices are $d_1=3$ and $d_2=1$. We rearrange the above columns and form the matrix $\b L$ of the form
\begin{eqnarray*}
\b L &=& \left[\begin{array}{cccc}
\b b_1, & \b A\b b_1, & \b A^2\b b_1, & \b b_2
\end{array}\right]\\
&=& \b I_4\\
&=& \b L^{-1}.
\end{eqnarray*}
The two row vectors that we need in constructing the transformation are
\begin{eqnarray*}
\b q_1 &=& \left[\begin{array}{cccc}
0 & 0 & 1 & 0
\end{array}\right],\\
\b q_2 &=& \left[\begin{array}{cccc}
0 & 0 & 0 & 1
\end{array}\right].
\end{eqnarray*}
The transformation matrix is
\begin{eqnarray*}
\b T&=& \left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\b q_1\b A^2\\
\b q_2
\end{array}\right]=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
0 & 1 & 3 & 0\\
1 & 3 & 11 & 0\\
0 & 0 & 0 & 1
\end{array}\right].
\end{eqnarray*}
The pair $(\b A,\b B)$ in the new coordinates has the form
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{ccc|c}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
1 & 2 & 3 & 0\\ \hline
-21 & 0 & 0 & 5
\end{array}\right],
\]
and
\[
\tilde{\b B}=\b T\b B=\left[\begin{array}{cc}
0 & 0\\
0 & 0\\
1 & 0\\ \hline
0 & 1
\end{array}\right].
\]
The desired closed-loop characteristic polynomial is
\begin{eqnarray*}
\alpha_c(s) &=& (s+2)(s+3-j)(s+3+j)(s+4)\\
&=& s^4+12s^3+54s^2+108s+80.
\end{eqnarray*}
Our goal is to find $\tilde{\b K}$ such that
\[
\tilde{\b A}-\tilde{\b B}\tilde{\b K}=\left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1\\
-80 & -108 & -54 & -12
\end{array}\right].
\]
Note that $\b \Gamma = \b I_2$. Therefore,
\[
\tilde{\b K}=\left[\begin{array}{cccc}
1 & 2 & 3 & -1\\
59 & 108& 54 & 17
\end{array}\right],
\]
and thus
\begin{eqnarray*}
\b K &=& \tilde{\b K}\b T\\
&=& \left[\begin{array}{cccc}
3 & 11 & 40 & -1\\
54 & 270 & 977 & 17
\end{array}\right].
\end{eqnarray*}
\end{example}

The above algorithm for pole placement for multi-input systems is of more of a theoretical value rather than being practical. This algorithm is not well suited for numerical implementations because the transformation of a given pair $(\b A, \b B)$ into the controller companion form suffers from poor numerical properties. For a discussion of pole placement numerically stable algorithms for multi-input systems we refer the reader to Jamshidi, Tarokh, and Shafai~\cite{jamshidi92}.


Unlike in the single-input case, a solution to the pole placement problem for a multi-input system is not unique. Therefore, one can use the remaining degrees of freedom to achieve secondary goals. We discuss a method for constructing a linear state-feedback control law that allocates the closed-loop poles into prespecified locations, and at the same time minimizes a quadratic performance index, in a subsequent chapter.

Using the results of the above discussion of the pole placement problem we can state and prove yet another equivalent condition for controllability.
\begin{thm}
\label{thm:pp}
The pole placement problem is solvable for all choices of $n$ desired closed-loop poles, symmetric with respect to the real axis if, and only if, the given pair $(\b A, \b B)$ is controllable.
\end{thm}
{\bf Proof} \quad The proof of necessity ($\Leftarrow$) follows immediately from the above discussion. Indeed, the pair $(\b A, \b B)$ is controllable if, and only if, it can be transformed into the controller canonical form. Once the transformation is performed we can easily solve the pole placement problem for the given set of desired closed-loop poles, symmetric with respect to the real axis. We then transform back the pair $(\b A, \b B)$ and the gain matrix into the original coordinates. Since the similarity transformation does not affect neither controllability nor the characteristic polynomial, the eigenvalues of $\b A-\b B\b K$ are precisely the desired prespecified closed-loop poles. This completes the proof of necessity part.

We use proof by contraposition to prove sufficiency part ($\Rightarrow$) of the Theorem. We assume that the pair $(\b A, \b B)$ is uncontrollable. By Theorem~\ref{thm_decomp} there is a similarity transformation $\b z=\b T\b x$ such that the pair $(\b A,\b B)$ in the new coordinates has the form
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{cc}
\b A_1 & \b A_2\\
\b 0 & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\
\b 0
\end{array}\right],
\]
where the pair $\left(\b A_1,\b B_1\right)$ is controllable, $\b A_1 \in \mb{\Bb R}^{r\times r}$, and $\b B_1 \in \mb{\Bb R}^{r\times m}$. Let
\[
\b u=-\tilde{\b K}\b z=-\left[\begin{array}{cc}
\b K_1 & \b K_2
\end{array}\right]\b z,
\]
where $\b K_1 \in \mb{\Bb R}^{m \times r}$ and $\b K_2 \in \mb{\Bb R}^{m \times (n-r)}$. Then,
\[
\tilde{\b A}-\tilde{\b B}\tilde{\b K}=\left[\begin{array}{cc}
\b A_1-\b B_1\b K_1 & \b A_2-\b B_1\b K_2\\
\b 0 & \b A_4
\end{array}\right].
\]
Note that the uncontrollable portion of the system is not affected by the state-feedback, that is, the eigenvalues of $\b A_4$ cannot be allocated. Hence, the pole placement problem cannot be solved if the pair $(\tilde{\b A}, \tilde{\b B})$, or equivalently the pair $(\b A, \b B)$, is uncontrollable. The proof of the sufficiency part of the Theorem is completed.\\
\hspace*{5.5in} $\Box$

For an alternative proof of this important result the reader may consult Wonham~\cite{wonham67}.

\section{State Estimators}
In the previous section we presented algorithms for solving pole placement problem using linear state-feedback control law. To implement such a control law we need availability of all the state variables. Often, this requirement is not met, either because measuring of all the state variables would require excessive number of sensors, or because the state variables are not accessible to direct measurement. Instead, only a subset of state variables or their combination may be available. To implement the control law constructed in the previous section we will use estimates of state variables rather than the true states. We now discuss the problem of constructing state estimators. We present two types of state estimators. First, a full-order state estimator will be discussed. Much of the literature refers to estimators as ``observers''. However, we agree with Franklin and Powell~\cite[page 139]{franklin80} that estimator is much more descriptive in its function because observer implies a direct measurement.

\subsection{Full-Order Estimator}
We now discuss the problem of constructing a full-order state estimator for dynamic systems modeled by
\begin{eqnarray*}
\dot{\b x}(t) &=& \b A\b x(t)+\b B\b u(t)\\
\b y(t) &=& \b C\b x(t),
\end{eqnarray*}
where $\b C \in \mb{\Bb R}^{p \times n}$, $p \le n$. We assume that the pair $(\b A, \b C)$ is observable. We wish to implement a control law $\b u(t)=-\b K\b x(t)$. But the state vector is not available for measurement. Only the output vector $\b y$ is. Our goal is to construct a dynamic system that will estimate the state vector $\b x$ based on the plant input $\b u$ and the plant output $\b y$. One could consider constructing a model of the plant dynamics and connecting the resulting dynamic system, referred to as an open-loop estimator, as in Figure~\ref{fig:op_esti}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/op_esti.bmp x=4in y=3in}
\caption{Open-loop estimator}
\label{fig:op_esti}
\end{figure}
This open-loop estimator is described by
\[
\dot{\tilde{\b x}}(t)=\b A \tilde{\b x}(t)+\b B\b u(t),
\]
where $\tilde{\b x}(t)$ is the estimate of $\b x(t)$. Let
\[
\b e(t)=\tilde{\b x}(t)-\b x(t)
\]
be the estimation error. Then, the dynamics of the estimation error are described by
\begin{eqnarray*}
\dot{\b e}(t) &=& \dot{\tilde{\b x}}(t)-\dot{\b x}(t)\\
&=& \b A \b e(t),
\end{eqnarray*}
with the initial estimation error
\[
\b e(0)=\tilde{\b x}(0)-\b x(0).
\]
If the eigenvalues of the matrix $\b A$ are in the open left-hand plane, then the error converges to zero. However, we have no control over the convergence rate. Furthermore, the matrix $\b A$ does not have to have its all eigenvalues in the open left-hand plane. Thus, the open-loop estimator is impractical. We modify this estimator by adding a feedback term to it. The resulting structure, depicted in Figure~\ref{fig:cl_esti}, is called the closed-loop estimator, or the {\em Luenberger observer\/}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/cl_esti.bmp x=4in y=3in}
\caption{Closed-loop estimator}
\label{fig:cl_esti}
\end{figure}
The dynamics of the closed-loop estimator are described by
\[
\dot{\tilde{\b x}}(t)=\b A \tilde{\b x}(t)+\b B\b u(t)+\b L\left(\b y(t)-\b C\tilde{\b x}(t)\right),
\]
and the dynamics of the estimation error are governed by
\begin{eqnarray*}
\dot{\b e}(t)&=& \dot{\tilde{\b x}}(t)-\dot{\b x}(t)\\
&=&\left( \b A-\b L\b C\right)\b e(t),\quad \b e(0)=\tilde{\b x}(0)-\b x(0).
\end{eqnarray*}
The pair $(\b A,\b C)$ is observable if, and only if, the dual pair $(\b A^T, \b C^T)$ is reachable, equivalently, controllable. By assumption, the pair $(\b A, \b C)$ is observable, and therefore the pair $(\b A^T,\b C^T)$ is controllable. By Theorem~\ref{thm:pp} we can solve the pole placement problem for the dual pair $(\b A^T,\b C^T)$, that is, for any set of prespecified $n$ complex numbers, symmetric with respect to the real axis, there is a matrix, call it for convenience, $\b L^T$ such that the eigenvalues of $\b A^T-\b C^T\b L^T$ and hence of $\b A-\b L\b C$ are in the prespecified locations. It follows from the above result that provided the pair $(\b A,\b C)$ is observable, we not only can secure that the estimation error converges to zero, but we can also control its rate of convergence by appropriately selecting eigenvalues of the matrix $\b A-\b L\b C$. We also note that the selection of the closed-loop estimator gain matrix $\b L$ can be approached in exactly the same fashion as the construction of the gain matrix $\b K$ in the linear state-feedback control law design. We illustrate the above point with a numerical example.
\begin{example}\rm
For the given observable pair
\[
\b A=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
1 & 0 & 2 & 0\\
0 & 1 & 3 & 0\\
0 & 0 & -21 & 5
\end{array}\right],\quad \b C=\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & 0 & 0 & 1
\end{array}\right]
\]
construct the matrix $\b L\in \mb{\Bb R}^{4\times 2}$ so that the eigenvalues of $\b A-\b L\b C$ are located at
\[
\{-2,-3+j,-3-j,-4\}.
\]
In our construction of the gain matrix $\b L$ we use the observer companion form of the pair $(\b A, \b C)$ that we computed in Example~\ref{ex:ocf}. Our goal then is to construct a matrix $\b L$ so that the characteristic polynomial of the matrix $\b A-\b L\b C$ is
\[
\det(s\b I_4-\b A+\b L\b C)=s^4+12s^3+54s^2+108s+80.
\]
Using the observer form of the pair $(\b A,\b C)$, we first find $\hat{\b L}$ so that
\[
\hat{\b A}-\hat{\b L}\hat{\b C}=\left[\begin{array}{cccc}
0 &0& 0 & -80\\
1 & 0 & 0 & -108\\
0 & 1 & 0 & -54\\
0 & 0 & 1 & -12
\end{array}\right].
\]
We have
\[
\hat{\b L}=\left[\begin{array}{cc}
1681 & 80\\
2270 & 108\\
1137 & 54\\
251 & 17
\end{array}\right],
\]
and hence
\begin{eqnarray*}
\b L&=& \hat{\b T}^T\hat{\b L}\\
&=&\left[\begin{array}{cc}
1137 & 54\\
3955 & 188\\
5681 & 270\\
-23626 & -1117
\end{array}\right].
\end{eqnarray*}
\end{example}

We now present an alternative approach to the closed-loop estimator design. This approach will turn out useful in constructing lower order estimators that we discuss in the subsequent section. We assume that the dynamics of an estimator are given by
\[
\dot{\b z}(t)=\b D\b z(t)+\b E\b u(t)+\b G\b y(t),
\]
where $\b z(t) \in \mb{\Bb R}^{n}$. To begin with the development, suppose that we would like to obtain
\[
\b z=\b T\b x,
\]
where $\b T \in \mb{\Bb R}^{n \times n}$ is invertible. Premultiplying $\dot{\b x}(t)=\b A\b x(t)+\b B\b u(t)$ by $\b T$ yields
\[
\b T\dot{\b x}(t)=\b T\b A\b x(t)+\b T\b B\b u(t).
\]
Taking into account that $\b y(t)=\b C\b x(t)$ we get
\[
\dot{\b z}(t)=\b D\b z(t)+\b E\b u(t)+\b G\b C\b x(t).
\]
Combining the above two equations, and taking into account that $\b z=\b T\b x$ and $\dot{\b z}=\b T\dot{\b x}$ gives
\[
\b 0=\left(\b T\b A-\b D\b T-\b G\b C \right)\b x(t)+\left(\b T\b B-\b E \right)\b u(t)
\]
for all $t$ and for arbitrary input $\b u$. Hence, we must have
\begin{eqnarray*}
\b T\b A-\b D\b T &=& \b G\b C\\
\b E &=& \b T\b B.
\end{eqnarray*}
If $\b z \ne \b T\b x$, but the two of the above equations hold, then
\begin{eqnarray*}
\frac{d}{dt}\left(\b z-\b T\b x \right) &=& \b D\b z-\b T\b A\b x+\b G\b C\b x\\
&=& \b D\b z-\b D\b T\b x\\
&=& \b D\left( \b z-\b T\b x\right).
\end{eqnarray*}
If the eigenvalues of $\b D$ all have negative real parts, then
\[
\b z-\b T\b x \to \b 0
\]
as $t \to \infty$. Note that if we try $\b T=\b I_n$, then we have the previously analyzed case, where $\b G=\b L$, and
\begin{eqnarray*}
\b E &=& \b B,\\
\b A-\b L\b C &=& \b D.
\end{eqnarray*}
The resulting estimator, when $\b T=\b I_n$, was called by its developer Luenberger, as the identity observer~\cite{luenberger66,luenberger71}. Given the desired eigenvalues, symmetric with respect to the real axis, the equation $\b A-\b L\b C = \b D$ can be solved for $\b L$ so that the resulting $\b D$ has its eigenvalues in the desired locations if, and only if, the pair $(\b A,\b C)$ is observable. However, it is not true that given an arbitrary $\b D$ we can solve for $\b L$ so that $\b A-\b L\b C = \b D$ even if the pair $(\b A,\b C)$ is observable. We will use the results of the above discussion in constructing estimators of reduced order in the following section.

\subsection{Reduced-Order Estimator}
If the output $\b y$ is a $p$-vector with $p<n$ we would like to use the $p$ outputs to determine $p$ of the $x_i$'s and design an estimator of order $n-p$ to estimate the rest of state variables. Specifically, if rank$\b C=p$, then we can use the equation $\b y=\b C\b x$ to solve for $p$ of the $x_i$'s in terms of the $y_i$'s and the remaining $n-p$ state variables $x_k$'s. Then, we construct an estimator of order $n-p$. To recover all states, we should like to solve, for $\b x$, the equations
\begin{eqnarray*}
\b z &=& \b T\b x\\
\b y &=& \b C\b x,
\end{eqnarray*}
where now $\b T \in \mb{\Bb R}^{(n-p) \times n}$. This can be done if, and only if,
\[
\mb{rank}\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]=n.
\]
Given $\b D \in \mb{\Bb R}^{(n-p)\times (n-p)}$, $\b G \in \mb{\Bb R}^{(n-p)\times p}$ and the triple $(\b A,\b B,\b C)$, we can use the Kronecker product to show that the equation
\[
\b T\b A-\b D\b T = \b G\b C
\]
can be uniquely solved for $\b T$ if, and only if, no eigenvalue of $\b D$ is also an eigenvalue of $\b A$. Indeed, the above equation is a special case of the matrix equation that we analyzed in Chapter~\ref{chp:m_review}. Note that when choosing the matrices $\b D$ and $\b G$ we must make sure that the resulting matrix $\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]$ is nonsingular. The structure of the resulting reduced-order estimator is shown in Figure~\ref{fig:red_esti}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/red_esti.bmp x=4in y=3in}
\caption{Reduced-order estimator}
\label{fig:red_esti}
\end{figure}
The last step in the control design process is to combine the control law that we constructed in the previous section with an estimator. We discuss this step in the next section.

\section{Combined Controller-Estimator Compensator}
We start with combining a control law with a full-order estimator. We begin with writing the equations that govern the behavior of the dynamic system consisting of the plant model and the full-order estimator. The resulting system's order is $2n$, and the equations that describe the system have the form
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\tilde{\b x}}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A & \b 0\\
\b L\b C & \b A-\b L\b C
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b B
\end{array}\right]\b u(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right].
\end{eqnarray*}
Suppose that we now apply the control law
\[
\b u(t)=-\b K\tilde{\b x}(t)+\b v(t)
\]
instead of the actual state-feedback control law. In the above, the vector $\b v$ denotes an external input signal. Combining the above two equations together yields a model of the closed-loop system driven by the combined controller-estimator compensator. We have
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\tilde{\b x}}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A &  -\b B\b K\\
\b L\b C & \b A-\b L\b C-\b B\b K
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b B
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right].
\end{eqnarray*}
To analyze the closed-loop system it is convenient to perform a change of state variables using the following transformation matrix
\[
\left[\begin{array}{cc}
\b I_n & \b 0\\
-\b I_n & \b I_n
\end{array}\right].
\]
Note that
\[
\left[\begin{array}{cc}
\b I_n & \b 0\\
-\b I_n & \b I_n
\end{array}\right]^{-1}=\left[\begin{array}{cc}
\b I_n & \b 0\\
\b I_n & \b I_n
\end{array}\right].
\]
In the new coordinates the equations describing the closed-loop system are
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\tilde{\b x}}(t)-\dot{\b x}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A -\b B\b K & -\b B\b K\\
\b 0 & \b A-\b L\b C
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)-\b x(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b 0
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right].
\end{eqnarray*}
Note that in the above system the subsystem corresponding to the error component $\b e(t)=\tilde{\b x}(t)-\b x(t)$ is uncontrollable. Furthermore, the $2n$ poles of the closed-loop system are equal to the individual eigenvalues of both $\b A-\b B\b K$ and $\b A-\b L\b C$, which means that the design of the control law is separated from the construction of the estimator. This is what is known as the {\em separation principle\/}. The closed-loop transfer function relating $\b Y(s)$ and $\b V(s)$ is
\begin{eqnarray*}
\b Y(s) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{cc}
s\b I_n -\b A +\b B\b K & \b B\b K\\
\b 0 & s\b I_n -\b A+\b L\b C
\end{array}\right]^{-1}\left[\begin{array}{c}
\b B\\
\b 0
\end{array}\right]\b V(s)\\
&=& \b C\left(s\b I_n -\b A +\b B\b K \right)^{-1}\b B\b V(s).
\end{eqnarray*}
The above expression is identical to that for the closed-loop system if we applied the state-feedback control law
\[
\b u(t)=-\b K\b x(t)+\b v(t).
\]
Thus, the combined estimator-controller compensator yields the same closed-loop transfer function as the actual state-feedback control law.

We now briefly discuss the issue of the estimator pole selection. Franklin, Powell, and Emami-Naeini~\cite{franklin86} recommend that the estimator poles, that is, the eigenvalues of the matrix $\b A-\b L\b C$, to be a factor of 2 to 6 times faster than the controller poles. Such a choice ensures a faster decay of the estimator error $\b e(t)=\tilde{\b x}(t)-\b x(t)$ compared with the desired controller dynamics. This in turn causes the controller poles to dominate the closed-loop system response. Since the estimator poles represent a measure of the speed with which the error $\b e(t)=\tilde{\b x}(t)-\b x(t)$ decays to zero, one would tend to assign estimator poles deep in the left-hand plane. However, fast decay requires large gains which may lead to saturation of some signals, and unpredictable nonlinear effects. If the estimator poles were slower than the controller poles, the closed-loop system response would be dominated by the estimator, an undesirable situation. As it is usual in engineering practice, the term compromise can be used to describe the process of constructing the final controller structure.

We now analyze the combined estimator-controller compensator that uses the reduced-order estimator. The closed-loop system driven by this type of compensator enjoys the same properties as in the case of the full-order estimator. To prove the above statement we begin with writing the equations describing the closed-loop system. We have
\begin{eqnarray*}
\dot{\b x}(t) &=& \b A\b x(t) +\b B\b u(t)\\
\dot{\b z}(t) &=& \b D\b z(t)+\b T\b B\b u(t)+\b G\b C\b x(t)\\
\b y(t) &=& \b C\b x(t)\\
\b u(t) &=& -\b K\tilde{\b x}(t)+\b v(t),
\end{eqnarray*}
where
\[
\tilde{\b x}=\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]^{-1}\left[\begin{array}{c}
\b z\\
\b y
\end{array}\right].
\]
Let
\[
\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]^{-1}=\left[\begin{array}{cc}
\b M,&\b N
\end{array}\right],
\]
where $\b M\in\mb{\Bb R}^{n \times (n-p)}$ and $\b N\in\mb{\Bb R}^{n \times p}$. Note that
\[
\b M\b T+\b N\b C=\b I_n.
\]
With the above notation we can represent the control input in the form
\begin{eqnarray*}
\b u(t) &=& -\b K\left[\begin{array}{cc}
\b M, & \b N
\end{array}\right]\left[\begin{array}{c}
\b z(t)\\
\b y(t)
\end{array}\right]+\b v(t)\\
&=& -\b K\b M\b z(t)-\b K\b N\b y(t)+\b v(t).
\end{eqnarray*}
Using the above equations, and noting that $\b y(t)=\b C\b x(t)$, we represent equations that describe the closed-loop system as
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\b z}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A & \b 0\\
\b G\b C & \b D
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b T\b B
\end{array}\right]\left(-\b K\b M\b z(t)-\b K\b N\b y(t)+\b v(t) \right)\\
&=& \left[\begin{array}{cc}
\b A-\b B\b K\b N\b C & -\b B\b K\b M\\
\b G\b C-\b T\b B\b K\b N\b C & \b D-\b T\b B\b K\b M
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b T\b B
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\b z(t)
\end{array}\right].
\end{eqnarray*}
To proceed further we perform a transformation of the state variable of the above system. We use the following transformation matrix
\[
\left[\begin{array}{cc}
\b I_n & \b 0\\
-\b T & \b I_{n-p}
\end{array}\right].
\]
Note that
\[
\left[\begin{array}{cc}
\b I_n & \b 0\\
-\b T & \b I_{n-p}
\end{array}\right]^{-1}=\left[\begin{array}{cc}
\b I_n & \b 0\\
\b T & \b I_{n-p}
\end{array}\right].
\]
In the new coordinates the equations describing the closed-loop system become
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\b z}(t)-\b T\dot{\b x}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A-\b B\b K\b N\b C-\b B\b K\b M\b T & -\b B\b K\b M\\
-\b T\b A+\b G\b C+\b D\b T & \b D
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)-\b T\b x(t)
\end{array}\right]\\
&{}&+\left[\begin{array}{c}
\b B\\
\b 0
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\b z(t)-\b T\b x(t)
\end{array}\right].
\end{eqnarray*}
Taking into account the equations
\begin{eqnarray*}
\b T\b A-\b D\b T-\b G\b C &=& \b 0\\
\b M\b T &=& \b I_n -\b N\b C,
\end{eqnarray*}
we obtain
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\b z}(t)-\b T\dot{\b x}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A-\b B\b K & -\b B\b K\b M\\
\b 0 & \b D
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)-\b T\b x(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b 0
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b 0
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\b z(t)-\b T\b x(t)
\end{array}\right].
\end{eqnarray*}
It is now apparent that the separation principle also holds if we use the reduced-order estimator in constructing the compensator, that is, the selection of the gain matrix $\b K$ that assigns closed-loop poles is independent, separate, from the selection of the estimator gain matrix $\b L$ that assigns the estimator poles. Furthermore, the transfer function matrix relating $\b Y(s)$ and $\b V(s)$ in the closed-loop system with the reduced-order estimator is exactly the same as the one that would be obtained using actual state-feedback control law $\b u(t)=-\b K\b x(t)+\b v(t)$.
\begin{example}\rm
Consider the following diagram of an armature controlled DC motor, where the system parameters are: $R_a=5$~$\Omega$, $L_a=200$~mH, $K_b=0.1$~V/rad/sec, $K_i=0.1$~Nm/A, the gear ratio $N_1/N_2=1/50$. The armature inertia is $2\times10^{-3}$~kgm$^2$. The load of $10$~kg is located at an effective radius of $0.2$~m. The gear inertia and friction are negligible.
\begin{figure}
\vspace{4.5in}
\special{bmp:c:/mybook/hw2fig2.bmp x=6in y=4.5in}
\caption{Block diagram of a DC motor system}
\label{fig:open_dc}
\end{figure}
Let $x_1=i_a$, $x_2=\theta$, $x_3=\dot{\theta}=\omega$, $u=e_a$, and $y=\theta_l$.

We first construct the state space model of the DC motor system. We start with writing the equation relating torque to angular acceleration. We have
\[
T_m=J_{eq}\ddot{\theta},
\]
where
\begin{eqnarray*}
J_{eq}&=&J_{armature}+\left(N_1/N_2 \right)^2J_{load}\\
&=&2\times10^{-3}\,\mb{kgm}^2+(1/50)^2\times10\times(0.2)^2\,\mb{kgm}^2\\
&=&2.16\times10^{-3}\,\mb{kgm}^2.
\end{eqnarray*}
Kirchhoff's voltage law applied to the armature circuit gives
\[
R_ai_a+L_a\frac{di_a}{dt}+K_b\frac{d\theta}{dt}=e_a.
\]
We also have
\begin{eqnarray*}
T_m &=& K_ii_a\\
&=& J_{eq}\ddot{\theta}.
\end{eqnarray*}
Taking into account the definition of the state variables, we represent the above equations in state-space format
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3
\end{array}\right] &=& \left[\begin{array}{ccc}
-\frac{R_a}{L_a} & 0 & -\frac{K_b}{L_a}\\
0 & 0 & 1\\
\frac{K_i}{J_{eq}} & 0 & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right]+\left[\begin{array}{c}
\frac{1}{L_a}\\
0\\
0
\end{array}\right]u\\
y &=& \left[\begin{array}{ccc}
0 & \frac{N_1}{N_2} & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right].
\end{eqnarray*}
Substituting the given parameter values we get
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3
\end{array}\right] &=& \left[\begin{array}{ccc}
-25 & 0 & -0.5\\
0 & 0 & 1\\
46.296 & 0 & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right]+\left[\begin{array}{c}
5\\
0\\
0
\end{array}\right]u\\
y &=& \left[\begin{array}{ccc}
0 & 0.02 & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right].
\end{eqnarray*}


Our next step is to design a state-feedback controller $u=-\b k\b x + v$, such that the eigenvalues of $\b A-\b b\b k$ are
\[
-1+j,-1-j,-10.
\]
To allocate the poles into the desired locations we first transform the system model into the controller companion form. We first form the controllability matrix
\[
\left[\begin{array}{ccc}
\b b, & \b A\b b, & \b A^2\b b
\end{array}\right]=\left[\begin{array}{ccc}
5 & -125 & 3009.3\\
0 & 0 & 231.5\\
0 & 231.5 &-5787
\end{array}\right]
\]
The system is controllable. The last row of the inverse of the controllability matrix is
\[
\b q_1=\left[\begin{array}{ccc}
0 & 0.0043 & 0
\end{array}\right],
\]
and hence the transformation matrix we are seeking has the form
\begin{eqnarray*}
\b Q &=& \left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\b q_1\b A^2
\end{array}\right]\\
&=& \left[\begin{array}{ccc}
0 & 0.0043 & 0\\
0 & 0 & 0.0043\\
0.2 & 0 & 0
\end{array}\right].
\end{eqnarray*}
The system's matrices in the new coordinates are
\[
\tilde{\b A} = \b Q\b A\b Q^{-1}
= \left[\begin{array}{ccc}
0 & 1 & 0\\
0 & 0 & 1\\
0 & -23.148 & -25
\end{array}\right],
\]
\[
\tilde{\b b} = \b Q\b b
= \left[\begin{array}{c}
0\\
0\\
1
\end{array}\right],
\]
and
\[
\tilde{\b c} = \b c\b Q^{-1}
= \left[\begin{array}{ccc}
4.63 & 0 & 0
\end{array}\right].
\]
The desired closed-loop characteristic polynomial $\alpha_c(s)$ is
\begin{eqnarray*}
\alpha_s(s) &=& (s+1-j)(s+1+j)(s+10)\\
&=& s^3+12s^2+22s+20.
\end{eqnarray*}
We now want to find $\tilde{\b k}$ so that
\[
\tilde{\b A}-\tilde{\b b}\tilde{\b k}=\left[\begin{array}{ccc}
0 & 1 & 0\\
0 & 0 & 1\\
-20 & -22 & -12
\end{array}\right].
\]
We have
\[
\tilde{\b k}=\left[\begin{array}{ccc}
20 & -1.148 & -13
\end{array}\right],
\]
and
\begin{eqnarray*}
\b k &=& \tilde{\b k}\b Q\\
&=&\left[\begin{array}{ccc}
-2.6 & 0.0864 & -0.005
\end{array}\right].
\end{eqnarray*}
Hence
\[
\b A-\b b \b k = \left[\begin{array}{ccc}
-12 & -0.432 & -0.4752\\
0 & 0 & 1\\
46.294 & 0 & 0
\end{array}\right].
\]
The transfer function of the closed-loop system is
\[
\frac{Y(s)}{V(s)}=\frac{4.6296}{s^3+12s^2+22s+20}.
\]
The step response of the closed-loop system is shown in Figure~\ref{fig:motcl}.
\begin{figure}
\vspace{4in}
\hskip.5in\special{bmp:c:/ee680/motcl.bmp x=5.33in y=4in}
\caption{Step response of the closed-loop DC motor system.}
\label{fig:motcl}
\end{figure}


Next, we design the full-order estimator placing the estimator poles at $\{-4, -5+2j, -5-2j\}$, and then synthesize the combined controller-estimator compensator.
To compute the estimator gain vector $\b l$ we first transform the pair $(\b A, \b c)$ into the observer companion form. This is equivalent to transforming the pair $(\b A^T, \b c^T)$ into the controller companion form. The transformation matrix that brings the pair $(\b A, \b c)$ into its observer companion form is
\[
\hat{\b Q}= \left[\begin{array}{ccc}
1.1 & -27 & 650\\
0 & 0 & 50\\
0 & 50 & -1250
\end{array}\right].
\]
The matrices $\b A$ and $\b c$ in the new coordinates have the form:
\[
\hat{\b A}=\hat{\b Q}^{-1}\b A\hat{\b Q}=\left[\begin{array}{ccc}
0 & 0 & 0\\
1 & 0 & -23.1481\\
0 & 1 & -25
\end{array}\right],
\]
and
\[
\hat{\b c}=\b c\hat{\b Q}=\left[\begin{array}{ccc}
0 & 0 & 1
\end{array}\right].
\]
The desired characteristic polynomial of the estimator is
\begin{eqnarray*}
\det\left(\b I_3-\b A+\b l\b c\right) &=& (s+4)(s+5-2j)(s+5+2j)\\
&=& s^3+14s^2+69s+116.
\end{eqnarray*}
We now find $\hat{\b l}$ so that
\[
\hat{\b A}-\hat{\b l}\hat{\b c}=\left[\begin{array}{ccc}
0 & 0 & -116\\
1 & 0 & -69\\
0 & 1 & -14
\end{array}\right].
\]
We have
\[
\hat{\b l}=\left[\begin{array}{c}
116\\
45.8519\\
-11
\end{array}\right],
\]
and
\[
\b l=\hat{\b Q}\hat{\b l}=\left[\begin{array}{c}
-8263\\
-550\\
16043
\end{array}\right].
\]
The dynamics of the full order state estimator are described by
\[
\dot{\tilde{\b x}}=(\b A-\b l\b c)\tilde{\b x}+\b b u+\b l y,
\]
that is,
\[
\dot{\tilde{\b x}}=\left[\begin{array}{ccc}
-25 & 165.2544 & -0.5\\
0 & 11 & 1\\
46.2963 & -320.8519 & 0
\end{array}\right]\tilde{\b x} + \left[\begin{array}{c}
5\\
0\\
0
\end{array}\right]u+\left[\begin{array}{c}
-8263\\
-550\\
16043
\end{array}\right]y.
\]
We then connect the full-order estimator to the DC motor system thus obtaining a combined controller-full-order-estimator compensator. In Figure~\ref{fig:mobser} we show a plot of $x_1$ and its estimate for the closed-loop system with the estimator in the loop, where $v=0$, $\b x(0)=\left[\begin{array}{ccc}
4 & 2 & -1
\end{array}\right]^T$, and $\tilde{\b x}(0)=\b 0$.
\begin{figure}
\vspace{4in}
\hskip.5in\special{bmp:c:/ee680/mobser.bmp x=5.33in y=4in}
\caption{A plot of the first state, marked by 1, and its estimate, marked by 2, versus time for the closed-loop system with the full-order estimator in the loop.}
\label{fig:mobser}
\end{figure}


Our last part of this example is to design the reduced-order state estimator. We choose the reduced-order estimator poles at $\{-5+2j, -5-2j\}$. The reduced-order estimator dynamics are given by
\[
\dot{\b z}=\b D \b z+\b E u+ \b G y.
\]
Let
\[
\b G=\left[\begin{array}{c}
100\\
100
\end{array}\right].
\]
The estimator's poles are supposed to be $-5+2j$ and $-5-2j$. Thus, the desired characteristic polynomial of $\b D$ should be
\[
\det(s\b I_2-\b D)=s^2+10s+29.
\]
Let
\[
\b D=\left[\begin{array}{cc}
0 & 1\\
-29 & -10
\end{array}\right].
\]
We now solve the following matrix equation for $\b T$:
\[
-\b D\b T+\b T\b A=\b G\b c.
\]
Let $\b G_c=\b G\b c$, then using MATLAB we can solve the above equation using the command
\begin{verbatim}
t=(-kron(eye(3),D)+kron(A',eye(2)))\Gc(:);
T=[t(1:2) t(3:4) t(5:6)]
\end{verbatim}
to get
\[
\b T=\left[\begin{array}{ccc}
-0.5493 & 0.7586 & -0.2507\\
2.1271 & -2.0000 & 1.0332
\end{array}\right].
\]
Note that
\[
\det\left[\begin{array}{c}
\b T\\
\b c
\end{array}\right]=6.8691e-04 \ne 0,
\]
and
\[
\left[\begin{array}{c}
\b T\\
\b c
\end{array}\right]^{-1}=\left[\begin{array}{ccc}
-30.0840 & -7.2980 & 411.3200\\
0 & 0 & 50\\
61.9338 & 15.9921 & -750
\end{array}\right].
\]
We also have
\begin{eqnarray*}
\b E &=& \b T\b b\\
&=& \left[\begin{array}{c}
-2.7463\\
10.6357
\end{array}\right].
\end{eqnarray*}
Hence, the dynamics of the reduced order estimator are described by
\[
\dot{\b z}=\left[\begin{array}{cc}
0 & 1\\
-29 & -10
\end{array}\right]\b z+\left[\begin{array}{c}
-2.7463\\
10.6357
\end{array}\right]u+\left[\begin{array}{c}
100\\
100
\end{array}\right]y.
\]
An estimate of the entire state can be obtained from
\begin{eqnarray*}
\hat{\b x} &=& \left[\begin{array}{c}
\b T\\
\b c
\end{array}\right]^{-1}\left[\begin{array}{c}
\b z\\
y
\end{array}\right]\\
&=& \left[\begin{array}{ccc}
-30.0840 & -7.2980 & 411.3200\\
0 & 0 & 50\\
61.9338 & 15.9921 & -750
\end{array}\right]\left[\begin{array}{c}
\b z\\
y
\end{array}\right].
\end{eqnarray*}
A plot of $x_1$ and its estimate versus time for the closed-loop system with the combined controller-reduced-order-estimator compensator is depicted in Figure~\ref{fig:mrobs}, where $v=0$, $\b x(0)=\left[\begin{array}{ccc}
4 & 2 & -1
\end{array}\right]^T$, and $\tilde{\b z}(0)=\b 0$.
\begin{figure}
\vspace{4in}
\hskip.5in\special{bmp:c:/ee680/mrobs.bmp x=5.33in y=4in}
\caption{A plot of the first state, marked by 1, and its estimate, marked by 2, versus time for the closed-loop system with the reduced-order estimator in the loop.}
\label{fig:mrobs}
\end{figure}
Of course, for zero initial conditions, the step responses of the closed-loop systems with the full-order, as well as with the reduced-order estimators in the loop, are the same as the step response of the closed-loop system with the state-feedback controller $u=-\b k\b x+v$, as it follows from our analyses of the combined controller-estimator compensators.
\end{example}

\section{Constructing Robust Linear Controllers}
In this section we use the Lyapunov Theorem to construct robust state-feedback controllers. One of the basic issues in the control of dynamic systems is the effect of uncertainties, or neglected nonlinearities, on the stability of the closed-loop system. A controller is viewed robust if it maintains stability for all uncertainties in an expected range. We consider a class of dynamic systems modeled by
\[
\dot{\b x}(t) = \b A\b x(t)+\b B\b u(t) +\b f(t, \b x(t))+\b B\b h(t,\b x(t),\b u(t)),
\]
where $\b x(t) \in \mb{\Bb R}^n$, $\b u(t) \in \mb{\Bb R}^m$, and the functions $\b f$ and $\b h$ model uncertainties, or nonlinearities, in the system. We refer to $\b f$ as the {\em unmatched uncertainty\/}, while to $\b h$ as the {\em matched uncertainty\/}. We assume that
\begin{enumerate}
\item $\|\b f(t, \b x)\| \le \alpha_f\|\b x\|$,
\item $\|\b h(t, \b x)\| \le \gamma_h\|\b u\|+\alpha_h\|\b x\|$,
\end{enumerate}
where $\alpha_f$, $\alpha_h$, and $\gamma_h$ are known nonnegative constants. We further assume that the matrix $\b A$ is asymptotically stable. If this is not the case, we apply a preliminary state-feedback controller $\b u=-\b K\b x$ such that $\b A-\b B\b K$ is asymptotically stable. Such a feedback exists provided the pair $(\b A,\b B)$ is stabilizable. Our goal is to construct a linear state-feedback controller that would make the closed-loop system asymptotically stable for arbitrary $\b f$ and $\b h$ that satisfy the above norm bounds.
\begin{thm}
Suppose that $\b A$ is asymptotically stable, and $\b P_c=\b P^T_c >0$ is the solution to the Lyapunov matrix equation $\b A^T\b P_c+\b P_c\b A=-2\b Q_c$ for some $\b Q_c=\b Q^T_c >0$. Suppose also that
\begin{eqnarray*}
\alpha_f &<& \frac{\lambda_{\min}(\b Q_c)}{\lambda_{\max}(\b P_c)},\\
\gamma_h &<& 1.
\end{eqnarray*}
Then, the state-feedback controller $\b u=-\gamma_c\b B^T\b P_c\b x$, where
\[
\gamma_c > \frac{\alpha_h^2}{4\left(\lambda_{\min}(\b Q_c)-\alpha_f \lambda_{\max}(\b P_c) \right)(1-\gamma_h)}
\]
stabilizes the uncertain system for arbitrary $\b f$ and $\b h$ that satisfy the norm bounds.
\end{thm}
{\bf Proof}\quad The time derivative of the positive definite function $V=\b x^T\b P_c\b x$ evaluated on any trajectory of the closed-loop system is
\begin{eqnarray*}
\dot{V} &=& 2\b x^T\b P_c\dot{\b x}\\
&=& -2\b x^T\b Q_c\b x -2\gamma_c\b x^T\b P_c\b B\b B^T\b P_c\b x +2\b x^T \b P_c\b f+2\b x^T \b P_c\b B\b h.
\end{eqnarray*}
Our goal is to determine $\tilde{\gamma}_c >0$ such that if $\gamma_c > \tilde{\gamma}_c$, then $\dot{V}<0$, which in turn implies the asymptotic stability of the closed-loop system. To proceed further we note that by Rayleigh's inequality
\[
\lambda_{\min}(\b Q_c)\|\b x\|^2 \le \b x^T\b Q_c\b x \le \lambda_{\max}(\b Q_c)\|\b x\|^2,
\]
and therefore
\[
-\b x^T\b Q_c \b x \le -\lambda_{\min}(\b Q_c)\|\b x\|^2.
\]
Furthermore,
\[
\b x^T\b P_c\b B\b B^T\b P_c\b x =\|\b x^T\b P_c\b B\|^2.
\]
Taking the above into account, and performing some manipulations yields
\begin{eqnarray}
\dot{V} &\le& -2\lambda_{\min}(\b Q_c)\|\b x\|^2-2\gamma_c\|\b x^T\b P_c\b B\|^2+2\alpha_f\lambda_{\max}(\b P_c)\|\b x\|^2\nonumber\\
&{}&\quad+2\|\b x^T\b P_c\b B\|\left( \alpha_h\|\b x\|+\gamma_h \gamma_c\|\b x^T\b P_c\b B\|\right).
\label{eq:vdotless}
\end{eqnarray}
Let
\begin{equation}
\b Q=\left[\begin{array}{cc}
\lambda_{\min}(\b Q_c)-\alpha_f\lambda_{\max}(\b P_c) & -\frac{\alpha_h}{2}\\
-\frac{\alpha_h}{2} & \gamma_c(1-\gamma_h)
\end{array}\right]\in \mb{\Bb R}^{2 \times 2}.
\label{eq:big_matrix}
\end{equation}
Then, we can represent~(\ref{eq:vdotless}) as
\begin{equation}
\dot{V} \le -2\left[\begin{array}{cc}
\|\b x\| & \|\b x^T\b P_c\b B\|
\end{array}\right]\b Q\left[\begin{array}{c}
\|\b x\|\\
\|\b x^T\b P_c\b B\|
\end{array}\right].
\label{eq:vdotq}
\end{equation}
For $\dot{V}$ to be negative it is sufficient that the leading principal minors of the matrix $\b Q$ given by~(\ref{eq:big_matrix}) be positive. The first-order leading principal minor is positive by assumption. For the second-order leading principal minor to be positive it is sufficient that $\gamma_h < 1$ and
\[
\gamma_c > \frac{\alpha_h^2}{4\left(\lambda_{\min}(\b Q_c)-\alpha_f \lambda_{\max}(\b P_c) \right)(1-\gamma_h)}.
\]
The proof is now complete.\\
\hspace*{5.5in} $\Box$

Note that if $\gamma_h=0$, then the closed-loop system is asymptotically stable if
\[
\alpha_f < \frac{\lambda_{\min}(\b Q_c)}{\lambda_{\max}(\b P_c)}
\]
and
\[
\gamma_c > \frac{\alpha_h^2}{4\left(\lambda_{\min}(\b Q_c)-\alpha_f \lambda_{\max}(\b P_c) \right)}.
\]

\section{Exercises}
\begin{exercise}\rm
Show
\end{exercise}