Pid 1
Pid 1
On-Off Control
Lastly, please keep in mind that you do not need to implement all three
controllers (proportional, derivative, and integral) into a single system, if not
necessary. For example, if a PI controller gives a good enough response (like the
above example), then you don't need to implement derivative controller to the
system. Keep the controller as simple as possible.
Open-Loop Control - Example
1
G( s )
2
s 10s 20
num=1;
den=[1 10 20];
step(num,den)
Proportional Control - Example
num=[Kp]; 1
0.9
Amplitude
0.8 0.8
den=[1 10 20+Kp];
To: Y(1)
0.7
0.6
0.6
t=0:0.01:2;
Amplitude
0.4
To: Y(1)
0.5
0.3
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0.2
Time (sec.)
0.1
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec.)
Proportional - Derivative - Example
The derivative controller (Kd) reduces both the overshoot and the
settling time.
Kd s Kp
T( s )
MATLAB Example 2
s ( 10 Kd ) s ( 20 Kp )
Step Response
From: U(1)
1.4
1.2
Kd=10;
Amplitude
0.8
To: Y(1)
0.9
0.6 0.8
Kd=10
0.4
0.6
Amplitude
den=[1 10+Kd 20+Kp];
To: Y(1)
0.2 0.5
0.4
0
t=0:0.01:2;
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0.3
Time (sec.)
0.2
Kd=20
step(num,den,t) 0.1
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec.)
Proportional - Integral - Example
The integral controller (Ki) decreases the rise time, increases both
the overshoot and the settling time, and eliminates the steady-state
error Kp s Ki
T( s )
3 2
MATLAB Example s 10 s ( 20 Kp ) s Ki
Step Response
From: U(1)
1.4
Kp=30;
1.2
Step Response
From: U(1)
1 1.4
Ki=70;
Amplitude
1.2
0.8
To: Y(1)
1
0.6
num=[Kp Ki];
Ki=70
Amplitude
0.8
To: Y(1)
0.4
0.4
0
Time (sec.)
1.2 1.4 1.6 1.8
0.2
2
Ki=100
0
Time (sec.)
1.2 1.4 1.6 1.8 2
Example - Practice
A first-order lead compensator can be designed using the root locus. A lead compensator
in root locus form is given by
( s z)
G c( s )
( s p)
where the magnitude of z is less than the magnitude of p. A phase-lead compensator
tends to shift the root locus toward the left half plane. This results in an improvement in
the system's stability and an increase in the response speed.
When a lead compensator is added to a system, the value of this intersection will be a
larger negative number than it was before. The net number of zeros and poles will be the
same (one zero and one pole are added), but the added pole is a larger negative number
than the added zero. Thus, the result of a lead compensator is that the asymptotes'
intersection is moved further into the left half plane, and the entire root locus will be
shifted to the left. This can increase the region of stability as well as the response speed.
Lead or Phase-Lead Compensator Using Root Locus
A first-order lag compensator can be designed using the root locus. A lag compensator in root
locus form is given by
( s z)
G c( s )
( s p)
where the magnitude of z is greater than the magnitude of p. A phase-lag compensator tends to
shift the root locus to the right, which is undesirable. For this reason, the pole and zero of a lag
compensator must be placed close together (usually near the origin) so they do not appreciably
change the transient response or stability characteristics of the system.
When a lag compensator is added to a system, the value of this intersection will be a smaller
negative number than it was before. The net number of zeros and poles will be the same (one
zero and one pole are added), but the added pole is a smaller negative number than the added
zero. Thus, the result of a lag compensator is that the asymptotes' intersection is moved closer
to the right half plane, and the entire root locus will be shifted to the right.