\documentclass[12pt]{article}
\usepackage{latexsym}
\renewcommand{\baselinestretch}{1.55}
\setlength{\topmargin}{-0.25in}
\setlength{\textheight}{8.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}
\newtheorem{example}{Example}
\newtheorem{thm}{Theorem}
\newcommand{\markex}{\nopagebreak\begin{center}\rule{5in}{.02in}\end{center}}
\newcommand{\mb}{\mbox}
\newcommand{\bm}{\boldmath}
\def\b#1{\mb{\bm$#1$}}
\newfont{\Bb}{msbm10 scaled\magstep1}
%\pagestyle{empty}
\begin{document}
\noindent{\Large ECE 382}\hfill{\Large Spring 2008}
\begin{center}
{\LARGE \bf The Internal Model Principle\footnote{handout prepared by S.~H.~\.{Z}ak}}
\end{center}
Consider a block diagram of a closed-loop system shown in Figure~\ref{fig:imp_general}.
\begin{figure}[h]
%\vskip.2in
\setlength{\unitlength}{.08in}
\begin{center}
\begin{picture}(70,30)
\thicklines
\put(0,18){\vector(1,0){14}}
\put(0,20){{\large$R(s)=\frac{N_r(s)}{D_r(s)}$}}
\put(4,15){{\large$r(t)$}}
\put(17,18){\circle{6}}
\put(17,18){\line(1,1){2.12}}
\put(17,18){\line(-1,-1){2.12}}
\put(17,18){\line(-1,1){2.12}}
\put(17,18){\line(1,-1){2.12}}
\put(14,17){$+$}
\put(16,16){$-$}
\put(20,18){\vector(1,0){11}}
\put(22,19){{\large$E(s)$}}
\put(22,15){{\large$e(t)$}}
\put(31,14){\framebox(10,8){{\large$\frac{N_c(s)}{D_c(s)}$}}}
\put(33,11){{\large$G_c(s)$}}
\put(31,24){Controller}
\put(41,18){\vector(1,0){9}}
\put(50,14){\framebox(10,8){{\large$\frac{N_p(s)}{D_p(s)}$}}}
\put(52,24){Plant}
\put(52,11){{\large$G_p(s)$}}
\put(60,18){\vector(1,0){12}}
\put(66,19){{\large$C(s)$}}
\put(67,15){{\large$c(t)$}}
\put(65,18){\vector(0,-1){4}}
\put(65,14){\line(0,-1){8}}
\put(17,6){\line(1,0){48}}
\put(17,6){\vector(0,1){9}}
\end{picture}
\end{center}
\caption{Block diagram of a closed-loop control system.}
\label{fig:imp_general}
\end{figure}
%For the sake of brevity we omit the argument $s$ of the Laplace transforms %of the signal involved in further manipulations. Thus, for example, we %write $E$ to mean $E(s)$.
Using basic rules of the block diagram algebra yields
\begin{eqnarray*}
E(s)&=& R(s)-G_p(s)G_c(s) E(s)\\
&=& \frac{N_r(s)}{D_r(s)}-\frac{N_p(s) N_c(s)}{D_p(s) D_c(s)}E(s).
\end{eqnarray*}
Performing simple manipulations, we obtain
\begin{equation}
\fbox{$\displaystyle E(s)=\frac{D_p(s) D_c(s)}{D_p(s)D_c(s)+N_p(s)N_c(s)}\frac{N_r(s)}{D_r(s)} $}
\label{eq:expforerr}
\end{equation}
Our objective is to design a controller $G_c(s)=\frac{N_c(s)}{D_c(s)}$ so that
\[
\lim_{t\to \infty} e(t)=\lim_{t\to \infty}\left(r(t)-c(t) \right)=0,
\]
where $e(t)={\cal L}^{-1}(E(s))$.

Suppose that the poles of the Laplace transform of the reference signal $r(t)$ are in the right half plane, that is, they belong to the set $\{s:\Re (s)\ge 0\}$. The polynomial
\[
P_c(s)=D_p(s)D_c(s)+N_p(s)N_c(s)
\]
is the closed-loop characteristic polynomial~(CLCP) of the closed-loop system depicted in Figure~\ref{fig:imp_general} and the polynomial zeros are the closed-loop poles. Using~(\ref{eq:expforerr}), we can easily prove the following result that we call the Internal Model Principle~(IMP).

\framebox{\parbox[t]{6in}{\begin{thm}[Internal Model Principle] In the configuration depicted in Figure~\ref{fig:imp_general}, where the poles of $R(s)$ are in the right half plane,
\[
\lim_{t\to \infty} e(t)=0
\]
if and only if
\begin{enumerate}
\item the closed-loop poles are in the open left-half plane;
\item $D_r(s)$ is a factor of the open-loop characteristic polynomial $D_p(s)D_c(s)$, that is, there is a polynomial, say $Q(s)$, such that $D_p(s)D_c(s)=Q(s)D_r(s)$.
\end{enumerate}
\end{thm}}}
\\
\\
The second condition of the IMP means that the tracking controller must be chosen in such way that the open-loop transfer function, $G_p(s)G_c(s)$, contains a model of the reference signal to be tracked. If none of the pole of $R(s)$ is a pole of the plant's transfer function, $G_p(s)$, then we can restate the IMP as follows:

\framebox{\parbox[t]{6in}{\em Any good tracking controller must stabilize the closed-loop system and  must contain a model of the reference signal.}}
\\
\\


