diff --git a/figs/loop_gain_newport.png b/figs/loop_gain_newport.png new file mode 100644 index 0000000..549f44d Binary files /dev/null and b/figs/loop_gain_newport.png differ diff --git a/index.html b/index.html index 68aae45..c7acaa6 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Cercalo Test Bench @@ -276,93 +276,110 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Introduction

+
+

1 Introduction

-
-

1.1 Block Diagram

+
+

1.1 Block Diagram

-The block diagram of the setup to be controlled is shown in Fig. 1. +The block diagram of the setup to be controlled is shown in Fig. 1.

-
+

cercalo_diagram_simplify.png

Figure 1: Block Diagram of the Experimental Setup

@@ -392,10 +409,10 @@ The transfer functions in the system are:

-The block diagram with each transfer function is shown in Fig. 2. +The block diagram with each transfer function is shown in Fig. 2.

-
+

cercalo_diagram.png

Figure 2: Block Diagram of the Experimental Setup with detailed dynamics

@@ -403,14 +420,14 @@ The block diagram with each transfer function is shown in Fig. -

1.2 Cercalo

+
+

1.2 Cercalo

-From the Cercalo documentation, we have the parameters shown on table 1. +From the Cercalo documentation, we have the parameters shown on table 1.

- +
@@ -468,11 +485,11 @@ The Inductance and DC resistance of the two axis of the Cercalo have been measur

-Let's first consider the horizontal direction and we try to model the Cercalo by a spring/mass/damper system (Fig. 3). +Let's first consider the horizontal direction and we try to model the Cercalo by a spring/mass/damper system (Fig. 3).

-
+

mech_cercalo.png

Figure 3: 1 degree-of-freedom model of the Cercalo

@@ -511,7 +528,7 @@ The current \(I\) is also proportional to the voltage at the output of the buffe

Let's try to determine the equivalent mass and spring values. -From table 1, for the horizontal direction: +From table 1, for the horizontal direction: \[ \left| \frac{x}{I} \right|(0) = \left| \alpha \frac{x}{F} \right|(0) = 28.4\ \frac{mA}{deg} = 1.63\ \frac{A}{rad} \]

@@ -572,18 +589,18 @@ This will be done using the Newport.
-
-

1.3 Optical Setup

+
+

1.3 Optical Setup

-
-

1.4 Newport

+
+

1.4 Newport

-Parameters of the Newport are shown in Fig. 4. +Parameters of the Newport are shown in Fig. 4.

-It's dynamics for small angle excitation is shown in Fig. 5. +It's dynamics for small angle excitation is shown in Fig. 5.

@@ -595,14 +612,14 @@ And we have: \end{align*} -

+

newport_doc.png

Figure 4: Documentation of the Newport

-
+

newport_gain.png

Figure 5: Transfer function of the Newport

@@ -610,25 +627,25 @@ And we have:
-
-

1.5 4 quadrant Diode

+
+

1.5 4 quadrant Diode

-The front view of the 4 quadrant photo-diode is shown in Fig. 6. +The front view of the 4 quadrant photo-diode is shown in Fig. 6.

-
+

4qd_naming.png

Figure 6: Front view of the 4QD

-Each of the photo-diode is amplified using a 4-channel amplifier as shown in Fig. 7. +Each of the photo-diode is amplified using a 4-channel amplifier as shown in Fig. 7.

-
+

4qd_amplifier.png

Figure 7: Wiring of the amplifier. The amplifier is located on the bottom right of the board

@@ -636,8 +653,8 @@ Each of the photo-diode is amplified using a 4-channel amplifier as shown in Fig
-
-

1.6 ADC/DAC

+
+

1.6 ADC/DAC

Let's compute the theoretical noise of the ADC/DAC. @@ -657,14 +674,14 @@ with \(\Delta V\) the total range of the ADC, \(n\) its number of bits, \(q\) th

-
-

2 Identification of the system dynamics

+
+

2 Identification of the system dynamics

- +

