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.6 2008/08/08 12:29:16 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.6 2008/08/08 12:29:16 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   % Apply controller Csus
0067   c2 = applyCsus(o12);
0068   % Add history
0069   c2.addHistory(getInfo, pl, ao_invars, [h1 h12]);
0070   % Set AO name
0071   c2.setName(sprintf('%s(%s,%s)', mfilename, ao_invars{1}, ao_invars{2}), 'internal');
0072 
0073   % Set output
0074   if nargout == 1
0075     varargout{1} = [c1 c2];
0076   else
0077     varargout{1} = c1;
0078     varargout{2} = c2;
0079   end
0080 end
0081 %--------------------------------------------------------------------------
0082 % Apply drag-free controller with filters designed in LISO fit to
0083 %
0084 % pole 0.0000108323f  ### fitted (name = pole0)
0085 % pole 492.4469487554m  ### fitted (name = pole3)
0086 % zero 5.9923220808m 520.0769724208m  ### fitted (name = zero0)
0087 % factor 190214348700.9898376465G  ### fitted
0088 %
0089 % pole 88.3387108214u 501.9601697563m  ### fitted (name = pole1)
0090 % zero 13.4574095925m 715.2446797808m  ### fitted (name = zero1)
0091 % factor 1
0092 %
0093 % pole 300.6237575544m 968.3134470825m  ### fitted (name = pole2)
0094 % zero 5.8794500998  ### fitted (name = zero2)
0095 % zero 40.1685309724  ### fitted (name = zero3)
0096 % factor 1
0097 
0098 function o1 = applyCdf(o1)
0099 
0100   % Sample frequency filters are designed for
0101   filtfs = 100;
0102 
0103   if o1.data.fs ~= filtfs
0104     warning('### Filters are designed for %dHz. Resampling time-series.', filtfs);
0105     fsin = o1.data.fs;
0106     o1.resample(plist('fsout', filtfs));
0107   end
0108 
0109   %---- First filter stage
0110   a = [27801.38587094533 -107218.527103749 180226.5071750752 ...
0111     -173891.2206875895 101664.0906613848 -33271.76258436936 4689.527541600029];
0112   b = [1 -3.833870654386819 6.42742334310825 -6.197734830947992 ...
0113     3.622482927835305 -1.185355897309293 0.1670551117005498];
0114   ff1 = miir(a,b,100);
0115 
0116   %---- Second filter stage
0117   a = [4.312632196506008e-05 -0.0001281084965932162 0.0001404024385649956 ...
0118     -6.89671676763067e-05 1.354691430208644e-05];
0119   b = [1 -2.971420266964361 3.257128504882159 -1.599992417674869 0.3142841797676335];
0120   ff2 = miir(a,b,100);
0121 
0122   %---- Third filter stage
0123   a = [0.00095273516542127803953  -0.00091952972321343779717  5.5197001381098205063e-05 8.7265653018697098768e-05];
0124   b = [1 -2.4840746702182161521  1.9782850928995776574 -0.49403473523860202965];
0125   ff3 = miir(a,b,100);
0126 
0127   % Apply filters
0128   o1.filter(ff1);
0129   o1.filter(ff2);
0130   o1.filter(ff3);
0131 
0132   % Apply delay filter
0133   o1.delay(plist('N', 31));
0134 
0135   % Apply actuator
0136   pzm = pzmodel(1, pz(0.8), []);
0137   af  = miir(pzm, plist('fs', filtfs));
0138   o1.filter(af);
0139 
0140   % Resample if necessary
0141   if fsin ~= filtfs
0142     o1.resample(plist('fsout', fsin));
0143   end
0144 end
0145 
0146 %--------------------------------------------------------------------------
0147 % Apply suspension controller designed in LISO
0148 %
0149 % pole 13.5111750971m 765.5054182119m  ### fitted (name = pole1)
0150 % zero 1.1290293787m 906.1738368029m  ### fitted (name = zero0)
0151 % factor 1  ### fitted
0152 %
0153 % pole 0.0000099821f  ### fitted (name = pole0)
0154 % pole 17.3189756179m  ### fitted (name = pole2)
0155 % zero 10.9038956793  ### fitted (name = zero1)
0156 % delay 27.2832312829m  ### fitted
0157 % factor 17126.3998612698e9
0158 %
0159 function o12 = applyCsus(o12)
0160 
0161   % Sample frequency filters are designed for
0162   filtfs = 100;
0163 
0164   if o12.data.fs ~= filtfs
0165     warning('### Filters are designed for %dHz. Resampling time-series.', filtfs);
0166     fsin = o12.data.fs;
0167     o12.resample(plist('fsout', filtfs));
0168   end
0169 
0170   %---- First filter stage
0171   a = [142.9896507914776862  -285.96810764145169514 142.97845756946250617];
0172   b = [1 -1.9988914209045689496 0.99889214047646490702];
0173   ff1 = miir(a,b,100);
0174 
0175   %---- Second filter stage
0176   a = [2.146238155432156e-11 -2.556622712681001e-11 1.278311356340501e-11 -2.840691902978891e-12];
0177   b = [1 -2.499139379998971 1.998822309472276 -0.4996829294733051];
0178   ff2 = miir(a,b,100);
0179 
0180   % Apply filters
0181   o12.filter(ff1);
0182   o12.filter(ff2);
0183 
0184   % Apply delay filter
0185   o12.delay(plist('N', 30));
0186 
0187   % Apply actuator
0188   pzm = pzmodel(1, pz(8), []);
0189   af  = miir(pzm, plist('fs', filtfs));
0190   o12.filter(af);
0191 
0192   % Resample if necessary
0193   if fsin ~= filtfs
0194     o12.resample(plist('fsout', fsin));
0195   end
0196 end
0197 
0198 %--------------------------------------------------------------------------
0199 % Get Info Object
0200 %--------------------------------------------------------------------------
0201 function ii = getInfo(varargin)
0202   if nargin == 1 && strcmpi(varargin{1}, 'None')
0203     sets = {};
0204     pl   = [];
0205   else
0206     sets = {'Default'};
0207     pl   = getDefaultPlist;
0208   end
0209   % Build info object
0210   ii = minfo(mfilename, 'ao', '', 'MDC1', '$Id: mdc1_ifo2control.m,v 1.6 2008/08/08 12:29:16 hewitson Exp $', sets, pl);
0211 end
0212 
0213 %--------------------------------------------------------------------------
0214 % Get Default Plist
0215 %--------------------------------------------------------------------------
0216 function pl_default = getDefaultPlist()
0217   pl_default = plist();
0218 end
0219 % END

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003