Digital Control Systems

Download Report

Transcript Digital Control Systems

Antenna Design Example
Antenna control system design
FP&W Examples 5.2, 5.3 & 5.4
7/17/2015
EE 432 - W.J. Murphy
2
Step #1: Choose ws
•FP&W choose T=1 sec (ws/wb) = 2*pi/1.153 = 5.447)
which is much too long for design by emulation. We should expect
their results to be very poor.
•A conservative choice would be T=0.2 sec which should yield
good results using emulation.
7/17/2015
EE 432 - W.J. Murphy
3
Step #1 (Cont’d)
•Design by Discrete Equivalent Method
7/17/2015
EE 432 - W.J. Murphy
4
.
7/17/2015
EE 432 - W.J. Murphy
5
Step #2: Find D(s) (Cont’d)
7/17/2015
EE 432 - W.J. Murphy
6
Step #2: Find D(s) (Cont’d)
7/17/2015
EE 432 - W.J. Murphy
7
Root Loci-Discrete Equivalent Compensation with T=1
7/17/2015
EE 432 - W.J. Murphy
8
Step #3: Compute D(z) for
T=0.2 sec
7/17/2015
EE 432 - W.J. Murphy
9
Step #3: Transform D(z) into
difference equation
9.1544 (z-0.9802)
9.1544 - 8.9731z^-1
U(z)
D(z) = ----------------= ______________ = ________
(z-0.8187)
1 - 0.8187 z^-1
E(z)
u[k] = 0.8187*u[k-1] + 9.1544*e[k]-8.9731*e[k-1]
Typical Code in High-Order Language:
Interrupt at Sample Time
Read (Channel 0,e)
% A/D call
u=0.8187*u_last+9.1544*e-8.9731*e_last %Control Law
Output (Channel1,u)
% D/A call
u_last=u
% Save last output
e_last=e
% Save last error sample
Return
% Return to main program
7/17/2015
EE 432 - W.J. Murphy
10
Step #4: Analyze Discrete
System using MATLAB
% Emulation_Antenna.m
% Continuous Plant Model
plant_c=zpk([],[0,-0.1],0.1)
D_c=zpk([-0.1],[-1],10)
closed_loop_c=feedback(D_c*plant_c,1);
damp(closed_loop_c)
% Discrete Plant Model
Ts=input('Enter desired sample period, Ts = ')
D_d=c2d(D_c,Ts,'matched')
plant_d=c2d(plant_c,Ts)
closed_loop_d=feedback(D_d*plant_d,1);
damp(closed_loop_d)
% Comparison of Step Responses
figure(1),step(closed_loop_c,'b',closed_loop_d,'r')
title('Step Response Comparison')
% Comparison of Frequency
figure(2),bode(closed_loop_c,'b',closed_loop_d,'r')
title('Frequency Response Comparison')
% Response of Discrete System to Ramp Input of 0.01*t
Integrator_d=tf(Ts,[1 -1],Ts);
figure(3),step(0.01*Integrator_d*closed_loop_d)
title('Unit Ramp Response of Discrete Model ')
7/17/2015
EE 432 - W.J. Murphy
11
MATLAB results with Ts=1.0
Zero/pole/gain:
0.1
--------s (s+0.1)
Zero/pole/gain:
10 (s+0.1)
---------(s+1)
Eigenvalue
Damping
Freq. (rad/s)
-1.00e-001
1.00e+000 1.00e-001
-5.00e-001 + 8.66e-001i 5.00e-001 1.00e+000
-5.00e-001 - 8.66e-001i 5.00e-001 1.00e+000
7/17/2015
EE 432 - W.J. Murphy
12
MATLAB results with Ts=1.0
Enter desired sample period, Ts1
Ts =
1
Eigenvalue
Zero/pole/gain:
6.6425 (z-0.9048)
----------------(z-0.3679)
Magnitude
Equiv. Damping
Equiv. Freq. (rad/s)
9.05e-001
9.05e-001
1.00e+000
5.23e-001 + 6.36e-001i 8.24e-001
2.14e-001
5.23e-001 - 6.36e-001i 8.24e-001
2.14e-001
1.00e-001
9.04e-001
9.04e-001
Sampling time: 1
Zero/pole/gain:
0.048374 (z+0.9672)
------------------(z-1) (z-0.9048)
Sampling time: 1
7/17/2015
EE 432 - W.J. Murphy
13
Step Response with Ts=1.0
Step Response
From: U(1)
1.5
To: Y(1)
Amplitude
1
0.5
0
0
5
10
15
20
25
30
Time (sec.)
7/17/2015
EE 432 - W.J. Murphy
14
Frequency Response with Ts=1.0
Bode Diagrams
From: U(1)
20
-20
-40
-60
100
0
To: Y(1)
Phase (deg); Magnitude (dB)
0
-100
-200
-300
-2
10
-1
0
10
10
1
10
Frequency (rad/sec)
7/17/2015
EE 432 - W.J. Murphy
15
MATLAB results with Ts=0.2
Enter desired sample period, Ts 0.2
Ts =
0.2000
Eigenvalue
Magnitude Equiv. Damping Equiv. Freq. (rad/s)
Zero/pole/gain:
9.1544 (z-0.9802)
9.80e-001
9.80e-001
1.00e+000
1.00e-001
----------------9.00e-001 + 1.62e-001i 9.15e-001
4.47e-001
9.96e-001
(z-0.8187)
9.00e-001 - 1.62e-001i 9.15e-001
4.47e-001
9.96e-001
Sampling time: 0.2
Zero/pole/gain:
0.0019867 (z+0.9934)
-------------------(z-1) (z-0.9802)
Sampling time: 0.2
7/17/2015
EE 432 - W.J. Murphy
16
Step Response with Ts=0.2
Step Response
From: U(1)
1.4
1.2
To: Y(1)
Amplitude
1
0.8
0.6
0.4
0.2
0
0
2
4
6
8
10
12
14
Time (sec.)
7/17/2015
EE 432 - W.J. Murphy
17
Frequency Response with Ts=0.2
Bode Diagrams
From: U(1)
50
-50
-100
100
0
To: Y(1)
Phase (deg); Magnitude (dB)
0
-100
-200
-300
-2
10
-1
10
0
10
1
10
2
10
Frequency (rad/sec)
7/17/2015
EE 432 - W.J. Murphy
18
0.01*t ramp response with
Ts=0.2
Unit Ramp Response of Discrete Model
From: U(1)
0.09
0.08
0.07
To: Y(1)
Amplitude
0.06
0.05
0.04
0.03
Steady-state error = 0.01 as predicted for a
Velocity Error Coefficient, Kv, of 1.0.
0.02
Error = Slope/Kv
0.01
0
0
1
2
3
4
5
6
7
8
9
10
Time (sec.)
7/17/2015
EE 432 - W.J. Murphy
19