test-bench-piezo-amplifiers/index.org

727 lines
22 KiB
Org Mode
Raw Normal View History

2020-08-13 09:54:00 +02:00
#+TITLE: Measurement of Piezoelectric Amplifiers
:DRAWER:
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
2020-11-12 10:11:31 +01:00
#+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP: ../index.html
2020-08-13 09:54:00 +02:00
2020-11-12 10:11:31 +01:00
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
#+HTML_HEAD: <script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>
2020-08-13 09:54:00 +02:00
#+PROPERTY: header-args:matlab :session *MATLAB*
#+PROPERTY: header-args:matlab+ :comments org
#+PROPERTY: header-args:matlab+ :exports both
#+PROPERTY: header-args:matlab+ :results none
#+PROPERTY: header-args:matlab+ :eval no-export
#+PROPERTY: header-args:matlab+ :noweb yes
#+PROPERTY: header-args:matlab+ :mkdirp yes
#+PROPERTY: header-args:matlab+ :output-dir figs
:END:
* Introduction :ignore:
2020-11-10 12:44:25 +01:00
#+begin_note
The following two voltage amplifiers are tested:
- PI E-505.00 ([[file:doc/E-505-Datasheet.pdf][doc]])
- Cedrat Technology LA75B ([[file:doc/LA75B.pdf][doc]])
The piezoelectric actuator under test is an APA95ML from Cedrat technology ([[file:doc/APA95ML.pdf][doc]]).
It contains three stacks with a capacitance of $5 \mu F$ each that can be connected independently to the amplifier.
2020-11-10 12:44:25 +01:00
#+end_note
This document is divided into the following sections:
- Section [[sec:effect_change_capacitance]]: The effect of a change in load capacitance on the amplifier dynamics is studied
- Section [[sec:effect_change_voltage]]: The effect on the voltage level on the amplifier dynamics is studied
- Section [[sec:comp_pi_cedrat]]: The dynamics of the E-505 and LA75B are compared
- Section [[sec:impedance_meas]]: The output impedance of both amplifiers are measured
- Section [[sec:pi_e505_filters]]: The effect of the internal filters of the E-505 on its dynamics is studied
2020-08-13 09:54:00 +02:00
* Effect of a change of capacitance
:PROPERTIES:
:header-args:matlab+: :tangle matlab/effect_change_capacitance.m
:END:
2020-11-10 12:44:25 +01:00
<<sec:effect_change_capacitance>>
2020-08-13 09:54:00 +02:00
** 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 :tangle no
addpath('./matlab/mat/');
#+end_src
#+begin_src matlab :eval no
addpath('./mat/');
#+end_src
2020-08-13 09:54:00 +02:00
** Cedrat Technology
Load Data
#+begin_src matlab
piezo1 = load('cedrat_la75b_med_1_stack.mat', 't', 'V_in', 'V_out');
piezo2 = load('cedrat_la75b_med_2_stack.mat', 't', 'V_in', 'V_out');
piezo3 = load('cedrat_la75b_med_3_stack.mat', 't', 'V_in', 'V_out');
2020-08-13 09:54:00 +02:00
#+end_src
Compute Coherence and Transfer functions
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[tf_1, f] = tfestimate(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_1, ~] = mscohere(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts);
[tf_2, ~] = tfestimate(piezo2.V_in, piezo2.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_2, ~] = mscohere(piezo2.V_in, piezo2.V_out, win, [], [], 1/Ts);
[tf_3, ~] = tfestimate(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_3, ~] = mscohere(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts);
#+end_src
We remove the phase delay due to the time delay of the ADC/DAC:
#+begin_src matlab
angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz')));
#+end_src
2020-08-13 09:54:00 +02:00
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_1), 'DisplayName', '1 stack')
plot(f, abs(tf_2), 'DisplayName', '2 stacks')
plot(f, abs(tf_3), 'DisplayName', '3 stacks')
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ylim([1, 40]);
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_1))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_2))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_3))-angle_delay)
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-270, 90]);
yticks(-360:90:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5000]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/change_capa_cedrat.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:change_capa_cedrat
#+caption: Effect of a change of the piezo capacitance on the Amplifier transfer function
#+RESULTS:
[[file:figs/change_capa_cedrat.png]]
** PI
#+begin_src matlab
piezo1 = load('pi_505_high.mat', 't', 'V_in', 'V_out');
piezo2 = load('pi_505_high_2_stacks.mat', 't', 'V_in', 'V_out');
piezo3 = load('pi_505_high_3_stacks.mat', 't', 'V_in', 'V_out');
2020-08-13 09:54:00 +02:00
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[tf_1, f] = tfestimate(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_1, ~] = mscohere(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts);
[tf_2, ~] = tfestimate(piezo2.V_in, piezo2.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_2, ~] = mscohere(piezo2.V_in, piezo2.V_out, win, [], [], 1/Ts);
[tf_3, ~] = tfestimate(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_3, ~] = mscohere(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts);
#+end_src
We remove the phase delay due to the time delay of the ADC/DAC:
#+begin_src matlab
angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz')));
#+end_src
2020-08-13 09:54:00 +02:00
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_1), 'DisplayName', '1 stack')
plot(f, abs(tf_2), 'DisplayName', '2 stacks')
plot(f, abs(tf_3), 'DisplayName', '3 stacks')
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ylim([0.05, 11]);
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_1))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_2))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_3))-angle_delay)
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-360, 0]);
yticks(-360:90:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5000]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/change_capa_pi.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:change_capa_pi
#+caption: Effect of a change of the piezo capacitance on the Amplifier transfer function
#+RESULTS:
[[file:figs/change_capa_pi.png]]
* Effect of a change in Voltage level
:PROPERTIES:
:header-args:matlab+: :tangle matlab/effect_change_voltage.m
:END:
2020-11-10 12:44:25 +01:00
<<sec:effect_change_voltage>>
2020-08-13 09:54:00 +02:00
** 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 :tangle no
addpath('./matlab/mat/');
#+end_src
#+begin_src matlab :eval no
addpath('./mat/');
#+end_src
2020-08-13 09:54:00 +02:00
** Cedrat Technology
#+begin_src matlab
hi = load('cedrat_la75b_high_1_stack.mat', 't', 'V_in', 'V_out');
me = load('cedrat_la75b_med_1_stack.mat', 't', 'V_in', 'V_out');
lo = load('cedrat_la75b_low_1_stack.mat', 't', 'V_in', 'V_out');
2020-08-13 09:54:00 +02:00
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[tf_hi, f] = tfestimate(hi.V_in, hi.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_hi, ~] = mscohere(hi.V_in, hi.V_out, win, [], [], 1/Ts);
[tf_me, ~] = tfestimate(me.V_in, me.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_me, ~] = mscohere(me.V_in, me.V_out, win, [], [], 1/Ts);
[tf_lo, ~] = tfestimate(lo.V_in, lo.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_lo, ~] = mscohere(lo.V_in, lo.V_out, win, [], [], 1/Ts);
#+end_src
We remove the phase delay due to the time delay of the ADC/DAC:
#+begin_src matlab
angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz')));
#+end_src
2020-08-13 09:54:00 +02:00
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_lo), 'DisplayName', 'low')
plot(f, abs(tf_me), 'DisplayName', 'med')
plot(f, abs(tf_hi), 'DisplayName', 'high')
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ylim([1, 50]);
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_lo))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_me))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_hi))-angle_delay)
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-360, 0]);
yticks(-360:90:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5000]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/change_level_cedrat.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:change_level_cedrat
#+caption: Effect of a change of voltage level on the Amplifier transfer function
#+RESULTS:
[[file:figs/change_level_cedrat.png]]
** PI
#+begin_src matlab
hi = load('pi_505_high.mat', 't', 'V_in', 'V_out');
lo = load('pi_505_low.mat', 't', 'V_in', 'V_out');
2020-08-13 09:54:00 +02:00
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[tf_hi, f] = tfestimate(hi.V_in, hi.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_hi, ~] = mscohere(hi.V_in, hi.V_out, win, [], [], 1/Ts);
[tf_lo, ~] = tfestimate(lo.V_in, lo.V_out, win, [], [], 1/Ts);
2020-08-13 09:54:00 +02:00
[co_lo, ~] = mscohere(lo.V_in, lo.V_out, win, [], [], 1/Ts);
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_hi), 'DisplayName', 'high')
plot(f, abs(tf_lo), 'DisplayName', 'low')
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ylim([0.1, 20]);
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_hi))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_lo))-angle_delay)
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-360, 0]);
yticks(-360:90:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5000]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/change_level_pi.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:change_level_pi
#+caption: Effect of a change of voltage level on the Amplifier transfer function
#+RESULTS:
[[file:figs/change_level_pi.png]]
* Comparison PI / Cedrat
:PROPERTIES:
:header-args:matlab+: :tangle matlab/comp_pi_cedrat.m
:END:
2020-11-10 12:44:25 +01:00
<<sec:comp_pi_cedrat>>
2020-08-13 09:54:00 +02:00
** 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 :tangle no
addpath('./matlab/mat/');
#+end_src
#+begin_src matlab :eval no
addpath('./mat/');
#+end_src
2020-08-13 09:54:00 +02:00
** Results
#+begin_src matlab
ce_results = load('cedrat_la75b_high_1_stack.mat', 't', 'V_in', 'V_out');
pi_results = load('pi_505_high.mat', 't', 'V_in', 'V_out');
2020-08-13 09:54:00 +02:00
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
2020-08-17 08:41:08 +02:00
[tf_ce, f] = tfestimate(ce_results.V_in, ce_results.V_out, win, [], [], 1/Ts);
[tf_pi, ~] = tfestimate(pi_results.V_in, pi_results.V_out, win, [], [], 1/Ts);
#+end_src
We remove the phase delay due to the time delay of the ADC/DAC:
#+begin_src matlab
angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz')));
2020-08-13 09:54:00 +02:00
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
2020-08-17 08:41:08 +02:00
plot(f, abs(tf_pi), 'DisplayName', 'PI')
plot(f, abs(tf_ce), 'DisplayName', 'Cedrat')
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ylim([0.1, 50]);
ax2 = subplot(2, 1, 2);
hold on;
2020-08-17 08:41:08 +02:00
plot(f, 180/pi*unwrap(angle(tf_pi))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_ce))-angle_delay)
2020-08-13 09:54:00 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
2020-08-17 08:41:08 +02:00
ylim([-270, 90]);
2020-08-13 09:54:00 +02:00
yticks(-360:90:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5000]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/tf_amplifiers_comp.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:tf_amplifiers_comp
#+caption: Comparison of the two Amplifier transfer functions
#+RESULTS:
[[file:figs/tf_amplifiers_comp.png]]
2020-08-13 17:11:21 +02:00
* Impedance Measurement
:PROPERTIES:
:header-args:matlab+: :tangle matlab/impedance_meas.m
:END:
2020-11-10 12:44:25 +01:00
<<sec:impedance_meas>>
2020-08-13 17:11:21 +02:00
** Introduction :ignore:
The goal is to experimentally measure the output impedance of the voltage amplifiers.
To do so, the output voltage is first measure without any load ($V$).
It is then measure when a 10Ohm load is used ($V^\prime$).
The load ($R = 10\Omega$) and the internal resistor ($R_i$) form a voltage divider, and thus:
\[ V^\prime = \frac{R}{R + R_i} V \]
From the two values of voltage, the internal resistor value can be computed:
\[ R_i = R \frac{V - V^\prime}{V^\prime} \]
** 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 :tangle no
addpath('./matlab/mat/');
#+end_src
#+begin_src matlab :eval no
addpath('./mat/');
#+end_src
2020-08-13 17:11:21 +02:00
** Cedrat Technology
*** Compute Impedance
2020-08-13 17:11:21 +02:00
#+begin_src matlab
R = 10; % Resistive Load used [Ohm]
2020-08-17 08:41:08 +02:00
V = 0.998; % Output Voltage without any load [V]
Vp = 0.912; % Output Voltage with resistice load [V]
#+end_src
#+begin_src matlab :results replace value
R * (V - Vp)/Vp;
#+end_src
#+RESULTS:
: 0.94298
#+begin_src matlab
R = 47; % Resistive Load used [Ohm]
V = 4.960; % Output Voltage without any load [V]
Vp = 4.874; % Output Voltage with resistice load [V]
2020-08-13 17:11:21 +02:00
#+end_src
#+begin_src matlab :results replace value
R * (V - Vp)/Vp;
#+end_src
#+RESULTS:
2020-08-17 08:41:08 +02:00
: 0.8293
2020-08-13 17:11:21 +02:00
*** Effect of Impedance on the phase drop
2020-08-13 17:11:21 +02:00
#+begin_src matlab
C_1 = 5e-6; % Capacitance in [F]
C_2 = 10e-6; % Capacitance in [F]
C_3 = 15e-6; % Capacitance in [F]
2020-08-13 17:11:21 +02:00
Ri = R * (V - Vp)/Vp; % Internal resistance [Ohm]
G0 = 20;
2020-08-13 17:11:21 +02:00
G_1 = G0/(1+Ri*C_1*s);
G_2 = G0/(1+Ri*C_2*s);
G_3 = G0/(1+Ri*C_3*s);
2020-08-13 17:11:21 +02:00
#+end_src
#+begin_src matlab :exports none
piezo1 = load('cedrat_la75b_med_1_stack.mat', 't', 'V_in', 'V_out');
piezo2 = load('cedrat_la75b_med_2_stack.mat', 't', 'V_in', 'V_out');
piezo3 = load('cedrat_la75b_med_3_stack.mat', 't', 'V_in', 'V_out');
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[tf_1, f] = tfestimate(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts);
[co_1, ~] = mscohere(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts);
[tf_2, ~] = tfestimate(piezo2.V_in, piezo2.V_out, win, [], [], 1/Ts);
[co_2, ~] = mscohere(piezo2.V_in, piezo2.V_out, win, [], [], 1/Ts);
[tf_3, ~] = tfestimate(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts);
[co_3, ~] = mscohere(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts);
angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz')));
#+end_src
2020-08-13 17:11:21 +02:00
#+begin_src matlab :exports none
freqs = logspace(1, 4, 1000);
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_1, freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_2, freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_3, freqs, 'Hz'))));
set(gca,'ColorOrderIndex',1);
plot(f, abs(tf_1), '--')
plot(f, abs(tf_2), '--')
plot(f, abs(tf_3), '--')
2020-08-13 17:11:21 +02:00
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_1, freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_2, freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_3, freqs, 'Hz'))));
set(gca,'ColorOrderIndex',1);
plot(f, 180/pi*unwrap(angle(tf_1))-angle_delay, '--')
plot(f, 180/pi*unwrap(angle(tf_2))-angle_delay, '--')
plot(f, 180/pi*unwrap(angle(tf_3))-angle_delay, '--')
2020-08-13 17:11:21 +02:00
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-90, 45]);
yticks([-90:15:45]);
2020-08-13 17:11:21 +02:00
linkaxes([ax1,ax2],'x');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/change_capa_cedrat.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:change_capa_cedrat
#+caption: Effect of a change of the piezo capacitance on the Amplifier transfer function
#+RESULTS:
[[file:figs/change_capa_cedrat.png]]
2020-08-13 17:11:21 +02:00
** PI
#+begin_src matlab
R = 10; % Resistive Load used [Ohm]
2020-08-17 08:41:08 +02:00
V = 1.059; % Output Voltage without any load [V]
Vp = 0.828; % Output Voltage with resistice load [V]
#+end_src
#+begin_src matlab :results replace value
R * (V - Vp)/Vp
#+end_src
#+RESULTS:
: 2.7899
#+begin_src matlab
R = 10; % Resistive Load used [Ohm]
V = 2.092; % Output Voltage without any load [V]
Vp = 1.637; % Output Voltage with resistice load [V]
2020-08-13 17:11:21 +02:00
#+end_src
#+begin_src matlab :results replace value
R * (V - Vp)/Vp
#+end_src
#+RESULTS:
2020-08-17 08:41:08 +02:00
: 2.7795
2020-08-13 17:11:21 +02:00
2020-11-10 12:44:25 +01:00
* Effect of filters configuration on the PI-E505 dynamics
:PROPERTIES:
:header-args:matlab+: :tangle matlab/pi_e505_filters.m
:END:
2020-11-10 12:44:25 +01:00
<<sec:pi_e505_filters>>
2020-09-03 14:09:03 +02:00
** 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 :tangle no
addpath('./matlab/mat/');
#+end_src
#+begin_src matlab :eval no
addpath('./mat/');
#+end_src
2020-09-03 14:09:03 +02:00
** PI
Three measurements are done:
- Slew Rate limitation at maximum
- Slew Rate limitation at minimum
- Notch Filter at maximum frequency
#+begin_src matlab
pi_sr_min = load('pi_slew_rate_min.mat');
pi_sr_max = load('pi_slew_rate_max.mat');
pi_sr_max_notch = load('pi_slew_rate_max_notch_high.mat');
pi_sr_load = load('pi_slew_rate_max_notch_high_2stacks.mat');
2020-09-03 14:09:03 +02:00
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[tf_sr_min, f] = tfestimate(pi_sr_min.V_in, pi_sr_min.V_out, win, [], [], 1/Ts);
[tf_sr_max, ~] = tfestimate(pi_sr_max.V_in, pi_sr_max.V_out, win, [], [], 1/Ts);
[tf_sr_max_notch, ~] = tfestimate(pi_sr_max_notch.V_in, pi_sr_max_notch.V_out, win, [], [], 1/Ts);
2020-09-04 15:18:01 +02:00
[tf_sr_load, ~] = tfestimate(pi_sr_load.V_in, pi_sr_load.V_out, win, [], [], 1/Ts);
2020-09-03 14:09:03 +02:00
#+end_src
#+begin_src matlab
angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz')));
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_sr_min), 'DisplayName', 'Slew Rate - Min')
plot(f, abs(tf_sr_max), 'DisplayName', 'Slew Rate - Max')
plot(f, abs(tf_sr_max_notch), 'DisplayName', 'Remove Notch')
2020-09-04 15:18:01 +02:00
plot(f, abs(tf_sr_load), 'DisplayName', 'With Load')
2020-09-03 14:09:03 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_sr_min))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_sr_max))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_sr_max_notch))-angle_delay)
2020-09-04 15:18:01 +02:00
plot(f, 180/pi*unwrap(angle(tf_sr_load))-angle_delay)
2020-09-03 14:09:03 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-180, 45]);
yticks(-360:45:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/pi_slew_rate_notch.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:pi_slew_rate_notch
#+caption: Effect of a change in the slew rate limitation and notch filter
#+RESULTS:
[[file:figs/pi_slew_rate_notch.png]]
** Transfer function of the Voltage Amplifier
The identified transfer function still seems to match the one of a notch filter at 5kHz.
#+begin_src matlab
w_nf = 2*pi*5e3; % Notch Filter Frequency [rad/s]
G = 10.5*(s^2 + 2*w_nf*0.12*s + w_nf^2)/(s^2 + 2*w_nf*s + w_nf^2);
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_sr_max_notch), 'DisplayName', 'Remove Notch')
plot(f, abs(squeeze(freqresp(G, f, 'Hz'))), 'DisplayName', 'Remove Notch')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_sr_max_notch))-angle_delay)
plot(f, 180/pi*angle(squeeze(freqresp(G, f, 'Hz'))), 'DisplayName', 'Remove Notch')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-180, 45]);
yticks(-360:45:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5e3]);
#+end_src
2020-09-04 15:18:01 +02:00
** With Load
#+begin_src matlab
R = 2.78; % Output Impedance [Ohm]
C = 9e-6; % Load capacitance [F]
G_amp = 10/(1 + s*R*C);
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_sr_max_notch), 'DisplayName', 'No load')
plot(f, abs(tf_sr_load), 'DisplayName', '$10\mu F$ load')
plot(f, abs(squeeze(freqresp(G_amp, f, 'Hz'))), 'k--', 'DisplayName', 'Model')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); xlabel('Frequency [Hz]');
hold off;
legend('location', 'southwest');
ax2 = subplot(2, 1, 2);
hold on;
plot(f, 180/pi*unwrap(angle(tf_sr_max_notch))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_sr_load))-angle_delay)
plot(f, 180/pi*unwrap(angle(squeeze(freqresp(G_amp, f, 'Hz')))), 'k--')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase'); xlabel('Frequency [Hz]');
hold off;
ylim([-180, 45]);
yticks(-360:45:90)
linkaxes([ax1,ax2], 'x');
xlim([10, 5e3]);
#+end_src