home

PDF (letter size)

Determination of PID controller parameters from step response specifications

Nasser M. Abbasi

June 30, 2015   Compiled on January 31, 2024 at 2:32am

This note describes how to design a PID controller for a system defined by second order differential equation based on requirements for a step response specified by the rise time and the settling time.

The goal is to determine the three PID parameters (Ki,Kd,Kp) from the plant transfer function and tr,ts (rise time and settling time).

Consider the following mechanical system

M is the mass of the car, b is the damping coefficient and k is the spring constant. To illustrate, assuming standard SI units:M=1 kgb=10 Ns/mk=20 N/m

The first step is to derive the mathematical model for the system. This means finding a differential equation that relates the output (the displacment y(t)) to the input, which is the applied force u(t).The fFriction force between the mass M and the ground is ignored in this example.

The first step is to make a free body diagram

Applying Netwon laws gives F=mau(t)by(t)ky(t)=My(t)

orMy(t)+by(t)+ky(t)=u(t) Taking Laplace transform and assuming zero initial conditions gives Ms2Y(s)+bsY(s)+kY(s)=U(s) The transfer function is defined as the ratio of the output to the input in the Laplace domain. Here the input is u(t), which is the external force, and the output is y(t) which is the displacement. Taking the Laplace transform of the above differential equation gives the transfer function sys(s)=Y(s)U(s)=1Ms2+bs+k Using block diagram the transfer function is illustrated as

The PID controller is now added. The transfer function of the PID controller itself isKp+Kds+Kis The controller is added to the system and the loop is closed. The following diagram represents the updated system with the controller in place

Let L(s) be the open loop transfer function L(s)=Kp+Kds+KisMs2+bs+k=Kps+Kds2+KiMs3+bs2+ks Hence the closed loop transfer function isG(s)=L(s)1+L(s)=Kps+Kds2+KiMs3+bs2+ks+Kps+Kds2+Ki Therefore (1)G(s)=1M(Kds2+Kps+Ki)s3+s2(b+KdM)+s(k+KpM)+KiM

The closed loop transfer function (1) shows there are three poles.

Putting one pole at a distance of 5ζωn away from the imaginary axis, while the remaining two poles are the dominant poles results in the following diagram

The denominator of equation (1) can be rewritten ass3+s2(b+KdM)+s(k+KpM)+KiM(s+5ζωn)(s2+2ζωns+ωn2)s3+2ζωns2+sωn2+5ζωns2+10ζ2ωn2s+5ζωn3s3+s2(7ζωn)+s(10ζ2ωn2+ωn2)+5ζωn3

Equating coefficients gives b+KdM=7ζωnk+KpM=10ζ2ωn2+ωn2KiM=5ζωn3

Solving for PID parameters results in (2)Kd=7MζωnbKp=M(10ζ2ωn2+ωn2)kKi=5Mζωn3

These are the PID parameters as a function of ωn and ζ.

ωn 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 ts=2 sec
  2. The rise time tr=0.1 sec

Using the following for 2% criterion

(3)ts=4ζωn And the rise time is given bytr=πβωd

But β=arctan(ωn1ζ2ζωn), hence (4)tr=πarctan(1ζ2ζ)ωn1ζ2 From (3) and (4) ωn,ζ are solved for 2=4ζωn0.1=πarctan(1ζ2ζ)ωn1ζ2

Solving numerically gives

Hence the solution is ζ=0.1176 and ωn=17  rad/sec Substituting the values for ωn and ζ in (2), and the values given for M,b and k, gives the PID parameters Kd=7(1)(0.1176)(17)10=3.9944Kp=1(10(0.11762)(172)+(17)2)20=308.97Ki=5(1)(0.1176)(17)3=2888.8

Using Matlab, the step response is found