Attachment 'C1cucumber.m'
Download 1 %% Cucumber control system model for lentickle
2 %
3 % Being Develiped for DRMI ....
4 %
5 % 25 Jan 2012, KK
6 %
7 %
8 %
9
10 %%
11 function cucumber = C1cucumber(opt,pos)
12 if nargin<2
13 pos = [];
14 end
15
16 %% First Create probeSens
17
18
19 % probes sensors
20 probeSensPairs = {'REFL 3I1', 'REFL_3I1'
21 'REFL 3Q1', 'REFL_3Q1'
22 'AS I2', 'AS_I2'
23 'AS Q2', 'AS_Q2'
24 'AS DC', 'AS_DC'
25 'AS 3I2', 'AS_3I2'
26 'AS 3Q2', 'AS_3Q2'
27 'AS DC', 'AS_DC'};
28
29 % now we can use this to create our matrix.
30
31 Nsens = size(probeSensPairs,1);
32 probeSens = sparse(Nsens,opt.Nprobe);
33
34 for jSens = 1:Nsens
35 %sensor index, probe index = 1
36 probeSens(jSens,getProbeNum(opt,probeSensPairs{jSens,1})) = 1; %#ok<SPRIX>
37 end
38
39 % We will also need the list of sensor names
40
41 sensNames = probeSensPairs(:,2).';
42
43 %% The other boring matrix is mirrDrive
44
45 % mirrors drives driveType
46 mirrDrivePairs = {'IX', 'IX', 1
47 'IY', 'IY', 1
48 'BS', 'BS', 1
49 'PR', 'PR', 1
50 'SR', 'SR', 1
51 'AM', 'AM', 1
52 'PM', 'PM', 1
53 'OSC_AM','Mod1', 'amp'
54 'OSC_PM','Mod1', 'phase'};
55
56 % now we can use this to create our matrix.
57
58 Nmirr = size(mirrDrivePairs,1);
59 mirrDrive = sparse(opt.Ndrive,Nmirr);
60
61 mirrNames = mirrDrivePairs(:,1).';
62
63 for jMirr = 1:Nmirr
64 %drive index, mirror index = 1
65 mirrDrive(getDriveNum(opt, mirrDrivePairs{jMirr,2}, mirrDrivePairs{jMirr,3}), jMirr) = 1; %#ok<SPRIX>
66 end
67
68 %% Control System Model
69 % what we've done so far is just to reduce the number of inputs and
70 % outputs to/from the Optickle model to make everything more resonable.
71 % Now it's time to actually build the control system model.
72
73 %% Input Matrix (sensDof)
74 % we will just construct the input matrix we want. For out michelson,
75 % let's just define a simple control system of two degrees of freedom,
76 % the common mode arm mirror motion, COMM, and the differential mode,
77 % DIFF. The ordering of the rows and columns are important, the first
78 % sensor definded in probeSens is the fist sensor here.
79
80 % REFL3I1 REFL3Q1 ASI2 ASQ2 ASDC AS3I2 AS3Q2 AS DC
81 sensDof = [ 0 0 0 1 0 0 0 0 % MICH
82 1 0 0 0 0 0 0 0 % PRCL
83 0 0 0 0 0 0 1 0 ]; % SRCL
84
85
86 % Now that we've defined our DOFs, let's store the names we will use to
87 % refer to them.
88
89 dofNames = { 'MICH', 'PRCL','SRCL'};
90
91 %% Control Filters (ctrlFilt)
92 % These are the feedback filters.
93
94 % MICH PRCL SRCL
95 ctrlFilt = [ filtZPK([5,10],[1,1000],5),...
96 filtZPK([10,50],[1,1000],50), ...
97 filtZPK([10,50],[1,1000],50)]; %#ok<*NBRAK>
98
99
100 % here we should also store the desired UGF of the loops
101 % MICH PRCL SRCL
102 setUgfDof = [ 100 100 100];
103
104 %% Output Matrix (dofMirr)
105 % remember, order matters.
106
107 % MICH PRCL SRCL
108 dofMirr = [ 1 0 0 % IX
109 -1 0 0 % IY
110 0 0 0 % BS
111 0 1 0 % PR
112 0 0 1 % SR
113 0 0 0 % AM
114 0 0 0 % PM
115 0 0 0 % OSC AM
116 0 0 0]; % OSC PM
117
118 %% Pendulum compensation (mirrFilt)
119 % We'll just do something really dumb for pendulum compensation: 2
120 % zeros at 1Hz and a few poles at 5kHz.
121
122 unityFilt = filtZPK([],[],1); % just a flat TF for non-mirrors
123 compFilt = filtZPK([],[],1);
124 %filtZPK([1,1],[5000,5000,5000],1); % dumb compensation
125
126 % IX IY BS PR SR AM PM OSCAM OSCPM
127 mirrFilt = [ compFilt compFilt compFilt compFilt compFilt unityFilt unityFilt unityFilt unityFilt ];
128
129 %% Mechanical Response (pendFilt)
130 % The mechanical response of the mirrors is defined in the Optickle
131 % Model, we should be able to just get the filters from there. Optickle
132 % stores them as zpk objects, we need to convert them to mf (mevans
133 % filter) objects.
134 %
135 % There may be cases where the optical mechanical response will not be
136 % the same as the actuator mechanical response. In that case, you'll
137 % want to create these filters manually, rather than taking them from
138 % the Optickle model.
139
140 for jMirr = 1:Nmirr
141 optic = getOptic(opt,mirrDrivePairs(jMirr,2));
142 if numel(optic.mechTF) ~= 0
143 pendFilt(jMirr) = zpk2mf(optic.mechTF); %#ok<AGROW>
144 else
145 % mechTF isn't set, so put in the indentity TF.
146 pendFilt(jMirr) = unityFilt; %#ok<AGROW>
147 end
148 end
149
150 %% Store all the needed variables in the cucumber
151 cucumber.opt = opt;
152 cucumber.probeSens = probeSens;
153 cucumber.sensNames = sensNames;
154 cucumber.mirrDrive = mirrDrive;
155 cucumber.mirrNames = mirrNames;
156 cucumber.sensDof = sensDof;
157 cucumber.dofNames = dofNames;
158 cucumber.ctrlFilt = ctrlFilt;
159 cucumber.setUgfDof = setUgfDof;
160 cucumber.dofMirr = dofMirr;
161 cucumber.mirrFilt = mirrFilt;
162 cucumber.pendFilt = pendFilt;
163
164 %% Choosing RF demod phases
165 % One step we skipped when making the Optickle model was choosing the
166 % demod phases of our RF sensors. Because Lentickle knows something
167 % about the control system, we can use it to modify the Optickle model
168 % to make certain sensors have maximum response to certain degrees of
169 % freedom. (Example, you want DARM to be mostly coupled to AS_Q not
170 % AS_I.)
171
172 % Let's prepare the arguments for the phasing function.
173
174 phaseMICH = struct( 'Iname', 'AS_I2', ... % name of the I sensor
175 'Qname', 'AS_Q2', ... % name of the Q sensor
176 'IorQ', 'Q', ... % maximize I or Q?
177 'DOF', 'MICH'); % maximize which DOF?
178
179 phasePRCL = struct( 'Iname', 'REFL_3I1', ...
180 'Qname', 'REFL_3Q1', ...
181 'IorQ', 'I', ...
182 'DOF', 'PRCL');
183
184 phaseSRCL = struct( 'Iname', 'AS_3I2', ...
185 'Qname', 'AS_3Q2', ...
186 'IorQ', 'Q', ...
187 'DOF', 'SRCL');
188
189
190 f0 = 150; %choose a frequency (Hz) at which to do the maximization
191
192 cucumber = lenticklePhase(cucumber,pos,f0,phaseMICH,phasePRCL, phaseSRCL); % this changes the opt inside cucumber
193
194 end
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.
