Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

That is, gain margin is negative and

phase
margin is negative.

Lenzing 8:
What is the condition for stability in a Bode diagram?
Ans:

Gain margin below 0dB is positive gain margin. Phase margin above -180 o line is positive phase
margin.

Lenzing 9:
Given the following open-loop transfer function of a control system. Show how to draw the Bode
diagram using Matlab.
Obtain the gain margin and phase margin from the plot.

Ans:

5.2
0.01s 0.25s 2 s
3

Matlab Code:
clf % clear figure
G=tf([5.2], [0.01 0.25 1 0]);
bode(G)
margin(G)
OR
clf % Clear figure
s=tf('s'); % Define s as transfer function
g=(5.2)/(0.01*s^3+0.25*s^2+s); % Same as C++ maths
G=minreal(g);
bode(G)
margin(G)

The system is stable because both gain margin and phase margin are positive.
Gain margin (at the top of the picture box) = +13.6 dB
Phase margin (at the top of the picture box) = 40.2 deg

Nichols diagram
Lenzing 10:
Given the following open-loop transfer function of a control system. Show how to draw the
Nichols diagram using Matlab.

G ( s)

1000
s (4 s 8)(8s 5)

Ans:
Matlab Code:
clf % Clear figure
s=tf('s'); % Define s as transfer funtion
g=(1000)/[s*(4*s+8)*(8*s+5)];
G=minreal(g);
nichols(G)

Compensators:
A compensator when added to the transfer function of a control system can alter the gain
margin, phase margin, rise time, settling time, overshoot, steady-state error, etc. of the system.
Lenzing 11:
Given the following open-loop transfer function of a control system.

G ( s)

Gc ( s) 1

1000
s (4 s 8)(8s 5)

( s 1)
( s 100)

A compensator of type,
is to be added to the above transfer function. Draw
the Nichols diagram of the uncompensated and compensated systems on the same plot using
Matlab.
The uncompensated system has the following transfer function:

G ( s)

1000
s (4 s 8)(8s 5)

The compensated system has the following transfer function:

Gall =
Matlab Code:
clf % clear figure
s=tf('s');
g=(1000)/[s*(4*s+8)*(8*s+5)]; % Draw
G=minreal(g);
nichols(G,'r') % r=red color

1000
s (4s 8)(8s 5)

( s 1)
( s 100)

G(s) first.

hold on % Wait for second graph


s=tf('s');
h=[(1000)/[s*(4*s+8)*(8*s+5)]]*1*[(s+1)/(s+100)]; % draw

Gall
H

H=minreal(h) % minreal prevents transfer function of the type,


coming out.
nichols(H,'b') % b=blue color

1000(8s 13) 4 s (1 s )
.
s(2 s 12)(8s 13) 4 s(1 s)
from

PID Controller:
PID is a special controller which allows rise time, settling time, overshoot, stead-state error, etc.
of a control system to be altered.
P = proportional control (i.e. gain control)
I = integral control (i.e. integration control)
D = differential control (i.e. differentiation control)
Sometimes P control alone is used. Combination of PI, PD or PID control is also often used in
control systems.
Lenzing 12:

Figure below shows a PID controller is used to control a D.C. motor.

Plot step response for the closed-loop transfer function and comment on the response (if
any), when
Kp=1, Kd=0, Ki=0.
Ans:

Kp
P = proportional control =

I = integral control =

Ki
s

Kd s
D = differential control =
We must first find the forward path transfer function, substituting Kp=1, Kd=0, Ki=0, this give us

G forward

0s 2 1s 0
0.01
.
2
s
0.005s 0.06 s 1.001

The feedback path transfer function is equal to 1.


Next, we find the closed-loop transfer function and then use the step command to obtain the
step response.
Matlab Code:
clf % clear figure
s=tf('s');
g=[(0*s^2+1*s+0)/s]*[(0.01)/(0.005*s^2+0.06*s+0.1001)];
G=minreal(g);
% to find closed-loop transfer function
H=feedback(G,1);
step(H) % Draw step response

Difficult to reach amplitude 1.0 in a short time (must have comment for
each graph).

10

You might also like