\chapter{Proportional-Integral-Derivative (PID) Control}
\label{chap:PID_control}


\begin{flushright}
\parbox{5.5in}{Thomas Stevic, a controls engineer at DMAX, said that when designing a solution to a problem, he finds that he typically has two masters to serve. The first master is the person who is responsible for the output of his design. This is often ``the person who pays the bills,'' Stevic said. ``These people usually do not care how a machine or process works. Their concern is: Does the machine make what it is supposed to make? While exotic solutions may increase quality, decrease production time, make better use of resources and, from an engineering viewpoint, be very cool to use and inch closer to perfection, their use is not often a benefit to the first master.''

The second master is described by Stevic as the person or people who will ``maintain the system after I am gone. Ultimately, my designs have to address the least capable people who may be required to maintain or modify my design.''

Given the requirements of the second master, Stevic says that, given a choice between using adaptive neural network control or a thermostat, if the thermostat will work, that is what he will choose. ``If neural nets or fuzzy logic are required to produce the desired result, I will use them, but only after examining the simpler solution,'' he said.~\cite[page~57]{greenfield10}}
\end{flushright}

\bigskip

In the previous chapters, we analyzed control algorithms that require a mathematical model of the dynamical system to be controlled.\index{mathematical model!to construct a controller} The mathematical model is then used to construct a controller. In many practical situations, however, it is not feasible to obtain a quality mathematical model of the controlled system. In this chapter, we present proportional-integral-derivative~(PID)\index{proportional-integral-derivative (PID)}\index{PID|see{proportional-integral-derivative}} controllers that are most useful when a mathematical model of the process to be controlled is not available to the control engineer.



The proportional-integral-derivative~(PID)\index{proportional-integral-derivative (PID)}\index{PID|see{proportional-integral-derivative}} controllers are without a doubt the most widely used controllers in industry today. {\AA}str{\"{o}m} and H{\"{a}}gglund~\cite[p.~198]{astrom96} regard the PID controller as the ``bread and butter'' of control engineering.\index{PID controller!``bread and butter'' of control engineering} Knospe~\cite{knospe06} estimates that over 90\% of control loops employ PID control.
%The PID control strategy is most useful when a mathematical model of the process to be controlled is not available to the control engineer.

To better appreciate the effectiveness of the PID control strategies, we first discuss a general control design principle referred to as the internal model principle~(IMP).\index{internal model principle (IMP)}\index{IMP|see{internal model principle}}


\section{The Internal Model Principle (IMP)}\label{sec:int_mod_principle}
Consider a block diagram of a closed-loop system\index{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$Y(s)$}}
\put(67,15){{\large$y(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\index{block diagram!algebra of} 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)-y(t) \right)=0,
\]
where $e(t)={\cal L}^{-1}(E(s))$ is the inverse Laplace transform of $E(s)$.

Suppose that the poles of the Laplace transform of the reference signal $r(t)$ are in the closed right half-plane, that is, they belong to the set $\{s:\Re (s)\ge 0\}$, where $\Re (s)$ denotes the real part of the complex variable $s$. The polynomial
\[
P_c(s)=D_p(s)D_c(s)+N_p(s)N_c(s)
\]
is the closed-loop characteristic polynomial~(CLCP)\index{closed-loop characteristic polynomial (CLCP)}\index{CLCP|see{closed-loop characteristic polynomial}} of the closed-loop system depicted in Figure~\ref{fig:imp_general} and the closed-loop characteristic polynomial zeros are the closed-loop poles.\index{closed-loop poles!zeros of the CLCP} Using~(\ref{eq:expforerr}), we can easily prove the following result that we refer to as the Internal Model Principle~(IMP).\index{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 closed 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 an be interpreted as follows: the controller, $G_c(s)$, must be chosen in such a way that the open-loop transfer function, $G_p(s)G_c(s)$, contains a model of the reference signal\index{reference signal!model of} to be tracked. If none of the poles 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\index{good tracking controller!conditions for} must stabilize the closed-loop system and  must contain a model of the reference signal.}}

For an alternative approach to the IMP, we recommend Wolovich~\cite[pp.~254--255]{wolovich94}.

