diff --git a/dcm-feedback-control.html b/dcm-feedback-control.html index 47f322a..44f6320 100644 --- a/dcm-feedback-control.html +++ b/dcm-feedback-control.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + ESRF Double Crystal Monochromator - Feedback Controller @@ -22,40 +22,41 @@

Table of Contents

@@ -65,12 +66,12 @@

This report is also available as a pdf.


-
-

1. Estimation of Sensitivity Function

+
+

1. Estimation of Sensitivity Function

-
-

1.1. Load Data

+
+

1.1. Load Data

Two scans are performed: @@ -99,7 +100,7 @@ t = linspace(Ts, Ts*length(ol_drx), length(ol_d

-By comparison the frequency content of the crystal orientation errors between mode B and mode C, it is possible to estimate the Sensitivity transfer function (Figure 1). +By comparison the frequency content of the crystal orientation errors between mode B and mode C, it is possible to estimate the Sensitivity transfer function (Figure 1).

win = hanning(ceil(1/Ts));
@@ -113,7 +114,7 @@ By comparison the frequency content of the crystal orientation errors between mo
 
-
+

sensitivity_function_drx_est.png

Figure 1: Estimation of the sensitivity transfer function magnitude

@@ -122,8 +123,8 @@ By comparison the frequency content of the crystal orientation errors between mo
-
-

1.2. Controller

+
+

1.2. Controller

load('X_tal_cage_PID.mat', 'K');
@@ -131,7 +132,7 @@ By comparison the frequency content of the crystal orientation errors between mo
 
-
+

bode_plot_cur_controller.png

Figure 2: Bode Plot of the Controller

@@ -139,8 +140,8 @@ By comparison the frequency content of the crystal orientation errors between mo
-
-

1.3. Test

+
+

1.3. Test

Ts = 5e-3;
@@ -170,14 +171,84 @@ t = linspace(Ts, Ts*length(ol_drx), length(ol_d
 
-
-

2. System Identification

+
+

2. System Identification

-
-

2.1. Identification

+
+

2.1. Identification ID24

+
load('test_id_id24_3.mat')
+
+
+ +
+
t = 1e-4*ones(size(fjpur, 1), 1);
+
+ur.dz  = fjpur(:,1) - mean(fjpur(:,1));
+ur.dry = fjpur(:,2) - mean(fjpur(:,2));
+ur.drx = fjpur(:,3) - mean(fjpur(:,3));
+ur.u   = fjpur(:,7) - mean(fjpur(:,7));
+
+uh.dz  = fjpuh(:,1) - mean(fjpuh(:,1));
+uh.dry = fjpuh(:,2) - mean(fjpuh(:,2));
+uh.drx = fjpuh(:,3) - mean(fjpuh(:,3));
+uh.u   = fjpuh(:,8) - mean(fjpuh(:,8));
+
+d.dz  = fjpd(:,1) - mean(fjpd(:,1));
+d.dry = fjpd(:,2) - mean(fjpd(:,2));
+d.drx = fjpd(:,3) - mean(fjpd(:,3));
+d.u   = fjpd(:,9) - mean(fjpd(:,9));
+
+
+ +
+
J_a_311 = [1,  0.14, -0.0675
+           1,  0.14,  0.1525
+           1, -0.14,  0.0425];
+
+J_a_111 = [1,  0.14, -0.1525
+           1,  0.14,  0.0675
+           1, -0.14, -0.0425];
+
+ur.y = [J_a_311 * [-ur.dz, ur.dry,-ur.drx]']';
+uh.y = [J_a_311 * [-uh.dz, uh.dry,-uh.drx]']';
+d.y  = [J_a_311 * [-d.dz,  d.dry, -d.drx]']';
+
+
+ +
+
%% Sampling Time and Frequency
+Ts = 1e-4; % [s]
+Fs = 1/Ts; % [Hz]
+
+% Hannning Windows
+win = hanning(ceil(1*Fs));
+
+
+ +
+
%% And we get the frequency vector
+[G_ur, f] = tfestimate(ur.u, ur.y, win, [], [], 1/Ts);
+[G_uh, ~] = tfestimate(uh.u, uh.y, win, [], [], 1/Ts);
+[G_d,  ~] = tfestimate(d.u,  d.y,  win, [], [], 1/Ts);
+
+
+ +
+
[coh_ur, ~] = mscohere(ur.u, ur.y, win, [], [], 1/Ts);
+[coh_uh, ~] = mscohere(uh.u, uh.y, win, [], [], 1/Ts);
+[coh_d,  ~] = mscohere(d.u,  d.y,  win, [], [], 1/Ts);
+
+
+
+
+ +
+

2.2. Identification

+
+
ur = load('FJPUR_step.mat');
 uh = load('FJPUH_step.mat');
 d  = load('FJPD_step.mat');
@@ -321,7 +392,7 @@ win = hanning(ceil(5*Fs));
 
-
+

coherence_id_dcm_dyn.png

Figure 3: Coherence

@@ -329,7 +400,7 @@ win = hanning(ceil(5*Fs)); -
+

bode_plot_dcm_dynamics.png

Figure 4: Bode Plot of the DCM dynamics in the frame of the fast jack.

@@ -359,7 +430,7 @@ Kb = eye(3)*(2* -
+

loop_gain_dcm_contr_simple.png

Figure 5: Loop gain

@@ -367,7 +438,7 @@ Kb = eye(3)*(2* +

loop_gain_diag_old_new_contr.png

Figure 6: Loop gain

@@ -377,7 +448,7 @@ Kb = eye(3)*(2* -
+

sensitivity_comp.png

Figure 7: Comparison of sensitivity functions

@@ -396,7 +467,7 @@ Lb = zeros(3, 3, length(f));
-
+

loci_loop_gain_comp_controllers.png

Figure 8: Root Locus

@@ -405,9 +476,9 @@ Lb = zeros(3, 3, length(f));
-
-

2.2. Identification - New

-
+
+

2.3. Identification - New

+
ur = load('FJPUR_step_new.mat');
 uh = load('FJPUH_step_new.mat');
@@ -577,7 +648,7 @@ Kb = eye(3)*(2*
 
-
+

sensitivity_comp.png

Figure 9: Comparison of sensitivity functions

@@ -596,7 +667,7 @@ Lb = zeros(3, 3, length(f));
-
+

loci_loop_gain_comp_controllers.png

Figure 10: Root Locus

@@ -605,9 +676,9 @@ Lb = zeros(3, 3, length(f));
-
-

2.3. Identification - White noise

-
+
+

2.4. Identification - White noise

+
ur = load('fjpur_white_noise.mat');
 uh = load('fjpuh_white_noise.mat');
@@ -725,14 +796,14 @@ win = hanning(ceil(0.5*Fs));
 
-
+

coherence_ident_noise.png

Figure 11: description

-
+

bode_plot_ident_noise.png

Figure 12: Bode Plot of the DCM dynamics in the frame of the fast jack.

@@ -762,14 +833,14 @@ Kb = eye(3)*(2* -
+

loop_gain_dcm_contr_simple.png

Figure 13: Loop gain

-
+

loop_gain_diag_old_new_contr.png

Figure 14: Loop gain

@@ -779,7 +850,7 @@ Kb = eye(3)*(2* -
+

sensitivity_comp.png

Figure 15: Comparison of sensitivity functions

@@ -798,7 +869,7 @@ Lb = zeros(3, 3, length(f));
-
+

loci_loop_gain_comp_controllers.png

Figure 16: Root Locus

@@ -807,9 +878,9 @@ Lb = zeros(3, 3, length(f));
-
-

2.4. Test

-
+
+

2.5. Test

+
%% Notch
 gm = 0.015;
@@ -851,9 +922,9 @@ Kb =  0.8*eye(3)*
 
-
-

2.5. New controller - Higher bandwidth

-
+
+

2.6. New controller - Higher bandwidth

+
%% Previously used controller
 load('X_tal_cage_PID.mat', 'K');
@@ -916,7 +987,7 @@ Kb =  0.9*eye(3)*
 
 
-
+

loop_gain_compare.png

Figure 17: description

@@ -937,14 +1008,14 @@ Lb_new = zeros(3, 3, length(f));
-
+

nyquist_compare.png

-

Figure 18: n

+

Figure 18: Nyquist Plot

-
+

sensitivity_function_compare.png

Figure 19: description

@@ -954,9 +1025,9 @@ Lb_new = zeros(3, 3, length(f)); -
-

2.6. Added gain

-
+
+

2.7. Added gain

+
%% Notch
 gm = 0.015;
@@ -1017,21 +1088,21 @@ Kb_gain =  0.9*eye(3)
 
-
+

loop_gain_compare_added_gain.png

Figure 20: description

-
+

sensitivity_new_gain_compare.png

Figure 21: description

-
+

nyquist_after_gain_frequency.png

Figure 22: nyquist plot

@@ -1041,12 +1112,12 @@ Kb_gain = 0.9*eye(3)
-
-

3. Noise Budgeting

+
+

3. Noise Budgeting

-
-

3.1. No Displacement

+
+

3.1. No Displacement

@@ -1275,8 +1346,8 @@ data_70_deg.drx = data_70_deg.allValues(:,6) -

3.2. Scans

+
+

3.2. Scans

@@ -1437,8 +1508,8 @@ CPS_70_10_d = flip(-cumtrapz(flip(f), flip(pxx -
-

3.3. Noise budgeting - No rotation

+
+

3.3. Noise budgeting - No rotation

First, we look at the position errors when the bragg axis is not moving @@ -1488,7 +1559,7 @@ win = hanning(ceil(1/Ts));

-
+

noise_budget_no_mov_asd.png

Figure 23: Amplitude Spectral Density

@@ -1511,7 +1582,7 @@ CPS_dz = cumtrapz(f, pxx_ol_dz);
-
+

noise_budget_no_mov_cas.png

Figure 24: Cumulative Amplitude Spectrum

@@ -1520,17 +1591,17 @@ CPS_dz = cumtrapz(f, pxx_ol_dz);
-
-

3.4. Noise budgeting - Bragg rotation

+
+

3.4. Noise budgeting - Bragg rotation

-
-

4. Test Mode C

+
+

4. Test Mode C

-
-

4.1. Mode B and Mode C

+
+

4.1. Mode B and Mode C

data_B = extractDatData(sprintf("/home/thomas/mnt/data_id21/22Jan/blc13491/id21/test_regul_220119/%s","lut_const_fj_vel_19012022_1450.dat"), ...
@@ -1620,12 +1691,12 @@ win = hanning(ceil(1/Ts));
 
-
-

5. Export numerator and denominator

+
+

5. Export numerator and denominator

-
-

5.1. Export

+
+

5.1. Export

K_order = 10;
@@ -1673,8 +1744,8 @@ fclose(fileID);
 
-
-

5.2. Verify

+
+

5.2. Verify

K_data = importdata('X_tal_cage_PID_20Hz.dat');
@@ -1687,7 +1758,7 @@ K = tf(K_data(1,:), K_data(2,
 

Author: Dehaeze Thomas

-

Created: 2022-02-20 dim. 23:36

+

Created: 2022-06-02 Thu 18:23