Determination of PID controller parameters fromstep response specifications
Nasser M. Abbasi
June 30, 2015 Compiled on May 24, 2020 at 2:04am
This note describes how to design a PID controller for a system defined by second orderdiοΏ½erential equation based on requirements for a step response specified by the rise timeand the settling time.
The goal is to determine the three PID parameters (πΎπ, πΎπ, πΎπ) from the plant transfer functionand π‘π, π‘π (rise time and settling time).
Consider the following mechanical system
M
b
k
ut
Mechanical system to control
yt
Figure 1: mechanical system
π is the mass of the car, π is the damping coeοΏ½cient and π is the spring constant. To
1
2
illustrate, assuming standard SI units:
π = 1 πππ = 10 ππ /ππ = 20 π/π
The first step is to derive the mathematical model for the system. This means finding adiοΏ½erential equation that relates the output (the displacment π¦(π‘)) to the input, which is theapplied force π’(π‘).The fFriction force between the mass M and the ground is ignored in thisexample.
The first step is to make a free body diagram
M ut
Free body diagram
yt
k yt
b y t
Figure 2: Free body diagram
Applying Netwon laws gives
πΉ = πππ’(π‘) β ππ¦β²(π‘) β ππ¦(π‘) = ππ¦β²β²(π‘)
orππ¦β²β²(π‘) + ππ¦β²(π‘) + ππ¦(π‘) = π’(π‘)
Taking Laplace transform and assuming zero initial conditions gives
ππ 2π(π ) + ππ π(π ) + ππ(π ) = π(π )
The transfer function is defined as the ratio of the output to the input in the Laplacedomain. Here the input is π’(π‘), which is the external force, and the output is π¦(π‘) which is
3
the displacement. Taking the Laplace transform of the above diοΏ½erential equation gives thetransfer function
π π¦π (π ) =π(π )π(π )
=1
ππ 2 + ππ + πUsing block diagram the transfer function is illustrated as
YsUs1
Ms2bsk
System differential equation as a transfer function
Figure 3: Transfer function
The PID controller is now added. The transfer function of the PID controller itself is
πΎπ + πΎππ +πΎππ
The controller is added to the system and the loop is closed. The following diagram repre-sents the updated system with the controller in place
YsUs 1
Ms2bsk
System Block diagram with a PID controller
+
-
Es NsKp Kds
K i
s
Figure 4: With PID
Let πΏ(π ) be the open loop transfer function
πΏ(π ) =πΎπ + πΎππ +
πΎππ
ππ 2 + ππ + π=
πΎππ + πΎππ 2 + πΎπ
ππ 3 + ππ 2 + ππ
4
Hence the closed loop transfer function is
πΊ (π ) =πΏ (π )
1 + πΏ (π )=
πΎππ + πΎππ 2 + πΎπ
ππ 3 + ππ 2 + ππ + πΎππ + πΎππ 2 + πΎπ
Therefore
πΊ (π ) =1ποΏ½πΎππ 2 + πΎππ + πΎποΏ½
π 3 + π 2 οΏ½ π+πΎπποΏ½ + π οΏ½
π+πΎππ
οΏ½ + πΎππ
(1)
YsUs +
-
Es
YsUs
Open loop transfer function using PID controller
a1Kds2KpsK i
s3a2s2a3s
a1Kds2KpsK i
s3s2a2a1Kdsa3a1Kpa1K i
Figure 5: Open loop
The closed loop transfer function (1) shows there are three poles.
Putting one pole at a distance of 5πππ away from the imaginary axis, while the remainingtwo poles are the dominant poles results in the following diagram
5
n
n 1 2
n
jd
pole placement
5n
Figure 6: Pole placement
The denominator of equation (1) can be rewritten as
π 3 + π 2 οΏ½π + πΎππ οΏ½ + π οΏ½
π + πΎπ
π οΏ½ +πΎππ
β‘ (π + 5πππ) οΏ½π 2 + 2ππππ + π2ποΏ½
β‘ π 3 + 2ππππ 2 + π π2π + 5ππππ 2 + 10π2π2
ππ + 5ππ3π
β‘ π 3 + π 2 (7πππ) + π οΏ½10π2π2π + π2
ποΏ½ + 5ππ3π
Equating coeοΏ½cients gives
π + πΎππ
= 7πππ
π + πΎπ
π= 10π2π2
π + π2π
πΎππ
= 5ππ3π
Solving for PID parameters results in
πΎπ = 7ππππ β π (2)
πΎπ = ποΏ½10π2π2π + π2
ποΏ½ β ππΎπ = 5πππ3
π
6
These are the PID parameters as a function of ππ and π.
ππ and π are determined in order to obtain the PID parameters.
The time response specifications are now introduced in order to determine these parameters.Assuming these are the time domain requirments
1. The settling time π‘π = 2 sec
2. The rise time π‘π = 0.1 sec
Using the following for 2% criterion
π‘π =4
πππ(3)
And the rise time is given by
π‘π =π β π½ππ
7
n
n 1 2
n
jd
s jd
sin
Dominant pole parameters
Figure 7: Dominant pole prameters
But π½ = arctan οΏ½πποΏ½1βπ2
ππποΏ½, hence
π‘π =π β arctan οΏ½οΏ½
1βπ2
π οΏ½
ππβ1 β π2(4)
From (3) and (4) ππ, π are solved for
2 =4
πππ
0.1 =π β arctan οΏ½οΏ½
1βπ2
π οΏ½
ππβ1 β π2
Solving numerically gives
8
restart;
> eq1:= 2 = 4 / (zeta*omega);
> k:= sqrt(1-zeta^2);
> eq2:= 0.1 = (Pi-arctan( k/zeta )) / (omega*k);
> fsolve({eq1,eq2});
:= eq1 24
:= k 1 2
:= eq2 0.1
arctan
1 2
1 2
{ }, 17.00484998 0.1176135045
Solution using Maple
Figure 8: Solution
Hence the solution isπ = 0.1176
andππ = 17 rad/sec
Substituting the values for ππ and π in (2), and the values given for π, π and π, gives thePID parameters
πΎπ = 7(1)(0.1176)(17) β 10= 3.9944
πΎπ = 1(10(0.11762)(172) + (17)2) β 20= 308.97
πΎπ = 5(1)(0.1176)(17)3
= 2888.8
Using Matlab, the step response is found
9
clear all; close all;
s=tf('s');
M=1;
b=10;
k=20;
gama=17;
zeta=0.1176;
Kd=(M*7*zeta*gama)-b
Kp=M*(gama^2+10*zeta^2*gama^2)-k
Ki=5*zeta*gama^3*M
sys=(Kd*s^2+Kp*s+Ki)/(M*s^3+s^2*(b+Kd)+s*(k+Kp)+Ki);
t=[0:0.01:2];
step(sys,t);
hold on;
line([0 2],[1 1],'Color','r');
%Ylim([0 1.2]);
legend('y(t)','u(t)');
title('step response. PID controller')
Step response using PID controller
Figure 9: Step solution using Matlab