up

Determinatin of PID controller parameters based on step response specifications

Nasser M. Abbasi, May 2012


This paper describes how to design a PID controller for a system represented by a second order differential equation based on the user requirments for a step response given by the rise time and the settling time. The goal is to determine the 3 PID parameters ( $ K_{i},K_{d},K_{p}$) given the plant transfer function and $ t_{r},t_{s}$ (rise time and settling time).

Consider the following mechanical system

Image pid
Where $ M$ is the mass of the car,$ b$ is the damping coefficient,$ k$ is the spring constant.

Assume, using standard SI units:

$\displaystyle M$ $\displaystyle =1\ kg$
$\displaystyle b$ $\displaystyle =10\ Ns/m$
$\displaystyle k$ $\displaystyle =20\ N/m$

The first step is to derive a mathematical model for the system. This means to derive a differential equation which relates the output (the displacment $ y\left( t\right) $) to the input (which is the applied force $ u\left(
t\right) .$ Note that we ignored the friction force between the mass M and the ground. We assume there is no friction.

Start by drawing the free body diagram, and then apply Newton second law:

Image pid2
Apply Netwon law. we obtain

$\displaystyle F$ $\displaystyle =ma$
$\displaystyle u\left( t\right) -by^{\prime}\left( t\right) -ky\left( t\right)$ $\displaystyle =My^{\prime\prime}\left( t\right)$

or

$\displaystyle My^{\prime\prime}\left( t\right) +by^{\prime}\left( t\right) +ky\left(
t\right) =u\left( t\right)
$

Take laplace transform, and assume initial conditions, we obtain

$\displaystyle Ms^{2}Y\left( s\right) +bsY\left( s\right) +kY\left( s\right) =U\left(
s\right)
$

The transfer function is defined as the ratio of the output to the input in the Laplace domain. Here the input is $ u\left( t\right) $, which is the force on the body, and the output is $ y\left( t\right) $ which is the displacment. Hence the transfer function is

$\displaystyle sys\left( s\right) =\frac{Y\left( s\right) }{U\left( s\right) }=\...
...left( s\right) }{U\left( s\right) }=\frac
{1}{Ms^{2}+bs+k}%\end{displaymath}$

Using block diagram, the above can be draw as follows.
Image sys1
This is the system dynamic equation. Next we add a PID controller.

The transfer function of a PID controller is

$\displaystyle K_{p}+K_{d}s+\frac{K_{i}}{s}%
$

We add the above controller to the system and close the loop. The following diagram represents the updated system with this controller in place
Image sys2
Let $ L\left( s\right) $ be the open loop transfer function, hence

$\displaystyle L\left( s\right) =\frac{K_{p}+K_{d}s+\frac{K_{i}}{s}}{Ms^{2}+bs+k}%
=\frac{K_{p}s+K_{d}s^{2}+K_{i}}{Ms^{3}+bs^{2}+ks}%
$

Hence the closed loop transfer function is

$\displaystyle G\left( s\right) =\frac{L\left( s\right) }{1+L\left( s\right) }%
=\frac{K_{p}s+K_{d}s^{2}+K_{i}}{Ms^{3}+bs^{2}+ks+K_{p}s+K_{d}s^{2}+K_{i}}%
$

Hence

$\displaystyle \fbox{$G\left( s\right) =\frac{\frac{1}{M}\left( K_{d}s^{2}+K_{p}...
...c{b+K_{d}}{M}\right) +s\left( \frac{k+K_{p}}{M}\right) +\frac{K_{i}}{M}}$} %
$ (1)

Image sys3
Now looking at the closed loop transfer function (1), we see that there are 3 poles. We put one pole at a distance of $ 5\zeta\omega_{n}$ away from the imaginary axis, and the remaining 2 poles will be the dominant poles. Hence we obtain the following diagram
Image dom_poles
Hence the denominator of equation (1) can be rewritten as

