diff --git a/figs/exp_setup_schematic.pdf b/figs/exp_setup_schematic.pdf new file mode 100644 index 0000000..9ae275b Binary files /dev/null and b/figs/exp_setup_schematic.pdf differ diff --git a/figs/force_sen_steps_time_domain.pdf b/figs/force_sen_steps_time_domain.pdf new file mode 100644 index 0000000..3b0f762 Binary files /dev/null and b/figs/force_sen_steps_time_domain.pdf differ diff --git a/figs/force_sen_steps_time_domain.png b/figs/force_sen_steps_time_domain.png new file mode 100644 index 0000000..df5b7fa Binary files /dev/null and b/figs/force_sen_steps_time_domain.png differ diff --git a/figs/force_sensor_linear_relation.pdf b/figs/force_sensor_linear_relation.pdf new file mode 100644 index 0000000..0fee4e8 Binary files /dev/null and b/figs/force_sensor_linear_relation.pdf differ diff --git a/figs/force_sensor_linear_relation.png b/figs/force_sensor_linear_relation.png new file mode 100644 index 0000000..9507787 Binary files /dev/null and b/figs/force_sensor_linear_relation.png differ diff --git a/figs/force_sensor_sin_charge.pdf b/figs/force_sensor_sin_charge.pdf new file mode 100644 index 0000000..ba22435 Binary files /dev/null and b/figs/force_sensor_sin_charge.pdf differ diff --git a/figs/force_sensor_sin_charge.png b/figs/force_sensor_sin_charge.png new file mode 100644 index 0000000..235210d Binary files /dev/null and b/figs/force_sensor_sin_charge.png differ diff --git a/figs/force_sensor_sin_encoder.pdf b/figs/force_sensor_sin_encoder.pdf new file mode 100644 index 0000000..103b99f Binary files /dev/null and b/figs/force_sensor_sin_encoder.pdf differ diff --git a/figs/force_sensor_sin_encoder.png b/figs/force_sensor_sin_encoder.png new file mode 100644 index 0000000..0449527 Binary files /dev/null and b/figs/force_sensor_sin_encoder.png differ diff --git a/figs/force_sensor_sin_stack.pdf b/figs/force_sensor_sin_stack.pdf new file mode 100644 index 0000000..572ea6b Binary files /dev/null and b/figs/force_sensor_sin_stack.pdf differ diff --git a/figs/force_sensor_sin_stack.png b/figs/force_sensor_sin_stack.png new file mode 100644 index 0000000..d69ef6b Binary files /dev/null and b/figs/force_sensor_sin_stack.png differ diff --git a/figs/force_sensor_sin_u.pdf b/figs/force_sensor_sin_u.pdf new file mode 100644 index 0000000..8b12f7b Binary files /dev/null and b/figs/force_sensor_sin_u.pdf differ diff --git a/figs/force_sensor_sin_u.png b/figs/force_sensor_sin_u.png new file mode 100644 index 0000000..d7a7518 Binary files /dev/null and b/figs/force_sensor_sin_u.png differ diff --git a/figs/piezo_sensor_model_instrumentation.png b/figs/piezo_sensor_model_instrumentation.png new file mode 100644 index 0000000..e1572e3 Binary files /dev/null and b/figs/piezo_sensor_model_instrumentation.png differ diff --git a/figs/stiffness_force_sensor_bode.pdf b/figs/stiffness_force_sensor_bode.pdf new file mode 100644 index 0000000..7f14027 Binary files /dev/null and b/figs/stiffness_force_sensor_bode.pdf differ diff --git a/figs/stiffness_force_sensor_bode.png b/figs/stiffness_force_sensor_bode.png new file mode 100644 index 0000000..f063238 Binary files /dev/null and b/figs/stiffness_force_sensor_bode.png differ diff --git a/figs/stiffness_force_sensor_bode_zoom.pdf b/figs/stiffness_force_sensor_bode_zoom.pdf new file mode 100644 index 0000000..2656359 Binary files /dev/null and b/figs/stiffness_force_sensor_bode_zoom.pdf differ diff --git a/figs/stiffness_force_sensor_bode_zoom.png b/figs/stiffness_force_sensor_bode_zoom.png new file mode 100644 index 0000000..dba9aac Binary files /dev/null and b/figs/stiffness_force_sensor_bode_zoom.png differ diff --git a/figs/stiffness_force_sensor_coherence.pdf b/figs/stiffness_force_sensor_coherence.pdf new file mode 100644 index 0000000..50bcc1a Binary files /dev/null and b/figs/stiffness_force_sensor_coherence.pdf differ diff --git a/figs/stiffness_force_sensor_coherence.png b/figs/stiffness_force_sensor_coherence.png new file mode 100644 index 0000000..eeb475d Binary files /dev/null and b/figs/stiffness_force_sensor_coherence.png differ diff --git a/index.html b/index.html index 5cd1b6b..b81e946 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Encoder - Test Bench @@ -31,37 +31,49 @@

