Anda di halaman 1dari 11

EE380 (Control Systems)

Lecture 4: Experiment 3
Ziegler-Nichols tuning method for PID controllers

Ramprasad Potluri and Manavaalan Gunasekaran

Department of Electrical Engineering, IIT Kanpur.

August 23, 2013

Contents

5 Root locus view of closed-loop system

1 Announcements

3 6 Homework (HW) vs. Lab work (LW)

2 Second Ziegler-Nichols method

4 7 Discretization

3 Outline of the experiment

5 8 Simulate; LW: C code, Implement, Analyze

10

4 Why H(s) prefixed to first-order plant

6 9 Review of Exp.2: What the experiment taught

11

EE380-Controls Lab

2 of 11

2013

Announcements

Before doing an experiment, download latest versions of supporting documents from Brihaspati.
Turn off power supply to board when not programming dsPIC or taking readings.
After completion of experiment
Shut down PC, FG, PS.
Remove PICkit 2 from dsPIC board.

EE380-Controls Lab

3 of 11

2013

Second Ziegler-Nichols method

For plants exhibiting sustained oscillations under CL proportional control for some kp = kcr > 0.
Step 1: Form CL system with kp > 0.
ref +
u

kp
G(s)

Step 4: Determine period Pcr of oscillations.

Step 2: Apply step ref to CL system and record .

Step 5: Tune parameters of PID controller according


to table.

Pcr =

Step 3: With ref on, increase kp from 0 to kcr.

Number of periods (count peaks)


Time duration in which these periods fit

Unit step response of CL system under proportional control


2

PID controller

kp

Ti

TD

0.5kcr

PI

0.45kcr (1/1.2)Pcr

Rotor speed [rad/s]

1.5

PID

0.6kcr

0.5Pcr

0
0.125Pcr

0.5

0
0

10

Time [s]

EE380-Controls Lab

4 of 11

2013

Outline of the experiment

Want speed of motor to track a reference step. Steps:

29
s2 + 10s + 29

Vreq

Motor

unew

Saturation

u
0.8 uactual 1
Vs
Vs

H-bridge

H(s)

PWM

Convert plant into 3rd order by prefixing 2nd order TF.

Here, unew is controllers output, uactual is numerical value of voltage applied to motors armature, Vreq is
actual voltage applied to motors armature, is duty ratio of PWM signal.

kp

unew

29
s2 + 10s + 29

Vreq

Motor

ref +

Saturation

u
0.8 uactual 1
Vs
Vs

H-bridge

H(s)

PWM

Apply step ref & tune kp so that closed-loop (CL) systems output oscillates sustainedly.

Determine coefficients of P, PI, PID controllers.


Replace kp with Z-N P/PI/PID controller; observe CL systems response to step ref .
EE380-Controls Lab

5 of 11

2013

Why H (s) prefixed to first-order plant


=0

0
5

Im

10

1 + j0

15
20
25
Km
m s+1

30
10
ref +

kp

0
u

G(s)

10

15
Re

20

29
s2 +10s+29

25

30

35

m
mKs+1

40

For CL system
with stable G(s) and kp > 0 to display sustained
oscillations, Nyquist Plot (NP) of kpG(s) must pass through 1 + j0.
m
NP of kp mKs+1
does not pass through 1 + j0 for any kp > 0.

29
m
NP of kp s2+10s+29
Ks+1
passes through 1 + j0 for suitable gain kp = kcr.
EE380-Controls Lab

6 of 11

2013

Root locus view of closed-loop system


asymptotes
locus
open loop poles

Plot root locus (RL)


Km
of 1 + H(s)
.
m s + 1

10

Pcr is calculated as
follows from RL.

Imag. axis

RL touches the j
axis at approximately j13.2.

Radian frequency
of sustained oscillations is cr = 13.2
rad/s.

-5

-10

-25

-20

-15

-10

-5

Pcr = 2/cr =
0.476 0.48 s.

Root locus from u1 to y1, gain=[0.000000,0.225000]: Real axis

EE380-Controls Lab

7 of 11

2013

Homework (HW) vs. Lab work (LW)


HW

LW

29
to
Prefix 2
s + 10s + 29
math model from Exp.1

Program H(s) into dsPIC


1.
2.
3.
4.

Determine kcr & Pcr

Form CL sys with kp.


Apply step ref .
Tune kp until sustained oscillations.
Determine kcr, Pcr.

Determine P, PI, PID controllers


Determine PID controller

Simulate using tf,


step, easysim.m

////////////
Simulate////////
using/////////////////////
easysim.m

Comment on observations

Program PID controller & verify

Descretize H(s) and


controllers; code in C
EE380-Controls Lab

8 of 11

2013

Discretization
a1 s + a0
s 2 + b1 s + b0
Simulation diagram
(or tf2ss)
x 1 = x2
x 2 = b0x1 b1x2 + u
y = a0x1 + a1x2
Eulers approximation

x1(k+1) = x1(k) + t x2(k)


x2(k+1) = b0t x1(k) + (1 b1t)x2(k) + t uk
yk = a0x1(k) + a1x2(k)

EE380-Controls Lab

9 of 11

2013

Simulate; LW: C code, Implement, Analyze

Simulation: simsine.m

Implement: As in demo slides

Discretized controller C code:

Analyze: Compare results

x1(k + 1) = a11x1(k) + a12x2(k) + b1u(k)


x2(k + 1) = a21x1(k) + a22x2(k) + b2u(k)
y(k) = c1x1(k) + c2x2(k) + du(k)
In main-prog.c before main() insert float x1[2],x2[2];
In main() insert x1[0] = x2[0] = 0;
x1[1]
x2[1]
y
x1[0]
x2[0]

EE380-Controls Lab

=
=
=
=
=

a11*x1[0] + a12*x2[0] + b1*u;


a21*x1[0] + a22*x2[0] + b2*u;
c1*x1[0] + c2*x2[0] + d*u;
x1[1];
x2[1];

10 of 11

2013

Review of Exp.2: What the experiment taught

Sys-id techinques from Exp.1 & Exp.2 give different results.


Likely cause is not only the dead zone nonlinearity in the plant, but also the input signals
the sys-id technique uses.
E.g., the step input (u = 7) in Exp.1 does not keep plant in dead zone, while the lowfrequency (5 10 Hz) triangular input makes the plant go into dead zone twich every
cycle.
Will using rectangular waveform instead of triangular waveform (TW) give a different model
with least squares sys-id (LSS)?
If plant behaves as 1st order even with TW, LSS will say that plant has one LHP pole that
is 10 20 times deeper than the other.

EE380-Controls Lab

11 of 11

2013

Anda mungkin juga menyukai