% Jon Newman
% 2014.01.19

%% Optical power at fiber tip using the LED
% INPUT MODULATION: DC voltage from power supply 
% MEASUREMENT: Newport 1830-C meter using a Newport 818-SL photodiode.
% K_fac accounts for distance and OD2 neutral density filter correction for
% higher laser powers

% 105 um diameter fiber
fiber_area = pi*(0.125/2)^2; 
p_offset = 0;
optimal_spot_factor = 1.1;

% LED (when the experiment room's lights were on, which adds a DC offset to
% the PD input and causes a dead zone at low command voltages)
v_cmd = [0 0  5];
v_ref = [0 0 2.3];
p_raw = [0 0.000195  0.3207];
v_pd  = [0 0.05  2.5];     
K_fac = [1 1  1];

p_tip = optimal_spot_factor*((p_raw - p_offset) .* K_fac)/fiber_area;

cftool
