Upload
annice
View
24
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Two d.o.f. Control design: dual loop. C(s). G p (s). d. +. r. +. e. C 1 (s). G p (s). y. +. _. _. C 2 (s). Example from last time: Two different implementations:. sy. y. PI*PD +0.1s. _. _. -0.1. Standard. PD +0.1s. y. PI. _. _. -0.1. Alternative (more overshoot). - PowerPoint PPT Presentation
Citation preview
C(s) Gp(s)
Two d.o.f. Control design: dual loop
C1(s) Gp(s)
C2(s)
rd
e y++
+
_ _
2 2Choose ( ) to s factors in: ( ) ( ) ( )p pC s d s C s n s
1
1
1
( ) ( ) ( )
1 ( ) ( ) 1 ( ) ( )
When d = 0,
( ) ( )
1 ( ) ( )
( ) ( )Use for closed loop step response
1 ( ) ( )
p p
p p
p
p
p
p
C s G s G sy r d
C s G s C s G s
C s G sy r
C s G s
C s G s
C s G s
-0.1
y
_
10
1s 1
s_PI*PD +0.1s
Example from last time:Two different implementations:
-0.1
y
_
10
1s 1
s_PI
PD+0.1s
Standard
Alternative(more overshoot)
sy
C(s) Gp(s)
Two d.o.f. Control design: FF+FB
C(s) Gp(s)
Cf(s)
rd
e y+
+
+
_+
+
( ( ) ( )) ( ) ( )
1 ( ) ( ) 1 ( ) ( )
1 ( ) ( ) ( )
1 ( ) ( ) 1 ( ) ( )
( ) ( )( ) , ( )
( ) ( )
( ( ) )
f p p
p p
f p p
p p
p p C Cp
p p C C
C p f p p C
p C p C p C p C
C s C s G s G sy r d
C s G s C s G s
C s G s G se r y r d
C s G s C s G s
n s n n s nG s C s
d s d d s d
d d C s n n de r d
d d n n d d n n
( ( ) )
# in ( ( ) ) defines type w.r.t. r
# in defines type w.r.t. d
When ( )=0,
type w.r.t. r = # in
=#integrato
C p f p p C
p C p C p C p C
C p f p
p C
f
C p
d d C s n n de r d
d d n n d d n n
s d d C s n
s n d
C s
s d d
rs in loop
type w.r.t. d = # in
=#integrators in controllerCs d
( ( ) )
When ( ) 0,
1type w.r.t. d = # in C(s)
type w.r.t. r set by ( ) :
Choose ( ) so that:
#s factors in ( ( ) ) = desired type
C p f p p C
p C p C p C p C
f
f
f
C p f p
d d C s n n de r d
d d n n d d n n
C s
sC s
C s
d d C s n
C(s)
Cf(s)
rd
e y+
+
+
_+
+ 1
( 2)s s
Example:
Suppose C(s) is a lead-lag controller.Without Cf, what is the system type w.r.t. r?What is the system type w.r.t. d?Can Cf affect the type w.r.t. d?Can Cf affect the type w.r.t. r?
C(s)
Cf(s)
rd
e y+
+
+
_+
+ 1
( 2)s s
Example:
Suppose C(s) is a lead-lag controller.
Q:Find a Cf to achieve 0 ess tracking for ramp input.
C(s)
Cf(s)
rd
e y+
+
+
_+
+ 1
( 2)s s
2
2
Solution:
Choose ( ) so that
( ) cancels lowest order term in .
1, +2s, choose ( ) 2s,
then: ( ) type 2, ess = 0
f
f p p
p p f
p f p ramp
C s
C s n d
n d s C s
d C s n s
Design specs: use PID to achieve 1.Ess to ramp input = 02.As fast as possible3.Overshoot <= 25%
Plant is type 1, so need PI after PD.25% Mp PM >= 45, but with PI, need PMd 55PD can contribute a maximum of about 75So, select max wgc at phase=-200
s=tf('s'); Gp=1/s/(s+1)/(s+5);figure(2); margin(Gp); grid; V=axis;Mp=25; PMd = 70 - Mp + 10; %+10 for PI laterDPM=75; PM=PMd-DPM;hold on; plot([V(1) V(2)],[PM PM]-180,'r:');[x, y]=ginput(1); wgcd=x;z_PD = wgcd/tan(DPM*pi/180); %PD controlK = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd));C=K*(s+z_PD); margin(C*Gp); grid; %Bode with PDz_PI = wgcd/10; C=C*(s+z_PI)/s; %multiply PI and PDmargin(C*Gp); grid; hold off; %Bode with PIDt=linspace(0, 15/wgcd, 301);figure(3); step(C*Gp/(1+C*Gp),t); grid;
-150
-100
-50
0
50
100M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
-270
-225
-180
-135
-90
Ph
ase
(deg
)
Bode DiagramGm = -Inf dB (at 0 rad/sec) , Pm = 48.2 deg (at 3.68 rad/sec)
Frequency (rad/sec)
0 0.5 1 1.5 2 2.5 3 3.5 40
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
Figure 8-8 Unit-step response curve of PID-controlled system designed by use of the Ziegler–Nichols tuning rule (second method).
Figure 8-10 Unit-step response of the system shown in Figure 8–6 with PID controller after numerical tuning of PID parameters.
Observations:
Can shift red bump toward high freq a bit to increase speed
But at higher freq, phase is lower, so PD needs to contribute more DPM
PM=48 can be reduced by about 3
s=tf('s'); Gp=1/s/(s+1)/(s+5);figure(2); margin(Gp); grid; V=axis;Mp=25; PMd = 70 - Mp + 7; %+7 for PI laterDPM=85; PM=PMd-DPM;hold on; plot([V(1) V(2)],[PM PM]-180,'r:');[x, y]=ginput(1); wgcd=x;z_PD = wgcd/tan(DPM*pi/180); %PD controlK = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd));C=K*(s+z_PD); margin(C*Gp); grid; %Bode with PDz_PI = wgcd/10; C=C*(s+z_PI)/s; %multiply PI and PDmargin(C*Gp); grid; hold off; %Bode with PIDt=linspace(0, 15/wgcd, 301);figure(3); step(C*Gp/(1+C*Gp),t); grid;
-150
-100
-50
0
50
100M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
-270
-225
-180
-135
-90
-45
Ph
ase
(deg
)
Bode DiagramGm = -Inf dB (at 0 rad/sec) , Pm = 45.5 deg (at 5.02 rad/sec)
Frequency (rad/sec)
0 0.5 1 1.5 2 2.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
C1(s)
C2(s)
rd
e y++
+
_ _
For dual loop implementation:
1
( 1)( 5)s s s
Should have C2(s) = - 5s
So C1(s) = PID + 5s
C1=C+5*s; Gp1=1/s/1/(s+6); figure(4); step(C1*Gp1/(1+C1*Gp1),t); grid;figure(5); step(C1*Gp1/(1+C1*Gp1)/s,10*t); grid; %ramp responsefigure(6); step(C1*Gp1/(1+C1*Gp1)/s/s,10*t);grid; %acc response
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
Overshoot became higher, about 33%,Significantly more than 25% spec
•Increase PMd •Increase the PI divide-number
s=tf('s'); Gp=1/s/(s+1)/(s+5);figure(2); margin(Gp); grid; V=axis;Mp=25; PMd = 70 - Mp + 10; %+10 for PI laterDPM=85; PM=PMd-DPM;hold on; plot([V(1) V(2)],[PM PM]-180,'r:');[x,y]=ginput(1); wgcd=x;z_PD = wgcd /tan(DPM*pi/180); %PD controlK = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd));C=K*(s+z_PD); margin(C*Gp); grid; %Bode with PDz_PI = wgcd/10; C=C*(s+z_PI)/s; %multiply PI and PDmargin(C*Gp); grid; hold off;t=linspace(0, 15/wgcd,301);figure(3); step(C*Gp/(1+C*Gp),t); grid;figure(4); C1=C+5*s; Gp1=1/s/s/(s+6); step(C1*Gp1/(1+C1*Gp1),t); grid;t=linspace(0, 150/wgcd,3001);figure(5); step(C1*Gp1/(1+C1*Gp1)/s,t); grid; %ramp responsefigure(6); step(C1*Gp1/(1+C1*Gp1)/s/s,t); grid; %acc response
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
about the same as single loop
0 5 10 15 20 25 300
5
10
15
20
25
30
35
Step Response
Time (sec)
Am
plit
ud
eRamp response
1.6 1.7 1.8 1.9 2 2.1 2.2 2.3
1.5
1.6
1.7
1.8
1.9
2
2.1
2.2
Step Response
Time (sec)
Am
plit
ud
e
29.6 29.65 29.7 29.75 29.8 29.85 29.9 29.95 30 30.05 30.129.6
29.65
29.7
29.75
29.8
29.85
29.9
29.95
30
30.05
30.1
Step Response
Time (sec)
Am
plit
ud
e
Ess_ramp = 0
0 5 10 15 20 25 300
50
100
150
200
250
300
350
400
450
500
Step Response
Time (sec)
Am
plit
ud
e
3.8 3.85 3.9 3.95 4 4.05 4.1 4.15 4.2 4.256.8
7
7.2
7.4
7.6
7.8
8
8.2
8.4
8.6
Step Response
Time (sec)
Am
plit
ud
e
29.5 29.6 29.7 29.8 29.9 30 30.1 30.2 30.3 30.4
435
440
445
450
455
460
Step Response
Time (sec)
Am
plit
ud
e
Acc response
Tuning based on desired loop shape:
We notice the max phase plot bump happens at a frequency lower than wgc
Reduce K to lower wgc so that max bump closer to wgcReduce PMd since at lower wgc, phase is higher
s=tf('s'); Gp=1/s/(s+1)/(s+5);figure(2); margin(Gp); grid; V=axis;Mp=15; PMd = 70 - Mp + 10; %+10 for PI laterDPM=85; PM=PMd-DPM;hold on; plot([V(1) V(2)],[PM PM]-180,'r:');[x,y]=ginput(1); wgcd=x;z_PD = wgcd /tan(DPM*pi/180); %PD controlK = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd))*0.5;C=K*(s+z_PD); margin(C*Gp); grid; %Bode with PDz_PI = wgcd/10; C=C*(s+z_PI)/s; %multiply PI and PDmargin(C*Gp); grid; hold off;t=linspace(0, 15/wgcd,301);figure(3); step(C*Gp/(1+C*Gp),t); grid;figure(4); C1=C+5*s; Gp1=1/s/s/(s+6); step(C1*Gp1/(1+C1*Gp1),t); grid;t=linspace(0, 150/wgcd,3001);figure(5); step(C1*Gp1/(1+C1*Gp1)/s,t); grid; %ramp responsefigure(6); step(C1*Gp1/(1+C1*Gp1)/s/s,t); grid; %ramp response
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
figure(3); step(C*Gp/(1+C*Gp),t); grid;
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
figure(4); C1=C+5*s; Gp1=1/s/s/(s+6); step(C1*Gp1/(1+C1*Gp1),t); grid;
Ess to ramp and acc still = 0
C(s)
Cf(s)
rd
e y+
+
+
_+
+ 1
( 1)( 5)s s s
FF+FB implementation of 2 dof control
Select Cf(s) = 5s
Y=(Cf+C)Gp/(1+CGp)
s=tf('s'); Gp=1/s/(s+1)/(s+5);figure(2); margin(Gp); grid; V=axis;Mp=15; PMd = 70 - Mp + 10; %+10 for PI laterDPM=85; PM=PMd-DPM;hold on; plot([V(1) V(2)],[PM PM]-180,'r:');[x,y]=ginput(1); wgcd=x;z_PD = wgcd /tan(DPM*pi/180); %PD controlK = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd))*0.5;C=K*(s+z_PD); margin(C*Gp); grid; %Bode with PDz_PI = wgcd/10; C=C*(s+z_PI)/s; %multiply PI and PDmargin(C*Gp); grid; hold off;t=linspace(0, 15/wgcd,301); t1=linspace(0, 150/wgcd,3001);figure(3); step(C*Gp/(1+C*Gp),t); grid;figure(4); C1=C+5*s; Gp1=1/s/s/(s+6); step(C1*Gp1/(1+C1*Gp1),t); grid;figure(5); step(C1*Gp1/(1+C1*Gp1)/s,t1); grid; %ramp responsefigure(6); step(C1*Gp1/(1+C1*Gp1)/s/s,t1); grid; %acc responseCf=5*s; figure(7); step((Cf+C)*Gp/(1+C*Gp),t); grid;
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
Cf=5*s; figure(7); step((Cf+C)*Gp/(1+C*Gp),t); grid;
PID
This is example 8-2.
Design specs:•10% overshoot in closed-loop unit step response
The book tries to design a PID controller.But with the above specs, a P-controller will do.
0 2 4 6 8 10 12 14 16 18 200
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
Step Response
Time (sec)
Am
plit
ud
e
But that was “obviously not good”.
Really? Why or why not?
Now suppose we change the design specs to:•10% overshoot in closed-loop unit step response•Ess to constant input must be zero•Limit controller to simple PID•Achieve as fast response as possible.
Now it is a valid design problem.
Design analysis:•Zero ess to step requires type 1 system, but plant is only type 0 need PI•To increase speed and Mp, we will need PD•So we will do PD followed by PI to get an overall PID•The upper limit of phase boost by PID is about 80 deg•To maximize speed, need max wgc, need to find highest freq at which when we add 80 deg we still have enough PM
s=tf('s'); Gp=1.2/(0.36*s^3+1.86*s^2+2.5*s+1);figure(1); margin(Gp); hold on; grid; V=axis;Mp=10; PMd = 70 - Mp + 10; %+10 for PI laterDPM=80; PM=PMd-DPM; plot(V(1:2),[PM PM]-180,'r:');
-150
-100
-50
0
50M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
-270
-180
-90
0
Ph
ase
(deg
)
Bode DiagramGm = 19.9 dB (at 2.64 rad/sec) , Pm = 126 deg (at 0.397 rad/sec)
Frequency (rad/sec)
[x,y]=ginput(1); wgcd=x;z_PD = wgcd /tan(DPM*pi/180); %PD controlK = 1/abs(evalfr((s+z_PD)*Gp,j*wgcd));C=K*(s+z_PD); margin(C*Gp); %Bode with PD
-150
-100
-50
0
50M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
-270
-180
-90
0
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 62.8 deg (at 3.51 rad/sec)
Frequency (rad/sec)
z_PI = wgcd/5; C=C*(s+z_PI)/s; %PI times PDmargin(C*Gp); hold off;t=linspace(0,15/wgcd,301); t1=linspace(0,150/wgcd,3001);figure(3); step(C*Gp/(1+C*Gp),t); grid;
-150
-100
-50
0
50
100M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
-270
-180
-90
0
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 52.3 deg (at 3.48 rad/sec)
Frequency (rad/sec)
0 0.5 1 1.5 2 2.5 3 3.5 40
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
C(s)
Let us reconsider this design problem with specs: •10% overshoot in closed-loop unit step response•Ess to constant input must be zero•Achieve as fast response as possible.•But limit controller order (nc and/or dc) to 2
PID is artificially imposed by the book. But we repeatedly said we should avoid I whenever possible.
Design analysis:•For zero ess to step, if we use an inner loop with a gain of -1.2, we can increase the plant type by 1. •So don’t need PI, but use dual loop.•For Mp <= 10%, we need PM >= 60.•For high speed, need high wgc.•But plant phase goes to -270 at high freq.•Need PD or lead to boost PM.•But order is limited to 2.•Choices are: two PDs, two leads, one of each•PD is sensitive to noise, not two PDs
Let’s do the more complex: PD*lead
s=tf('s'); Gp=1.2/(0.36*s^3+1.86*s^2+2.5*s+1);figure(1); margin(Gp); hold on; grid; V=axis;Mp=10; PMd = 70 - Mp + 7; DPM_PD=80; DPM_lead=70; PM=PMd-DPM_PD-DPM_lead; plot(V(1:2),[PM PM]-180);[x,y]=ginput(1); wgcd=x;z_PD = wgcd /tan(DPM*pi/180); %PD controlalpha=(1+sin(DPM_lead*pi/180))/(1-sin(DPM_lead*pi/180));z_lead=wgcd/alpha^0.5;p_lead=wgcd*alpha^0.5;C=(s+z_PD)*(s+z_lead)/(s+p_lead);K = 1/abs(evalfr(C*Gp,j*wgcd)); C=C*K;margin(C*Gp); hold off; %Bode with PDt=linspace(0,15/wgcd,301); t1=linspace(0,150/wgcd,3001);figure(3); step(C*Gp/(1+C*Gp),t); grid;
>> CTransfer function:2520 s^2 + 3.439e004 s + 1.173e005---------------------------------- s + 219.5
-200
-150
-100
-50
0
50
100M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
103
104
-270
-180
-90
0
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 67.6 deg (at 38.7 rad/sec)
Frequency (rad/sec)
0 0.05 0.1 0.15 0.2 0.25 0.3 0.350
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
First design achieved 10 times fasterMp is about OK, but a little over
Ess is actually not zero but very smallDual loop implementation will make ess =0
But before we do that, should reduce Mp
s=tf('s'); Gp=1.2/(0.36*s^3+1.86*s^2+2.5*s+1);figure(1); margin(Gp); hold on; grid; V=axis;Mp=10; PMd = 70 - Mp + 10; DPM_PD=80; DPM_lead=70; PM=PMd-DPM_PD-DPM_lead; plot(V(1:2),[PM PM]-180);[x,y]=ginput(1); wgcd=x;z_PD = wgcd /tan(DPM*pi/180); %PD controlalpha=(1+sin(DPM_lead*pi/180))/(1-sin(DPM_lead*pi/180));z_lead=wgcd/alpha^0.5;p_lead=wgcd*alpha^0.5;C=(s+z_PD)*(s+z_lead)/(s+p_lead);K = 1/abs(evalfr(C*Gp,j*wgcd)); C=C*K;margin(C*Gp); hold off; %Bode with PDt=linspace(0,15/wgcd,301); t1=linspace(0,150/wgcd,3001);figure(3); step(C*Gp/(1+C*Gp),t); grid;
>> CTransfer function:1254 s^2 + 1.204e004 s + 2.891e004---------------------------------- s + 154.5
-200
-150
-100
-50
0
50M
agn
itu
de
(dB
)
10-2
10-1
100
101
102
103
104
-270
-225
-180
-135
-90
-45
0
Ph
ase
(deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 70.8 deg (at 27.2 rad/sec)
Frequency (rad/sec)
0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e
>> C2=-1.2; C1=C-C2; Gcl=C1*Gp/(1+C*Gp);figure(4); step(Gcl,t); grid
>> C1 Transfer function:1254 s^2 + 1.204e004 s + 2.91e004--------------------------------- s + 154.5
0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ud
e