Let us now solve two numerical examples to get better insight into the IMP.
\begin{example}\label{ex:imp_one}\rm For the closed-loop system shown in Figure~\ref{fig:imp_exone}, our objective is to construct a transfer function $G_c(s)$ such that $\lim_{t\to \infty} e(t)=0$.
\begin{figure}
\setlength{\unitlength}{.08in}
\begin{center}
\begin{picture}(70,30)
\thicklines
\put(0,18){\vector(1,0){14}}
\put(1,20){{\large$R(s)=\frac{1}{s}$}}
%\put(4,15){{\large$r(t)$}}
\put(17,18){\circle{6}}
\put(17,18){\line(1,1){2.12}}
\put(17,18){\line(-1,-1){2.12}}
\put(17,18){\line(-1,1){2.12}}
\put(17,18){\line(1,-1){2.12}}
\put(14,17){$+$}
\put(16,16){$-$}
\put(20,18){\vector(1,0){11}}
\put(22,19){{\large$E(s)$}}
\put(22,15){{\large$e(t)$}}
\put(31,14){\framebox(12,8){{\large$G_c(s)=?$}}}
\put(30,11){{\large$G_c(s)=\frac{N_c(s)}{D_c(s)}$}}
\put(32,24){Controller}
\put(43,18){\vector(1,0){7}}
\put(50,14){\framebox(10,8){{\large$\frac{1}{s+2}$}}}
\put(52,24){Plant}
%\put(52,11){{\large$G_p(s)$}}
\put(60,18){\vector(1,0){12}}
\put(66,19){{\large$C(s)$}}
\put(67,15){{\large$c(t)$}}
\put(65,18){\vector(0,-1){4}}
\put(65,14){\line(0,-1){8}}
\put(17,6){\line(1,0){48}}
\put(17,6){\vector(0,1){9}}
\end{picture}
\end{center}
\caption{A closed-loop control system of Example~\ref{ex:imp_one}.}
\label{fig:imp_exone}
\end{figure}
 The Laplace transform of the error is
\[
E(s)=\frac{1}{1+\frac{1}{s+2}\frac{N_c(s)}{D_c(s)}}\frac{1}{s}=\frac{(s+2)D_c(s)}{(s+2)D_c(s)+N_c(s)}\frac{1}{s}.
\]
Let $N_c(s)=1$ and $D_c(s)=s$, that is, let
\[
G_c(s)=\frac{1}{s},
\]
Then,
\[
E(s)=\frac{(s+2)s}{s^2+2s+1}\frac{1}{s}=\frac{s+2}{s^2+2s+1}.
\]
It is easy to check using, for example, the final value theorem that $\lim_{t\to \infty}e(t)=0$. Thus, in this case a simple integral controller does the job.
\end{example}\markex
\begin{example}\label{ex:imp_two}\rm Consider the closed-loop system shown in Figure~\ref{fig:imp_extwo}. This example looks very similar to the previous one. The only difference is that now the reference signal is the unit ramp function rather than the unit step. Our objective is the same as before, that is, we wish to construct a controller $G_c(s)=\frac{N_c(s)}{D_c(s)}$ so that $\lim_{t\to \infty}e(t)=0$.
\begin{figure}
\setlength{\unitlength}{.08in}
\begin{center}
\begin{picture}(70,30)
\thicklines
\put(0,18){\vector(1,0){14}}
\put(1,20){{\large$R(s)=\frac{1}{s^2}$}}
%\put(4,15){{\large$r(t)$}}
\put(17,18){\circle{6}}
\put(17,18){\line(1,1){2.12}}
\put(17,18){\line(-1,-1){2.12}}
\put(17,18){\line(-1,1){2.12}}
\put(17,18){\line(1,-1){2.12}}
\put(14,17){$+$}
\put(16,16){$-$}
\put(20,18){\vector(1,0){11}}
\put(22,19){{\large$E(s)$}}
\put(22,15){{\large$e(t)$}}
\put(31,14){\framebox(12,8){{\large$G_c(s)=?$}}}
\put(30,11){{\large$G_c(s)=\frac{N_c(s)}{D_c(s)}$}}
\put(32,24){Controller}
\put(43,18){\vector(1,0){7}}
\put(50,14){\framebox(10,8){{\large$\frac{1}{s+2}$}}}
\put(52,24){Plant}
%\put(52,11){{\large$G_p(s)$}}
\put(60,18){\vector(1,0){12}}
\put(66,19){{\large$C(s)$}}
\put(67,15){{\large$c(t)$}}
\put(65,18){\vector(0,-1){4}}
\put(65,14){\line(0,-1){8}}
\put(17,6){\line(1,0){48}}
\put(17,6){\vector(0,1){9}}
\end{picture}
\end{center}
\caption{A closed-loop control system of Example~\ref{ex:imp_two}.}
\label{fig:imp_extwo}
\end{figure}
In Example~\ref{ex:imp_one}, the simple integrator was all we needed. Let us try the same controller here. Then, the Laplace transform of the error signal is
\begin{eqnarray*}
E(s)&=&\frac{1}{1+\frac{1}{s+2}\frac{N_c(s)}{D_c(s)}}\frac{1}{s^2}\\
&=&\frac{(s+2)D_c(s)}{(s+2)D_c(s)+N_c(s)}\frac{1}{s^2}\\
&=&\frac{s+2}{s^2+2s+1}\frac{1}{s}.
\end{eqnarray*}
Note that now $e(\infty)=2$. Thus the simple integrator is not enough now to force the steady-state error to zero. Note that in this case the polynomial $D_r(s)$ was not a factor of $D_c(s)$. Let us then try a controller that would satisfy the divisibility property of the IMP. If we take the double integrator than the divisibility condition will be satisfied and we obtain
\[
E(s)=\frac{s+2}{s^3+2s^2+1}.
\]
However, now $e(t)$ is divergent because the poles of $E(s)$ are not stable. The three poles of $E(s)$ are located at -2.2056, and $0.1028\pm j0.6655$. This time the first condition of the Internal Model Principle is not satisfied.
\end{example}\markex
\end{document}
