Home > classes > @ao > mdc1_ifo2control.m

mdc1_ifo2control

PURPOSE ^

MDC1_IFO2CONTROL converts the input time-series to control forces.

SYNOPSIS ^

function varargout = mdc1_ifo2control(varargin)

DESCRIPTION ^

 MDC1_IFO2CONTROL converts the input time-series to control forces.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: MDC1_IFO2CONTROL converts the input time-series to control forces.

 CALL:        c = mdc1_ifo2control(o1, o12)

 INPUTS:      o1       - time-series of the IFO output o1
              o12      - time-series of the IFO output o12

 M-FILE INFO: Get information about this methods by calling
              >> ao.getInfo('mdc1_ifo2control')

              Get information about a specified set-plist by calling:
              >> ao.getInfo('mdc1_ifo2control', 'None')

 VERSION:     $Id: mdc1_ifo2control.m,v 1.8 2008/09/05 14:15:14 hewitson Exp $

 HISTORY:     11-04-08 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % MDC1_IFO2CONTROL converts the input time-series to control forces.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: MDC1_IFO2CONTROL converts the input time-series to control forces.
0005 %
0006 % CALL:        c = mdc1_ifo2control(o1, o12)
0007 %
0008 % INPUTS:      o1       - time-series of the IFO output o1
0009 %              o12      - time-series of the IFO output o12
0010 %
0011 % M-FILE INFO: Get information about this methods by calling
0012 %              >> ao.getInfo('mdc1_ifo2control')
0013 %
0014 %              Get information about a specified set-plist by calling:
0015 %              >> ao.getInfo('mdc1_ifo2control', 'None')
0016 %
0017 % VERSION:     $Id: mdc1_ifo2control.m,v 1.8 2008/09/05 14:15:14 hewitson Exp $
0018 %
0019 % HISTORY:     11-04-08 M Hewitson
0020 %                 Creation
0021 %
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 
0024 function varargout = mdc1_ifo2control(varargin)
0025 
0026   % Check if this is a call for parameters
0027   if utils.helper.isinfocall(varargin{:})
0028     varargout{1} = getInfo(varargin{3});
0029     return
0030   end
0031 
0032   import utils.const.*
0033   utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0034   
0035   % Collect input variable names
0036   in_names = cell(size(varargin));
0037   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0038 
0039   % Collect all AOs and plists
0040   [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
0041   pl              = utils.helper.collect_objects(varargin(:), 'plist', in_names);
0042 
0043   % Decide on a deep copy or a modify
0044   bs = copy(as, nargout);
0045 
0046   % combine plists
0047   pl = combine(pl, getDefaultPlist());
0048 
0049   %% Extract parameters from plist
0050 
0051   % Get parameters out
0052   o1  = bs(1);
0053   o12 = bs(2);
0054 
0055   % Store input histories
0056   h1  = o1.hist;
0057   h12 = o12.hist;
0058 
0059   % Apply controller Cdf
0060   c1 = applyCdf(o1);
0061   % Add history
0062   c1.addHistory(getInfo, pl, ao_invars, [h1 h12]);
0063   % Set AO name
0064   c1.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0065 
0066   c1.setYunits('m s^-2');
0067   
0068   % Apply controller Csus
0069   c2 = applyCsus(o12);
0070   % Add history
0071   c2.addHistory(getInfo, pl, ao_invars, [h1 h12]);
0072   % Set AO name
0073   c2.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0074 
0075   c2.setYunits('m s^-2');  
0076   
0077   % Set output
0078   if nargout == 1
0079     varargout{1} = [c1 c2];
0080   else
0081     varargout{1} = c1;
0082     varargout{2} = c2;
0083   end
0084 end
0085 %--------------------------------------------------------------------------
0086 % Apply drag-free controller with filters designed in LISO fit to
0087 %
0088 % pole 0.0000108323f  ### fitted (name = pole0)
0089 % pole 492.4469487554m  ### fitted (name = pole3)
0090 % zero 5.9923220808m 520.0769724208m  ### fitted (name = zero0)
0091 % factor 190214348700.9898376465G  ### fitted
0092 %
0093 % pole 88.3387108214u 501.9601697563m  ### fitted (name = pole1)
0094 % zero 13.4574095925m 715.2446797808m  ### fitted (name = zero1)
0095 % factor 1
0096 %
0097 % pole 300.6237575544m 968.3134470825m  ### fitted (name = pole2)
0098 % zero 5.8794500998  ### fitted (name = zero2)
0099 % zero 40.1685309724  ### fitted (name = zero3)
0100 % factor 1
0101 
0102 function o1 = applyCdf(o1)
0103 
0104   % Sample frequency filters are designed for
0105   filtfs = 100;
0106 
0107   if o1.data.fs ~= filtfs
0108     warning('### Filters are designed for %dHz. Resampling time-series.', filtfs);
0109     fsin = o1.data.fs;
0110     o1.resample(plist('fsout', filtfs));
0111   end
0112 
0113   %---- First filter stage
0114   a = [27801.38587094533 -107218.527103749 180226.5071750752 ...
0115     -173891.2206875895 101664.0906613848 -33271.76258436936 4689.527541600029];
0116   b = [1 -3.833870654386819 6.42742334310825 -6.197734830947992 ...
0117     3.622482927835305 -1.185355897309293 0.1670551117005498];
0118   ff1 = miir(a,b,100);
0119 
0120   %---- Second filter stage
0121   a = [4.312632196506008e-05 -0.0001281084965932162 0.0001404024385649956 ...
0122     -6.89671676763067e-05 1.354691430208644e-05];
0123   b = [1 -2.971420266964361 3.257128504882159 -1.599992417674869 0.3142841797676335];
0124   ff2 = miir(a,b,100);
0125 
0126   %---- Third filter stage
0127   a = [0.00095273516542127803953  -0.00091952972321343779717  5.5197001381098205063e-05 8.7265653018697098768e-05];
0128   b = [1 -2.4840746702182161521  1.9782850928995776574 -0.49403473523860202965];
0129   ff3 = miir(a,b,100);
0130 
0131   % Apply filters
0132   o1.filter(ff1);
0133   o1.filter(ff2);
0134   o1.filter(ff3);
0135 
0136   % Apply delay filter
0137   o1.delay(plist('N', 31));
0138 
0139   % Apply actuator
0140   pzm = pzmodel(1, pz(0.8), []);
0141   af  = miir(pzm, plist('fs', filtfs));
0142   o1.filter(af);
0143 
0144   % Resample if necessary
0145   if fsin ~= filtfs
0146     o1.resample(plist('fsout', fsin));
0147   end
0148 end
0149 
0150 %--------------------------------------------------------------------------
0151 % Apply suspension controller designed in LISO
0152 %
0153 % pole 13.5111750971m 765.5054182119m  ### fitted (name = pole1)
0154 % zero 1.1290293787m 906.1738368029m  ### fitted (name = zero0)
0155 % factor 1  ### fitted
0156 %
0157 % pole 0.0000099821f  ### fitted (name = pole0)
0158 % pole 17.3189756179m  ### fitted (name = pole2)
0159 % zero 10.9038956793  ### fitted (name = zero1)
0160 % delay 27.2832312829m  ### fitted
0161 % factor 17126.3998612698e9
0162 %
0163 function o12 = applyCsus(o12)
0164 
0165   % Sample frequency filters are designed for
0166   filtfs = 100;
0167 
0168   if o12.data.fs ~= filtfs
0169     warning('### Filters are designed for %dHz. Resampling time-series.', filtfs);
0170     fsin = o12.data.fs;
0171     o12.resample(plist('fsout', filtfs));
0172   end
0173 
0174   %---- First filter stage
0175   a = [142.9896507914776862  -285.96810764145169514 142.97845756946250617];
0176   b = [1 -1.9988914209045689496 0.99889214047646490702];
0177   ff1 = miir(a,b,100);
0178 
0179   %---- Second filter stage
0180   a = [2.146238155432156e-11 -2.556622712681001e-11 1.278311356340501e-11 -2.840691902978891e-12];
0181   b = [1 -2.499139379998971 1.998822309472276 -0.4996829294733051];
0182   ff2 = miir(a,b,100);
0183 
0184   % Apply filters
0185   o12.filter(ff1);
0186   o12.filter(ff2);
0187 
0188   % Apply delay filter
0189   o12.delay(plist('N', 30));
0190 
0191   % Apply actuator
0192   pzm = pzmodel(1, pz(8), []);
0193   af  = miir(pzm, plist('fs', filtfs));
0194   o12.filter(af);
0195 
0196   % Resample if necessary
0197   if fsin ~= filtfs
0198     o12.resample(plist('fsout', fsin));
0199   end
0200 end
0201 
0202 %--------------------------------------------------------------------------
0203 % Get Info Object
0204 %--------------------------------------------------------------------------
0205 function ii = getInfo(varargin)
0206   if nargin == 1 && strcmpi(varargin{1}, 'None')
0207     sets = {};
0208     pl   = [];
0209   else
0210     sets = {'Default'};
0211     pl   = getDefaultPlist;
0212   end
0213   % Build info object
0214   ii = minfo(mfilename, 'ao', '', utils.const.categories.mdc01, '$Id: mdc1_ifo2control.m,v 1.8 2008/09/05 14:15:14 hewitson Exp $', sets, pl);
0215 end
0216 
0217 %--------------------------------------------------------------------------
0218 % Get Default Plist
0219 %--------------------------------------------------------------------------
0220 function pl_default = getDefaultPlist()
0221   pl_default = plist();
0222 end
0223 % END

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003