Export to pdf
This commit is contained in:
BIN
matlab/DCM_RT_control_v09.slx
Executable file
BIN
matlab/DCM_RT_control_v09.slx
Executable file
Binary file not shown.
BIN
matlab/DCM_RT_control_v09.slx.r2019b
Executable file
BIN
matlab/DCM_RT_control_v09.slx.r2019b
Executable file
Binary file not shown.
32
matlab/calc_kinematics.m
Executable file
32
matlab/calc_kinematics.m
Executable file
@@ -0,0 +1,32 @@
|
||||
%% this script computes the transforamtion matrices for piezo to pseudo coordinates
|
||||
|
||||
fjpur_111 = [-140; -67.5; 0]*0.001;
|
||||
fjpuh_111 = [-140; (220-67.5); 0]*0.001;
|
||||
fjpd_111 = [140; (110-67.5); 0]*0.001;
|
||||
|
||||
fjpur_311 = [-140; -(220-67.5); 0]*0.001;
|
||||
fjpuh_311 = [-140; 67.5; 0]*0.001;
|
||||
fjpd_311 = [140; -(110-67.5); 0]*0.001;
|
||||
|
||||
A_p2r_111 = [1 -1*fjpur_111(1) fjpur_111(2); 1 -1*fjpuh_111(1) fjpuh_111(2); 1 -1*fjpd_111(1) fjpd_111(2)];
|
||||
A_p2r_311 = [1 -1*fjpur_311(1) fjpur_311(2); 1 -1*fjpuh_311(1) fjpuh_311(2); 1 -1*fjpd_311(1) fjpd_311(2)];
|
||||
|
||||
A_r2p_111 = inv(A_p2r_111);
|
||||
A_r2p_311 = inv(A_p2r_311);
|
||||
|
||||
A_x2p = [-1 0 0; 0 1 0; 0 0 1];
|
||||
B_x2p = [0 0 0];
|
||||
|
||||
motor_pos2mv = 0.6667; %modified by Ludovic 12/07/2021
|
||||
% % no calibr
|
||||
calibr_fjpur = (1);
|
||||
calibr_fjpuh = (1);
|
||||
calibr_fjpd = (1);
|
||||
|
||||
%calibr
|
||||
% calibr_fjpur = (1-0.016);
|
||||
% calibr_fjpuh = (1+0.052);
|
||||
% calibr_fjpd = (1+0.0065);
|
||||
|
||||
calibr_mat = [calibr_fjpur 0 0;0 calibr_fjpuh 0;0 0 calibr_fjpd];
|
||||
|
1
matlab/figs
Symbolic link
1
matlab/figs
Symbolic link
@@ -0,0 +1 @@
|
||||
../figs
|
22
matlab/src/extractDatData.m
Normal file
22
matlab/src/extractDatData.m
Normal file
@@ -0,0 +1,22 @@
|
||||
function [data_struct] = extractDatData(dat_file, names, scale)
|
||||
% extractDatData -
|
||||
%
|
||||
% Syntax: extractDatData(data_file, lut_file, args)
|
||||
%
|
||||
% Inputs:
|
||||
% - data_file - Where to load the .mat file
|
||||
% - lut_file - Where to save the .dat file
|
||||
|
||||
%% Load Data
|
||||
data_array = importdata(dat_file);
|
||||
|
||||
%% Initialize Struct
|
||||
data_struct = struct();
|
||||
|
||||
%% Populate Struct
|
||||
for i = 1:length(names)
|
||||
data_struct.(names{i}) = scale(i)*data_array(:,i);
|
||||
end
|
||||
|
||||
%% Add Time
|
||||
data_struct.time = 1e-4*[1:1:length(data_struct.(names{1}))];
|
49
matlab/src/processMeasData.m
Normal file
49
matlab/src/processMeasData.m
Normal file
@@ -0,0 +1,49 @@
|
||||
function [data] = processMeasData(data, args)
|
||||
% processMeasData -
|
||||
%
|
||||
% Syntax: processMeasData(data_file, lut_file, args)
|
||||
%
|
||||
% Inputs:
|
||||
% - data
|
||||
|
||||
arguments
|
||||
data
|
||||
args.fir_order (1,1) double {mustBeNumericOrLogical} = 5000
|
||||
end
|
||||
|
||||
%% Actuator Jacobian
|
||||
J_a_111 = [1, 0.14, -0.0675
|
||||
1, 0.14, 0.1525
|
||||
1, -0.14, 0.0425];
|
||||
|
||||
%% FIR Filter
|
||||
Fs = 1e4; % Sampling Frequency [Hz]
|
||||
fir_order = args.fir_order; % Filter's order
|
||||
delay = fir_order/2; % Delay induced by the filter
|
||||
B_fir = firls(args.fir_order, ... % Filter's order
|
||||
[0 50/(Fs/2) 0.1e3/(Fs/2) 1], ... % Frequencies [Hz]
|
||||
[1 1 0 0]); % Wanted Magnitudes
|
||||
|
||||
data.ddz = 10.5e-3./(2*cos(data.bragg)) - data.dz;
|
||||
|
||||
%% Computation of the position of the FJ as measured by the interferometers
|
||||
error = J_a_111 * [data.ddz, data.dry, data.drx]';
|
||||
|
||||
data.fjur_e = error(1,:)'; % [m]
|
||||
data.fjuh_e = error(2,:)'; % [m]
|
||||
data.fjd_e = error(3,:)'; % [m]
|
||||
|
||||
%% Filtering all measured Fast Jack Position using the FIR filter
|
||||
data.fjur_e_filt = filter(B_fir, 1, data.fjur_e);
|
||||
data.fjuh_e_filt = filter(B_fir, 1, data.fjuh_e);
|
||||
data.fjd_e_filt = filter(B_fir, 1, data.fjd_e);
|
||||
|
||||
%% Compensation of the delay introduced by the FIR filter
|
||||
data.fjur_e_filt(1:end-delay) = data.fjur_e_filt(delay+1:end);
|
||||
data.fjuh_e_filt(1:end-delay) = data.fjuh_e_filt(delay+1:end);
|
||||
data.fjd_e_filt( 1:end-delay) = data.fjd_e_filt( delay+1:end);
|
||||
|
||||
%% Re-sample data to have same data points in FJUR
|
||||
[data.fjur_e_resampl, data.fjur_resampl] = resample(data.fjur_e_filt, data.fjur, 1/100e-9);
|
||||
[data.fjuh_e_resampl, data.fjuh_resampl] = resample(data.fjuh_e_filt, data.fjuh, 1/100e-9);
|
||||
[data.fjd_e_resampl, data.fjd_resampl] = resample(data.fjd_e_filt, data.fjd, 1/100e-9);
|
Reference in New Issue
Block a user