forked from nicolassmith/OpticklePDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcucumberPDE.m
127 lines (99 loc) · 4.04 KB
/
cucumberPDE.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
function cucumber = cucumberPDE(opt,pos)
if nargin<2
pos = [];
end
% probeSens
% probes sensors
probeSensPairs = {'REFL_I', 'REFL_I'
'REFL_Q', 'REFL_Q'
'AS_I', 'AS_I'
'AS_Q', 'AS_Q'
'X_TRANS_DC','X_TRANS'
'Y_TRANS_DC','Y_TRANS'};
% now we can use this to create our matrix.
Nsens = size(probeSensPairs,1);
probeSens = sparse(Nsens,opt.Nprobe);
for jSens = 1:Nsens
%sensor index, probe index = 1
probeSens(jSens,getProbeNum(opt,probeSensPairs{jSens,1})) = 1; %#ok<SPRIX>
end
% We will also need the list of sensor names
sensNames = probeSensPairs(:,2).';
% mirrDrive
% mirrors drives driveType
mirrDrivePairs = {'EX', 'EX', 1
'EY', 'EY', 1
'IX', 'IX', 1
'IY', 'IY', 1
'BS', 'BS', 1
'AM', 'AM', 1
'PM', 'PM', 1
'OSC_AM','Mod1', 'amp'
'OSC_PM','Mod1', 'phase'};
% now we can use this to create our matrix.
Nmirr = size(mirrDrivePairs,1);
mirrDrive = sparse(opt.Ndrive,Nmirr);
mirrNames = mirrDrivePairs(:,1).';
for jMirr = 1:Nmirr
%drive index, mirror index = 1
mirrDrive(getDriveNum(opt, mirrDrivePairs{jMirr,2}, mirrDrivePairs{jMirr,3}), jMirr) = 1; %#ok<SPRIX>
end
% sensDof
% REFLI REFLQ ASI ASQ XTRN YTRN
sensDof = [ 1 0 0 0 0 0 % CML
1 0 0 0 0 0 % CMF
0 0 0 1 0 0 % DARM
0 1 0 0 0 0]; % MICH
% Now that we've defined our DOFs, let's store the names we will use to
% refer to them.
dofNames = { 'CML', 'CMF', 'DARM', 'MICH'};
%#ok<*NBRAK>
% Control Filters (ctrlFilt)
% These are the feedback filters.
cmlGain = 2e4;
ctrlFilt = [ filtZPK([],[0,0,0,200,200],cmlGain),... %CML
filtZPK([100,1000],[0,0,0,100],1),... %CMF
filtZPK([],[0],1),... %DARM
filtZPK([],[0],1)]; %MICH
% here we should also store the desired UGF of the loops
% CML CMF DARM MICH
setUgfDof = [ NaN 10000 200 100];
% dofMirr
% CML CMF DARM MICH
dofMirr = [ 0 0 0 0 % EX
0 0 0 0 % EY
1 0 1 0 % IX
1 0 -1 0 % IY
0 0 0 1 % BS
0 0 0 0 % AM
0 1 0 0 % PM
0 0 0 0 % OSC AM
0 0 0 0];% OSC PM
unityFilt = filtZPK([],[],1); % just a flat TF
% EX EY IX IY BS AM PM OSCAM OSCPM
mirrFilt = [unityFilt unityFilt unityFilt unityFilt unityFilt unityFilt unityFilt unityFilt unityFilt];
% pendFilt
for jMirr = 1:Nmirr
optic = getOptic(opt,mirrDrivePairs(jMirr,2));
if numel(optic.mechTF) ~= 0
pendFilt(jMirr) = zpk2mf(optic.mechTF); %#ok<AGROW>
else
% mechTF isn't set, so put in the indentity TF.
pendFilt(jMirr) = unityFilt; %#ok<AGROW>
end
end
% store everything in the cucumber
cucumber.opt = opt;
cucumber.probeSens = probeSens;
cucumber.sensNames = sensNames;
cucumber.mirrDrive = mirrDrive;
cucumber.mirrNames = mirrNames;
cucumber.sensDof = sensDof;
cucumber.dofNames = dofNames;
cucumber.ctrlFilt = ctrlFilt;
cucumber.setUgfDof = setUgfDof;
cucumber.dofMirr = dofMirr;
cucumber.mirrFilt = mirrFilt;
cucumber.pendFilt = pendFilt;
% lenticklePhase here if necessary
end