We illustrate the IMP with two numerical examples. We use the final value theorem\index{final value theorem} that we state next.
\begin{thm}
Suppose that $F(s)={\cal L}(f(t))$ has poles only in the open left half-plane with possible exception of a single-order pole at $s=0$.\index{single-order pole at the origin!final value theorem} Then
\[
\lim_{s \to 0} s F(s) = \lim_{t \to \infty} f(t).
\]
\end{thm}
\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$Y(s)$}}
\put(67,15){{\large$y(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 tracking error, $e(t)$, 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~(I) 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
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$, where the reference signal is the unit ramp function.\index{reference signal!unit ramp}
\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$Y(s)$}}
\put(67,15){{\large$y(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 that we needed for the unit step as the reference input. 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 second condition of the IMP, the divisibility condition. If we take the double integrator then the divisibility condition will be satisfied and we obtain
\[
E(s)=\frac{s+2}{s^3+2s^2+1}.
\]
However, $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.

Finally, let us try a controller of the form
\begin{equation}
G_c(s)=\frac{N_c(s)}{D_c(s)}=\frac{s+a}{s^2},
\label{eq:third_con}
\end{equation}
where $a$ is a design parameter that should be chosen to satisfy the both conditions of the IMP. Note that the above controller contains the model of the reference signal. Thus, we only need to select the design parameter $a$ so that the CLCP, $P_c(s)$, has its zeros in the open left half-plane, where
\begin{eqnarray*}
P_c(s) &=& D_p(s)D_c(s) + N_p(s)N_c(s)\\
&=& (s+2)s^2+ s + a\\
&=& s^3+2s^2+s+a
\end{eqnarray*}
Selecting $a=1$ yields $P_c(s)$ with its zeros at
\[
-1.7549,\, -0.1226 \pm j 0.7449
\]
and
\[
E(s)=\frac{s+2}{s^3+2s^2+s+1}
\]
Applying the final value theorem to $E(s)$, we obtain,
$\lim_{t\to \infty} e(t) = 0$.

The selection of $a=1$ results in the desired steady-state behavior of the closed-loop system.\index{steady-state behavior!of the closed-loop system} However, the above controller may, or may not, guarantee the desired transient performance of the closed-loop system.\index{transient performance!of the closed-loop system} Thus further tuning of the parameter $a$ may be necessary.
\end{example}\markex

In industrial applications, control engineers usually specify the performance of the controlled system based on the system step response. In such a case $r(t)$ is a step function, which sometimes is also referred to as the constant {\it set-point\/},\index{set-point!constant} which can be represented as
\[
r(t)=\left\{\begin{array}{ccc}
0 & \mb{for} & t<0\\
A & \mb{for} & t\ge 0,
\end{array}  \right.
\]
where $A$ is the constant set-point value. Recall that the Laplace transform of the above signal is
\[
R(s)={\cal L}(r(t))=\frac{A}{s}.
\]
Taking the above into account it is easy to see that the integral~(I) controller\index{integral (I) controller} contains the model of the unit step function as well as any scalar multiple of it. If, in addition, the zeros of the CLCP are all in the open left-half plane, then $e(\infty)=0$ for any step input. For this reason, the I controller is often referred to as as {\it reset controller\/}\index{reset controller} because it automatically ensures $e(\infty)=0$ without an operator manually altering or ``resetting'' the set-point value to achieve a desired output value.


\section{PID Controller Architecture}
\label{sec:PID_architecture} We begin our discussion with a basic
PID controller architecture, also known as the type A~PID
controller;\index{PID controller!type A} it consists of three-terms. Later we discuss two
modifications, B and C, of the type A~PID control architecture.
%We will be referring to the type A PID controller as a PID controller.
The three terms of a PID controller attempt to fulfill the transient and steady-state specifications.\index{PID controller!transient and steady-state specifications}

To proceed, we need some notation. Let $u(t)$ denote the output of
the controller, which is the input signal to the plant. Recall
that $e(t)$ is the tracking error, that is, the difference between
the desired plant output, $r(t)$, and the actual plant output,
$y(t)$. Thus
\begin{equation}
e(t)=r(t)-y(t).
\label{eq:tracking_error}
\end{equation}


The three-term type A~PID control\index{type A PID control!three terms} law can be described as
\begin{equation}
u(t)=u_P(t)+u_I(t)+u_D(t),
\label{eq:three-term}
\end{equation}
where $u_P$ is the proportional term, $u_I$ is the integral term, and $u_D$ is the derivative term. We now analyze each term one by one.
\begin{itemize}
\item The proportional term, $u_P$, has the form
\begin{equation}
u_P(t) = K_P e(t),
\label{eq:propo-term}
\end{equation}
where $K_P$ is the proportional gain.\index{proportional gain!type A PID controller}\index{type A PID controller!proportional gain of}

The proportional term responds immediately to the current tracking error. Typically, however, it cannot achieve the desired tracking accuracy without excessively large gain.
\item The integral term, $u_I$, is given by
\begin{equation}
u_I(t) = \frac{K_P}{T_I}\int_0^t e(\tau) d\tau ,
\label{eq:integral-term}
\end{equation}
where $T_I$ is the integral time constant.\index{integral time constant!type A PID controller}\index{type A PID controller!integral time constant of}

The integral term yields a zero steady-state error in tracking a step function (a constant set-point). This term is slow in response to the current tracking error.
\item The derivative term, $u_D$, is
\begin{equation}
u_D(t) = K_P T_D \frac{d e(t)}{d t},
\label{eq:derivative-term}
\end{equation}
where $T_D$ is the derivative time constant.\index{derivative time constant!type A PID controller}\index{type A PID controller!derivative time constant of}

The derivative term is especially effective for plants with significant dead-time resulting in a poor representation of previous control actions in the current tracking error. This, in turn, as pointed out by Knospe~\cite{knospe06}, may lead to large transient error when PI control is used. The derivative action combats this problem by generating its action based on a prediction of future tracking error.\index{derivative action!combats large transient error} But there is a cost to be paid---the derivative term amplifies higher frequencies sensor noise. To alleviate the problem, a filtering of the differentiated signal is employed thus resulting in a PID controller with a derivative filter referred to as a PIDF controller.\index{PIDF controller!PID controller with a derivative filter} We present a PIDF controller in a section on implementing PID controllers.
\end{itemize}
Combining the above terms together, we obtain the type A PID control action, in the time domain,
\begin{eqnarray}
u(t)&=&u_P(t)+u_I(t)+u_D(t)\nonumber\\
&=& K_P\left(e(t)+\frac{1}{T_I}\int_0^t e(\tau) d\tau + T_D\frac{d e(t)}{dt}  \right).
\label{eq:PID_time_dom}
\end{eqnarray}

It is advantageous to work in the Laplace domain when analyzing the PID-controlled plant. The Laplace transfer function of the type A~PID controller, denoted $G_{PID}(s)$, is
\begin{equation}
G_{PID}(s)=\frac{U(s)}{E(s)}=K_P\left(1+\frac{1}{T_Is} + T_D s  \right),
\label{eq:PID_Lap_transfer}
\end{equation}
where $U(s)={\cal L}(u(t))$ is the Laplace transform\index{Laplace transform} of $u(t)$ and $E(s)={\cal L}(e(t))$ is the Laplace transform of the tracking error $e(t)$. In Figure~\ref{fig:PID_controlled_system}, we show a PID-controlled system with the type A~PID controller in the forward path.\index{forward path!type A~PID controller in forward path}
\begin{figure}
\setlength{\unitlength}{.08in}
\begin{center}
\begin{picture}(70,25)
\thicklines
\put(0,18){\vector(1,0){11}}
\put(0,19){\shortstack{Desired\\output}}
\put(0,14){\shortstack{Reference\\input}}
\put(14,18){\circle{6}}
\put(14,18){\line(1,1){2.12}}
\put(14,18){\line(-1,-1){2.12}}
\put(14,18){\line(-1,1){2.12}}
\put(14,18){\line(1,-1){2.12}}
\put(11,17){$+$}
\put(13,16){$-$}
\put(17,18){\vector(1,0){6}}
%\put(17,19){\shortstack{Actuating\\signal}}
\put(23,14){\framebox(20,8){$K_P\left(1+\frac{1}{T_I s}+T_D s  \right)$}}
\put(43,18){\vector(1,0){7}}
%\put(39,19){\shortstack{Controller\\output}}
%\put(41,14){\shortstack{Plant\\input}}
\put(50,14){\framebox(10,8){Plant}}
\put(60,18){\vector(1,0){10}}
\put(61,19){\shortstack{Actual\\output}}
%\put(65,18){\vector(0,-1){4}}
%\put(65,14){\line(0,-1){8}}
%\put(65,6){\line(-1,0){20}}
%\put(35,2){\framebox(10,8){Sensor}}
\put(65,18){\line(0,-1){12}}
\put(65,6){\line(-1,0){30}}
\put(14,6){\line(1,0){21}}
%\put(24,7){\shortstack{Measured\\output}}
\put(14,6){\vector(0,1){9}}
\end{picture}
\end{center}
\caption{A PID-controlled system.}
\label{fig:PID_controlled_system}
\end{figure}
%\begin{figure}
%\centering \epsfig{file=sz_01.eps,width=10cm}
%\caption{A PID-controlled system.} \label{fig:PID_controlled_system}
%\end{figure}

\section{PID Controller Tuning}
\label{sec:PID_tuning} The control engineer's task is to select
the PID controller's parameters to meet given performance
specifications. This process is referred to as the controller
tuning.\index{controller tuning!selecting the controller's parameters} The most widely known PID tuning rules were proposed by
Ziegler and Nichols~\cite{ziegler42} in 1942.\index{Ziegler and Nichols PID tuning rules} They proposed two
sets of tuning rules of the type A PID controllers. In both cases
the controller's parameters are selected based on the experimental
measurements of the controlled process.

\subsection{The Open-Loop Method---Tuning Based on Open-Loop Tests on the Plant}
The first method of choosing control settings for the PID
controller, proposed by Ziegler and Nichols, is based on open-loop
tests on the plant as shown in Figure~\ref{fig:first_ZN_method}.\index{Ziegler and Nichols!open-loop method}
\begin{figure}
\centering \epsfig{file=sz_02_2009.eps,width=7cm}
\caption{Open-loop test on the plant---measuring the step response of the plant.} \label{fig:first_ZN_method}
\end{figure}
There is a restriction on the applicability of this method. The method can only be applied if the step response is $S$-shaped as shown in Figure~\ref{fig:S_shaped}.\index{step response!S-shaped} The $S$-shaped step response can be characterized using three parameters: the delay time (dead-time) $L$, the time constant $T$, and the steady-state gain (process gain) $K$.\index{step response!delay time (dead-time) $L$ of}\index{step response!steady-state gain (process gain) $K$ of}
\begin{figure}
\centering \epsfig{file=sz_03_2009.eps,width=9cm}
\caption{An $S$-shaped step response and its characterization using three parameters.} \label{fig:S_shaped}
\end{figure}

We add that a plant with the $S$-shaped step response can be approximately\index{S-shaped step response!approximation of} modeled by a first-order transfer function with transportation delay,\index{first-order transfer function!with transportation delay}
\begin{equation}
\frac{Y(s)}{U(s)}=G_d(s)=\frac{Ke^{-Ls}}{Ts+1}.
\label{eq:firs_delay}
\end{equation}
We illustrate the procedure of approximating a system with an $S$-shaped step response using a first-order transfer function with transportation delay given by~(\ref{eq:firs_delay}) with the following example.

\begin{example}\label{examp:compa_tfs}\rm We consider, as in Ogata~\cite[p.~444]{ogata97}, a plant modeled by the second-order transfer function
\begin{equation}
G_p(s)=\frac{10}{(s+1)(s+5)}=\frac{10}{s^2+6s+5}.
\label{eq:sec_ordertf}
\end{equation}
Using the procedure illustrated in Figure~\ref{fig:S_shaped}, we approximate the second-order transfer function~(\ref{eq:sec_ordertf}) using the first-order transfer function with transportation delay,
\begin{equation}
G_d(s)=\frac{Ke^{-Ls}}{Ts+1}=\frac{2 e^{-0.053 s}}{0.798 s +1}.
\label{eq:fordelay}
\end{equation}
In Figure~\ref{fig:twomods}, we compare the step responses of the above two transfer functions. One can see that approximating the $S$-shaped step step response of a dynamical system using a first-order transfer function with transportation delay is a challenging problem. Optimization methods, such as genetic algorithms and particle swarm optimizers are the tools that can be used here effectively to determine parameters $L$ and $T$ that result in $G_d(s)$ that ``best'' approximates a given $G_p(s)$.
\begin{figure}
\centering \epsfig{file=TWOMODS_2009.eps,height=7.5cm}
\caption{Comparison of step responses of the second-order system and its approximation using a first-order system with transportation delay in Example~\ref{examp:compa_tfs}.} \label{fig:twomods}
\end{figure}
\end{example}\markex

Ziegler and Nichols proposed a set of tuning rules, formulas,
using the parameters that characterize the step response of the
plant modeled by the transfer function~(\ref{eq:firs_delay}).
These tuning formulas are shown in Table~\ref{tab:first_ZN}.
\begin{table}[h]
\begin{center}
\caption{Ziegler-Nichols tuning formulas based on the step
response of the plant (open-loop method).} \label{tab:first_ZN}
\begin{tabular}{cccc}\hline Controller & $K_P$ & $T_I$ &
$T_D$\\\hline
P & $\frac{T}{L}$ & $\infty$ & $0$\\
PI & $0.9\frac{T}{L}$ & $\frac{L}{0.3}$ & $0$\\
PID & $1.2\frac{T}{L}$ & $2L$ & $0.5L$\\
 \hline
\end{tabular}
\end{center}
\end{table}



Substituting the tuning parameters given in
Table~\ref{tab:first_ZN} into the transfer function of the PID
controller gives
\begin{eqnarray}
G_{PID}(s)&=&K_P\left(1+\frac{1}{T_I} s + T_D s  \right)\nonumber\\
&=& 1.2\frac{T}{L}\left(1+\frac{1}{2 L s} + 0.5 L s  \right)\nonumber\\
&=& 0.6 T \frac{\left(s+\frac{1}{L}  \right)^2}{s}.
\label{eq:PID_tf_first_ZN}
\end{eqnarray}
%Note that the the process gain $K$ in the transfer
%function~(\ref{eq:firs_delay}) is cancelled out by $1/K$ in the
%transfer function of the type A PID controller shown in
%Figure~\ref{fig:PID_controlled_system}.
Thus the type A~PID
controllers tuned using the formulas of the open-loop method can
be parameterized by two parameters, $T$ and $L$.\index{type A PID
controller!parameterized by two parameters, $T$ and $L$}


The ACT controller manufacturer, as well as Li, Ang, and Chong~\cite{li06},
present slightly modified Ziegler-Nichols open-loop tuning
formulas shown in Table~\ref{tab:mo_first_ZN}. The only difference
between the formulas shown in Table~\ref{tab:first_ZN} and those
in Table~\ref{tab:mo_first_ZN} is in the first column where all
the column elements of the first column of Table~\ref{tab:mo_first_ZN} are obtained by dividing by $K$ the corresponding elements of Table~\ref{tab:first_ZN}.
\begin{table}[h]
\begin{center}
\caption{Modified Ziegler-Nichols tuning formulas based on the
step response of the plant (open-loop method).}
\label{tab:mo_first_ZN} \begin{tabular}{cccc}\hline
Controller & $K_P$ & $T_I$ & $T_D$\\\hline
P & $\frac{T}{LK}$ & $\infty$ & $0$\\
PI & $0.9\frac{T}{LK}$ & $\frac{L}{0.3}$ & $0$\\
PID & $1.2\frac{T}{LK}$ & $2L$ & $0.5L$\\
 \hline
\end{tabular}
\end{center}
\end{table}
\subsection{The Closed-Loop Method---Tuning Based on Closed-Loop Tests on the Plant}

The second method of Ziegler and Nichols of tuning PID controllers
is also known as the the closed-loop method.\index{Ziegler and Nichols!closed-loop method} This method requires
an experiment on the closed-loop system as shown in
Figure~\ref{fig:cl_exp_ZN2}.
\begin{figure}
\centering \epsfig{file=sz_04_2009.eps,width=8cm}
\caption{Experimental setup to determine the critical gain, $K_{cr}$ and critical period of oscillation, $P_{cr}$.} \label{fig:cl_exp_ZN2}
\end{figure}

In this experiment, we have a pure P-controller in the {\it feed-forward path\/}.\index{P-controller!in feed-forward path}\index{feed-forward path} A step is applied as the input and the response is observed. The test is repeated with increased or decreased controller gain until a sustained oscillation\index{sustained oscillation!using P-controller} is achieved, as shown in Figure~\ref{fig:oscil_ZN2}. This gain is called the ``critical gain'' and denoted $K_{cr}$.\index{critical gain!$K_{cr}$} The period of the sustained oscillation is called the critical period and denoted $P_{cr}$.\index{critical period!$P_{cr}$}
\begin{figure}
\centering \epsfig{file=sz_05_2009.eps,width=9cm}
\caption{Measuring the period of the sustained oscillation, $P_{cr}$.} \label{fig:oscil_ZN2}
\end{figure}
Using the parameters $K_{cr}$ and $P_{cr}$, Ziegler and Nichols proposed tuning formulas depicted in Table~\ref{tab:second_ZN}.
\begin{table}[h]
\begin{center}
\caption{Ziegler-Nichols tuning formulas based on critical gain $K_{cr}$ and critical period $P_{cr}$ (closed-loop method).}
\label{tab:second_ZN}
\begin{tabular}{cccc}\hline
Controller & $K_P$ & $T_I$ & $T_D$\\\hline
P & $0.5 K_{cr}$ & $\infty$ & $0$\\
PI & $0.45 K_{cr}$ & $\frac{P_{cr}}{1.2}$ & $0$\\
PID & $0.6 K_{cr}$ & $0.5 P_{cr}$ & $0.125 P_{cr}$\\
 \hline
\end{tabular}
\end{center}
\end{table}
Substituting the tuning parameters from Table~\ref{tab:second_ZN} into the transfer function of the type A PID controller, we obtain
\begin{eqnarray}
G_{PID}(s)&=&K_P\left(1+\frac{1}{T_I} s + T_D s  \right)\nonumber\\
&=&0.6 K_{cr}\left(1+\frac{1}{0.5 P_{cr} s} + 0.125 P_{cr} s  \right)\nonumber\\
&=& 0.075 K_{cr} P_{cr} \frac{\left(s+\frac{4}{P_{cr}}  \right)^2}{s}.
\label{eq:PID_tf_second_ZN}
\end{eqnarray}
As in the open-loop method, the type A PID controllers tuned using the formulas of the closed-loop method can be parameterized by two parameters; this time by $K_{cr}$ and $P_{cr}$.

In summary, both the open-loop and closed-loop Ziegler-Nichols tuning rules allow us to parameterize the type A~PID controllers using just two parameters. That is, we can represent a family of type A~PID controllers as
\begin{equation}
G_{A-PID}=K_c\frac{(s+a)^2}{s},
\label{eq:APID}
\end{equation}
where $K_c$ and $a$ are design parameters.\index{family!of type A~PID controllers}\index{type A~PID controllers!family of} The above representation can be used to computationally obtain parameters' values that satisfy design specifications---see~Exercise~\ref{exer:Two_par_PID}.

\section{Implementing PID Controllers}

If the reference input\index{reference input} is a step, then because of the presence of
the derivative term, the controller output will involve an impulse
function. In addition, the derivative term amplifies high
frequency sensor noise. To alleviate the above problems, the pure
derivative term is replaced with a derivative filter, which
results in the PIDF controller.\index{PIDF controller!pure
derivative replaced with derivative filter}

\subsection{PIDF Controller}
In the PIDF controller, the pure differentiator is
approximated with the pure differentiator cascaded
with a first-order low-pass filter. Thus the pure derivative term is replaced by the approximate differentiator and so the derivative term contribution would take the form,\index{derivative!approximate differentiator}
\begin{equation}
U_D(s)=\frac{K_P T_D s}{\gamma T_D s + 1}E(s),
\label{eq:udfilt}
\end{equation}
where $\gamma$ is a small parameter, for example, $\gamma=0.1$.
The transfer function of the type A PIDF controller has the form
\begin{equation}
G_{PIDF}=K_P\left(1+\frac{1}{T_I} s + \frac{T_D s}{\gamma T_D s +
1} \right). \label{eq:pidftf}
\end{equation}

For a step reference, the PIDF controller output will involve a
sharp pulse rather than an impulse function. This is referred to
as the {\it set-point kick phenomenon\/}.\index{set-point kick phenomenon}

\begin{example}\label{ex:firstmePID}\rm
In this example, we use the open-loop Ziegler-Nichols tuning
formulas given in Table~\ref{tab:first_ZN} to tune the PIDF
controller for plant models in Example~\ref{examp:compa_tfs}. We
first apply the PIDF controller to the second-order transfer
function given by~(\ref{eq:sec_ordertf}). We add that the
proportional gain was tuned as
\[
K_P=1.2\frac{T}{L}=18.068
\]
because for
the modified gain, $K_P=1.2\frac{T}{LK}$, the closed-loop system
becomes unstable. The remaining parameters are:
\[
T_I=2L=0.106,\quad T_D=0.5 L = 0.0265,\quad\mb{and}\quad \gamma=0.1.
\]
The plant output and the
control signal plots versus time are shown in
Figure~\ref{fig:pidfso}.
\begin{figure}
\centering \epsfig{file=PIDFSO_2009.eps,height=9cm}
\caption{PIDF-controlled second-order system's step response of
Example~\ref{ex:firstmePID}, where the reference input is a step
function delayed by 0.5~s in order to better observe the set-point
kick phenomenon.} \label{fig:pidfso}
\end{figure}
The system output is very oscillatory and takes long time to settle down. We can observe the set-point kick phenomenon in the plot of the control effort versus time.

We then applied the type A PIDF controller to the transfer function given by~(\ref{eq:fordelay}). Here, on the other hand, we used $K_P=1.2\frac{T}{LK}$ because for $K_P=1.2\frac{T}{L}$ the closed-loop system becomes unstable. The plant output and the control signal plots versus time are shown in Figure~\ref{fig:pidfde}.
\begin{figure}
\centering \epsfig{file=PIDFDE_2009.eps,height=9cm}
\caption{Step response of the PIDF-controlled first-order system with transportation delay in Example~\ref{ex:firstmePID}.}
\label{fig:pidfde}
\end{figure}
Here, as in the previous case, we can observe a set-point kick phenomenon. The closed-loop system is much faster here but the overshoot is at unacceptable level.

We conclude that the open-loop Ziegler-Nichols tuning rules do not necessarily yield excellent performance of the PID-controlled system. The controller requires careful additional tuning. To illustrate this point, we doubled the values of $K_P$, $T_I$, and $T_D$. The re-tuned PIDF controller performance applied to the second-order plant is shown in Figure~\ref{fig:pidfsom}. This re-tuning\index{re-tuning!of PIDF controller} was suggested by Ogata~\cite[p.~165]{ogata97sm}.
\begin{figure}
\centering \epsfig{file=PIDFSOM_2009.eps,height=9cm} \caption{Step
response of the closed-loop system with re-tuned PIDF controller
and second-order plant in Example~\ref{ex:firstmePID}.}
\label{fig:pidfsom}
\end{figure}
However the re-tuned controller does not work for the first-order plant with transportation delay. The closed-loop system driven by this controller is in fact unstable.
\end{example}\markex

As we observed before, in addition to the transient performance,
the designer has to deal with the set-point kick phenomenon.\index{set-point kick phenomenon} We
address this issue next.

\subsection{Integrator Windup}
When implementing a PID controller,\index{implementing!a PID controller}\index{PID controller implementation} we need to take into account
physical constraints of the controlled plant. In particular, a
control engineer has to remember that all actuators have physical
limitations; a motor has a finite limited speed while a valve can
only be opened to its limits. Thus a control engineer is
faced with the problem of actuator saturation. To illustrate the
issue, consider Example~\ref{ex:firstmePID}. Suppose that the
actuator saturation limits are $\pm 10$, that is,
\[
|u(t)|\le 10 .
\]
These constraints are violated in the above example because of
the set-point kick phenomenon. Let us now impose the constraints
on the control action and see how this affects the closed-loop
system behavior.

\begin{example}\label{ex:sat_problem}\rm
First, we consider the second-order plant~(\ref{eq:sec_ordertf})
simulated in the previous example. We impose constraints on
the actuator,\index{constraints on actuator} $|u(t)|\le 10$. The PIDF controller parameters are
the same as the ones we used in the simulation shown in
Figure~\ref{fig:pidfsom}. The output of the closed-loop system is
shown in Figure~\ref{fig:bndso}.
\begin{figure}
\centering \epsfig{file=bndso_2009.eps,height=9cm} \caption{A
PIDF-controlled second-order plant with with constrained
actuator.} \label{fig:bndso}
\end{figure}
\begin{figure}
\centering \epsfig{file=bndde_2009.eps,height=9cm} \caption{Plant
output of the PIDF-controlled first-order plant with with
transportation delay and constraints on input.} \label{fig:bndde}
\end{figure}
\end{example}\markex

As can be seen in Figure~\ref{fig:bndso} and~\ref{fig:bndde}, in
both cases the control signal saturates in the moment the
reference input is applied. The input to the plant remains
saturated\index{saturated plant input!feedback loop broken}\index{feedback loop broken!due to saturated plant input} in the sense that the feedback loop is broken because
the controller's output is not responding to its input. The output
of the integral term continues to increase because the tracking
error is positive. The output of the integral term starts
decreasing when the plant's output becomes larger than the
reference input. However, the controller stays saturated for some
time because of the excessively large output of the integral term.
As a result of the integral term excessive output, the plant's
output has a large overshoot. This phenomenon of excessive
integrator term output resulting in the large overshoot of the
plant's output is called the {\em integrator windup}.\index{excessive
integrator output!resulting in the large overshoot}\index{integrator windup!excessive
integrator output}

We can avoid or reduce the integrator windup by reducing the
integral term output when the actuator saturates. A possible
{\it anti-windup\/}\index{anti-windup} scheme is shown in Figure~\ref{fig:A_anti_w}. This
anti-windup mechanism is referred to as tracking or back
calculation.
\begin{figure}
\centering \epsfig{file=A_anti_w.eps,width=15cm}
\caption{A type A PID controller with the integrator anti-windup.} \label{fig:A_anti_w}
\end{figure}
In Figure~\ref{fig:antiso}, we show the output of the PIDF-controlled second-order plant with the anti-wind, where $T_A=T_I/0.075$.
\begin{figure}
\centering \epsfig{file=antiso_2009.eps,height=9cm} \caption{Plant
output of the PIDF-controlled second-order plant with the
integrator ani-windup circuit.} \label{fig:antiso}
\end{figure}
In Figure~\ref{fig:antiwde}, we show the output of the first-order
plant with transportation delay controlled with a PIDF controller
with the integrator windup. The PIDF controller parameters are the
same as in the simulation of Figure~\ref{fig:pidfde}, and
$T_A=0.21$.
\begin{figure}
\centering \epsfig{file=antiwde_2009.eps,height=9cm}
\caption{Plant output of the PIDF-controlled first-order plant with transportation delay and the integrator ani-windup.} \label{fig:antiwde}
\end{figure}

\section{Modified PID Control Schemes}

We now discuss two alternative schemes to eliminate the set-point
kick phenomenon.\index{set-point kick phenomenon!elimination of} We first take another look at the type A~PID
control architecture as shown in Figure~\ref{fig:Detail_PID}.
\begin{figure}
\centering \epsfig{file=sz_07_2009.eps,width=11cm}
\caption{More detailed view of the type A~PID controller.} \label{fig:Detail_PID}
\end{figure}
In order to avoid differentiating a step reference input, it is
proposed to operate the derivative action in the feedback as shown
in Figure~\ref{fig:TypeB_PID}; hence its name, the PI-D controller\index{PI-D controller!type B~PID controller}
also referred to as the type B~PID controller.\index{type B~PID controller|see{PI-D controller}} A practical implementation of this controller that we refer to as the type B~PIDF controller action can be described as
\[
U(s)=K_P\left(1+\frac{1}{T_I s}  \right)E(s) - \frac{K_P T_D s}{\gamma T_D s + 1} Y(s).
\]
\begin{figure}
\centering \epsfig{file=sz_08_2009.eps,width=11cm}
\caption{Type B~PID controller.} \label{fig:TypeB_PID}
\end{figure}
We can go even further and move the proportional and derivative actions into feedback giving us the I-PD control or the type C~PID controller\index{type C~PID controller|see{I-PD controller}}\index{I-PD controller!type C~PID controller} shown in Figure~\ref{fig:TypeC_PID}. A practical implementation of this controller that we refer to as the type C~PIDF controller action can be described as\index{type C~PIDF controller!practical implementation of I-PD}
\[
U(s)=\frac{K_P}{T_I s} E(s) -K_P\left(1 + \frac{T_D s}{\gamma T_D s + 1}\right) Y(s).
\]
\begin{figure}
\centering \epsfig{file=sz_09_2009.eps,width=11cm}
\caption{Type C~PID controller.} \label{fig:TypeC_PID}
\end{figure}

\section{Digital Implementation}

In this section we present a method of implementing PID controllers using a computer.\index{implementing PID controllers!using a computer} To obtain a computer implementation, we need to discretize the continuous-time differential equation describing a controller at hand.

We discuss discretization of different terms of the type A~PIDF controller.\index{discretization!of type A~PIDF controller} The types B and C PIDF controllers can be easily obtained by modifying the A~PIDF architecture.  In our discussion, we assume that the sampling instants are equally spaced. We denote the sampling period as $h$, and sampling instants as $t_k$, where $k=0,1,2,\ldots$ .
\begin{itemize}
\item The discrete-time version of the proportional term, $u_P(t_k)$, has the form\index{discrete-time version!of the proportional term}
\begin{equation}
u_P(t_k) = K_P e(t_k),
\label{eq:dpropo-term}
\end{equation}
where $K_P$ is the proportional gain.
\item Recall that the continuous-time integral term, $u_I(t)$, is given by
\[
u_I(t) = \frac{K_P}{T_I}\int_0^t e(\tau) d\tau ,
\]
Differentiating both sides of the above integral equation yields
\[
\frac{d u_I(t)}{dt}=\frac{K_P}{T_I} e(t).
\]
We can use several methods to discretize the above differential equation. Using the forward difference discretization\index{forward difference discretization} gives
\begin{equation}
u_I(t_{k+1})=u_I(t_k)+\frac{K_P h}{T_I} e(t_k).
\label{eq:dintegral-term}
\end{equation}
For other discretization methods, the reader may wish to consult Section~\ref{section:numeric_techniq} on numerical techniques.
\item Performing cross-multiplication in~(\ref{eq:udfilt}) and representing the resulting polynomial equation, in the Laplace variable $s$, into the time domain gives the continuous-time differential equation describing the filtered derivative term,
\begin{equation}
\gamma T_D \frac{d u_D(t)}{dt}  + u_D(t)=  K_P T_D \frac{d e(t)}{dt}.
\label{eq:fil_diff}
\end{equation}
The forward difference discretization of the above differential equation yields
\begin{equation}
u_D(t_{k+1}) = \left(1-\frac{h}{\gamma T_D}  \right) u_D(t_k) + \frac{K_P}{\gamma}\left( e(t_{k+1})-e(t_k) \right).
\label{eq:fdderivative-term}
\end{equation}
On the other hand, the backward difference discretization of the differential equation~(\ref{eq:fil_diff}) gives,
\begin{equation}
u_D(t_{k}) = \frac{\gamma T_D}{\gamma T_D+h}   u_D(t_{k-1}) + \frac{T_D K_P}{\gamma T_D + h}\left( e(t_{k})-e(t_{k-1}) \right).
\label{eq:bdderivative-term}
\end{equation}
\end{itemize}
Combining~(\ref{eq:dpropo-term}), (\ref{eq:dintegral-term}), and~(\ref{eq:bdderivative-term}), we obtain a discrete-time approximation of the type A~PIDF controller,\index{type A~PIDF controller!discrete-time approximation}\index{discrete-time approximation!of type A~PIDF controller}
\begin{equation}
\left. \begin{array}{ccl}
u_P(t_k) &=& K_P e(t_k)\\
u_D(t_{k}) &=& \frac{\gamma T_D}{\gamma T_D+h}   u_D(t_{k-1}) + \frac{T_D K_P}{\gamma T_D + h}\left( e(t_{k})-e(t_{k-1}) \right)\\
u(t_k)& = & u_P(t_k)+u_I(t_k)+u_D(t_k)\\
u_I(t_{k+1}) &=& u_I(t_k)+\frac{K_P h}{T_I} e(t_k)
\end{array}
 \right\}
\label{eq:d_pidf_bd}
\end{equation}
To implement the above controller, one can use the zero-order hold---see Exercises~\ref{exer:PI_digit}, \ref{exer:PID_Dig}, and~\ref{exer:C_PID_Dig}.\index{zero-order hold}

\section{Notes}

The first PID controllers for industrial applications were introduced in 1939 by the Taylor Instrument Company and the Foxboro Instrument Company.\index{Taylor Instrument Company!first PID controllers}\index{Foxboro Instrument Company!first PID controllers} For an account of the PID controller development along with an overview of early process control devises, we recommend Bennett~\cite{bennett93}. For an account of recent advances in PID control, see an article by Li, Ang, and Chong~\cite{li06}. See also H{\"{a}}gglund and {\AA}str{\"{o}}m for a discussion of automatic tuning of PID controllers~\cite{hagglund11}.

Many engineers are familiar with PID controllers and prefer to enhance the performance of a well-known solution through additional capabilities rather than switch to an untested solution. Knospe~\cite{knospe06} observers that even alternative digital control methods have not supplanted PID's primacy in industrial control\index{PID's primacy!in industrial control} with a possible exception of model predictive control,\index{model predictive control} where the control action is calculated on the fly. Knospe~\cite{knospe06} adds that PID control still has a role even in this case by handling lower level loops.

Welander states in~\cite{welander10} that about 90\% of loops that employ PID control are probably PI control.\index{PI control} This is because derivative action is the least understood. ``{\em Derivative} acts as a brake or dampener on the control effort. The more the controller tries to change the value, the more it counteracts the effort.'' Welander concludes his analysis of the D part in PID architecture\index{PID!architecture} as follows: ``Ultimately, the use of derivative action can be beneficial, but it has to be used in the right situations and in the right amounts. Your starting assumption should be to see if the process will run satisfactorily on PI control alone.'' He continues to say that, adding derivative should be done cautiously and with appropriate filtration. ``Like cooking with hot sauce, in the right context and in skilled hands, the result can be remarkable. But if it's used inappropriately, it's a recipe for disaster''~\cite{welander10}.

\section{Exercises}
\begin{exercise}\label{exer:one_imp}\rm Propose a simple controller for the system in Example~\ref{ex:imp_one} that yields $e(\infty)=0$ when the reference signal is
\[
r(t)=\frac{1}{2} t^2 1(t),
\]
where $1(t)$ is the unit step function. Recall that
\[
R(s)={\cal L}(r(t))=\frac{1}{s^3}.
\]
\end{exercise}

\begin{exercise}\label{exer:Two_par_PID}\rm (Based on Ogata~\cite[p.~692]{ogata02}) For the PID-controlled system shown in Figure~\ref{fig:Two_par_PID}, write a MATLAB program that finds a combination of the parameters $K_c$ and $a$ such that the maximum overshoot\index{maximum overshoot} of the system output $y(t)$ is in the range $(5\%, 10\%)$. Assume the following search region for $K_c$ and $a$,
\[
5\le K_c \le 20\quad\mb{ and }\quad 5\le a \le 10 .
\]
Plot the unit-step response for the first found set of the parameters that satisfy the overshoot specifications.
\begin{figure}[h]
\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$K_c\frac{(s+a)^2}{s}$}}}
%\put(30,11){{\large$G_c(s)=\frac{N_c(s)}{D_c(s)}$}}
\put(30,11){ PID Controller}
\put(43,18){\vector(1,0){7}}
\put(50,14){\framebox(10,8){{\large$\frac{10}{s^2+6s + 5}$}}}
%\put(52,24){Plant}
%\put(52,11){{\large$G_p(s)$}}
\put(60,18){\vector(1,0){12}}
\put(66,19){{\large$Y(s)$}}
\put(67,15){{\large$y(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 PID controlled system of Exercise~\ref{exer:Two_par_PID}.}
\label{fig:Two_par_PID}
\end{figure}
\end{exercise}

\begin{exercise}\label{exer:B_PID}\rm Compare the performance of the type B~PID controller\index{type B~PID controller} on the plants of Example~\ref{examp:compa_tfs} with constraints on the plant input of the form, $|u(t)|\le 10$. Plot $u(t)$ versus time.
\end{exercise}

\begin{exercise}\label{exer:C_PID}\rm Compare the performance of the type C~PID controller\index{type C~PID controller} on the plants of Example~\ref{examp:compa_tfs} with constraints on the plant input of the form, $|u(t)|\le 10$. Plot $u(t)$ versus time.
\end{exercise}

\begin{exercise}\label{exer:PI_digit}\rm Compare the performance of the digital PI controller,\index{digital PI controller}\index{PI controller!digital} $u(t_k) =  u_P(t_k)+u_I(t_k)$ given by~(\ref{eq:d_pidf_bd}), on the plants of Example~\ref{examp:compa_tfs} with constraints on the plant input\index{input constraints} of the form, $|u(t)|\le 10$. Use the zero-order hold.\index{zero-order hold} Analyze the controller performance with and without the integrator anti-windup.\index{integrator anti-windup} Plot $u(t)$ versus time.
\end{exercise}


\begin{exercise}\label{exer:PID_Dig}\rm Compare the performance of the digital type B~PIDF controller\index{digital type B~PIDF controller}\index{type B~PIDF controller!digital} on the plants of Example~\ref{examp:compa_tfs} with constraints on the plant input of the form, $|u(t)|\le 10$. Equations describing this controller can be obtained by modifying the derivative term of the architecture~(\ref{eq:d_pidf_bd}). Use the zero-order hold in the controller implementation. Plot $u(t)$ versus time.
\end{exercise}

\begin{exercise}\label{exer:C_PID_Dig}\rm Compare the performance of the digital type C~PIDF controller\index{digital type C~PIDF controller}\index{type C~PIDF controller!digital} on the plants of Example~\ref{examp:compa_tfs} with constraints on the plant input of the form, $|u(t)|\le 10$. Equations describing this controller can be obtained by modifying the proportional and derivative terms of the architecture~(\ref{eq:d_pidf_bd}). Use the zero-order hold\index{zero-order hold!in controller implementation} in the controller implementation. Plot $u(t)$ versus time.
\end{exercise}


\begin{exercise}\label{exer:one_lin_PID}\rm For the one-link manipulator from Exercise~\ref{exer:one-link_compensat}, use the linearized model from Part~{\bf (b)} of that exercise to design\begin{itemize}
\item[{\bf (a)}] digital, type A PIDF controller. Implement and perform animation of the closed-loop system comprised of the PID controller driving the nonlinear model of the robot;
\item[{\bf (b)}] assume that the actuator saturation limits are $\pm 10$.  Design, implement, and perform animation of
the digital, type A PIDF controller with the integrator anti-windup on the nonlinear model of the robot.
\end{itemize}
\end{exercise}

\begin{exercise}\label{exer:two_lin_PID}\rm For the nonlinear model of a double-link robot manipulator in Subsection~\ref{subsection:two_link_robot}, use the linearized model of this robot obtained in Exercise~\ref{exer:linearized_2_link} to design\begin{itemize}
\item[{\bf (a)}] digital, type A PIDF controller. Implement and perform animation of the closed-loop system comprised of the PID controller driving the nonlinear model of the robot;
\item[{\bf (b)}] assume that the actuator saturation limits are $\pm 10$.  Design, implement, and perform animation of
the digital, type A PIDF controller with the integrator anti-windup on the nonlinear model of the robot.
\end{itemize}
\end{exercise} 