% A.P June 13th 2013

%% urad to counts calibration for TMSY [Pitch Yaw]

% Numbers are from T110378-v7 and Mark B mathematica model (cf LHO aLog 6738)

%calibration_gain=(DAC (V/Ct)    *Coil driver(A/V)*Coil Magnet(N/A)*M1toM2[ Pitch      Yaw(rad/N.m)] * urad/rad)   .^-1
calibration_gain=  (20/(2^18)    *   9.94e-3      *    1.694        *       [ 0.00491551  0.0150533  ] * 1e6)      .^-1;

pitch_gain=calibration_gain(1);
yaw_gain=calibration_gain(2);

%% max range for MEDM sliders alignment offsets  [Pitch Yaw]

%           +/-max DAC out  /([    pitch gain             yaw gain    ]       *     M1PtoLF/RT M1YtoF2/F3)
sliders_range=2^18/2       ./([calibration_gain(1) calibration_gain(2)]      .*     [2.7778      4.1667]);

sliders_range_pitch=sliders_range(1);
sliders_range_yaw=sliders_range(2);