$\displaystyle s^{3}+s^{2}\left( \frac{b+K_{d}}{M}\right) +s\left( \frac{k+K_{p}}%
{M}\right) +\frac{K_{i}}{M}$ $\displaystyle \equiv\left( s+5\zeta\omega_{n}\right) \left( s^{2}+2\zeta\omega_{n}s+\omega_{n}^{2}\right)$
  $\displaystyle \equiv s^{3}+2\zeta\omega_{n}s^{2}+s\omega_{n}^{2}+5\zeta\omega_{n}%
s^{2}+10\zeta^{2}\omega_{n}^{2}s+5\zeta\omega_{n}^{3}$
  $\displaystyle \equiv s^{3}+s^{2}\left( 7\zeta\omega_{n}\right) +s\left( 10\zeta ^{2}\omega_{n}^{2}+\omega_{n}^{2}\right) +5\zeta\omega_{n}^{3}%
$

equating coefficients we obtain

$\displaystyle \frac{b+K_{d}}{M}$ $\displaystyle =7\zeta\omega_{n}$
$\displaystyle \frac{k+K_{p}}{M}$ $\displaystyle =10\zeta^{2}\omega_{n}^{2}+\omega_{n}^{2}$
$\displaystyle \frac{K_{i}}{M}$ $\displaystyle =5\zeta\omega_{n}^{3}%
$

Solve for PID parameters, we obtain

$\displaystyle K_{d}$ $\displaystyle =7M\zeta\omega_{n}-b$ (2)
$\displaystyle K_{p}$ $\displaystyle =M\left( 10\zeta^{2}\omega_{n}^{2}+\omega_{n}^{2}\right) -k$
$\displaystyle K_{i}$ $\displaystyle =5M\zeta\omega_{n}^{3}$

We have obtained the PID parameters as a function of $ \omega_{n},\zeta$.

Now we need to do is determine $ \omega_{n},\zeta$, and that will give us the PID parameters.

We now need to introduce the time response specifications we are required to design for. Assume the following are the requirments

  1. The settling time $ t_{s}=2\sec$

  2. The rise time $ t_{r}=0.1\sec$

But

$\displaystyle t_{s}=\frac{4}{\zeta\omega_{n}} %
$ (3)

for $ 2\%$ criterion. And the rise time is given by

$\displaystyle t_{r}=\frac{\pi-\beta}{\omega_{d}}%
$

Image sys6
but $ \beta=\arctan\left( \frac{\omega_{n}\sqrt{1-\zeta^{2}}}{\zeta\omega_{n}%
}\right) $, hence

$\displaystyle t_{r}=\frac{\pi-\arctan\left( \frac{\sqrt{1-\zeta^{2}}}{\zeta}\right) }{\omega_{n}\sqrt{1-\zeta^{2}}} %
$ (4)

From (3) and (4) we can solve for $ \omega_{n},\zeta$, hence we get the following 2 equations in 2 unknowns

$\displaystyle 2$ $\displaystyle =\frac{4}{\zeta\omega_{n}}$
$\displaystyle 0.1$ $\displaystyle =\frac{\pi-\arctan\left( \frac{\sqrt{1-\zeta^{2}}}{\zeta}\right) }{\omega_{n}\sqrt{1-\zeta^{2}}}%
$

Solving the above numerically, we obtain the solution as shown below
Image find_solution
The solution is

$\displaystyle \zeta=0.1176
$

and

$\displaystyle \omega_{n}=17\ $   rad/sec$\displaystyle %
$

Substitue these values of $ \omega_{n}$ and $ \zeta$ in equation(2), and the values given for $ M,b$ and $ k$, we obtain

$\displaystyle K_{d}$ $\displaystyle =7\left( 1\right) \left( 0.1176\right) \left( 17\right) -10=3.\,\allowbreak994\,4$ (5)
$\displaystyle K_{p}$ $\displaystyle =1\left( 10\left( 0.1176^{2}\right) \left( 17^{2}\right) +\left( 17\right) ^{2}\right) -20=308.\,\allowbreak97$
$\displaystyle K_{i}$ $\displaystyle =5\left( 1\right) \left( 0.1176\right) \left( 17\right) ^{3}=2888.\,\allowbreak8$

To obtain the step response, using Matlab, this is the result
Image sys4
me 2012-05-11