Table of Contents

-
-

1 Experimental Setup

+
+

1 Experimental Setup

-The experimental Setup is schematically represented in Figure 1. +The experimental Setup is schematically represented in Figure 1.

@@ -70,21 +82,21 @@ The displacement of the mass (relative to the mechanical frame) is measured both

-
+

exp_setup_schematic.png

Figure 1: Schematic of the Experiment

-
+

IMG_20201023_153905.jpg

Figure 2: Side View of the encoder

-
+

IMG_20201023_153914.jpg

Figure 3: Front View of the encoder

@@ -92,8 +104,8 @@ The displacement of the mass (relative to the mechanical frame) is measured both
-
-

2 Huddle Test

+
+

2 Huddle Test

The goal in this section is the estimate the noise of both the encoder and the intereferometer. @@ -105,8 +117,8 @@ Ideally, a mechanical part would clamp the two together, we here suppose that th

-
-

2.1 Load Data

+
+

2.1 Load Data

load('mat/int_enc_huddle_test.mat', 'interferometer', 'encoder', 't');
@@ -121,11 +133,11 @@ encoder = detrend(encoder, 0);
 
-
-

2.2 Time Domain Results

+
+

2.2 Time Domain Results

-
+

huddle_test_time_domain.png

Figure 4: Huddle test - Time domain signals

@@ -137,7 +149,7 @@ encoder = detrend(encoder, 0);
-
+

huddle_test_time_domain_filtered.png

Figure 5: Huddle test - Time domain signals filtered with a LPF at 10Hz

@@ -145,8 +157,8 @@ encoder = detrend(encoder, 0);
-
-

2.3 Frequency Domain Noise

+
+

2.3 Frequency Domain Noise

Ts = 1e-4;
@@ -158,7 +170,7 @@ win = hann(ceil(10/Ts));
 
-
+

huddle_test_asd.png

Figure 6: Amplitude Spectral Density of the signals during the Huddle test

@@ -167,8 +179,8 @@ win = hann(ceil(10/Ts));
-
-

3 Comparison Interferometer / Encoder

+
+

3 Comparison Interferometer / Encoder

The goal here is to make sure that the interferometer and encoder measurements are coherent. @@ -176,8 +188,8 @@ We may see non-linearity in the interferometric measurement.

-
-

3.1 Load Data

+
+

3.1 Load Data

load('mat/int_enc_comp.mat', 'interferometer', 'encoder', 'u', 't');
@@ -193,18 +205,18 @@ u = detrend(u, 0);
 
-
-

3.2 Time Domain Results

+
+

3.2 Time Domain Results

-
+

int_enc_one_cycle.png

Figure 7: One cycle measurement

-
+

int_enc_one_cycle_error.png

Figure 8: Difference between the Encoder and the interferometer during one cycle

