Add Newport Controller

This commit is contained in:
Thomas Dehaeze 2019-09-18 09:41:49 +02:00
parent 1ef431dee9
commit 284780d60e
4 changed files with 542 additions and 194 deletions

BIN
figs/loop_gain_newport.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

File diff suppressed because it is too large Load Diff

163
index.org
View File

@ -1949,10 +1949,14 @@ We compute the Power Spectral Density of the voltage across the inductance used
#+end_src #+end_src
* Plant Scaling * Plant Scaling
- measured noise | | Value | Unit | |
- expected perturbations |------------------------+-------+-------------+---|
- maximum input usage | Expected perturbations | 1 | [V] | $U_n$ |
- maximum wanted error | Maximum input usage | 10 | [V] | $U_c$ |
| Maximum wanted error | 10 | [$\mu rad$] | $\theta$ |
| Measured noise | 5 | [$\mu rad$] | |
** General Configuration
* Plant Analysis * Plant Analysis
** Matlab Init :noexport:ignore: ** 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'); save('mat/K_diag.mat', 'K', 'Kd');
#+end_src #+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)
<<matlab-dir>>
#+end_src
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+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")
<<plt-matlab>>
#+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 * 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)
<<matlab-dir>>
#+end_src
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+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<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
#+end_src
** TODO Some Plots
** Repeatability
#+begin_src matlab :exports none
figure;
ax1 = subplot(1, 2, 1);
hold on;
plot(Vnh, Va);
hold off;
xlabel('$V_{n,h}$ [V]'); ylabel('$V_a$ [m]');
ax2 = subplot(1, 2, 2);
hold on;
plot(Vnv, Va);
hold off;
xlabel('$V_{n,v}$ [V]'); ylabel('$V_a$ [m]');
#+end_src
#+begin_src matlab
bh = [ones(size(Vnh)) Vnh]\Vph;
bv = [ones(size(Vnv)) Vnv]\Vpv;
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(1, 2, 1);
hold on;
plot(2*gn0*uh.Vnh, uh.Vph, 'o', 'DisplayName', 'Exp. data');
plot(2*gn0*[min(uh.Vnh) max(uh.Vnh)], 2*gn0*[min(uh.Vnh) max(uh.Vnh)].*bh(2) + bh(1), 'k--', 'DisplayName', sprintf('%.1e x + %.1e', bh(2), bh(1)))
hold off;
xlabel('$\alpha_{0,h}$ [rad]'); ylabel('$Vp_h$ [V]');
legend();
ax2 = subplot(1, 2, 2);
hold on;
plot(2*gn0*uv.Vnv, uv.Vpv, 'o', 'DisplayName', 'Exp. data');
plot(2*gn0*[min(uv.Vnv) max(uv.Vnv)], 2*gn0*[min(uv.Vnv) max(uv.Vnv)].*bv(2) + bv(1), 'k--', 'DisplayName', sprintf('%.1e x + %.1e', bv(2), bv(1)))
hold off;
xlabel('$\alpha_{0,v}$ [rad]'); ylabel('$Vp_v$ [V]');
legend();
#+end_src

BIN
mat/K_newport.mat Normal file

Binary file not shown.