-In this section, we seek to identify all the blocks as shown in Fig. 1. +In this section, we seek to identify all the blocks as shown in Fig. 1.

Table 1: Cercalo Parameters
@@ -761,8 +778,8 @@ All the files (data and Matlab scripts) are accessible -

2.1 Calibration of the 4 Quadrant Diode

+
+

2.1 Calibration of the 4 Quadrant Diode

Prior to any dynamic identification, we would like to be able to determine the meaning of the 4 quadrant diode measurement. @@ -777,8 +794,8 @@ We then should be able to obtain the "gain" of the 4QD in [V/rad].

-
-

2.1.1 Input / Output data

+
+

2.1.1 Input / Output data

The identification data is loaded @@ -812,7 +829,7 @@ uv.t = uv.t - uv.t +

calib_4qd_h.png

Figure 8: Identification signals when exciting the horizontal direction (png, pdf)

@@ -820,7 +837,7 @@ uv.t = uv.t - uv.t +

calib_4qd_v.png

Figure 9: Identification signals when exciting in the vertical direction (png, pdf)

@@ -828,8 +845,8 @@ uv.t = uv.t - uv.t -

2.1.2 Linear Regression to obtain the gain of the 4QD

+
+

2.1.2 Linear Regression to obtain the gain of the 4QD

We plot the angle of mirror @@ -859,7 +876,7 @@ where:

-The linear regression is shown in Fig. 10. +The linear regression is shown in Fig. 10.

