diff --git a/analysis_capacitance_cedrat.m b/analysis_capacitance_cedrat.m deleted file mode 100644 index f3c0b59..0000000 --- a/analysis_capacitance_cedrat.m +++ /dev/null @@ -1,45 +0,0 @@ -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'); - -%% -run setup; - -win = hann(ceil(0.1/Ts)); - -[tf_1, f_1] = tfestimate(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts); -[co_1, ~] = mscohere(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts); - - -[tf_2, f_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, f_3] = tfestimate(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts); -[co_3, ~] = mscohere(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts); - -%% -figure; -ax1 = subplot(2, 1, 1); -hold on; -plot(f_1, abs(tf_1), 'DisplayName', '1 stack') -plot(f_2, abs(tf_2), 'DisplayName', '2 stacks') -plot(f_3, 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.1, 20]); - -ax2 = subplot(2, 1, 2); -hold on; -plot(f_1, 180/pi*unwrap(angle(tf_1))) -plot(f_2, 180/pi*unwrap(angle(tf_2))) -plot(f_3, 180/pi*unwrap(angle(tf_3))) -set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); -ylabel('Phase'); xlabel('Frequency [Hz]'); -hold off; -ylim([-360, 0]); - -linkaxes([ax1,ax2], 'x'); -xlim([10, 5000]); \ No newline at end of file diff --git a/analysis_capacitance_pi.m b/analysis_capacitance_pi.m deleted file mode 100644 index ce09e63..0000000 --- a/analysis_capacitance_pi.m +++ /dev/null @@ -1,44 +0,0 @@ -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'); - -%% -run setup; - -win = hann(ceil(0.1/Ts)); - -[tf_1, f_1] = tfestimate(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts); -[co_1, ~] = mscohere(piezo1.V_in, piezo1.V_out, win, [], [], 1/Ts); - - -[tf_2, f_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, f_3] = tfestimate(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts); -[co_3, ~] = mscohere(piezo3.V_in, piezo3.V_out, win, [], [], 1/Ts); - -%% -figure; -ax1 = subplot(2, 1, 1); -hold on; -plot(f_1, abs(tf_1), 'DisplayName', '1 stack') -plot(f_2, abs(tf_2), 'DisplayName', '2 stacks') -plot(f_3, 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.1, 50]); - -ax2 = subplot(2, 1, 2); -hold on; -plot(f_1, 180/pi*unwrap(angle(tf_1))) -plot(f_2, 180/pi*unwrap(angle(tf_2))) -plot(f_3, 180/pi*unwrap(angle(tf_3))) -set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); -ylabel('Phase'); xlabel('Frequency [Hz]'); -hold off; - -linkaxes([ax1,ax2], 'x'); -xlim([10, 5000]); \ No newline at end of file diff --git a/analysis_level_cedrat.m b/analysis_level_cedrat.m deleted file mode 100644 index 30fc47c..0000000 --- a/analysis_level_cedrat.m +++ /dev/null @@ -1,43 +0,0 @@ -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'); - -%% -run setup; - -win = hann(ceil(0.1/Ts)); - -[tf_hi, f_hi] = tfestimate(hi.V_in, hi.V_out, win, [], [], 1/Ts); -[co_hi, ~] = mscohere(hi.V_in, hi.V_out, win, [], [], 1/Ts); - -[tf_me, f_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, f_lo] = tfestimate(lo.V_in, lo.V_out, win, [], [], 1/Ts); -[co_lo, ~] = mscohere(lo.V_in, lo.V_out, win, [], [], 1/Ts); - -%% -figure; -ax1 = subplot(2, 1, 1); -hold on; -plot(f_lo, abs(tf_lo), 'DisplayName', 'low') -plot(f_me, abs(tf_me), 'DisplayName', 'med') -plot(f_hi, abs(tf_hi), 'DisplayName', 'high') -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_lo, 180/pi*unwrap(angle(tf_lo))) -plot(f_me, 180/pi*unwrap(angle(tf_me))) -plot(f_hi, 180/pi*unwrap(angle(tf_hi))) -set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); -ylabel('Phase'); xlabel('Frequency [Hz]'); -hold off; -ylim([-360, 0]); - -linkaxes([ax1,ax2], 'x'); -xlim([10, 5000]); \ No newline at end of file diff --git a/analysis_level_pi.m b/analysis_level_pi.m deleted file mode 100644 index 2706a12..0000000 --- a/analysis_level_pi.m +++ /dev/null @@ -1,37 +0,0 @@ -hi = load('mat/pi_505_high.mat', 't', 'V_in', 'V_out'); -lo = load('mat/pi_505_low.mat', 't', 'V_in', 'V_out'); - -%% -run setup; - -win = hann(ceil(0.1/Ts)); - -[tf_hi, f_hi] = tfestimate(hi.V_in, hi.V_out, win, [], [], 1/Ts); -[co_hi, ~] = mscohere(hi.V_in, hi.V_out, win, [], [], 1/Ts); - -[tf_lo, f_lo] = tfestimate(lo.V_in, lo.V_out, win, [], [], 1/Ts); -[co_lo, ~] = mscohere(lo.V_in, lo.V_out, win, [], [], 1/Ts); - -%% -figure; -ax1 = subplot(2, 1, 1); -hold on; -plot(f_hi, abs(tf_hi), 'DisplayName', 'high') -plot(f_lo, 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_hi, 180/pi*unwrap(angle(tf_hi))) -plot(f_lo, 180/pi*unwrap(angle(tf_lo))) -set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); -ylabel('Phase'); xlabel('Frequency [Hz]'); -hold off; -ylim([-360, 0]); - -linkaxes([ax1,ax2], 'x'); -xlim([10, 5000]); \ No newline at end of file diff --git a/comp_pi_cedrat.m b/comp_pi_cedrat.m deleted file mode 100644 index 8b1ff46..0000000 --- a/comp_pi_cedrat.m +++ /dev/null @@ -1,34 +0,0 @@ -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'); - -%% -run setup; - -win = hann(ceil(0.1/Ts)); - -[tf_ce, f_ce] = tfestimate(ce_results.V_in, ce_results.V_out, win, [], [], 1/Ts); -[tf_pi, f_pi] = tfestimate(pi_results.V_in, pi_results.V_out, win, [], [], 1/Ts); - -%% -figure; -ax1 = subplot(2, 1, 1); -hold on; -plot(f_pi, abs(tf_pi), 'DisplayName', 'PI') -plot(f_ce, 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_pi, 180/pi*unwrap(angle(tf_pi))) -plot(f_ce, 180/pi*unwrap(angle(tf_ce))) -set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); -ylabel('Phase'); xlabel('Frequency [Hz]'); -hold off; -ylim([-360, 0]); - -linkaxes([ax1,ax2], 'x'); -xlim([10, 5000]); \ No newline at end of file diff --git a/css/custom.css b/css/custom.css new file mode 100644 index 0000000..ff286c2 --- /dev/null +++ b/css/custom.css @@ -0,0 +1,49 @@ +.figure p{ + text-align: center; +} + +.figure img{ + max-width:100%; + display: block; + margin: auto; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.org-src-container > pre.src:before { + display: inline; + position: absolute; + color: #808080; + background-color: white; + top: -10px; + left: 10px; + padding: 0px 4px; + border: 1px solid #d0d0d0; + font-size: 80%; +} +.org-src-container > pre { + margin-top: 1.5em; + position: relative; + overflow: visible; +} +.org-src-container > pre > code.src:before { + display: inline; + position: absolute; + color: #808080; + background-color: white; + top: -10px; + left: 10px; + padding: 0px 4px; + border: 1px solid #d0d0d0; + font-size: 80%; +} +.org-src-container > pre.src-emacs-lisp:before { content: 'Emacs Lisp'; } +.org-src-container > pre.src-elisp:before { content: 'Emacs Lisp'; } +.org-src-container > pre.src-sh:before { content: 'shell'; } +.org-src-container > pre.src-bash:before { content: 'bash'; } +.org-src-container > pre.src-org:before { content: 'Org mode'; } +.org-src-container > pre.src-python:before { content: 'Python'; } +.org-src-container > pre.src-matlab:before { content: 'Matlab'; } diff --git a/css/readtheorg.css b/css/readtheorg.css index 1690bd0..423a707 100644 --- a/css/readtheorg.css +++ b/css/readtheorg.css @@ -513,7 +513,7 @@ legend{ padding:0; white-space:normal} -.fa:before,#content .admonition-title:before,#content h1 .headerlink:before,#content h2 .headerlink:before,#content h3 .headerlink:before,#content h4 .headerlink:before,#content h5 .headerlink:before,#content h6 .headerlink:before,#content dl dt .headerlink:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,#content .note,#content .attention,#content .caution,#content .danger,#content .error,#content .hint,#content .important,#content .tip,#content .warning,#content .seealso,#content .admonitiontodo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,#table-of-contents li.on a,#table-of-contents li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{ +.fa:before,#content .admonition-title:before,#content h1 .headerlink:before,#content h2 .headerlink:before,#content h3 .headerlink:before,#content h4 .headerlink:before,#content h5 .headerlink:before,#content h6 .headerlink:before,#content dl dt .headerlink:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,#content .note,#content .attention,#content .caution,#content .danger,#content .error,#content .summary,#content .hint,#content .important,#content .tip,#content .warning,#content .question,#content .seealso,#content .admonitiontodo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,#table-of-contents li.on a,#table-of-contents li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{ -webkit-font-smoothing:antialiased} /*! @@ -576,7 +576,7 @@ a .fa,a #content .admonition-title,#content a .admonition-title{ .nav #content .admonition-title,#content .nav .admonition-title,.nav .icon{ display:inline} -.wy-alert,#content .note,#content .attention,#content .caution,#content .danger,#content .error,#content .hint,#content .important,#content .tip,#content .warning,#content .seealso,#content .admonitiontodo{ +.wy-alert,#content .note,#content .attention,#content .caution,#content .danger,#content .error,#content .summary,#content .hint,#content .important,#content .tip,#content .warning,#content .question,#content .seealso,#content .admonitiontodo{ padding:12px; line-height:24px; margin-bottom:24px; @@ -596,32 +596,45 @@ a .fa,a #content .admonition-title,#content a .admonition-title{ #content .danger,#content .error{ background:#fdf3f2} -.wy-alert.wy-alert-warning,#content .wy-alert-warning.note,#content .attention,#content .caution,#content .wy-alert-warning.danger,#content .wy-alert-warning.error,#content .wy-alert-warning.hint,#content .wy-alert-warning.important,#content .wy-alert-warning.tip,#content .warning,#content .wy-alert-warning.seealso,#content .admonitiontodo{ +.wy-alert.wy-alert-warning,#content .wy-alert-warning.note,#content .attention,#content .caution,#content .wy-alert-warning.danger,#content .wy-alert-warning.error,#content .wy-alert-warning.summary,#content .wy-alert-warning.hint,#content .wy-alert-warning.important,#content .wy-alert-warning.tip,#content .warning,#content .wy-alert-warning.seealso,#content .admonitiontodo{ background:#ffedcc} -#content .admonition-title.note:before, #content .admonition-title.seealso:before, -#content .admonition-title.warning:before, #content .admonition-title.caution:before, +#content .admonition-title.warning:before, +#content .admonition-title.caution:before, #content .admonition-title.attention:before, -#content .admonition-title.tip:before, #content .admonition-title.hint:before, #content .admonition-title.important:before, -#content .admonition-title.error:before, #content .admonition-title.danger:before{ +#content .admonition-title.error:before, +#content .admonition-title.danger:before{ font-family:FontAwesome; content: "";} -#content .note,#content .seealso{ +#content .admonition-title.question:before{ + font-family:FontAwesome; + content: "";} + +#content .admonition-title.note:before, +#content .admonition-title.seealso:before, +#content .admonition-title.tip:before, +#content .admonition-title.summary:before, +#content .admonition-title.hint:before{ + font-family:FontAwesome; + content: "";} + + +#content .note,#content .question,#content .seealso{ background:#e7f2fa} -.wy-alert p:last-child,#content .note p:last-child,#content .attention p:last-child,#content .caution p:last-child,#content .danger p:last-child,#content .error p:last-child,#content .hint p:last-child,#content .important p:last-child,#content .tip p:last-child,#content .warning p:last-child,#content .seealso p:last-child,#content .admonitiontodo p:last-child{ +.wy-alert p:last-child,#content .note p:last-child,#content .attention p:last-child,#content .caution p:last-child,#content .danger p:last-child,#content .error p:last-child,#content .summary p:last-child,#content .hint p:last-child,#content .important p:last-child,#content .tip p:last-child,#content .warning p:last-child,#content .question p:last-child,#content .seealso p:last-child,#content .admonitiontodo p:last-child{ margin-bottom:0} -#content .admonition-title.tip,#content .admonition-title.important,#content .admonition-title.hint{ +#content .admonition-title.tip,#content .admonition-title.important,#content .admonition-title.summary,#content .admonition-title.hint{ line-height: 1; background:#1abc9c} -#content .important,#content .tip,#content .hint{ +#content .important,#content .tip,#content .summary,#content .hint{ background:#dbfaf4} -#content .admonition-title.note,#content .admonition-title.seealso{ +#content .admonition-title.note,#content .admonition-title.question,#content .admonition-title.seealso{ line-height: 1; background:#6ab0de} @@ -938,7 +951,7 @@ footer p{ font-style:italic; } -#content .note .last,#content .attention .last,#content .caution .last,#content .danger .last,#content .error .last,#content .hint .last,#content .important .last,#content .tip .last,#content .warning .last,#content .seealso .last,#content .admonitiontodo .last{ +#content .note .last,#content .attention .last,#content .caution .last,#content .danger .last,#content .error .last,#content .hint .summary,#content .hint .last,#content .important .last,#content .tip .last,#content .warning .last,#content .question .last,#content .seealso .last,#content .admonitiontodo .last{ margin-bottom:0} #content .admonition-title:before{ diff --git a/data/apa95ml.dat b/data/apa95ml.dat deleted file mode 100644 index 154a72c..0000000 Binary files a/data/apa95ml.dat and /dev/null differ diff --git a/doc/APA95ML.pdf b/doc/APA95ML.pdf new file mode 100644 index 0000000..d567f32 Binary files /dev/null and b/doc/APA95ML.pdf differ diff --git a/doc/E-505-Datasheet.pdf b/doc/E-505-Datasheet.pdf new file mode 100644 index 0000000..84f7aa1 Binary files /dev/null and b/doc/E-505-Datasheet.pdf differ diff --git a/doc/LA75B.pdf b/doc/LA75B.pdf new file mode 100644 index 0000000..0055f41 Binary files /dev/null and b/doc/LA75B.pdf differ diff --git a/index.html b/index.html index 1b1059c..c3608ef 100644 --- a/index.html +++ b/index.html @@ -3,17 +3,16 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Measurement of Piezoelectric Amplifiers - + - #+HTML_HEAD: -#+HTML_HEAD: #+HTML_HEAD: #+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/tikz/org/}{config.tex}") @@ -24,7 +23,6 @@ #+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 @@ -37,13 +35,16 @@ * 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]]) +- 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. +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. * Effect of a change of capacitance +:PROPERTIES: +:header-args:matlab+: :tangle src/effect_change_capacitance.m +:END: ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> @@ -53,12 +54,20 @@ It contains three stacks with a capacitance of $5 \mu F$ each that can be connec <> #+end_src +#+begin_src matlab :tangle no + addpath('./matlab/mat/'); +#+end_src + +#+begin_src matlab :eval no + addpath('./mat/'); +#+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'); + 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'); #+end_src Compute Coherence and Transfer functions @@ -120,9 +129,9 @@ We remove the phase delay due to the time delay of the ADC/DAC: ** 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'); + 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'); #+end_src #+begin_src matlab @@ -182,6 +191,9 @@ We remove the phase delay due to the time delay of the ADC/DAC: [[file:figs/change_capa_pi.png]] * Effect of a change in Voltage level +:PROPERTIES: +:header-args:matlab+: :tangle src/effect_change_voltage.m +:END: ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> @@ -191,11 +203,19 @@ We remove the phase delay due to the time delay of the ADC/DAC: <> #+end_src +#+begin_src matlab :tangle no + addpath('./matlab/mat/'); +#+end_src + +#+begin_src matlab :eval no + addpath('./mat/'); +#+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'); + 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'); #+end_src #+begin_src matlab @@ -256,8 +276,8 @@ We remove the phase delay due to the time delay of the ADC/DAC: ** 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'); + hi = load('pi_505_high.mat', 't', 'V_in', 'V_out'); + lo = load('pi_505_low.mat', 't', 'V_in', 'V_out'); #+end_src #+begin_src matlab @@ -307,6 +327,9 @@ We remove the phase delay due to the time delay of the ADC/DAC: [[file:figs/change_level_pi.png]] * Comparison PI / Cedrat +:PROPERTIES: +:header-args:matlab+: :tangle src/comp_pi_cedrat.m +:END: ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> @@ -316,10 +339,18 @@ We remove the phase delay due to the time delay of the ADC/DAC: <> #+end_src +#+begin_src matlab :tangle no + addpath('./matlab/mat/'); +#+end_src + +#+begin_src matlab :eval no + addpath('./mat/'); +#+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'); + 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'); #+end_src #+begin_src matlab @@ -371,6 +402,9 @@ We remove the phase delay due to the time delay of the ADC/DAC: [[file:figs/tf_amplifiers_comp.png]] * Impedance Measurement +:PROPERTIES: +:header-args:matlab+: :tangle src/impedance_meas.m +:END: ** Introduction :ignore: The goal is to experimentally measure the output impedance of the voltage amplifiers. @@ -392,6 +426,14 @@ From the two values of voltage, the internal resistor value can be computed: <> #+end_src +#+begin_src matlab :tangle no + addpath('./matlab/mat/'); +#+end_src + +#+begin_src matlab :eval no + addpath('./mat/'); +#+end_src + ** Cedrat Technology *** Compute Impedance #+begin_src matlab @@ -435,9 +477,9 @@ From the two values of voltage, the internal resistor value can be computed: #+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'); + 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)); @@ -528,6 +570,9 @@ From the two values of voltage, the internal resistor value can be computed: : 2.7795 * New PI amplifier measurements +:PROPERTIES: +:header-args:matlab+: :tangle src/pi_e505_filters.m +:END: ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> @@ -537,6 +582,14 @@ From the two values of voltage, the internal resistor value can be computed: <> #+end_src +#+begin_src matlab :tangle no + addpath('./matlab/mat/'); +#+end_src + +#+begin_src matlab :eval no + addpath('./mat/'); +#+end_src + ** PI Three measurements are done: - Slew Rate limitation at maximum @@ -544,10 +597,10 @@ Three measurements are done: - 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'); + 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'); #+end_src #+begin_src matlab diff --git a/js/jquery.stickytableheaders.min.js b/js/jquery.stickytableheaders.min.js deleted file mode 100644 index 6c17ea4..0000000 --- a/js/jquery.stickytableheaders.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a,b){"use strict";function c(c,g){var h=this;h.$el=a(c),h.el=c,h.id=e++,h.$window=a(b),h.$document=a(document),h.$el.bind("destroyed",a.proxy(h.teardown,h)),h.$clonedHeader=null,h.$originalHeader=null,h.isSticky=!1,h.hasBeenSticky=!1,h.leftOffset=null,h.topOffset=null,h.init=function(){h.$el.each(function(){var b=a(this);b.css("padding",0),h.$originalHeader=a("thead:first",this),h.$clonedHeader=h.$originalHeader.clone(),b.trigger("clonedHeader."+d,[h.$clonedHeader]),h.$clonedHeader.addClass("tableFloatingHeader"),h.$clonedHeader.css("display","none"),h.$originalHeader.addClass("tableFloatingHeaderOriginal"),h.$originalHeader.after(h.$clonedHeader),h.$printStyle=a(''),a("head").append(h.$printStyle)}),h.setOptions(g),h.updateWidth(),h.toggleHeaders(),h.bind()},h.destroy=function(){h.$el.unbind("destroyed",h.teardown),h.teardown()},h.teardown=function(){h.isSticky&&h.$originalHeader.css("position","static"),a.removeData(h.el,"plugin_"+d),h.unbind(),h.$clonedHeader.remove(),h.$originalHeader.removeClass("tableFloatingHeaderOriginal"),h.$originalHeader.css("visibility","visible"),h.$printStyle.remove(),h.el=null,h.$el=null},h.bind=function(){h.$scrollableArea.on("scroll."+d,h.toggleHeaders),h.isWindowScrolling||(h.$window.on("scroll."+d+h.id,h.setPositionValues),h.$window.on("resize."+d+h.id,h.toggleHeaders)),h.$scrollableArea.on("resize."+d,h.toggleHeaders),h.$scrollableArea.on("resize."+d,h.updateWidth)},h.unbind=function(){h.$scrollableArea.off("."+d,h.toggleHeaders),h.isWindowScrolling||(h.$window.off("."+d+h.id,h.setPositionValues),h.$window.off("."+d+h.id,h.toggleHeaders)),h.$scrollableArea.off("."+d,h.updateWidth)},h.toggleHeaders=function(){h.$el&&h.$el.each(function(){var b,c=a(this),d=h.isWindowScrolling?isNaN(h.options.fixedOffset)?h.options.fixedOffset.outerHeight():h.options.fixedOffset:h.$scrollableArea.offset().top+(isNaN(h.options.fixedOffset)?0:h.options.fixedOffset),e=c.offset(),f=h.$scrollableArea.scrollTop()+d,g=h.$scrollableArea.scrollLeft(),i=h.isWindowScrolling?f>e.top:d>e.top,j=(h.isWindowScrolling?f:0)a||a+h.$window.height()>h.$document.height()||0>b||b+h.$window.width()>h.$document.width()||h.$originalHeader.css({top:h.topOffset-(h.isWindowScrolling?0:a),left:h.leftOffset-(h.isWindowScrolling?0:b)})},h.updateWidth=function(){if(h.isSticky){h.$originalHeaderCells||(h.$originalHeaderCells=a("th,td",h.$originalHeader)),h.$clonedHeaderCells||(h.$clonedHeaderCells=a("th,td",h.$clonedHeader));var b=h.getWidth(h.$clonedHeaderCells);h.setWidth(b,h.$clonedHeaderCells,h.$originalHeaderCells),h.$originalHeader.css("width",h.$clonedHeader.width())}},h.getWidth=function(c){var d=[];return c.each(function(c){var e,f=a(this);if("border-box"===f.css("box-sizing"))e=f[0].getBoundingClientRect().width;else{var g=a("th",h.$originalHeader);if("collapse"===g.css("border-collapse"))if(b.getComputedStyle)e=parseFloat(b.getComputedStyle(this,null).width);else{var i=parseFloat(f.css("padding-left")),j=parseFloat(f.css("padding-right")),k=parseFloat(f.css("border-width"));e=f.outerWidth()-i-j-k}else e=f.width()}d[c]=e}),d},h.setWidth=function(a,b,c){b.each(function(b){var d=a[b];c.eq(b).css({"min-width":d,"max-width":d})})},h.resetWidth=function(b,c){b.each(function(b){var d=a(this);c.eq(b).css({"min-width":d.css("min-width"),"max-width":d.css("max-width")})})},h.setOptions=function(c){h.options=a.extend({},f,c),h.$scrollableArea=a(h.options.scrollableArea),h.isWindowScrolling=h.$scrollableArea[0]===b},h.updateOptions=function(a){h.setOptions(a),h.unbind(),h.bind(),h.updateWidth(),h.toggleHeaders()},h.init()}var d="stickyTableHeaders",e=0,f={fixedOffset:0,leftOffset:0,marginTop:0,scrollableArea:b};a.fn[d]=function(b){return this.each(function(){var e=a.data(this,"plugin_"+d);e?"string"==typeof b?e[b].apply(e):e.updateOptions(b):"destroy"!==b&&a.data(this,"plugin_"+d,new c(this,b))})}}(jQuery,window); \ No newline at end of file diff --git a/js/readtheorg.js b/js/readtheorg.js index 0f8439a..14b23d4 100644 --- a/js/readtheorg.js +++ b/js/readtheorg.js @@ -9,6 +9,8 @@ $(function() { $('.hint').before("

Hint

"); $('.error').before("

Error

"); $('.danger').before("

Danger

"); + $('.question').before("

Question

"); + $('.summary').before("

Summary

"); }); $( document ).ready(function() { diff --git a/mat/cedrat_la75b_high_1_stack.mat b/matlab/mat/cedrat_la75b_high_1_stack.mat similarity index 100% rename from mat/cedrat_la75b_high_1_stack.mat rename to matlab/mat/cedrat_la75b_high_1_stack.mat diff --git a/mat/cedrat_la75b_low_1_stack.mat b/matlab/mat/cedrat_la75b_low_1_stack.mat similarity index 100% rename from mat/cedrat_la75b_low_1_stack.mat rename to matlab/mat/cedrat_la75b_low_1_stack.mat diff --git a/mat/cedrat_la75b_med_1_stack.mat b/matlab/mat/cedrat_la75b_med_1_stack.mat similarity index 100% rename from mat/cedrat_la75b_med_1_stack.mat rename to matlab/mat/cedrat_la75b_med_1_stack.mat diff --git a/mat/cedrat_la75b_med_2_stack.mat b/matlab/mat/cedrat_la75b_med_2_stack.mat similarity index 100% rename from mat/cedrat_la75b_med_2_stack.mat rename to matlab/mat/cedrat_la75b_med_2_stack.mat diff --git a/mat/cedrat_la75b_med_3_stack.mat b/matlab/mat/cedrat_la75b_med_3_stack.mat similarity index 100% rename from mat/cedrat_la75b_med_3_stack.mat rename to matlab/mat/cedrat_la75b_med_3_stack.mat diff --git a/mat/dac_adc.mat b/matlab/mat/dac_adc.mat similarity index 100% rename from mat/dac_adc.mat rename to matlab/mat/dac_adc.mat diff --git a/mat/pi_505_high.mat b/matlab/mat/pi_505_high.mat similarity index 100% rename from mat/pi_505_high.mat rename to matlab/mat/pi_505_high.mat diff --git a/mat/pi_505_high_2_stacks.mat b/matlab/mat/pi_505_high_2_stacks.mat similarity index 100% rename from mat/pi_505_high_2_stacks.mat rename to matlab/mat/pi_505_high_2_stacks.mat diff --git a/mat/pi_505_high_3_stacks.mat b/matlab/mat/pi_505_high_3_stacks.mat similarity index 100% rename from mat/pi_505_high_3_stacks.mat rename to matlab/mat/pi_505_high_3_stacks.mat diff --git a/mat/pi_505_low.mat b/matlab/mat/pi_505_low.mat similarity index 100% rename from mat/pi_505_low.mat rename to matlab/mat/pi_505_low.mat diff --git a/mat/pi_slew_rate_max.mat b/matlab/mat/pi_slew_rate_max.mat similarity index 100% rename from mat/pi_slew_rate_max.mat rename to matlab/mat/pi_slew_rate_max.mat diff --git a/mat/pi_slew_rate_max_notch_high.mat b/matlab/mat/pi_slew_rate_max_notch_high.mat similarity index 100% rename from mat/pi_slew_rate_max_notch_high.mat rename to matlab/mat/pi_slew_rate_max_notch_high.mat diff --git a/mat/pi_slew_rate_max_notch_high_2stacks.mat b/matlab/mat/pi_slew_rate_max_notch_high_2stacks.mat similarity index 100% rename from mat/pi_slew_rate_max_notch_high_2stacks.mat rename to matlab/mat/pi_slew_rate_max_notch_high_2stacks.mat diff --git a/mat/pi_slew_rate_min.mat b/matlab/mat/pi_slew_rate_min.mat similarity index 100% rename from mat/pi_slew_rate_min.mat rename to matlab/mat/pi_slew_rate_min.mat diff --git a/piezoapa.slx b/matlab/piezo_amplifier.slx similarity index 100% rename from piezoapa.slx rename to matlab/piezo_amplifier.slx diff --git a/runtest.m b/matlab/runtest.m similarity index 100% rename from runtest.m rename to matlab/runtest.m diff --git a/setup.m b/matlab/setup.m similarity index 100% rename from setup.m rename to matlab/setup.m diff --git a/speedgoat_IO318_100k_CI_01585.mat b/matlab/speedgoat_IO318_100k_CI_01585.mat similarity index 100% rename from speedgoat_IO318_100k_CI_01585.mat rename to matlab/speedgoat_IO318_100k_CI_01585.mat diff --git a/piezoapabio.m b/piezoapabio.m deleted file mode 100644 index 636d351..0000000 --- a/piezoapabio.m +++ /dev/null @@ -1,236 +0,0 @@ -function bio=piezoapabio -bio = []; -bio(1).blkName='Data Type Conversion1'; -bio(1).sigName=''; -bio(1).portIdx=0; -bio(1).dim=[1,1]; -bio(1).sigWidth=1; -bio(1).sigAddress='&piezoapa_B.DataTypeConversion1'; -bio(1).ndims=2; -bio(1).size=[]; -bio(1).isStruct=false; -bio(getlenBIO) = bio(1); - -bio(2).blkName='bit to m'; -bio(2).sigName='Va [m]'; -bio(2).portIdx=0; -bio(2).dim=[1,1]; -bio(2).sigWidth=1; -bio(2).sigAddress='&piezoapa_B.Vam'; -bio(2).ndims=2; -bio(2).size=[]; -bio(2).isStruct=false; - -bio(3).blkName='Random Number'; -bio(3).sigName=''; -bio(3).portIdx=0; -bio(3).dim=[1,1]; -bio(3).sigWidth=1; -bio(3).sigAddress='&piezoapa_B.RandomNumber'; -bio(3).ndims=2; -bio(3).size=[]; -bio(3).isStruct=false; - -bio(4).blkName='Saturation1'; -bio(4).sigName='Uch [V]'; -bio(4).portIdx=0; -bio(4).dim=[1,1]; -bio(4).sigWidth=1; -bio(4).sigAddress='&piezoapa_B.UchV'; -bio(4).ndims=2; -bio(4).size=[]; -bio(4).isStruct=false; - -bio(5).blkName='Analog input /p1'; -bio(5).sigName=''; -bio(5).portIdx=0; -bio(5).dim=[1,1]; -bio(5).sigWidth=1; -bio(5).sigAddress='&piezoapa_B.Analoginput_o1'; -bio(5).ndims=2; -bio(5).size=[]; -bio(5).isStruct=false; - -bio(6).blkName='Analog input /p2'; -bio(6).sigName=''; -bio(6).portIdx=1; -bio(6).dim=[1,1]; -bio(6).sigWidth=1; -bio(6).sigAddress='&piezoapa_B.Analoginput_o2'; -bio(6).ndims=2; -bio(6).size=[]; -bio(6).isStruct=false; - -bio(7).blkName='Analog input /p3'; -bio(7).sigName=''; -bio(7).portIdx=2; -bio(7).dim=[1,1]; -bio(7).sigWidth=1; -bio(7).sigAddress='&piezoapa_B.Analoginput_o3'; -bio(7).ndims=2; -bio(7).size=[]; -bio(7).isStruct=false; - -bio(8).blkName='Analog input /p4'; -bio(8).sigName='V monitor'; -bio(8).portIdx=3; -bio(8).dim=[1,1]; -bio(8).sigWidth=1; -bio(8).sigAddress='&piezoapa_B.Vmonitor'; -bio(8).ndims=2; -bio(8).size=[]; -bio(8).isStruct=false; - -bio(9).blkName='Analog input /p5'; -bio(9).sigName=''; -bio(9).portIdx=4; -bio(9).dim=[1,1]; -bio(9).sigWidth=1; -bio(9).sigAddress='&piezoapa_B.Analoginput_o5'; -bio(9).ndims=2; -bio(9).size=[]; -bio(9).isStruct=false; - -bio(10).blkName='Analog input /p6'; -bio(10).sigName=''; -bio(10).portIdx=5; -bio(10).dim=[1,1]; -bio(10).sigWidth=1; -bio(10).sigAddress='&piezoapa_B.Analoginput_o6'; -bio(10).ndims=2; -bio(10).size=[]; -bio(10).isStruct=false; - -bio(11).blkName='Analog input /p7'; -bio(11).sigName=''; -bio(11).portIdx=6; -bio(11).dim=[1,1]; -bio(11).sigWidth=1; -bio(11).sigAddress='&piezoapa_B.Analoginput_o7'; -bio(11).ndims=2; -bio(11).size=[]; -bio(11).isStruct=false; - -bio(12).blkName='Analog input /p8'; -bio(12).sigName=''; -bio(12).portIdx=7; -bio(12).dim=[1,1]; -bio(12).sigWidth=1; -bio(12).sigAddress='&piezoapa_B.Analoginput_o8'; -bio(12).ndims=2; -bio(12).size=[]; -bio(12).isStruct=false; - -bio(13).blkName='Analog input /p9'; -bio(13).sigName=''; -bio(13).portIdx=8; -bio(13).dim=[1,1]; -bio(13).sigWidth=1; -bio(13).sigAddress='&piezoapa_B.Analoginput_o9'; -bio(13).ndims=2; -bio(13).size=[]; -bio(13).isStruct=false; - -bio(14).blkName='Analog input /p10'; -bio(14).sigName=''; -bio(14).portIdx=9; -bio(14).dim=[1,1]; -bio(14).sigWidth=1; -bio(14).sigAddress='&piezoapa_B.Analoginput_o10'; -bio(14).ndims=2; -bio(14).size=[]; -bio(14).isStruct=false; - -bio(15).blkName='Analog input /p11'; -bio(15).sigName=''; -bio(15).portIdx=10; -bio(15).dim=[1,1]; -bio(15).sigWidth=1; -bio(15).sigAddress='&piezoapa_B.Analoginput_o11'; -bio(15).ndims=2; -bio(15).size=[]; -bio(15).isStruct=false; - -bio(16).blkName='Analog input /p12'; -bio(16).sigName=''; -bio(16).portIdx=11; -bio(16).dim=[1,1]; -bio(16).sigWidth=1; -bio(16).sigAddress='&piezoapa_B.Analoginput_o12'; -bio(16).ndims=2; -bio(16).size=[]; -bio(16).isStruct=false; - -bio(17).blkName='Analog input /p13'; -bio(17).sigName=''; -bio(17).portIdx=12; -bio(17).dim=[1,1]; -bio(17).sigWidth=1; -bio(17).sigAddress='&piezoapa_B.Analoginput_o13'; -bio(17).ndims=2; -bio(17).size=[]; -bio(17).isStruct=false; - -bio(18).blkName='Analog input /p14'; -bio(18).sigName=''; -bio(18).portIdx=13; -bio(18).dim=[1,1]; -bio(18).sigWidth=1; -bio(18).sigAddress='&piezoapa_B.Analoginput_o14'; -bio(18).ndims=2; -bio(18).size=[]; -bio(18).isStruct=false; - -bio(19).blkName='Analog input /p15'; -bio(19).sigName=''; -bio(19).portIdx=14; -bio(19).dim=[1,1]; -bio(19).sigWidth=1; -bio(19).sigAddress='&piezoapa_B.Analoginput_o15'; -bio(19).ndims=2; -bio(19).size=[]; -bio(19).isStruct=false; - -bio(20).blkName='Analog input /p16'; -bio(20).sigName=''; -bio(20).portIdx=15; -bio(20).dim=[1,1]; -bio(20).sigWidth=1; -bio(20).sigAddress='&piezoapa_B.Analoginput_o16'; -bio(20).ndims=2; -bio(20).size=[]; -bio(20).isStruct=false; - -bio(21).blkName='SSIM (2)1'; -bio(21).sigName=''; -bio(21).portIdx=0; -bio(21).dim=[1,1]; -bio(21).sigWidth=1; -bio(21).sigAddress='&piezoapa_B.SSIM21'; -bio(21).ndims=2; -bio(21).size=[]; -bio(21).isStruct=false; - -bio(22).blkName='Manual Switch'; -bio(22).sigName=''; -bio(22).portIdx=0; -bio(22).dim=[1,1]; -bio(22).sigWidth=1; -bio(22).sigAddress='&piezoapa_B.ManualSwitch'; -bio(22).ndims=2; -bio(22).size=[]; -bio(22).isStruct=false; - -bio(23).blkName='Discrete Transfer Fcn'; -bio(23).sigName=''; -bio(23).portIdx=0; -bio(23).dim=[1,1]; -bio(23).sigWidth=1; -bio(23).sigAddress='&piezoapa_B.DiscreteTransferFcn'; -bio(23).ndims=2; -bio(23).size=[]; -bio(23).isStruct=false; - -function len = getlenBIO -len = 23; - diff --git a/piezoapapt.m b/piezoapapt.m deleted file mode 100644 index 8e8d6f9..0000000 --- a/piezoapapt.m +++ /dev/null @@ -1,1110 +0,0 @@ -function pt=piezoapapt -pt = []; - - -pt(1).blockname = 'Constant6'; -pt(1).paramname = 'Value'; -pt(1).class = 'scalar'; -pt(1).nrows = 1; -pt(1).ncols = 1; -pt(1).subsource = 'SS_DOUBLE'; -pt(1).ndims = '2'; -pt(1).size = '[]'; -pt(1).isStruct = false; -pt(1).symbol = 'piezoapa_P.Constant6_Value'; -pt(1).baseaddr = '&piezoapa_P.Constant6_Value'; -pt(1).dtname = 'real_T'; - -pt(getlenPT) = pt(1); - - - -pt(2).blockname = 'bit to m'; -pt(2).paramname = 'Gain'; -pt(2).class = 'scalar'; -pt(2).nrows = 1; -pt(2).ncols = 1; -pt(2).subsource = 'SS_INT32'; -pt(2).ndims = '2'; -pt(2).size = '[]'; -pt(2).isStruct = false; -pt(2).symbol = 'piezoapa_P.bittom_Gain'; -pt(2).baseaddr = '&piezoapa_P.bittom_Gain'; -pt(2).dtname = 'int32_T'; - - - - -pt(3).blockname = 'Random Number'; -pt(3).paramname = 'Mean'; -pt(3).class = 'scalar'; -pt(3).nrows = 1; -pt(3).ncols = 1; -pt(3).subsource = 'SS_DOUBLE'; -pt(3).ndims = '2'; -pt(3).size = '[]'; -pt(3).isStruct = false; -pt(3).symbol = 'piezoapa_P.RandomNumber_Mean'; -pt(3).baseaddr = '&piezoapa_P.RandomNumber_Mean'; -pt(3).dtname = 'real_T'; - - - - -pt(4).blockname = 'Random Number'; -pt(4).paramname = 'StdDev'; -pt(4).class = 'scalar'; -pt(4).nrows = 1; -pt(4).ncols = 1; -pt(4).subsource = 'SS_DOUBLE'; -pt(4).ndims = '2'; -pt(4).size = '[]'; -pt(4).isStruct = false; -pt(4).symbol = 'piezoapa_P.RandomNumber_StdDev'; -pt(4).baseaddr = '&piezoapa_P.RandomNumber_StdDev'; -pt(4).dtname = 'real_T'; - - - - -pt(5).blockname = 'Random Number'; -pt(5).paramname = 'Seed'; -pt(5).class = 'scalar'; -pt(5).nrows = 1; -pt(5).ncols = 1; -pt(5).subsource = 'SS_DOUBLE'; -pt(5).ndims = '2'; -pt(5).size = '[]'; -pt(5).isStruct = false; -pt(5).symbol = 'piezoapa_P.RandomNumber_Seed'; -pt(5).baseaddr = '&piezoapa_P.RandomNumber_Seed'; -pt(5).dtname = 'real_T'; - - - - -pt(6).blockname = 'Saturation1'; -pt(6).paramname = 'UpperLimit'; -pt(6).class = 'scalar'; -pt(6).nrows = 1; -pt(6).ncols = 1; -pt(6).subsource = 'SS_DOUBLE'; -pt(6).ndims = '2'; -pt(6).size = '[]'; -pt(6).isStruct = false; -pt(6).symbol = 'piezoapa_P.Saturation1_UpperSat'; -pt(6).baseaddr = '&piezoapa_P.Saturation1_UpperSat'; -pt(6).dtname = 'real_T'; - - - - -pt(7).blockname = 'Saturation1'; -pt(7).paramname = 'LowerLimit'; -pt(7).class = 'scalar'; -pt(7).nrows = 1; -pt(7).ncols = 1; -pt(7).subsource = 'SS_DOUBLE'; -pt(7).ndims = '2'; -pt(7).size = '[]'; -pt(7).isStruct = false; -pt(7).symbol = 'piezoapa_P.Saturation1_LowerSat'; -pt(7).baseaddr = '&piezoapa_P.Saturation1_LowerSat'; -pt(7).dtname = 'real_T'; - - - - -pt(8).blockname = 'Analog input '; -pt(8).paramname = 'P1'; -pt(8).class = 'scalar'; -pt(8).nrows = 1; -pt(8).ncols = 1; -pt(8).subsource = 'SS_DOUBLE'; -pt(8).ndims = '2'; -pt(8).size = '[]'; -pt(8).isStruct = false; -pt(8).symbol = 'piezoapa_P.Analoginput_P1'; -pt(8).baseaddr = '&piezoapa_P.Analoginput_P1'; -pt(8).dtname = 'real_T'; - - - - -pt(9).blockname = 'Analog input '; -pt(9).paramname = 'P2'; -pt(9).class = 'scalar'; -pt(9).nrows = 1; -pt(9).ncols = 1; -pt(9).subsource = 'SS_DOUBLE'; -pt(9).ndims = '2'; -pt(9).size = '[]'; -pt(9).isStruct = false; -pt(9).symbol = 'piezoapa_P.Analoginput_P2'; -pt(9).baseaddr = '&piezoapa_P.Analoginput_P2'; -pt(9).dtname = 'real_T'; - - - - -pt(10).blockname = 'Analog input '; -pt(10).paramname = 'P3'; -pt(10).class = 'scalar'; -pt(10).nrows = 1; -pt(10).ncols = 1; -pt(10).subsource = 'SS_DOUBLE'; -pt(10).ndims = '2'; -pt(10).size = '[]'; -pt(10).isStruct = false; -pt(10).symbol = 'piezoapa_P.Analoginput_P3'; -pt(10).baseaddr = '&piezoapa_P.Analoginput_P3'; -pt(10).dtname = 'real_T'; - - - - -pt(11).blockname = 'Analog input '; -pt(11).paramname = 'P4'; -pt(11).class = 'scalar'; -pt(11).nrows = 1; -pt(11).ncols = 1; -pt(11).subsource = 'SS_DOUBLE'; -pt(11).ndims = '2'; -pt(11).size = '[]'; -pt(11).isStruct = false; -pt(11).symbol = 'piezoapa_P.Analoginput_P4'; -pt(11).baseaddr = '&piezoapa_P.Analoginput_P4'; -pt(11).dtname = 'real_T'; - - - - -pt(12).blockname = 'Analog input '; -pt(12).paramname = 'P5'; -pt(12).class = 'scalar'; -pt(12).nrows = 1; -pt(12).ncols = 1; -pt(12).subsource = 'SS_DOUBLE'; -pt(12).ndims = '2'; -pt(12).size = '[]'; -pt(12).isStruct = false; -pt(12).symbol = 'piezoapa_P.Analoginput_P5'; -pt(12).baseaddr = '&piezoapa_P.Analoginput_P5'; -pt(12).dtname = 'real_T'; - - - - -pt(13).blockname = 'Analog input '; -pt(13).paramname = 'P6'; -pt(13).class = 'scalar'; -pt(13).nrows = 1; -pt(13).ncols = 1; -pt(13).subsource = 'SS_DOUBLE'; -pt(13).ndims = '2'; -pt(13).size = '[]'; -pt(13).isStruct = false; -pt(13).symbol = 'piezoapa_P.Analoginput_P6'; -pt(13).baseaddr = '&piezoapa_P.Analoginput_P6'; -pt(13).dtname = 'real_T'; - - - - -pt(14).blockname = 'Analog input '; -pt(14).paramname = 'P7'; -pt(14).class = 'vector'; -pt(14).nrows = 1; -pt(14).ncols = 16; -pt(14).subsource = 'SS_DOUBLE'; -pt(14).ndims = '2'; -pt(14).size = '[]'; -pt(14).isStruct = false; -pt(14).symbol = 'piezoapa_P.Analoginput_P7'; -pt(14).baseaddr = '&piezoapa_P.Analoginput_P7[0]'; -pt(14).dtname = 'real_T'; - - - - -pt(15).blockname = 'Analog input '; -pt(15).paramname = 'P8'; -pt(15).class = 'scalar'; -pt(15).nrows = 1; -pt(15).ncols = 1; -pt(15).subsource = 'SS_DOUBLE'; -pt(15).ndims = '2'; -pt(15).size = '[]'; -pt(15).isStruct = false; -pt(15).symbol = 'piezoapa_P.Analoginput_P8'; -pt(15).baseaddr = '&piezoapa_P.Analoginput_P8'; -pt(15).dtname = 'real_T'; - - - - -pt(16).blockname = 'Analog input '; -pt(16).paramname = 'P9'; -pt(16).class = 'scalar'; -pt(16).nrows = 1; -pt(16).ncols = 1; -pt(16).subsource = 'SS_DOUBLE'; -pt(16).ndims = '2'; -pt(16).size = '[]'; -pt(16).isStruct = false; -pt(16).symbol = 'piezoapa_P.Analoginput_P9'; -pt(16).baseaddr = '&piezoapa_P.Analoginput_P9'; -pt(16).dtname = 'real_T'; - - - - -pt(17).blockname = 'Analog input '; -pt(17).paramname = 'P10'; -pt(17).class = 'scalar'; -pt(17).nrows = 1; -pt(17).ncols = 1; -pt(17).subsource = 'SS_DOUBLE'; -pt(17).ndims = '2'; -pt(17).size = '[]'; -pt(17).isStruct = false; -pt(17).symbol = 'piezoapa_P.Analoginput_P10'; -pt(17).baseaddr = '&piezoapa_P.Analoginput_P10'; -pt(17).dtname = 'real_T'; - - - - -pt(18).blockname = 'Analog input '; -pt(18).paramname = 'P11'; -pt(18).class = 'scalar'; -pt(18).nrows = 1; -pt(18).ncols = 1; -pt(18).subsource = 'SS_DOUBLE'; -pt(18).ndims = '2'; -pt(18).size = '[]'; -pt(18).isStruct = false; -pt(18).symbol = 'piezoapa_P.Analoginput_P11'; -pt(18).baseaddr = '&piezoapa_P.Analoginput_P11'; -pt(18).dtname = 'real_T'; - - - - -pt(19).blockname = 'Analog input '; -pt(19).paramname = 'P12'; -pt(19).class = 'scalar'; -pt(19).nrows = 1; -pt(19).ncols = 1; -pt(19).subsource = 'SS_DOUBLE'; -pt(19).ndims = '2'; -pt(19).size = '[]'; -pt(19).isStruct = false; -pt(19).symbol = 'piezoapa_P.Analoginput_P12'; -pt(19).baseaddr = '&piezoapa_P.Analoginput_P12'; -pt(19).dtname = 'real_T'; - - - - -pt(20).blockname = 'Analog output '; -pt(20).paramname = 'P1'; -pt(20).class = 'scalar'; -pt(20).nrows = 1; -pt(20).ncols = 1; -pt(20).subsource = 'SS_DOUBLE'; -pt(20).ndims = '2'; -pt(20).size = '[]'; -pt(20).isStruct = false; -pt(20).symbol = 'piezoapa_P.Analogoutput_P1'; -pt(20).baseaddr = '&piezoapa_P.Analogoutput_P1'; -pt(20).dtname = 'real_T'; - - - - -pt(21).blockname = 'Analog output '; -pt(21).paramname = 'P2'; -pt(21).class = 'scalar'; -pt(21).nrows = 1; -pt(21).ncols = 1; -pt(21).subsource = 'SS_DOUBLE'; -pt(21).ndims = '2'; -pt(21).size = '[]'; -pt(21).isStruct = false; -pt(21).symbol = 'piezoapa_P.Analogoutput_P2'; -pt(21).baseaddr = '&piezoapa_P.Analogoutput_P2'; -pt(21).dtname = 'real_T'; - - - - -pt(22).blockname = 'Analog output '; -pt(22).paramname = 'P3'; -pt(22).class = 'scalar'; -pt(22).nrows = 1; -pt(22).ncols = 1; -pt(22).subsource = 'SS_DOUBLE'; -pt(22).ndims = '2'; -pt(22).size = '[]'; -pt(22).isStruct = false; -pt(22).symbol = 'piezoapa_P.Analogoutput_P3'; -pt(22).baseaddr = '&piezoapa_P.Analogoutput_P3'; -pt(22).dtname = 'real_T'; - - - - -pt(23).blockname = 'Analog output '; -pt(23).paramname = 'P4'; -pt(23).class = 'scalar'; -pt(23).nrows = 1; -pt(23).ncols = 1; -pt(23).subsource = 'SS_DOUBLE'; -pt(23).ndims = '2'; -pt(23).size = '[]'; -pt(23).isStruct = false; -pt(23).symbol = 'piezoapa_P.Analogoutput_P4'; -pt(23).baseaddr = '&piezoapa_P.Analogoutput_P4'; -pt(23).dtname = 'real_T'; - - - - -pt(24).blockname = 'Analog output '; -pt(24).paramname = 'P5'; -pt(24).class = 'scalar'; -pt(24).nrows = 1; -pt(24).ncols = 1; -pt(24).subsource = 'SS_DOUBLE'; -pt(24).ndims = '2'; -pt(24).size = '[]'; -pt(24).isStruct = false; -pt(24).symbol = 'piezoapa_P.Analogoutput_P5'; -pt(24).baseaddr = '&piezoapa_P.Analogoutput_P5'; -pt(24).dtname = 'real_T'; - - - - -pt(25).blockname = 'Analog output '; -pt(25).paramname = 'P6'; -pt(25).class = 'vector'; -pt(25).nrows = 1; -pt(25).ncols = 8; -pt(25).subsource = 'SS_DOUBLE'; -pt(25).ndims = '2'; -pt(25).size = '[]'; -pt(25).isStruct = false; -pt(25).symbol = 'piezoapa_P.Analogoutput_P6'; -pt(25).baseaddr = '&piezoapa_P.Analogoutput_P6[0]'; -pt(25).dtname = 'real_T'; - - - - -pt(26).blockname = 'Analog output '; -pt(26).paramname = 'P7'; -pt(26).class = 'vector'; -pt(26).nrows = 1; -pt(26).ncols = 8; -pt(26).subsource = 'SS_DOUBLE'; -pt(26).ndims = '2'; -pt(26).size = '[]'; -pt(26).isStruct = false; -pt(26).symbol = 'piezoapa_P.Analogoutput_P7'; -pt(26).baseaddr = '&piezoapa_P.Analogoutput_P7[0]'; -pt(26).dtname = 'real_T'; - - - - -pt(27).blockname = 'Analog output '; -pt(27).paramname = 'P8'; -pt(27).class = 'vector'; -pt(27).nrows = 1; -pt(27).ncols = 8; -pt(27).subsource = 'SS_DOUBLE'; -pt(27).ndims = '2'; -pt(27).size = '[]'; -pt(27).isStruct = false; -pt(27).symbol = 'piezoapa_P.Analogoutput_P8'; -pt(27).baseaddr = '&piezoapa_P.Analogoutput_P8[0]'; -pt(27).dtname = 'real_T'; - - - - -pt(28).blockname = 'Analog output '; -pt(28).paramname = 'P9'; -pt(28).class = 'scalar'; -pt(28).nrows = 1; -pt(28).ncols = 1; -pt(28).subsource = 'SS_DOUBLE'; -pt(28).ndims = '2'; -pt(28).size = '[]'; -pt(28).isStruct = false; -pt(28).symbol = 'piezoapa_P.Analogoutput_P9'; -pt(28).baseaddr = '&piezoapa_P.Analogoutput_P9'; -pt(28).dtname = 'real_T'; - - - - -pt(29).blockname = 'Analog output '; -pt(29).paramname = 'P10'; -pt(29).class = 'scalar'; -pt(29).nrows = 1; -pt(29).ncols = 1; -pt(29).subsource = 'SS_DOUBLE'; -pt(29).ndims = '2'; -pt(29).size = '[]'; -pt(29).isStruct = false; -pt(29).symbol = 'piezoapa_P.Analogoutput_P10'; -pt(29).baseaddr = '&piezoapa_P.Analogoutput_P10'; -pt(29).dtname = 'real_T'; - - - - -pt(30).blockname = 'Analog output '; -pt(30).paramname = 'P11'; -pt(30).class = 'scalar'; -pt(30).nrows = 1; -pt(30).ncols = 1; -pt(30).subsource = 'SS_DOUBLE'; -pt(30).ndims = '2'; -pt(30).size = '[]'; -pt(30).isStruct = false; -pt(30).symbol = 'piezoapa_P.Analogoutput_P11'; -pt(30).baseaddr = '&piezoapa_P.Analogoutput_P11'; -pt(30).dtname = 'real_T'; - - - - -pt(31).blockname = 'Analog output '; -pt(31).paramname = 'P12'; -pt(31).class = 'scalar'; -pt(31).nrows = 1; -pt(31).ncols = 1; -pt(31).subsource = 'SS_DOUBLE'; -pt(31).ndims = '2'; -pt(31).size = '[]'; -pt(31).isStruct = false; -pt(31).symbol = 'piezoapa_P.Analogoutput_P12'; -pt(31).baseaddr = '&piezoapa_P.Analogoutput_P12'; -pt(31).dtname = 'real_T'; - - - - -pt(32).blockname = 'Analog output '; -pt(32).paramname = 'P13'; -pt(32).class = 'scalar'; -pt(32).nrows = 1; -pt(32).ncols = 1; -pt(32).subsource = 'SS_DOUBLE'; -pt(32).ndims = '2'; -pt(32).size = '[]'; -pt(32).isStruct = false; -pt(32).symbol = 'piezoapa_P.Analogoutput_P13'; -pt(32).baseaddr = '&piezoapa_P.Analogoutput_P13'; -pt(32).dtname = 'real_T'; - - - - -pt(33).blockname = 'Analog output '; -pt(33).paramname = 'P14'; -pt(33).class = 'scalar'; -pt(33).nrows = 1; -pt(33).ncols = 1; -pt(33).subsource = 'SS_DOUBLE'; -pt(33).ndims = '2'; -pt(33).size = '[]'; -pt(33).isStruct = false; -pt(33).symbol = 'piezoapa_P.Analogoutput_P14'; -pt(33).baseaddr = '&piezoapa_P.Analogoutput_P14'; -pt(33).dtname = 'real_T'; - - - - -pt(34).blockname = 'Analog output '; -pt(34).paramname = 'P15'; -pt(34).class = 'scalar'; -pt(34).nrows = 1; -pt(34).ncols = 1; -pt(34).subsource = 'SS_DOUBLE'; -pt(34).ndims = '2'; -pt(34).size = '[]'; -pt(34).isStruct = false; -pt(34).symbol = 'piezoapa_P.Analogoutput_P15'; -pt(34).baseaddr = '&piezoapa_P.Analogoutput_P15'; -pt(34).dtname = 'real_T'; - - - - -pt(35).blockname = 'SSIM (2)1'; -pt(35).paramname = 'P1'; -pt(35).class = 'scalar'; -pt(35).nrows = 1; -pt(35).ncols = 1; -pt(35).subsource = 'SS_DOUBLE'; -pt(35).ndims = '2'; -pt(35).size = '[]'; -pt(35).isStruct = false; -pt(35).symbol = 'piezoapa_P.SSIM21_P1'; -pt(35).baseaddr = '&piezoapa_P.SSIM21_P1'; -pt(35).dtname = 'real_T'; - - - - -pt(36).blockname = 'SSIM (2)1'; -pt(36).paramname = 'P2'; -pt(36).class = 'scalar'; -pt(36).nrows = 1; -pt(36).ncols = 1; -pt(36).subsource = 'SS_DOUBLE'; -pt(36).ndims = '2'; -pt(36).size = '[]'; -pt(36).isStruct = false; -pt(36).symbol = 'piezoapa_P.SSIM21_P2'; -pt(36).baseaddr = '&piezoapa_P.SSIM21_P2'; -pt(36).dtname = 'real_T'; - - - - -pt(37).blockname = 'SSIM (2)1'; -pt(37).paramname = 'P3'; -pt(37).class = 'scalar'; -pt(37).nrows = 1; -pt(37).ncols = 1; -pt(37).subsource = 'SS_DOUBLE'; -pt(37).ndims = '2'; -pt(37).size = '[]'; -pt(37).isStruct = false; -pt(37).symbol = 'piezoapa_P.SSIM21_P3'; -pt(37).baseaddr = '&piezoapa_P.SSIM21_P3'; -pt(37).dtname = 'real_T'; - - - - -pt(38).blockname = 'SSIM (2)1'; -pt(38).paramname = 'P4'; -pt(38).class = 'scalar'; -pt(38).nrows = 1; -pt(38).ncols = 1; -pt(38).subsource = 'SS_DOUBLE'; -pt(38).ndims = '2'; -pt(38).size = '[]'; -pt(38).isStruct = false; -pt(38).symbol = 'piezoapa_P.SSIM21_P4'; -pt(38).baseaddr = '&piezoapa_P.SSIM21_P4'; -pt(38).dtname = 'real_T'; - - - - -pt(39).blockname = 'SSIM (2)1'; -pt(39).paramname = 'P5'; -pt(39).class = 'scalar'; -pt(39).nrows = 1; -pt(39).ncols = 1; -pt(39).subsource = 'SS_DOUBLE'; -pt(39).ndims = '2'; -pt(39).size = '[]'; -pt(39).isStruct = false; -pt(39).symbol = 'piezoapa_P.SSIM21_P5'; -pt(39).baseaddr = '&piezoapa_P.SSIM21_P5'; -pt(39).dtname = 'real_T'; - - - - -pt(40).blockname = 'SSIM (2)1'; -pt(40).paramname = 'P6'; -pt(40).class = 'scalar'; -pt(40).nrows = 1; -pt(40).ncols = 1; -pt(40).subsource = 'SS_DOUBLE'; -pt(40).ndims = '2'; -pt(40).size = '[]'; -pt(40).isStruct = false; -pt(40).symbol = 'piezoapa_P.SSIM21_P6'; -pt(40).baseaddr = '&piezoapa_P.SSIM21_P6'; -pt(40).dtname = 'real_T'; - - - - -pt(41).blockname = 'SSIM (2)1'; -pt(41).paramname = 'P7'; -pt(41).class = 'scalar'; -pt(41).nrows = 1; -pt(41).ncols = 1; -pt(41).subsource = 'SS_DOUBLE'; -pt(41).ndims = '2'; -pt(41).size = '[]'; -pt(41).isStruct = false; -pt(41).symbol = 'piezoapa_P.SSIM21_P7'; -pt(41).baseaddr = '&piezoapa_P.SSIM21_P7'; -pt(41).dtname = 'real_T'; - - - - -pt(42).blockname = 'SSIM (2)1'; -pt(42).paramname = 'P8'; -pt(42).class = 'scalar'; -pt(42).nrows = 1; -pt(42).ncols = 1; -pt(42).subsource = 'SS_DOUBLE'; -pt(42).ndims = '2'; -pt(42).size = '[]'; -pt(42).isStruct = false; -pt(42).symbol = 'piezoapa_P.SSIM21_P8'; -pt(42).baseaddr = '&piezoapa_P.SSIM21_P8'; -pt(42).dtname = 'real_T'; - - - - -pt(43).blockname = 'SSIM (2)1'; -pt(43).paramname = 'P9'; -pt(43).class = 'scalar'; -pt(43).nrows = 1; -pt(43).ncols = 1; -pt(43).subsource = 'SS_DOUBLE'; -pt(43).ndims = '2'; -pt(43).size = '[]'; -pt(43).isStruct = false; -pt(43).symbol = 'piezoapa_P.SSIM21_P9'; -pt(43).baseaddr = '&piezoapa_P.SSIM21_P9'; -pt(43).dtname = 'real_T'; - - - - -pt(44).blockname = 'SSIM (2)1'; -pt(44).paramname = 'P10'; -pt(44).class = 'scalar'; -pt(44).nrows = 1; -pt(44).ncols = 1; -pt(44).subsource = 'SS_DOUBLE'; -pt(44).ndims = '2'; -pt(44).size = '[]'; -pt(44).isStruct = false; -pt(44).symbol = 'piezoapa_P.SSIM21_P10'; -pt(44).baseaddr = '&piezoapa_P.SSIM21_P10'; -pt(44).dtname = 'real_T'; - - - - -pt(45).blockname = 'SSIM (2)1'; -pt(45).paramname = 'P11'; -pt(45).class = 'scalar'; -pt(45).nrows = 1; -pt(45).ncols = 1; -pt(45).subsource = 'SS_DOUBLE'; -pt(45).ndims = '2'; -pt(45).size = '[]'; -pt(45).isStruct = false; -pt(45).symbol = 'piezoapa_P.SSIM21_P11'; -pt(45).baseaddr = '&piezoapa_P.SSIM21_P11'; -pt(45).dtname = 'real_T'; - - - - -pt(46).blockname = 'SSIM (2)1'; -pt(46).paramname = 'P12'; -pt(46).class = 'scalar'; -pt(46).nrows = 1; -pt(46).ncols = 1; -pt(46).subsource = 'SS_DOUBLE'; -pt(46).ndims = '2'; -pt(46).size = '[]'; -pt(46).isStruct = false; -pt(46).symbol = 'piezoapa_P.SSIM21_P12'; -pt(46).baseaddr = '&piezoapa_P.SSIM21_P12'; -pt(46).dtname = 'real_T'; - - - - -pt(47).blockname = 'Setup'; -pt(47).paramname = 'P1'; -pt(47).class = 'scalar'; -pt(47).nrows = 1; -pt(47).ncols = 1; -pt(47).subsource = 'SS_DOUBLE'; -pt(47).ndims = '2'; -pt(47).size = '[]'; -pt(47).isStruct = false; -pt(47).symbol = 'piezoapa_P.Setup_P1'; -pt(47).baseaddr = '&piezoapa_P.Setup_P1'; -pt(47).dtname = 'real_T'; - - - - -pt(48).blockname = 'Setup'; -pt(48).paramname = 'P2'; -pt(48).class = 'scalar'; -pt(48).nrows = 1; -pt(48).ncols = 1; -pt(48).subsource = 'SS_DOUBLE'; -pt(48).ndims = '2'; -pt(48).size = '[]'; -pt(48).isStruct = false; -pt(48).symbol = 'piezoapa_P.Setup_P2'; -pt(48).baseaddr = '&piezoapa_P.Setup_P2'; -pt(48).dtname = 'real_T'; - - - - -pt(49).blockname = 'Setup'; -pt(49).paramname = 'P3'; -pt(49).class = 'scalar'; -pt(49).nrows = 1; -pt(49).ncols = 1; -pt(49).subsource = 'SS_DOUBLE'; -pt(49).ndims = '2'; -pt(49).size = '[]'; -pt(49).isStruct = false; -pt(49).symbol = 'piezoapa_P.Setup_P3'; -pt(49).baseaddr = '&piezoapa_P.Setup_P3'; -pt(49).dtname = 'real_T'; - - - - -pt(50).blockname = 'Setup'; -pt(50).paramname = 'P4'; -pt(50).class = 'vector'; -pt(50).nrows = 3318808; -pt(50).ncols = 1; -pt(50).subsource = 'SS_DOUBLE'; -pt(50).ndims = '2'; -pt(50).size = '[]'; -pt(50).isStruct = false; -pt(50).symbol = 'piezoapa_P.Setup_P4'; -pt(50).baseaddr = '&piezoapa_P.Setup_P4[0]'; -pt(50).dtname = 'real_T'; - - - - -pt(51).blockname = 'Setup'; -pt(51).paramname = 'P5'; -pt(51).class = 'vector'; -pt(51).nrows = 1; -pt(51).ncols = 2; -pt(51).subsource = 'SS_DOUBLE'; -pt(51).ndims = '2'; -pt(51).size = '[]'; -pt(51).isStruct = false; -pt(51).symbol = 'piezoapa_P.Setup_P5'; -pt(51).baseaddr = '&piezoapa_P.Setup_P5[0]'; -pt(51).dtname = 'real_T'; - - - - -pt(52).blockname = 'Setup'; -pt(52).paramname = 'P6'; -pt(52).class = 'scalar'; -pt(52).nrows = 1; -pt(52).ncols = 1; -pt(52).subsource = 'SS_DOUBLE'; -pt(52).ndims = '2'; -pt(52).size = '[]'; -pt(52).isStruct = false; -pt(52).symbol = 'piezoapa_P.Setup_P6'; -pt(52).baseaddr = '&piezoapa_P.Setup_P6'; -pt(52).dtname = 'real_T'; - - - - -pt(53).blockname = 'Setup'; -pt(53).paramname = 'P7'; -pt(53).class = 'scalar'; -pt(53).nrows = 1; -pt(53).ncols = 1; -pt(53).subsource = 'SS_DOUBLE'; -pt(53).ndims = '2'; -pt(53).size = '[]'; -pt(53).isStruct = false; -pt(53).symbol = 'piezoapa_P.Setup_P7'; -pt(53).baseaddr = '&piezoapa_P.Setup_P7'; -pt(53).dtname = 'real_T'; - - - - -pt(54).blockname = 'Setup'; -pt(54).paramname = 'P8'; -pt(54).class = 'scalar'; -pt(54).nrows = 1; -pt(54).ncols = 1; -pt(54).subsource = 'SS_DOUBLE'; -pt(54).ndims = '2'; -pt(54).size = '[]'; -pt(54).isStruct = false; -pt(54).symbol = 'piezoapa_P.Setup_P8'; -pt(54).baseaddr = '&piezoapa_P.Setup_P8'; -pt(54).dtname = 'real_T'; - - - - -pt(55).blockname = 'Setup'; -pt(55).paramname = 'P9'; -pt(55).class = 'scalar'; -pt(55).nrows = 1; -pt(55).ncols = 1; -pt(55).subsource = 'SS_DOUBLE'; -pt(55).ndims = '2'; -pt(55).size = '[]'; -pt(55).isStruct = false; -pt(55).symbol = 'piezoapa_P.Setup_P9'; -pt(55).baseaddr = '&piezoapa_P.Setup_P9'; -pt(55).dtname = 'real_T'; - - - - -pt(56).blockname = 'Setup'; -pt(56).paramname = 'P10'; -pt(56).class = 'scalar'; -pt(56).nrows = 1; -pt(56).ncols = 1; -pt(56).subsource = 'SS_DOUBLE'; -pt(56).ndims = '2'; -pt(56).size = '[]'; -pt(56).isStruct = false; -pt(56).symbol = 'piezoapa_P.Setup_P10'; -pt(56).baseaddr = '&piezoapa_P.Setup_P10'; -pt(56).dtname = 'real_T'; - - - - -pt(57).blockname = 'Setup'; -pt(57).paramname = 'P11'; -pt(57).class = 'scalar'; -pt(57).nrows = 1; -pt(57).ncols = 1; -pt(57).subsource = 'SS_DOUBLE'; -pt(57).ndims = '2'; -pt(57).size = '[]'; -pt(57).isStruct = false; -pt(57).symbol = 'piezoapa_P.Setup_P11'; -pt(57).baseaddr = '&piezoapa_P.Setup_P11'; -pt(57).dtname = 'real_T'; - - - - -pt(58).blockname = 'Setup'; -pt(58).paramname = 'P12'; -pt(58).class = 'scalar'; -pt(58).nrows = 1; -pt(58).ncols = 1; -pt(58).subsource = 'SS_DOUBLE'; -pt(58).ndims = '2'; -pt(58).size = '[]'; -pt(58).isStruct = false; -pt(58).symbol = 'piezoapa_P.Setup_P12'; -pt(58).baseaddr = '&piezoapa_P.Setup_P12'; -pt(58).dtname = 'real_T'; - - - - -pt(59).blockname = 'Setup'; -pt(59).paramname = 'P13'; -pt(59).class = 'scalar'; -pt(59).nrows = 1; -pt(59).ncols = 1; -pt(59).subsource = 'SS_DOUBLE'; -pt(59).ndims = '2'; -pt(59).size = '[]'; -pt(59).isStruct = false; -pt(59).symbol = 'piezoapa_P.Setup_P13'; -pt(59).baseaddr = '&piezoapa_P.Setup_P13'; -pt(59).dtname = 'real_T'; - - - - -pt(60).blockname = 'Setup '; -pt(60).paramname = 'P1'; -pt(60).class = 'scalar'; -pt(60).nrows = 1; -pt(60).ncols = 1; -pt(60).subsource = 'SS_DOUBLE'; -pt(60).ndims = '2'; -pt(60).size = '[]'; -pt(60).isStruct = false; -pt(60).symbol = 'piezoapa_P.Setup_P1_p'; -pt(60).baseaddr = '&piezoapa_P.Setup_P1_p'; -pt(60).dtname = 'real_T'; - - - - -pt(61).blockname = 'Setup '; -pt(61).paramname = 'P2'; -pt(61).class = 'scalar'; -pt(61).nrows = 1; -pt(61).ncols = 1; -pt(61).subsource = 'SS_DOUBLE'; -pt(61).ndims = '2'; -pt(61).size = '[]'; -pt(61).isStruct = false; -pt(61).symbol = 'piezoapa_P.Setup_P2_h'; -pt(61).baseaddr = '&piezoapa_P.Setup_P2_h'; -pt(61).dtname = 'real_T'; - - - - -pt(62).blockname = 'Setup '; -pt(62).paramname = 'P3'; -pt(62).class = 'scalar'; -pt(62).nrows = 1; -pt(62).ncols = 1; -pt(62).subsource = 'SS_DOUBLE'; -pt(62).ndims = '2'; -pt(62).size = '[]'; -pt(62).isStruct = false; -pt(62).symbol = 'piezoapa_P.Setup_P3_f'; -pt(62).baseaddr = '&piezoapa_P.Setup_P3_f'; -pt(62).dtname = 'real_T'; - - - - -pt(63).blockname = 'Setup '; -pt(63).paramname = 'P4'; -pt(63).class = 'scalar'; -pt(63).nrows = 1; -pt(63).ncols = 1; -pt(63).subsource = 'SS_DOUBLE'; -pt(63).ndims = '2'; -pt(63).size = '[]'; -pt(63).isStruct = false; -pt(63).symbol = 'piezoapa_P.Setup_P4_i'; -pt(63).baseaddr = '&piezoapa_P.Setup_P4_i'; -pt(63).dtname = 'real_T'; - - - - -pt(64).blockname = 'Setup '; -pt(64).paramname = 'P5'; -pt(64).class = 'scalar'; -pt(64).nrows = 1; -pt(64).ncols = 1; -pt(64).subsource = 'SS_DOUBLE'; -pt(64).ndims = '2'; -pt(64).size = '[]'; -pt(64).isStruct = false; -pt(64).symbol = 'piezoapa_P.Setup_P5_p'; -pt(64).baseaddr = '&piezoapa_P.Setup_P5_p'; -pt(64).dtname = 'real_T'; - - - - -pt(65).blockname = 'Setup '; -pt(65).paramname = 'P6'; -pt(65).class = 'scalar'; -pt(65).nrows = 1; -pt(65).ncols = 1; -pt(65).subsource = 'SS_DOUBLE'; -pt(65).ndims = '2'; -pt(65).size = '[]'; -pt(65).isStruct = false; -pt(65).symbol = 'piezoapa_P.Setup_P6_o'; -pt(65).baseaddr = '&piezoapa_P.Setup_P6_o'; -pt(65).dtname = 'real_T'; - - - - -pt(66).blockname = 'Manual Switch'; -pt(66).paramname = 'CurrentSetting'; -pt(66).class = 'scalar'; -pt(66).nrows = 1; -pt(66).ncols = 1; -pt(66).subsource = 'SS_UINT8'; -pt(66).ndims = '2'; -pt(66).size = '[]'; -pt(66).isStruct = false; -pt(66).symbol = 'piezoapa_P.ManualSwitch_CurrentSetting'; -pt(66).baseaddr = '&piezoapa_P.ManualSwitch_CurrentSetting'; -pt(66).dtname = 'uint8_T'; - - - - -pt(67).blockname = 'Discrete Transfer Fcn'; -pt(67).paramname = 'Numerator'; -pt(67).class = 'vector'; -pt(67).nrows = 1; -pt(67).ncols = 2; -pt(67).subsource = 'SS_DOUBLE'; -pt(67).ndims = '2'; -pt(67).size = '[]'; -pt(67).isStruct = false; -pt(67).symbol = 'piezoapa_P.DiscreteTransferFcn_NumCoef'; -pt(67).baseaddr = '&piezoapa_P.DiscreteTransferFcn_NumCoef[0]'; -pt(67).dtname = 'real_T'; - - - - -pt(68).blockname = 'Discrete Transfer Fcn'; -pt(68).paramname = 'Denominator'; -pt(68).class = 'vector'; -pt(68).nrows = 1; -pt(68).ncols = 2; -pt(68).subsource = 'SS_DOUBLE'; -pt(68).ndims = '2'; -pt(68).size = '[]'; -pt(68).isStruct = false; -pt(68).symbol = 'piezoapa_P.DiscreteTransferFcn_DenCoef'; -pt(68).baseaddr = '&piezoapa_P.DiscreteTransferFcn_DenCoef[0]'; -pt(68).dtname = 'real_T'; - - - - -pt(69).blockname = 'Discrete Transfer Fcn'; -pt(69).paramname = 'InitialStates'; -pt(69).class = 'scalar'; -pt(69).nrows = 1; -pt(69).ncols = 1; -pt(69).subsource = 'SS_DOUBLE'; -pt(69).ndims = '2'; -pt(69).size = '[]'; -pt(69).isStruct = false; -pt(69).symbol = 'piezoapa_P.DiscreteTransferFcn_InitialStat'; -pt(69).baseaddr = '&piezoapa_P.DiscreteTransferFcn_InitialStat'; -pt(69).dtname = 'real_T'; - - -function len = getlenPT -len = 69; - diff --git a/piezoaparef.m b/piezoaparef.m deleted file mode 100644 index a33631d..0000000 --- a/piezoaparef.m +++ /dev/null @@ -1,13 +0,0 @@ -function sys=piezoaparef -sys = []; -sys.child = []; -sys.NumDataTypes = 4; -sys.DataTypes = []; -temp.EnumNames=''; -temp.EnumValues = []; -temp.Name = ''; -sys.DataTypes = repmat(temp,1,4); -sys.DataTypes(1).Name = 'int32_T'; -sys.DataTypes(2).Name = 'real_T'; -sys.DataTypes(3).Name = 'uint32_T'; -sys.DataTypes(4).Name = 'uint8_T'; diff --git a/piezoapari.m b/piezoapari.m deleted file mode 100644 index dbcf593..0000000 --- a/piezoapari.m +++ /dev/null @@ -1,4 +0,0 @@ -function ri = piezoapari - -ri = []; - diff --git a/src/comp_pi_cedrat.m b/src/comp_pi_cedrat.m new file mode 100644 index 0000000..ae90f28 --- /dev/null +++ b/src/comp_pi_cedrat.m @@ -0,0 +1,48 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./mat/'); + +% Results + +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'); + +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); + + + +% We remove the phase delay due to the time delay of the ADC/DAC: + +angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz'))); + +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]); diff --git a/src/effect_change_capacitance.m b/src/effect_change_capacitance.m new file mode 100644 index 0000000..175dbbd --- /dev/null +++ b/src/effect_change_capacitance.m @@ -0,0 +1,112 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./mat/'); + +% Cedrat Technology +% Load Data + +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'); + + + +% Compute Coherence and Transfer functions + +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); + + + +% We remove the phase delay due to the time delay of the ADC/DAC: + +angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz'))); + +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]); + +% PI + +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'); + +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); + + + +% We remove the phase delay due to the time delay of the ADC/DAC: + +angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz'))); + +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]); diff --git a/src/effect_change_voltage.m b/src/effect_change_voltage.m new file mode 100644 index 0000000..33808dd --- /dev/null +++ b/src/effect_change_voltage.m @@ -0,0 +1,95 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./mat/'); + +% Cedrat Technology + +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'); + +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); + + + +% We remove the phase delay due to the time delay of the ADC/DAC: + +angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz'))); + +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]); + +% PI + +hi = load('pi_505_high.mat', 't', 'V_in', 'V_out'); +lo = load('pi_505_low.mat', 't', 'V_in', 'V_out'); + +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); + +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]); diff --git a/src/impedance_meas.m b/src/impedance_meas.m new file mode 100644 index 0000000..cd5c9ad --- /dev/null +++ b/src/impedance_meas.m @@ -0,0 +1,112 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./mat/'); + +% Compute Impedance + +R = 10; % Resistive Load used [Ohm] +V = 0.998; % Output Voltage without any load [V] +Vp = 0.912; % Output Voltage with resistice load [V] + +R * (V - Vp)/Vp; + + + +% #+RESULTS: +% : 0.94298 + + +R = 47; % Resistive Load used [Ohm] +V = 4.960; % Output Voltage without any load [V] +Vp = 4.874; % Output Voltage with resistice load [V] + +R * (V - Vp)/Vp; + +% Effect of Impedance on the phase drop + +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); + +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'))); + +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'); + +% PI + +R = 10; % Resistive Load used [Ohm] +V = 1.059; % Output Voltage without any load [V] +Vp = 0.828; % Output Voltage with resistice load [V] + +R * (V - Vp)/Vp + + + +% #+RESULTS: +% : 2.7899 + + +R = 10; % Resistive Load used [Ohm] +V = 2.092; % Output Voltage without any load [V] +Vp = 1.637; % Output Voltage with resistice load [V] + +R * (V - Vp)/Vp diff --git a/src/pi_e505_filters.m b/src/pi_e505_filters.m new file mode 100644 index 0000000..efb980c --- /dev/null +++ b/src/pi_e505_filters.m @@ -0,0 +1,118 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./mat/'); + +% PI +% Three measurements are done: +% - Slew Rate limitation at maximum +% - Slew Rate limitation at minimum +% - Notch Filter at maximum frequency + + +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'); + +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); + +angle_delay = 180/pi*angle(squeeze(freqresp(exp(-s*Ts), f, 'Hz'))); + +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]); + +% Transfer function of the Voltage Amplifier +% The identified transfer function still seems to match the one of a notch filter at 5kHz. + + +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); + +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]); + +% With Load + +R = 2.78; % Output Impedance [Ohm] +C = 9e-6; % Load capacitance [F] + +G_amp = 10/(1 + s*R*C); + +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]);