#+TITLE: Measurement of Piezoelectric Amplifiers
:DRAWER:
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/tikz/org/}{config.tex}")
#+PROPERTY: header-args:latex+ :imagemagick t :fit yes
#+PROPERTY: header-args:latex+ :iminoptions -scale 100% -density 150
#+PROPERTY: header-args:latex+ :imoutoptions -quality 100
#+PROPERTY: header-args:latex+ :results raw replace :buffer no
#+PROPERTY: header-args:latex+ :eval no-export
#+PROPERTY: header-args:latex+ :exports both
#+PROPERTY: header-args:latex+ :mkdirp yes
#+PROPERTY: header-args:latex+ :output-dir figs
#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png")
#+PROPERTY: header-args:matlab :session *MATLAB*
#+PROPERTY: header-args:matlab+ :tangle filters.m
#+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:
Two voltage amplifiers are tested:
- PI E-505.00 ([[https://www.pi-usa.us/en/products/controllers-drivers-motion-control-software/piezo-drivers-controllers-power-supplies-high-voltage-amplifiers/e-505-piezo-amplifier-module-602300/][link]])
- Cedrat Technology LA75B ([[https://www.cedrat-technologies.com/en/products/piezo-controllers/electronic-amplifier-boards.html][link]])
The piezoelectric actuator under test is an APA95ML from Cedrat technology.
It contains three stacks with a capacitance of $5 \mu F$ each that can be connected independently to the amplifier.
* Effect of a change of capacitance
** 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
** Cedrat Technology
Load Data
#+begin_src matlab
piezo1 = load('mat/cedrat_la75b_med_1_stack.mat', 't', 'V_in', 'V_out');
piezo2 = load('mat/cedrat_la75b_med_2_stack.mat', 't', 'V_in', 'V_out');
piezo3 = load('mat/cedrat_la75b_med_3_stack.mat', 't', 'V_in', 'V_out');
#+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);
[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);
#+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
#+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')
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)
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('mat/pi_505_high.mat', 't', 'V_in', 'V_out');
piezo2 = load('mat/pi_505_high_2_stacks.mat', 't', 'V_in', 'V_out');
piezo3 = load('mat/pi_505_high_3_stacks.mat', 't', 'V_in', 'V_out');
#+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);
[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);
#+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
#+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')
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)
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
** 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
** Cedrat Technology
#+begin_src matlab
hi = load('mat/cedrat_la75b_high_1_stack.mat', 't', 'V_in', 'V_out');
me = load('mat/cedrat_la75b_med_1_stack.mat', 't', 'V_in', 'V_out');
lo = load('mat/cedrat_la75b_low_1_stack.mat', 't', 'V_in', 'V_out');
#+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);
[co_hi, ~] = mscohere(hi.V_in, hi.V_out, win, [], [], 1/Ts);
[tf_me, ~] = tfestimate(me.V_in, me.V_out, win, [], [], 1/Ts);
[co_me, ~] = mscohere(me.V_in, me.V_out, win, [], [], 1/Ts);
[tf_lo, ~] = tfestimate(lo.V_in, lo.V_out, win, [], [], 1/Ts);
[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
#+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')
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)
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('mat/pi_505_high.mat', 't', 'V_in', 'V_out');
lo = load('mat/pi_505_low.mat', 't', 'V_in', 'V_out');
#+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);
[co_hi, ~] = mscohere(hi.V_in, hi.V_out, win, [], [], 1/Ts);
[tf_lo, ~] = tfestimate(lo.V_in, lo.V_out, win, [], [], 1/Ts);
[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')
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)
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
** 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
** Results
#+begin_src matlab
ce_results = load('mat/cedrat_la75b_high_1_stack.mat', 't', 'V_in', 'V_out');
pi_results = load('mat/pi_505_high.mat', 't', 'V_in', 'V_out');
#+end_src
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(0.1/Ts));
[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')));
#+end_src
#+begin_src matlab :exports none
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(f, abs(tf_pi), 'DisplayName', 'PI')
plot(f, abs(tf_ce), 'DisplayName', 'Cedrat')
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;
plot(f, 180/pi*unwrap(angle(tf_pi))-angle_delay)
plot(f, 180/pi*unwrap(angle(tf_ce))-angle_delay)
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/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]]
* Impedance Measurement
** 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)
<>
#+end_src
#+begin_src matlab :exports none :results silent :noweb yes
<>
#+end_src
** Cedrat Technology
*** Compute Impedance
#+begin_src matlab
R = 10; % Resistive Load used [Ohm]
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]
#+end_src
#+begin_src matlab :results replace value
R * (V - Vp)/Vp;
#+end_src
#+RESULTS:
: 0.8293
*** Effect of Impedance on the phase drop
#+begin_src matlab
C_1 = 5e-6; % Capacitance in [F]
C_2 = 10e-6; % Capacitance in [F]
C_3 = 15e-6; % Capacitance in [F]
Ri = R * (V - Vp)/Vp; % Internal resistance [Ohm]
G0 = 20;
G_1 = G0/(1+Ri*C_1*s);
G_2 = G0/(1+Ri*C_2*s);
G_3 = G0/(1+Ri*C_3*s);
#+end_src
#+begin_src matlab :exports none
piezo1 = load('mat/cedrat_la75b_med_1_stack.mat', 't', 'V_in', 'V_out');
piezo2 = load('mat/cedrat_la75b_med_2_stack.mat', 't', 'V_in', 'V_out');
piezo3 = load('mat/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
#+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), '--')
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, '--')
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-90, 45]);
yticks([-90:15:45]);
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]]
** PI
#+begin_src matlab
R = 10; % Resistive Load used [Ohm]
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]
#+end_src
#+begin_src matlab :results replace value
R * (V - Vp)/Vp
#+end_src
#+RESULTS:
: 2.7795
* New PI amplifier measurements
** 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
** 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('mat/pi_slew_rate_min.mat');
pi_sr_max = load('mat/pi_slew_rate_max.mat');
pi_sr_max_notch = load('mat/pi_slew_rate_max_notch_high.mat');
pi_sr_load = load('mat/pi_slew_rate_max_notch_high_2stacks.mat');
#+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);
[tf_sr_load, ~] = tfestimate(pi_sr_load.V_in, pi_sr_load.V_out, win, [], [], 1/Ts);
#+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')
plot(f, abs(tf_sr_load), 'DisplayName', 'With Load')
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)
plot(f, 180/pi*unwrap(angle(tf_sr_load))-angle_delay)
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
** 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