@@ -869,17 +886,17 @@ bv = [ones +

4qd_linear_reg.png

Figure 10: Linear Regression (png, pdf)

-Thus, we obtain the "gain of the 4 quadrant photo-diode as shown on table 2. +Thus, we obtain the "gain of the 4 quadrant photo-diode as shown on table 2.

-
+
@@ -923,11 +940,11 @@ We obtain: -
-

2.2 Identification of the Cercalo Impedance, Current Amplifier and Voltage Amplifier dynamics

+
+

2.2 Identification of the Cercalo Impedance, Current Amplifier and Voltage Amplifier dynamics

-We wish here to determine \(G_i\) and \(G_a\) shown in Fig. 1. +We wish here to determine \(G_i\) and \(G_a\) shown in Fig. 1.

@@ -935,15 +952,15 @@ We ignore the electro-mechanical coupling.

-
-

2.2.1 Electrical Schematic

+
+

2.2.1 Electrical Schematic

-The schematic of the electrical circuit used to drive the Cercalo is shown in Fig. 11. +The schematic of the electrical circuit used to drive the Cercalo is shown in Fig. 11.

-
+

cercalo_amplifier.png

Figure 11: Current Amplifier Schematic

@@ -1030,8 +1047,8 @@ with
-
-

2.2.2 Theoretical Transfer Functions

+
+

2.2.2 Theoretical Transfer Functions

The values of the components in the current amplifier have been measured. @@ -1061,7 +1078,7 @@ Ga = blkdiag( +

current_amplifier_tf.png

Figure 12: Transfer function for the current amplifier (png, pdf)

@@ -1083,8 +1100,8 @@ Zc = tf(blkdiag -

2.2.3 Identified Transfer Functions

+
+

2.2.3 Identified Transfer Functions

Noise is generated using the DAC (\([U_{c,h}\ U_{c,v}]\)) and we measure the output of the voltage amplifier \([V_{c,h}, V_{c,v}]\). @@ -1111,7 +1128,7 @@ We remove the first seconds where the Cercalo is turned on.

-
+

current_amplifier_comp_theory_id.png

Figure 13: Identified and Theoretical Transfer Function \(G_a G_i\) (png, pdf)

@@ -1129,7 +1146,7 @@ Gi = tf(blkdiag +

current_amplifier_comp_theory_id_bis.png

Figure 14: Identified and Theoretical Transfer Function \(G_a G_i\) (png, pdf)

@@ -1207,11 +1224,11 @@ Continuous-time zero/pole/gain model.
-
-

2.3 Identification of the Cercalo Dynamics

+
+

2.3 Identification of the Cercalo Dynamics

-We now wish to identify the dynamics of the Cercalo identified by \(G_c\) on the block diagram in Fig. 1. +We now wish to identify the dynamics of the Cercalo identified by \(G_c\) on the block diagram in Fig. 1.

@@ -1223,8 +1240,8 @@ The transfer function obtained will be \(G_c G_i\), and because we have already

-
-

2.3.1 Input / Output data

+
+

2.3.1 Input / Output data

The identification data is loaded @@ -1259,7 +1276,7 @@ uv.t = uv.t - uv.t +

identification_uh.png

Figure 15: Identification signals when exciting the horizontal direction (png, pdf)

@@ -1267,7 +1284,7 @@ uv.t = uv.t - uv.t +

identification_uv.png

Figure 16: Identification signals when exciting in the vertical direction (png, pdf)

@@ -1275,8 +1292,8 @@ uv.t = uv.t - uv.t -

2.3.2 Coherence

+
+

2.3.2 Coherence

The window used for the spectral analysis is an hanning windows with temporal size equal to 1 second. @@ -1295,7 +1312,7 @@ The window used for the spectral analysis is an hanning windows wit

-
+

coh_cercalo.png

Figure 17: Coherence (png, pdf)

@@ -1303,8 +1320,8 @@ The window used for the spectral analysis is an hanning windows wit
-
-

2.3.3 Estimation of the Frequency Response Function Matrix

+
+

2.3.3 Estimation of the Frequency Response Function Matrix

We compute an estimate of the transfer functions. @@ -1318,14 +1335,14 @@ We compute an estimate of the transfer functions.

-
+

frf_cercalo_gain.png

Figure 18: Frequency Response Matrix (png, pdf)

-
+

frf_cercalo_phase.png

Figure 19: Frequency Response MatrixPhase (png, pdf)

@@ -1333,8 +1350,8 @@ We compute an estimate of the transfer functions.
-
-

2.3.4 Time Delay

+
+

2.3.4 Time Delay

Now, we would like to remove the time delay included in the FRF prior to the model extraction. @@ -1365,8 +1382,8 @@ tf_Ucv_Vpv = tf_Ucv_Vpv./G_delay_resp;

-
-

2.3.5 Extraction of a transfer function matrix

+
+

2.3.5 Extraction of a transfer function matrix

First we define the initial guess for the resonance frequencies and the weights associated. @@ -1416,11 +1433,11 @@ weight_Ucv_Vpv(f

-The weights are shown in Fig. 20. +The weights are shown in Fig. 20.

-
+

weights_cercalo.png

Figure 20: Weights amplitude (png, pdf)

@@ -1472,7 +1489,7 @@ An we run the vectfit3 algorithm.
-
+

identification_matrix_fit.png

Figure 21: Transfer Function Extraction of the FRF matrix (png, pdf)

@@ -1480,7 +1497,7 @@ An we run the vectfit3 algorithm. -
+

identification_matrix_fit_phase.png

Figure 22: Transfer Function Extraction of the FRF matrix (png, pdf)

@@ -1503,8 +1520,8 @@ Gc = [G_Uch_Vph, G_Ucv_Vph;
-
-

2.4 Identification of the Newport Dynamics

+
+

2.4 Identification of the Newport Dynamics

We here identify the transfer function from a reference sent to the Newport \([U_{n,h},\ U_{n,v}]\) to the measurement made by the 4QD \([V_{p,h},\ V_{p,v}]\). @@ -1515,8 +1532,8 @@ To do so, we inject noise to the Newport \([U_{n,h},\ U_{n,v}]\) and we record t

-
-

2.4.1 Input / Output data

+
+

2.4.1 Input / Output data

The identification data is loaded @@ -1551,14 +1568,14 @@ uv.t = uv.t - uv.t +

identification_unh.png

Figure 23: Identification signals when exciting the horizontal direction (png, pdf)

-
+

identification_unv.png

Figure 24: Identification signals when exciting in the vertical direction (png, pdf)

@@ -1566,8 +1583,8 @@ uv.t = uv.t - uv.t -

2.4.2 Coherence

+
+

2.4.2 Coherence

The window used for the spectral analysis is an hanning windows with temporal size equal to 1 second. @@ -1586,7 +1603,7 @@ The window used for the spectral analysis is an hanning windows wit

-
+

id_newport_coherence.png

Figure 25: Coherence (png, pdf)

@@ -1594,8 +1611,8 @@ The window used for the spectral analysis is an hanning windows wit
-
-

2.4.3 Estimation of the Frequency Response Function Matrix

+
+

2.4.3 Estimation of the Frequency Response Function Matrix

We compute an estimate of the transfer functions. @@ -1609,14 +1626,14 @@ We compute an estimate of the transfer functions.

-
+

frf_newport_gain.png

Figure 26: Frequency Response Matrix (png, pdf)

-
+

frf_newport_phase.png

Figure 27: Frequency Response Matrix Phase (png, pdf)

@@ -1624,8 +1641,8 @@ We compute an estimate of the transfer functions.
-
-

2.4.4 Time Delay

+
+

2.4.4 Time Delay

Now, we would like to remove the time delay included in the FRF prior to the model extraction. @@ -1647,7 +1664,7 @@ G_delay_resp = squeeze(freqr We then remove the time delay from the frequency response function.

-
+

time_delay_newport.png

Figure 28: Phase change due to time-delay in the Newport dynamics (png, pdf)

@@ -1655,11 +1672,11 @@ We then remove the time delay from the frequency response function.
-
-

2.4.5 Extraction of a transfer function matrix

+
+

2.4.5 Extraction of a transfer function matrix

-From Fig. 26, it seems reasonable to model the Newport dynamics as diagonal and constant. +From Fig. 26, it seems reasonable to model the Newport dynamics as diagonal and constant.

@@ -1670,8 +1687,8 @@ From Fig. 26, it seems reasonable to model the Newport
-
Table 2: Identified Gain of the 4 quadrant diode
+ + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 ValueUnit 
Expected perturbations1[V]\(U_n\)
Maximum input usage10[V]\(U_c\)
Maximum wanted error10[\(\mu rad\)]\(\theta\)
Measured noise5[\(\mu rad\)] 
+
+ +
+

5.1 General Configuration

-
-

6 Plant Analysis

+
+

6 Plant Analysis

-
-

6.1 Load Plant

+
+

6.1 Load Plant

load('mat/plant.mat', 'G');
@@ -1888,8 +1953,8 @@ xlim(
-

6.2 RGA-Number

+
+

6.2 RGA-Number

freqs = logspace(2, 4, 1000);
@@ -1928,8 +1993,8 @@ V = zeros(
-

6.3 Rotation Matrix

+
+

6.3 Rotation Matrix

G0 = freqresp(G, 0);
@@ -1939,8 +2004,8 @@ V = zeros(
-

7 Control Objective

+
+

7 Control Objective

The maximum expected stroke is \(y_\text{max} = 3mm \approx 5e^{-2} rad\) at \(1Hz\). @@ -1962,11 +2027,11 @@ In terms of loop gain, this is equivalent to:

-
-

8 Decentralized Control

+
+

8 Decentralized Control

- +

In this section, we try to implement a simple decentralized controller. @@ -1979,8 +2044,8 @@ All the files (data and Matlab scripts) are accessible -

8.1 Load Plant

+
+

8.1 Load Plant

load('mat/plant.mat', 'sys', 'Gi', 'Zc', 'Ga', 'Gc', 'Gn', 'Gd');
@@ -1989,12 +2054,12 @@ All the files (data and Matlab scripts) are accessible 
-

8.2 Diagonal Controller

+
+

8.2 Diagonal Controller

Using SISOTOOL, a diagonal controller is designed. -The two SISO loop gains are shown in Fig. 29. +The two SISO loop gains are shown in Fig. 29.

Kh = -0.25598*(s+112)*(s^2 + 15.93*s + 6.686e06)/((s^2*(s+352.5)*(1+s/2/pi/2000)));
@@ -2007,14 +2072,14 @@ K.OutputName = {
 
 
-
+

diag_contr_loop_gain.png

Figure 29: Loop Gain using the Decentralized Diagonal Controller (png, pdf)

-We then close the loop and we look at the transfer function from the Newport rotation signal to the beam angle (Fig. 30). +We then close the loop and we look at the transfer function from the Newport rotation signal to the beam angle (Fig. 30).

inputs  = {'Uch', 'Ucv', 'Unh', 'Unv'};
@@ -2025,7 +2090,7 @@ sys_cl = connect(sys, 
 
 
-
+

diag_contr_effect_newport.png

Figure 30: Effect of the Newport rotation on the beam position when the loop is closed using the Decentralized Diagonal Controller (png, pdf)

@@ -2033,8 +2098,8 @@ sys_cl = connect(sys,
-
-

8.3 Save the Controller

+
+

8.3 Save the Controller

Kd = c2d(K, 1e-4, 'tustin');
@@ -2052,13 +2117,141 @@ The diagonal controller is accessible here.
 
-
-

9 Measurement of the non-repeatability

+
+

9 Newport Control

+
+

+In this section, we try to implement a simple decentralized controller for the Newport. +This can be used to align the 4QD: +

+
    +
  • once there is a signal from the 4QD, the Newport feedback loop is closed
  • +
  • thus, the Newport is positioned such that the beam hits the center of the 4QD
  • +
  • then we can move the 4QD manually in X-Y plane in order to cancel the command signal of the Newport
  • +
  • finally, we are sure to be aligned when the command signal of the Newport is 0
  • +
+
+ +
+

9.1 Load Plant

+
+
+
load('mat/plant.mat', 'Gn', 'Gd');
+
+
+
+
+ +
+

9.2 Analysis

+
+

+The plant is basically a constant until frequencies up to the required bandwidth. +

+ +

+We get that constant value. +

+
+
Gn0 = freqresp(inv(Gd)*Gn, 0);
+
+
+ +

+We design two controller containing 2 integrators and one lead near the crossover frequency set to 10Hz. +

+
+
h = 2;
+w0 = 2*pi*10;
+
+Knh = 1/Gn0(1,1) * (w0/s)^2 * (1 + s/w0*h)/(1 + s/w0/h)/h;
+Knv = 1/Gn0(2,2) * (w0/s)^2 * (1 + s/w0*h)/(1 + s/w0/h)/h;
+
+
+ + +
+

loop_gain_newport.png +

+

Figure 31: Diagonal Loop Gain for the Newport (png, pdf)

+
+
+
+ +
+

9.3 Save

+
+

+The controllers can be downloaded here. +

+ +
+
save('mat/K_newport.mat', 'Knh', 'Knv');
+
+
+
+
+
+ +
+

10 Measurement of the non-repeatability

+
+
+
+

10.1 Data Load

+
+
+
load('mat/data_rep_1.mat', ...
+     't', 'Uch', 'Ucv', ...
+     'Unh', 'Unv', ...
+     'Vph', 'Vpv', ...
+     'Vch', 'Vcv', ...
+     'Vnh', 'Vnv', ...
+     'Va');
+
+
+ +
+
t0 = 5;
+
+Uch(t<t0) = [];
+Ucv(t<t0) = [];
+Unh(t<t0) = [];
+Unv(t<t0) = [];
+Vph(t<t0) = [];
+Vpv(t<t0) = [];
+Vch(t<t0) = [];
+Vcv(t<t0) = [];
+Vnh(t<t0) = [];
+Vnv(t<t0) = [];
+Va(t<t0)  = [];
+t(t<t0)   = [];
+
+t = t - t(1); % We start at t=0
+
+
+
+
+ +
+

10.2 TODO Some Plots

+
+ +
+

10.3 Repeatability

+
+
+
bh = [ones(size(Vnh)) Vnh]\Vph;
+bv = [ones(size(Vnv)) Vnv]\Vpv;
+
+
+
+

Author: Dehaeze Thomas

-

Created: 2019-09-17 mar. 16:21

+

Created: 2019-09-18 mer. 09:41

Validate

diff --git a/index.org b/index.org index 1076ffe..8948798 100644 --- a/index.org +++ b/index.org @@ -1949,10 +1949,14 @@ We compute the Power Spectral Density of the voltage across the inductance used #+end_src * Plant Scaling -- measured noise -- expected perturbations -- maximum input usage -- maximum wanted error +| | Value | Unit | | +|------------------------+-------+-------------+---| +| Expected perturbations | 1 | [V] | $U_n$ | +| Maximum input usage | 10 | [V] | $U_c$ | +| Maximum wanted error | 10 | [$\mu rad$] | $\theta$ | +| Measured noise | 5 | [$\mu rad$] | | + +** General Configuration * Plant Analysis ** Matlab Init :noexport:ignore: @@ -2157,4 +2161,155 @@ The diagonal controller is accessible [[./mat/K_diag.mat][here]]. save('mat/K_diag.mat', 'K', 'Kd'); #+end_src +* Newport Control +** Introduction :ignore: +In this section, we try to implement a simple decentralized controller for the Newport. +This can be used to align the 4QD: +- once there is a signal from the 4QD, the Newport feedback loop is closed +- thus, the Newport is positioned such that the beam hits the center of the 4QD +- then we can move the 4QD manually in X-Y plane in order to cancel the command signal of the Newport +- finally, we are sure to be aligned when the command signal of the Newport is 0 + +** Matlab Init :noexport:ignore: +#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) + <> +#+end_src + +#+begin_src matlab :exports none :results silent :noweb yes + <> +#+end_src + +#+begin_src matlab + freqs = logspace(0, 2, 1000); +#+end_src + +** Load Plant +#+begin_src matlab + load('mat/plant.mat', 'Gn', 'Gd'); +#+end_src + +** Analysis +The plant is basically a constant until frequencies up to the required bandwidth. + +We get that constant value. +#+begin_src matlab + Gn0 = freqresp(inv(Gd)*Gn, 0); +#+end_src + +We design two controller containing 2 integrators and one lead near the crossover frequency set to 10Hz. +#+begin_src matlab + h = 2; + w0 = 2*pi*10; + + Knh = 1/Gn0(1,1) * (w0/s)^2 * (1 + s/w0*h)/(1 + s/w0/h)/h; + Knv = 1/Gn0(2,2) * (w0/s)^2 * (1 + s/w0*h)/(1 + s/w0/h)/h; +#+end_src + +#+begin_src matlab :exports none + figure; + + hold on; + plot(freqs, abs(squeeze(freqresp(Gn0(1,1)*Knh, freqs, 'Hz')))) + hold off; + set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); + xlabel('Frequency [Hz]'); ylabel('Loop Gain'); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/loop_gain_newport.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") + <> +#+end_src + +#+NAME: fig:loop_gain_newport +#+CAPTION: Diagonal Loop Gain for the Newport ([[./figs/loop_gain_newport.png][png]], [[./figs/loop_gain_newport.pdf][pdf]]) +[[file:figs/loop_gain_newport.png]] + +** Save +The controllers can be downloaded [[./mat/K_newport.mat][here]]. + +#+begin_src matlab + save('mat/K_newport.mat', 'Knh', 'Knv'); +#+end_src + * Measurement of the non-repeatability +** Matlab Init :noexport:ignore: +#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) + <> +#+end_src + +#+begin_src matlab :exports none :results silent :noweb yes + <> +#+end_src + +** Data Load +#+begin_src matlab + load('mat/data_rep_1.mat', ... + 't', 'Uch', 'Ucv', ... + 'Unh', 'Unv', ... + 'Vph', 'Vpv', ... + 'Vch', 'Vcv', ... + 'Vnh', 'Vnv', ... + 'Va'); +#+end_src + +#+begin_src matlab + t0 = 5; + + Uch(t