-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfr_hdd.m
61 lines (61 loc) · 1.51 KB
/
cfr_hdd.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
% Nominal frequency responses of the Hard Disk Drive Servo System
% for three controllers
%
% Closed-loop frequency response
%
sim_hdd
w = logspace(3,4.301,400);
%
% mu-controller
clp_mu = lft(sim_ic,K_mu,1,1);
ref_mu = clp_mu(1,1);
%
% Hinf controller
clp_hin = lft(sim_ic,K_hin,1,1);
ref_hin = clp_hin(1,1);
%
% Loop Shaping controller
clp_lsh = lft(sim_ic,K_lsh,1,1);
ref_lsh = clp_lsh(1,1);
%
figure(1)
bode(ref_mu.Nom,'r-',ref_hin.Nom,'b--',ref_lsh.Nom,'m-.',w), grid
legend('\mu-controller','H_\infty controller','Loop Shaping controller')
title('Closed-loop Bode plots for three controllers')
%
% Output sensitivity to disturbance
w = logspace(-1,5,100);
%
% mu controller
clp_mu = lft(sim_ic,K_mu,1,1);
sen_mu = clp_mu(1,2);
%
% Hinf controller
clp_hin = lft(sim_ic,K_hin,1,1);
sen_hin = clp_hin(1,2);
%
% Loop Shaping controller
clp_lsh = lft(sim_ic,K_lsh,1,1);
sen_lsh = clp_lsh(1,2);
%
figure(2)
bodemag(sen_mu.Nom,'r-',sen_hin.Nom,'b--',sen_lsh.Nom,'m-.',w), grid
title('Output sensitivity to disturbance')
legend('\mu-controller','H_\infty controller','Loop Shaping controller')
%
% Output sensitivity to noise
w = logspace(0,5,100);
%
% mu controller
noise_mu = clp_mu(1,3);
%
% Hinf controller
noise_hin = clp_hin(1,3);
%
% Loop Shaping controller
noise_lsh = clp_lsh(1,3);
%
figure(3)
bodemag(noise_mu.Nom,'r-',noise_hin.Nom,'b--',noise_lsh.Nom,'m-.',w), grid
title('Output sensitivity to noise')
legend('\mu-controller','H_\infty controller','Loop Shaping controller')