@@ -212,8 +224,8 @@ u = detrend(u, 0);
-
-

3.3 Difference between Encoder and Interferometer as a function of time

+
+

3.3 Difference between Encoder and Interferometer as a function of time

Ts = 1e-4;
@@ -234,7 +246,7 @@ d_err_mean = d_err_mean - mean(d_err_mean);
 
-
+

int_enc_error_mean_time.png

Figure 9: Difference between the two measurement in the time domain, averaged for all the cycles

@@ -242,8 +254,8 @@ d_err_mean = d_err_mean - mean(d_err_mean);
-
-

3.4 Difference between Encoder and Interferometer as a function of position

+
+

3.4 Difference between Encoder and Interferometer as a function of position

Compute the mean of the interferometer measurement corresponding to each of the encoder measurement. @@ -262,7 +274,7 @@ i_mean_error = (i_mean - e_sorted);

-
+

int_enc_error_mean_position.png

Figure 10: Difference between the two measurement as a function of the measured position by the encoder, averaged for all the cycles

@@ -283,7 +295,7 @@ e_sorted_mean_over_period = mean(reshape(i_mean_error(i_init +

int_non_linearity_period_wavelength.png

Figure 11: Non-Linearity of the Interferometer over the period of the wavelength

@@ -292,12 +304,12 @@ e_sorted_mean_over_period = mean(reshape(i_mean_error(i_init -

4 Identification

+
+

4 Identification

-
-

4.1 Load Data

+
+

4.1 Load Data

load('mat/int_enc_id_noise_bis.mat', 'interferometer', 'encoder', 'u', 't');
@@ -313,8 +325,8 @@ u = detrend(u, 0);
 
-
-

4.2 Identification

+
+

4.2 Identification

Ts = 1e-4; % Sampling Time [s]
@@ -332,24 +344,436 @@ win = hann(ceil(10/Ts));
 
-
+

identification_dynamics_coherence.png

-
+

identification_dynamics_bode.png

+ +
+

5 Change of Stiffness due to Sensors stack being open/closed circuit

+
+
+
+

5.1 Load Data

+
+
+
oc = load('./mat/identification_open_circuit.mat', 't', 'encoder', 'u');
+sc = load('./mat/identification_short_circuit.mat', 't', 'encoder', 'u');
+
+
+
+
+ +
+

5.2 Transfer Functions

+
+
+
Ts = 1e-4; % Sampling Time [s]
+win = hann(ceil(10/Ts));
+
+
+ +
+
[tf_oc_est, f] = tfestimate(oc.u, oc.encoder, win, [], [], 1/Ts);
+[co_oc_est, ~] = mscohere(  oc.u, oc.encoder, win, [], [], 1/Ts);
+
+[tf_sc_est, ~] = tfestimate(sc.u, sc.encoder, win, [], [], 1/Ts);
+[co_sc_est, ~] = mscohere(  sc.u, sc.encoder, win, [], [], 1/Ts);
+
+
+ + +
+

stiffness_force_sensor_coherence.png +

+
+ + + +
+

stiffness_force_sensor_bode.png +

+
+ + +
+

stiffness_force_sensor_bode_zoom.png +

+

Figure 16: Zoom on the change of resonance

+
+ +
+

+The change of resonance frequency / stiffness is very small and is not important here. +

+ +
+
+
+
+ +
+

6 Generated Number of Charge / Voltage

+
+

+Two stacks are used as actuator (in parallel) and one stack is used as sensor. +

+ +

+The amplifier gain is 20V/V (Cedrat LA75B). +

+
+ +
+

6.1 Steps

+
+
+
load('./mat/force_sensor_steps.mat', 't', 'encoder', 'u', 'v');
+
+
+ +
+
figure;
+tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None');
+nexttile;
+plot(t, v);
+xlabel('Time [s]'); ylabel('Measured voltage [V]');
+nexttile;
+plot(t, u);
+xlabel('Time [s]'); ylabel('Actuator Voltage [V]');
+
+
+ + +
+

force_sen_steps_time_domain.png +

+

Figure 17: Time domain signal during the 3 actuator voltage steps

+
+ +

+Three steps are performed at the following time intervals: +

+
    +
  • 2.5, 23
  • +
  • 23.8, 35
  • +
  • 35.8, 50
  • +
+ +

+Fit function: +

+
+
f = @(b,x) b(1).*exp(b(2).*x) + b(3);
+
+
+ +

+We are interested by the b(2) term, which is the time constant of the exponential. +

+ +
+
tau = zeros(3,1);
+V0  = zeros(3,1);
+
+
+ +
+
t_cur = t(2.5 < t & t < 23);
+t_cur = t_cur - t_cur(1);
+y_cur = v(2.5 < t & t < 23);
+
+nrmrsd = @(b) norm(y_cur - f(b,t_cur)); % Residual Norm Cost Function
+B0 = [0.5, -0.15, 2.2];                        % Choose Appropriate Initial Estimates
+[B,rnrm] = fminsearch(nrmrsd, B0);     % Estimate Parameters ‘B’
+
+tau(1) = 1/B(2);
+V0(1)  = B(3);
+
+
+ +
+
t_cur = t(23.8 < t & t < 35);
+t_cur = t_cur - t_cur(1);
+y_cur = v(23.8 < t & t < 35);
+
+nrmrsd = @(b) norm(y_cur - f(b,t_cur)); % Residual Norm Cost Function
+B0 = [0.5, -0.15, 2.2];                 % Choose Appropriate Initial Estimates
+[B,rnrm] = fminsearch(nrmrsd, B0);      % Estimate Parameters ‘B’
+
+tau(2) = 1/B(2);
+V0(2)  = B(3);
+
+
+ +
+
t_cur = t(35.8 < t);
+t_cur = t_cur - t_cur(1);
+y_cur = v(35.8 < t);
+
+nrmrsd = @(b) norm(y_cur - f(b,t_cur)); % Residual Norm Cost Function
+B0 = [0.5, -0.15, 2.2];                 % Choose Appropriate Initial Estimates
+[B,rnrm] = fminsearch(nrmrsd, B0);     % Estimate Parameters ‘B’
+
+tau(3) = 1/B(2);
+V0(3)  = B(3);
+
+
+ + + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + +
\(tau\) [s]\(V_0\) [V]
6.472.26
6.762.26
6.492.25
+ +

+With the capacitance being \(C = 4.4 \mu F\), the internal impedance of the Speedgoat ADC can be computed as follows: +

+
+
Cp = 4.4e-6; % [F]
+Rin = abs(mean(tau))/Cp;
+
+
+ +
+1494100.0
+
+ + +

+The input impedance of the Speedgoat’s ADC should then be close to \(1.5\,M\Omega\) (specified at \(1\,M\Omega\)). +

+ +
+

+How can we explain the voltage offset? +

+ +
+ +

+As shown in Figure 18 (taken from (Reza and Andrew 2006)), an input voltage offset is due to the input bias current \(i_n\). +

+ + +
+

piezo_sensor_model_instrumentation.png +

+

Figure 18: Model of a piezoelectric transducer (left) and instrumentation amplifier (right)

+
+ +

+The estimated input bias current is then: +

+
+
in = mean(V0)/Rin;
+
+
+ +
+1.5119e-06
+
+ + +

+An additional resistor in parallel with \(R_{in}\) would have two effects: +

+
    +
  • reduce the input voltage offset +\[ V_{off} = \frac{R_a R_{in}}{R_a + R_{in}} i_n \]
  • +
  • increase the high pass corner frequency \(f_c\) +\[ C_p \frac{R_{in}R_a}{R_{in} + R_a} = \tau_c = \frac{1}{f_c} \] +\[ R_a = \frac{R_i}{f_c C_p R_i - 1} \]
  • +
+ + +

+If we allow the high pass corner frequency to be equals to 3Hz: +

+
+
fc = 3;
+Ra = Rin/(fc*C*Rin - 1);
+
+
+ +
+79804
+
+ + +

+With this parallel resistance value, the voltage offset would be: +

+
+
V_offset = Ra*Rin/(Ra + Rin) * in;
+
+
+ +
+0.11454
+
+ + +

+Which is much more acceptable. +

+
+
+ +
+

6.2 Sinus

+
+
+
load('./mat/force_sensor_sin.mat', 't', 'encoder', 'u', 'v');
+
+u       = u(t>25);
+v       = v(t>25);
+encoder = encoder(t>25) - mean(encoder(t>25));
+t       = t(t>25);
+
+
+ +

+The driving voltage is a sinus at 0.5Hz centered on 3V and with an amplitude of 3V (Figure 19). +

+ + +
+

force_sensor_sin_u.png +

+

Figure 19: Driving Voltage

+
+ +

+The full stroke as measured by the encoder is: +

+
+
max(encoder)-min(encoder)
+
+
+ +
+5.005e-05
+
+ + +

+Its signal is shown in Figure 20. +

+ + +
+

force_sensor_sin_encoder.png +

+

Figure 20: Encoder measurement

+
+ +

+The generated voltage by the stack is shown in Figure +

+ + +
+

force_sensor_sin_stack.png +

+

Figure 21: Voltage measured on the stack used as a sensor

+
+ +

+The capacitance of the stack is +

+
+
Cp = 4.4e-6; % [F]
+
+
+ +

+The corresponding generated charge is then shown in Figure 22. +

+ +
+

force_sensor_sin_charge.png +

+

Figure 22: Generated Charge

+
+ + +

+The relation between the generated voltage and the measured displacement is almost linear as shown in Figure 23. +

+ +
+
b1 = encoder\(v-mean(v));
+
+
+ + +
+

force_sensor_linear_relation.png +

+

Figure 23: Almost linear relation between the relative displacement and the generated voltage

+
+ +

+With a 16bits ADC, the resolution will then be equals to (in [nm]): +

+
+
abs((20/2^16)/(b1/1e9))
+
+
+ +
+3.9838
+
+ + +

Bibliography

+
+
Reza, Moheimani, and Fleming Andrew. 2006. Piezoelectric Transducers for Vibration Control and Damping. London: Springer.
+
+
+
+

Author: Dehaeze Thomas

-

Created: 2020-10-25 dim. 09:06

+

Created: 2020-10-29 jeu. 09:59

diff --git a/index.org b/index.org index 3efded5..647de5c 100644 --- a/index.org +++ b/index.org @@ -404,3 +404,408 @@ The period of the non-linearity seems to be $1.53 \mu m$ which corresponds to th #+caption: #+RESULTS: [[file:figs/identification_dynamics_bode.png]] + +* Change of Stiffness due to Sensors stack being open/closed circuit +** 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 + +** Load Data +#+begin_src matlab + oc = load('./mat/identification_open_circuit.mat', 't', 'encoder', 'u'); + sc = load('./mat/identification_short_circuit.mat', 't', 'encoder', 'u'); +#+end_src + +** Transfer Functions +#+begin_src matlab + Ts = 1e-4; % Sampling Time [s] + win = hann(ceil(10/Ts)); +#+end_src + +#+begin_src matlab + [tf_oc_est, f] = tfestimate(oc.u, oc.encoder, win, [], [], 1/Ts); + [co_oc_est, ~] = mscohere( oc.u, oc.encoder, win, [], [], 1/Ts); + + [tf_sc_est, ~] = tfestimate(sc.u, sc.encoder, win, [], [], 1/Ts); + [co_sc_est, ~] = mscohere( sc.u, sc.encoder, win, [], [], 1/Ts); +#+end_src + +#+begin_src matlab :exports none + figure; + hold on; + plot(f, co_oc_est, '-') + plot(f, co_sc_est, '-') + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); + ylabel('Coherence'); xlabel('Frequency [Hz]'); + hold off; + xlim([0.5, 5e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/stiffness_force_sensor_coherence.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:stiffness_force_sensor_coherence +#+caption: +#+RESULTS: +[[file:figs/stiffness_force_sensor_coherence.png]] + + +#+begin_src matlab :exports none + figure; + tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None'); + + ax1 = nexttile; + hold on; + plot(f, abs(tf_oc_est), '-', 'DisplayName', 'Open-Circuit') + plot(f, abs(tf_sc_est), '-', 'DisplayName', 'Short-Circuit') + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log'); + ylabel('Amplitude'); set(gca, 'XTickLabel',[]); + hold off; + ylim([1e-7, 3e-4]); + legend('location', 'southwest'); + + ax2 = nexttile; + hold on; + plot(f, 180/pi*angle(tf_oc_est), '-') + plot(f, 180/pi*angle(tf_sc_est), '-') + set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); + ylabel('Phase'); xlabel('Frequency [Hz]'); + hold off; + yticks(-360:90:360); + axis padded 'auto x' + + linkaxes([ax1,ax2], 'x'); + xlim([0.5, 5e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/stiffness_force_sensor_bode.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:stiffness_force_sensor_bode +#+caption: +#+RESULTS: +[[file:figs/stiffness_force_sensor_bode.png]] + +#+begin_src matlab :tangle no :exports results :results file replace + xlim([180, 280]); + exportFig('figs/stiffness_force_sensor_bode_zoom.pdf', 'width', 'small', 'height', 'tall'); +#+end_src + +#+name: fig:stiffness_force_sensor_bode_zoom +#+caption: Zoom on the change of resonance +#+RESULTS: +[[file:figs/stiffness_force_sensor_bode_zoom.png]] + +#+begin_important + The change of resonance frequency / stiffness is very small and is not important here. +#+end_important + +* Generated Number of Charge / Voltage +** Introduction :ignore: +Two stacks are used as actuator (in parallel) and one stack is used as sensor. + +The amplifier gain is 20V/V (Cedrat LA75B). + +** 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 + +** Steps +#+begin_src matlab + load('./mat/force_sensor_steps.mat', 't', 'encoder', 'u', 'v'); +#+end_src + +#+begin_src matlab + figure; + tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None'); + nexttile; + plot(t, v); + xlabel('Time [s]'); ylabel('Measured voltage [V]'); + nexttile; + plot(t, u); + xlabel('Time [s]'); ylabel('Actuator Voltage [V]'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/force_sen_steps_time_domain.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:force_sen_steps_time_domain +#+caption: Time domain signal during the 3 actuator voltage steps +#+RESULTS: +[[file:figs/force_sen_steps_time_domain.png]] + +Three steps are performed at the following time intervals: +- 2.5, 23 +- 23.8, 35 +- 35.8, 50 + +Fit function: +#+begin_src matlab + f = @(b,x) b(1).*exp(b(2).*x) + b(3); +#+end_src + +We are interested by the =b(2)= term, which is the time constant of the exponential. + +#+begin_src matlab + tau = zeros(3,1); + V0 = zeros(3,1); +#+end_src + +#+begin_src matlab + t_cur = t(2.5 < t & t < 23); + t_cur = t_cur - t_cur(1); + y_cur = v(2.5 < t & t < 23); + + nrmrsd = @(b) norm(y_cur - f(b,t_cur)); % Residual Norm Cost Function + B0 = [0.5, -0.15, 2.2]; % Choose Appropriate Initial Estimates + [B,rnrm] = fminsearch(nrmrsd, B0); % Estimate Parameters ‘B’ + + tau(1) = 1/B(2); + V0(1) = B(3); +#+end_src + +#+begin_src matlab + t_cur = t(23.8 < t & t < 35); + t_cur = t_cur - t_cur(1); + y_cur = v(23.8 < t & t < 35); + + nrmrsd = @(b) norm(y_cur - f(b,t_cur)); % Residual Norm Cost Function + B0 = [0.5, -0.15, 2.2]; % Choose Appropriate Initial Estimates + [B,rnrm] = fminsearch(nrmrsd, B0); % Estimate Parameters ‘B’ + + tau(2) = 1/B(2); + V0(2) = B(3); +#+end_src + +#+begin_src matlab + t_cur = t(35.8 < t); + t_cur = t_cur - t_cur(1); + y_cur = v(35.8 < t); + + nrmrsd = @(b) norm(y_cur - f(b,t_cur)); % Residual Norm Cost Function + B0 = [0.5, -0.15, 2.2]; % Choose Appropriate Initial Estimates + [B,rnrm] = fminsearch(nrmrsd, B0); % Estimate Parameters ‘B’ + + tau(3) = 1/B(2); + V0(3) = B(3); +#+end_src + +#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*) + data2orgtable([abs(tau), V0], {}, {'$tau$ [s]', '$V_0$ [V]'}, ' %.2f '); +#+end_src + +#+RESULTS: +| $tau$ [s] | $V_0$ [V] | +|-----------+-----------| +| 6.47 | 2.26 | +| 6.76 | 2.26 | +| 6.49 | 2.25 | + +With the capacitance being $C = 4.4 \mu F$, the internal impedance of the Speedgoat ADC can be computed as follows: +#+begin_src matlab + Cp = 4.4e-6; % [F] + Rin = abs(mean(tau))/Cp; +#+end_src + +#+begin_src matlab :results value replace :exports results + ans = Rin +#+end_src + +#+RESULTS: +: 1494100.0 + +The input impedance of the Speedgoat's ADC should then be close to $1.5\,M\Omega$ (specified at $1\,M\Omega$). + +#+begin_important + How can we explain the voltage offset? +#+end_important + +As shown in Figure [[fig:piezo_sensor_model_instrumentation]] (taken from cite:reza06_piezoel_trans_vibrat_contr_dampin), an input voltage offset is due to the input bias current $i_n$. + +#+name: fig:piezo_sensor_model_instrumentation +#+caption: Model of a piezoelectric transducer (left) and instrumentation amplifier (right) +[[file:figs/piezo_sensor_model_instrumentation.png]] + +The estimated input bias current is then: +#+begin_src matlab + in = mean(V0)/Rin; +#+end_src + +#+begin_src matlab :results value replace :exports results + ans = in +#+end_src + +#+RESULTS: +: 1.5119e-06 + +An additional resistor in parallel with $R_{in}$ would have two effects: +- reduce the input voltage offset + \[ V_{off} = \frac{R_a R_{in}}{R_a + R_{in}} i_n \] +- increase the high pass corner frequency $f_c$ + \[ C_p \frac{R_{in}R_a}{R_{in} + R_a} = \tau_c = \frac{1}{f_c} \] + \[ R_a = \frac{R_i}{f_c C_p R_i - 1} \] + + +If we allow the high pass corner frequency to be equals to 3Hz: +#+begin_src matlab + fc = 3; + Ra = Rin/(fc*C*Rin - 1); +#+end_src + +#+begin_src matlab :results value replace :exports results + ans = Ra +#+end_src + +#+RESULTS: +: 79804 + +With this parallel resistance value, the voltage offset would be: +#+begin_src matlab + V_offset = Ra*Rin/(Ra + Rin) * in; +#+end_src + +#+begin_src matlab :results value replace :exports results + ans = V_offset +#+end_src + +#+RESULTS: +: 0.11454 + +Which is much more acceptable. + +** Sinus +#+begin_src matlab + load('./mat/force_sensor_sin.mat', 't', 'encoder', 'u', 'v'); + + u = u(t>25); + v = v(t>25); + encoder = encoder(t>25) - mean(encoder(t>25)); + t = t(t>25); +#+end_src + +The driving voltage is a sinus at 0.5Hz centered on 3V and with an amplitude of 3V (Figure [[fig:force_sensor_sin_u]]). + +#+begin_src matlab :exports none + figure; + plot(t, u) + xlabel('Time [s]'); ylabel('Control Voltage [V]'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/force_sensor_sin_u.pdf', 'width', 'normal', 'height', 'small'); +#+end_src + +#+name: fig:force_sensor_sin_u +#+caption: Driving Voltage +#+RESULTS: +[[file:figs/force_sensor_sin_u.png]] + +The full stroke as measured by the encoder is: +#+begin_src matlab :results value replace + max(encoder)-min(encoder) +#+end_src + +#+RESULTS: +: 5.005e-05 + +Its signal is shown in Figure [[fig:force_sensor_sin_encoder]]. + +#+begin_src matlab :exports none + figure; + plot(t, encoder) + xlabel('Time [s]'); ylabel('Encoder [m]'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/force_sensor_sin_encoder.pdf', 'width', 'normal', 'height', 'small'); +#+end_src + +#+name: fig:force_sensor_sin_encoder +#+caption: Encoder measurement +#+RESULTS: +[[file:figs/force_sensor_sin_encoder.png]] + +The generated voltage by the stack is shown in Figure + +#+begin_src matlab :exports none + figure; + plot(t, v) + xlabel('Time [s]'); ylabel('Force Sensor Output [V]'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/force_sensor_sin_stack.pdf', 'width', 'normal', 'height', 'small'); +#+end_src + +#+name: fig:force_sensor_sin_stack +#+caption: Voltage measured on the stack used as a sensor +#+RESULTS: +[[file:figs/force_sensor_sin_stack.png]] + +The capacitance of the stack is +#+begin_src matlab + Cp = 4.4e-6; % [F] +#+end_src + +The corresponding generated charge is then shown in Figure [[fig:force_sensor_sin_charge]]. +#+begin_src matlab :exports none + figure; + plot(t, 1e6*Cp*(v-mean(v))) + xlabel('Time [s]'); ylabel('Generated Charge [$\mu C$]'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/force_sensor_sin_charge.pdf', 'width', 'normal', 'height', 'small'); +#+end_src + +#+name: fig:force_sensor_sin_charge +#+caption: Generated Charge +#+RESULTS: +[[file:figs/force_sensor_sin_charge.png]] + + +The relation between the generated voltage and the measured displacement is almost linear as shown in Figure [[fig:force_sensor_linear_relation]]. + +#+begin_src matlab + b1 = encoder\(v-mean(v)); +#+end_src + +#+begin_src matlab :exports none + figure; + hold on; + plot(encoder, v-mean(v), 'DisplayName', 'Measured Voltage'); + plot(encoder, encoder*b1, 'DisplayName', sprintf('Linear Fit: $U_s \\approx %.3f [V/\\mu m] \\cdot d$', 1e-6*abs(b1))); + hold off; + xlabel('Measured Displacement [m]'); ylabel('Generated Voltage [V]'); + legend(); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace + exportFig('figs/force_sensor_linear_relation.pdf', 'width', 'normal', 'height', 'small'); +#+end_src + +#+name: fig:force_sensor_linear_relation +#+caption: Almost linear relation between the relative displacement and the generated voltage +#+RESULTS: +[[file:figs/force_sensor_linear_relation.png]] + +With a 16bits ADC, the resolution will then be equals to (in [nm]): +#+begin_src matlab :results value replace + abs((20/2^16)/(b1/1e9)) +#+end_src + +#+RESULTS: +: 3.9838