diff --git a/.gitmodules b/.gitmodules index 18fb59c..07710cc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "matlab/nass-simscape"] path = matlab/nass-simscape url = https://git.tdehaeze.xyz/tdehaeze/nass-simscape +[submodule "matlab/vibration-table"] + path = matlab/vibration-table + url = https://git.tdehaeze.xyz/tdehaeze/vibration-table diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..3ee3141 --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,98 @@ +#!/bin/env perl + +# Shebang is only to get syntax highlighting right across GitLab, GitHub and IDEs. +# This file is not meant to be run, but read by `latexmk`. + +# ====================================================================================== +# Perl `latexmk` configuration file +# ====================================================================================== + +# ====================================================================================== +# PDF Generation/Building/Compilation +# ====================================================================================== + +@default_files=('test-bench-nano-hexapod.tex'); + +# PDF-generating modes are: +# 1: pdflatex, as specified by $pdflatex variable (still largely in use) +# 2: postscript conversion, as specified by the $ps2pdf variable (useless) +# 3: dvi conversion, as specified by the $dvipdf variable (useless) +# 4: lualatex, as specified by the $lualatex variable (best) +# 5: xelatex, as specified by the $xelatex variable (second best) +$pdf_mode = 1; + +# Treat undefined references and citations as well as multiply defined references as +# ERRORS instead of WARNINGS. +# This is only checked in the *last* run, since naturally, there are undefined references +# in initial runs. +# This setting is potentially annoying when debugging/editing, but highly desirable +# in the CI pipeline, where such a warning should result in a failed pipeline, since the +# final document is incomplete/corrupted. +# +# However, I could not eradicate all warnings, so that `latexmk` currently fails with +# this option enabled. +# Specifically, `microtype` fails together with `fontawesome`/`fontawesome5`, see: +# https://tex.stackexchange.com/a/547514/120853 +# The fix in that answer did not help. +# Setting `verbose=silent` to mute `microtype` warnings did not work. +# Switching between `fontawesome` and `fontawesome5` did not help. +$warnings_as_errors = 0; + +# Show used CPU time. Looks like: https://tex.stackexchange.com/a/312224/120853 +$show_time = 1; + +# Default is 5; we seem to need more owed to the complexity of the document. +# Actual documents probably don't need this many since they won't use all features, +# plus won't be compiling from cold each time. +$max_repeat=7; + +# --shell-escape option (execution of code outside of latex) is required for the +#'svg' package. +# It converts raw SVG files to the PDF+PDF_TEX combo using InkScape. +# +# SyncTeX allows to jump between source (code) and output (PDF) in IDEs with support +# (many have it). A value of `1` is enabled (gzipped), `-1` is enabled but uncompressed, +# `0` is off. +# Testing in VSCode w/ LaTeX Workshop only worked for the compressed version. +# Adjust this as needed. Of course, only relevant for local use, no effect on a remote +# CI pipeline (except for slower compilation, probably). +# +# %O and %S will forward Options and the Source file, respectively, given to latexmk. +# +# `set_tex_cmds` applies to all *latex commands (latex, xelatex, lualatex, ...), so +# no need to specify these each. This allows to simply change `$pdf_mode` to get a +# different engine. Check if this works with `latexmk --commands`. +set_tex_cmds("--shell-escape -interaction=nonstopmode --synctex=1 %O %S"); + +# Use default pdf viewer +$pdf_previewer = 'zathura'; + +# option 2 is same as 1 (run biber when necessary), but also deletes the +# regeneratable bbl-file in a clenaup (`latexmk -c`). Do not use if original +# bib file is not available! +$bibtex_use = 2; # default: 1 + +# Change default `biber` call, help catch errors faster/clearer. See +# https://web.archive.org/web/20200526101657/https://www.semipol.de/2018/06/12/latex-best-practices.html#database-entries +$biber = "biber --validate-datamodel %O %S"; + +# ====================================================================================== +# Auxiliary Files +# ====================================================================================== + +# Let latexmk know about generated files, so they can be used to detect if a +# rerun is required, or be deleted in a cleanup. +# loe: List of Examples (KOMAScript) +# lol: List of Listings (`listings` and `minted` packages) +# run.xml: biber runs +# glg: glossaries log +# glstex: generated from glossaries-extra +push @generated_exts, 'loe', 'lol', 'run.xml', 'glg', 'glstex'; + +# Also delete the *.glstex files from package glossaries-extra. Problem is, +# that that package generates files of the form "basename-digit.glstex" if +# multiple glossaries are present. Latexmk looks for "basename.glstex" and so +# does not find those. For that purpose, use wildcard. +# Also delete files generated by gnuplot/pgfplots contour plots +# (.dat, .script, .table). +$clean_ext = "%R-*.glstex %R_contourtmp*.*"; diff --git a/doc/PD200-V7-R1.pdf b/doc/PD200-V7-R1.pdf new file mode 100644 index 0000000..9fd00fe Binary files /dev/null and b/doc/PD200-V7-R1.pdf differ diff --git a/figs/bode_plot_hac_iff_loop_gain_diag_inverse.pdf b/figs/bode_plot_hac_iff_loop_gain_diag_inverse.pdf new file mode 100644 index 0000000..1f796fb Binary files /dev/null and b/figs/bode_plot_hac_iff_loop_gain_diag_inverse.pdf differ diff --git a/figs/bode_plot_hac_iff_loop_gain_diag_inverse.png b/figs/bode_plot_hac_iff_loop_gain_diag_inverse.png new file mode 100644 index 0000000..f8d999b Binary files /dev/null and b/figs/bode_plot_hac_iff_loop_gain_diag_inverse.png differ diff --git a/figs/bode_plot_hac_iff_loop_gain_jacobian_cok.pdf b/figs/bode_plot_hac_iff_loop_gain_jacobian_cok.pdf new file mode 100644 index 0000000..0d129ca Binary files /dev/null and b/figs/bode_plot_hac_iff_loop_gain_jacobian_cok.pdf differ diff --git a/figs/bode_plot_hac_iff_loop_gain_jacobian_cok.png b/figs/bode_plot_hac_iff_loop_gain_jacobian_cok.png new file mode 100644 index 0000000..5bb1e0a Binary files /dev/null and b/figs/bode_plot_hac_iff_loop_gain_jacobian_cok.png differ diff --git a/figs/bode_plot_hac_iff_loop_gain_svd.pdf b/figs/bode_plot_hac_iff_loop_gain_svd.pdf new file mode 100644 index 0000000..f380280 Binary files /dev/null and b/figs/bode_plot_hac_iff_loop_gain_svd.pdf differ diff --git a/figs/bode_plot_hac_iff_loop_gain_svd.png b/figs/bode_plot_hac_iff_loop_gain_svd.png new file mode 100644 index 0000000..d40350b Binary files /dev/null and b/figs/bode_plot_hac_iff_loop_gain_svd.png differ diff --git a/figs/bode_plot_hac_iff_plant_jacobian_cok.pdf b/figs/bode_plot_hac_iff_plant_jacobian_cok.pdf new file mode 100644 index 0000000..2d4f25d Binary files /dev/null and b/figs/bode_plot_hac_iff_plant_jacobian_cok.pdf differ diff --git a/figs/bode_plot_hac_iff_plant_jacobian_cok.png b/figs/bode_plot_hac_iff_plant_jacobian_cok.png new file mode 100644 index 0000000..6e63dd8 Binary files /dev/null and b/figs/bode_plot_hac_iff_plant_jacobian_cok.png differ diff --git a/figs/bode_plot_hac_iff_plant_svd.pdf b/figs/bode_plot_hac_iff_plant_svd.pdf new file mode 100644 index 0000000..87bda2c Binary files /dev/null and b/figs/bode_plot_hac_iff_plant_svd.pdf differ diff --git a/figs/bode_plot_hac_iff_plant_svd.png b/figs/bode_plot_hac_iff_plant_svd.png new file mode 100644 index 0000000..bd31b62 Binary files /dev/null and b/figs/bode_plot_hac_iff_plant_svd.png differ diff --git a/figs/comp_iff_plant_frf_sim.pdf b/figs/comp_iff_plant_frf_sim.pdf new file mode 100644 index 0000000..282b7a6 Binary files /dev/null and b/figs/comp_iff_plant_frf_sim.pdf differ diff --git a/figs/comp_iff_plant_frf_sim.png b/figs/comp_iff_plant_frf_sim.png new file mode 100644 index 0000000..6460a40 Binary files /dev/null and b/figs/comp_iff_plant_frf_sim.png differ diff --git a/figs/comp_masses_model_exp_dvf.pdf b/figs/comp_masses_model_exp_dvf.pdf new file mode 100644 index 0000000..8beb46d Binary files /dev/null and b/figs/comp_masses_model_exp_dvf.pdf differ diff --git a/figs/comp_masses_model_exp_dvf.png b/figs/comp_masses_model_exp_dvf.png new file mode 100644 index 0000000..7ad2355 Binary files /dev/null and b/figs/comp_masses_model_exp_dvf.png differ diff --git a/figs/comp_masses_model_exp_dvf_zoom.pdf b/figs/comp_masses_model_exp_dvf_zoom.pdf new file mode 100644 index 0000000..ce2d34b Binary files /dev/null and b/figs/comp_masses_model_exp_dvf_zoom.pdf differ diff --git a/figs/comp_masses_model_exp_dvf_zoom.png b/figs/comp_masses_model_exp_dvf_zoom.png new file mode 100644 index 0000000..55a30a5 Binary files /dev/null and b/figs/comp_masses_model_exp_dvf_zoom.png differ diff --git a/figs/comp_masses_model_exp_iff.pdf b/figs/comp_masses_model_exp_iff.pdf new file mode 100644 index 0000000..ee18f8f Binary files /dev/null and b/figs/comp_masses_model_exp_iff.pdf differ diff --git a/figs/comp_masses_model_exp_iff.png b/figs/comp_masses_model_exp_iff.png new file mode 100644 index 0000000..ff9b3d6 Binary files /dev/null and b/figs/comp_masses_model_exp_iff.png differ diff --git a/figs/comp_masses_model_exp_iff_zoom.pdf b/figs/comp_masses_model_exp_iff_zoom.pdf new file mode 100644 index 0000000..b986289 Binary files /dev/null and b/figs/comp_masses_model_exp_iff_zoom.pdf differ diff --git a/figs/comp_masses_model_exp_iff_zoom.png b/figs/comp_masses_model_exp_iff_zoom.png new file mode 100644 index 0000000..2c262fb Binary files /dev/null and b/figs/comp_masses_model_exp_iff_zoom.png differ diff --git a/figs/comp_plant_coupling_payloads_dvf.pdf b/figs/comp_plant_coupling_payloads_dvf.pdf new file mode 100644 index 0000000..fb5cfd6 Binary files /dev/null and b/figs/comp_plant_coupling_payloads_dvf.pdf differ diff --git a/figs/comp_plant_coupling_payloads_dvf.png b/figs/comp_plant_coupling_payloads_dvf.png new file mode 100644 index 0000000..ab1bdf8 Binary files /dev/null and b/figs/comp_plant_coupling_payloads_dvf.png differ diff --git a/figs/comp_plant_coupling_payloads_iff.pdf b/figs/comp_plant_coupling_payloads_iff.pdf new file mode 100644 index 0000000..ebb47f5 Binary files /dev/null and b/figs/comp_plant_coupling_payloads_iff.pdf differ diff --git a/figs/comp_plant_coupling_payloads_iff.png b/figs/comp_plant_coupling_payloads_iff.png new file mode 100644 index 0000000..7c2e55e Binary files /dev/null and b/figs/comp_plant_coupling_payloads_iff.png differ diff --git a/figs/comp_plant_payloads_dvf.pdf b/figs/comp_plant_payloads_dvf.pdf new file mode 100644 index 0000000..cfa5024 Binary files /dev/null and b/figs/comp_plant_payloads_dvf.pdf differ diff --git a/figs/comp_plant_payloads_dvf.png b/figs/comp_plant_payloads_dvf.png new file mode 100644 index 0000000..68ff04d Binary files /dev/null and b/figs/comp_plant_payloads_dvf.png differ diff --git a/figs/comp_plant_payloads_iff.pdf b/figs/comp_plant_payloads_iff.pdf new file mode 100644 index 0000000..b82f554 Binary files /dev/null and b/figs/comp_plant_payloads_iff.pdf differ diff --git a/figs/comp_plant_payloads_iff.png b/figs/comp_plant_payloads_iff.png new file mode 100644 index 0000000..2a8c63c Binary files /dev/null and b/figs/comp_plant_payloads_iff.png differ diff --git a/figs/comp_undamped_damped_plant_meas_frf.pdf b/figs/comp_undamped_damped_plant_meas_frf.pdf new file mode 100644 index 0000000..ccd2333 Binary files /dev/null and b/figs/comp_undamped_damped_plant_meas_frf.pdf differ diff --git a/figs/comp_undamped_damped_plant_meas_frf.png b/figs/comp_undamped_damped_plant_meas_frf.png new file mode 100644 index 0000000..723a27d Binary files /dev/null and b/figs/comp_undamped_damped_plant_meas_frf.png differ diff --git a/figs/control_architecture_hac_iff_struts.pdf b/figs/control_architecture_hac_iff_struts.pdf index c2d0ea8..c7b2c2e 100644 Binary files a/figs/control_architecture_hac_iff_struts.pdf and b/figs/control_architecture_hac_iff_struts.pdf differ diff --git a/figs/control_architecture_hac_iff_struts.png b/figs/control_architecture_hac_iff_struts.png index 0c98af7..47407a6 100644 Binary files a/figs/control_architecture_hac_iff_struts.png and b/figs/control_architecture_hac_iff_struts.png differ diff --git a/figs/control_architecture_hac_iff_struts.svg b/figs/control_architecture_hac_iff_struts.svg index 1e189ff..37fac3c 100644 Binary files a/figs/control_architecture_hac_iff_struts.svg and b/figs/control_architecture_hac_iff_struts.svg differ diff --git a/figs/control_architecture_hac_iff_struts_L.pdf b/figs/control_architecture_hac_iff_struts_L.pdf new file mode 100644 index 0000000..cd56f09 Binary files /dev/null and b/figs/control_architecture_hac_iff_struts_L.pdf differ diff --git a/figs/control_architecture_hac_iff_struts_L.png b/figs/control_architecture_hac_iff_struts_L.png new file mode 100644 index 0000000..75f6a73 Binary files /dev/null and b/figs/control_architecture_hac_iff_struts_L.png differ diff --git a/figs/control_architecture_hac_iff_struts_L.svg b/figs/control_architecture_hac_iff_struts_L.svg new file mode 100644 index 0000000..8b440d7 Binary files /dev/null and b/figs/control_architecture_hac_iff_struts_L.svg differ diff --git a/figs/damped_iff_plant_meas_frf.pdf b/figs/damped_iff_plant_meas_frf.pdf new file mode 100644 index 0000000..fc7302d Binary files /dev/null and b/figs/damped_iff_plant_meas_frf.pdf differ diff --git a/figs/damped_iff_plant_meas_frf.png b/figs/damped_iff_plant_meas_frf.png new file mode 100644 index 0000000..96f31d1 Binary files /dev/null and b/figs/damped_iff_plant_meas_frf.png differ diff --git a/figs/damped_plant_model_masses.pdf b/figs/damped_plant_model_masses.pdf new file mode 100644 index 0000000..644012b Binary files /dev/null and b/figs/damped_plant_model_masses.pdf differ diff --git a/figs/damped_plant_model_masses.png b/figs/damped_plant_model_masses.png new file mode 100644 index 0000000..8944b0c Binary files /dev/null and b/figs/damped_plant_model_masses.png differ diff --git a/figs/decoupling_arch_crossover.pdf b/figs/decoupling_arch_crossover.pdf new file mode 100644 index 0000000..32c5594 Binary files /dev/null and b/figs/decoupling_arch_crossover.pdf differ diff --git a/figs/decoupling_arch_crossover.png b/figs/decoupling_arch_crossover.png new file mode 100644 index 0000000..a5d7eca Binary files /dev/null and b/figs/decoupling_arch_crossover.png differ diff --git a/figs/decoupling_arch_crossover.svg b/figs/decoupling_arch_crossover.svg new file mode 100644 index 0000000..5e538b5 Binary files /dev/null and b/figs/decoupling_arch_crossover.svg differ diff --git a/figs/decoupling_arch_decentralized.pdf b/figs/decoupling_arch_decentralized.pdf new file mode 100644 index 0000000..b73f3b9 Binary files /dev/null and b/figs/decoupling_arch_decentralized.pdf differ diff --git a/figs/decoupling_arch_decentralized.png b/figs/decoupling_arch_decentralized.png new file mode 100644 index 0000000..2221488 Binary files /dev/null and b/figs/decoupling_arch_decentralized.png differ diff --git a/figs/decoupling_arch_decentralized.svg b/figs/decoupling_arch_decentralized.svg new file mode 100644 index 0000000..6a4bf60 Binary files /dev/null and b/figs/decoupling_arch_decentralized.svg differ diff --git a/figs/decoupling_arch_dynamic.png b/figs/decoupling_arch_dynamic.png new file mode 100644 index 0000000..997a147 Binary files /dev/null and b/figs/decoupling_arch_dynamic.png differ diff --git a/figs/decoupling_arch_dynamic.svg b/figs/decoupling_arch_dynamic.svg new file mode 100644 index 0000000..a4cd1ee Binary files /dev/null and b/figs/decoupling_arch_dynamic.svg differ diff --git a/figs/decoupling_arch_jacobian_cok.pdf b/figs/decoupling_arch_jacobian_cok.pdf new file mode 100644 index 0000000..d6d1cad Binary files /dev/null and b/figs/decoupling_arch_jacobian_cok.pdf differ diff --git a/figs/decoupling_arch_jacobian_cok.png b/figs/decoupling_arch_jacobian_cok.png new file mode 100644 index 0000000..3e258db Binary files /dev/null and b/figs/decoupling_arch_jacobian_cok.png differ diff --git a/figs/decoupling_arch_jacobian_cok.svg b/figs/decoupling_arch_jacobian_cok.svg new file mode 100644 index 0000000..0bb78f8 Binary files /dev/null and b/figs/decoupling_arch_jacobian_cok.svg differ diff --git a/figs/decoupling_arch_jacobian_com.pdf b/figs/decoupling_arch_jacobian_com.pdf new file mode 100644 index 0000000..e439408 Binary files /dev/null and b/figs/decoupling_arch_jacobian_com.pdf differ diff --git a/figs/decoupling_arch_jacobian_com.png b/figs/decoupling_arch_jacobian_com.png new file mode 100644 index 0000000..f8565a9 Binary files /dev/null and b/figs/decoupling_arch_jacobian_com.png differ diff --git a/figs/decoupling_arch_jacobian_com.svg b/figs/decoupling_arch_jacobian_com.svg new file mode 100644 index 0000000..fcd2642 Binary files /dev/null and b/figs/decoupling_arch_jacobian_com.svg differ diff --git a/figs/decoupling_arch_static.pdf b/figs/decoupling_arch_static.pdf new file mode 100644 index 0000000..ddf996f Binary files /dev/null and b/figs/decoupling_arch_static.pdf differ diff --git a/figs/decoupling_arch_static.png b/figs/decoupling_arch_static.png new file mode 100644 index 0000000..0109d9e Binary files /dev/null and b/figs/decoupling_arch_static.png differ diff --git a/figs/decoupling_arch_static.svg b/figs/decoupling_arch_static.svg new file mode 100644 index 0000000..580eccb Binary files /dev/null and b/figs/decoupling_arch_static.svg differ diff --git a/figs/decoupling_arch_svd.pdf b/figs/decoupling_arch_svd.pdf new file mode 100644 index 0000000..2b592ee Binary files /dev/null and b/figs/decoupling_arch_svd.pdf differ diff --git a/figs/decoupling_arch_svd.png b/figs/decoupling_arch_svd.png new file mode 100644 index 0000000..05acf51 Binary files /dev/null and b/figs/decoupling_arch_svd.png differ diff --git a/figs/decoupling_arch_svd.svg b/figs/decoupling_arch_svd.svg new file mode 100644 index 0000000..e70b154 Binary files /dev/null and b/figs/decoupling_arch_svd.svg differ diff --git a/figs/frf_damp_unbalanced_mass.pdf b/figs/frf_damp_unbalanced_mass.pdf new file mode 100644 index 0000000..4be8c7e Binary files /dev/null and b/figs/frf_damp_unbalanced_mass.pdf differ diff --git a/figs/frf_damp_unbalanced_mass.png b/figs/frf_damp_unbalanced_mass.png new file mode 100644 index 0000000..4b832c1 Binary files /dev/null and b/figs/frf_damp_unbalanced_mass.png differ diff --git a/figs/hac_iff_plates_exp_loop_gain_redesigned_K.pdf b/figs/hac_iff_plates_exp_loop_gain_redesigned_K.pdf index 14f535b..2c20f69 100644 Binary files a/figs/hac_iff_plates_exp_loop_gain_redesigned_K.pdf and b/figs/hac_iff_plates_exp_loop_gain_redesigned_K.pdf differ diff --git a/figs/hac_iff_plates_exp_loop_gain_redesigned_K.png b/figs/hac_iff_plates_exp_loop_gain_redesigned_K.png index 137b4d7..69bf442 100644 Binary files a/figs/hac_iff_plates_exp_loop_gain_redesigned_K.png and b/figs/hac_iff_plates_exp_loop_gain_redesigned_K.png differ diff --git a/figs/iff_loop_gain_masses.pdf b/figs/iff_loop_gain_masses.pdf new file mode 100644 index 0000000..58649b4 Binary files /dev/null and b/figs/iff_loop_gain_masses.pdf differ diff --git a/figs/iff_loop_gain_masses.png b/figs/iff_loop_gain_masses.png new file mode 100644 index 0000000..d79d9ef Binary files /dev/null and b/figs/iff_loop_gain_masses.png differ diff --git a/figs/iff_root_locus_masses.pdf b/figs/iff_root_locus_masses.pdf new file mode 100644 index 0000000..301f8e4 Binary files /dev/null and b/figs/iff_root_locus_masses.pdf differ diff --git a/figs/iff_root_locus_masses.png b/figs/iff_root_locus_masses.png new file mode 100644 index 0000000..30639f9 Binary files /dev/null and b/figs/iff_root_locus_masses.png differ diff --git a/figs/interaction_J_cok_plant.pdf b/figs/interaction_J_cok_plant.pdf new file mode 100644 index 0000000..935b450 Binary files /dev/null and b/figs/interaction_J_cok_plant.pdf differ diff --git a/figs/interaction_J_cok_plant.png b/figs/interaction_J_cok_plant.png new file mode 100644 index 0000000..79e0da2 Binary files /dev/null and b/figs/interaction_J_cok_plant.png differ diff --git a/figs/interaction_J_com_plant.pdf b/figs/interaction_J_com_plant.pdf new file mode 100644 index 0000000..1aca7d2 Binary files /dev/null and b/figs/interaction_J_com_plant.pdf differ diff --git a/figs/interaction_J_com_plant.png b/figs/interaction_J_com_plant.png new file mode 100644 index 0000000..4a18a4c Binary files /dev/null and b/figs/interaction_J_com_plant.png differ diff --git a/figs/interaction_compare_rga_numbers.pdf b/figs/interaction_compare_rga_numbers.pdf new file mode 100644 index 0000000..7ffc255 Binary files /dev/null and b/figs/interaction_compare_rga_numbers.pdf differ diff --git a/figs/interaction_compare_rga_numbers.png b/figs/interaction_compare_rga_numbers.png new file mode 100644 index 0000000..b946f78 Binary files /dev/null and b/figs/interaction_compare_rga_numbers.png differ diff --git a/figs/interaction_compare_rga_numbers_rob.pdf b/figs/interaction_compare_rga_numbers_rob.pdf new file mode 100644 index 0000000..0e22cbd Binary files /dev/null and b/figs/interaction_compare_rga_numbers_rob.pdf differ diff --git a/figs/interaction_compare_rga_numbers_rob.png b/figs/interaction_compare_rga_numbers_rob.png new file mode 100644 index 0000000..f4bb3e6 Binary files /dev/null and b/figs/interaction_compare_rga_numbers_rob.png differ diff --git a/figs/interaction_decentralized_plant.pdf b/figs/interaction_decentralized_plant.pdf new file mode 100644 index 0000000..02f323f Binary files /dev/null and b/figs/interaction_decentralized_plant.pdf differ diff --git a/figs/interaction_decentralized_plant.png b/figs/interaction_decentralized_plant.png new file mode 100644 index 0000000..afcf7a5 Binary files /dev/null and b/figs/interaction_decentralized_plant.png differ diff --git a/figs/interaction_dynamic_dec_plant.pdf b/figs/interaction_dynamic_dec_plant.pdf new file mode 100644 index 0000000..3fd7c85 Binary files /dev/null and b/figs/interaction_dynamic_dec_plant.pdf differ diff --git a/figs/interaction_dynamic_dec_plant.png b/figs/interaction_dynamic_dec_plant.png new file mode 100644 index 0000000..a464202 Binary files /dev/null and b/figs/interaction_dynamic_dec_plant.png differ diff --git a/figs/interaction_rga_J_cok.pdf b/figs/interaction_rga_J_cok.pdf new file mode 100644 index 0000000..046fa21 Binary files /dev/null and b/figs/interaction_rga_J_cok.pdf differ diff --git a/figs/interaction_rga_J_cok.png b/figs/interaction_rga_J_cok.png new file mode 100644 index 0000000..9789045 Binary files /dev/null and b/figs/interaction_rga_J_cok.png differ diff --git a/figs/interaction_rga_J_com.pdf b/figs/interaction_rga_J_com.pdf new file mode 100644 index 0000000..4232e1f Binary files /dev/null and b/figs/interaction_rga_J_com.pdf differ diff --git a/figs/interaction_rga_J_com.png b/figs/interaction_rga_J_com.png new file mode 100644 index 0000000..9e6148c Binary files /dev/null and b/figs/interaction_rga_J_com.png differ diff --git a/figs/interaction_rga_decentralized.pdf b/figs/interaction_rga_decentralized.pdf new file mode 100644 index 0000000..7d3e934 Binary files /dev/null and b/figs/interaction_rga_decentralized.pdf differ diff --git a/figs/interaction_rga_decentralized.png b/figs/interaction_rga_decentralized.png new file mode 100644 index 0000000..85bd4c9 Binary files /dev/null and b/figs/interaction_rga_decentralized.png differ diff --git a/figs/interaction_rga_dynamic_dec.pdf b/figs/interaction_rga_dynamic_dec.pdf new file mode 100644 index 0000000..0d56ee8 Binary files /dev/null and b/figs/interaction_rga_dynamic_dec.pdf differ diff --git a/figs/interaction_rga_dynamic_dec.png b/figs/interaction_rga_dynamic_dec.png new file mode 100644 index 0000000..6b1c21e Binary files /dev/null and b/figs/interaction_rga_dynamic_dec.png differ diff --git a/figs/interaction_rga_static_dec.pdf b/figs/interaction_rga_static_dec.pdf new file mode 100644 index 0000000..a405cbd Binary files /dev/null and b/figs/interaction_rga_static_dec.pdf differ diff --git a/figs/interaction_rga_static_dec.png b/figs/interaction_rga_static_dec.png new file mode 100644 index 0000000..0aa8288 Binary files /dev/null and b/figs/interaction_rga_static_dec.png differ diff --git a/figs/interaction_rga_svd.pdf b/figs/interaction_rga_svd.pdf new file mode 100644 index 0000000..1f296b1 Binary files /dev/null and b/figs/interaction_rga_svd.pdf differ diff --git a/figs/interaction_rga_svd.png b/figs/interaction_rga_svd.png new file mode 100644 index 0000000..6582310 Binary files /dev/null and b/figs/interaction_rga_svd.png differ diff --git a/figs/interaction_rga_wc.pdf b/figs/interaction_rga_wc.pdf new file mode 100644 index 0000000..d0cb161 Binary files /dev/null and b/figs/interaction_rga_wc.pdf differ diff --git a/figs/interaction_rga_wc.png b/figs/interaction_rga_wc.png new file mode 100644 index 0000000..4728a1c Binary files /dev/null and b/figs/interaction_rga_wc.png differ diff --git a/figs/interaction_static_dec_plant.pdf b/figs/interaction_static_dec_plant.pdf new file mode 100644 index 0000000..68b1c7b Binary files /dev/null and b/figs/interaction_static_dec_plant.pdf differ diff --git a/figs/interaction_static_dec_plant.png b/figs/interaction_static_dec_plant.png new file mode 100644 index 0000000..6554005 Binary files /dev/null and b/figs/interaction_static_dec_plant.png differ diff --git a/figs/interaction_svd_plant.pdf b/figs/interaction_svd_plant.pdf new file mode 100644 index 0000000..6f0734f Binary files /dev/null and b/figs/interaction_svd_plant.pdf differ diff --git a/figs/interaction_svd_plant.png b/figs/interaction_svd_plant.png new file mode 100644 index 0000000..f6d740c Binary files /dev/null and b/figs/interaction_svd_plant.png differ diff --git a/figs/interaction_wc_plant.pdf b/figs/interaction_wc_plant.pdf new file mode 100644 index 0000000..9fde506 Binary files /dev/null and b/figs/interaction_wc_plant.pdf differ diff --git a/figs/interaction_wc_plant.png b/figs/interaction_wc_plant.png new file mode 100644 index 0000000..88a83ce Binary files /dev/null and b/figs/interaction_wc_plant.png differ diff --git a/figs/loci_hac_iff_loop_gain_diag_inverse.pdf b/figs/loci_hac_iff_loop_gain_diag_inverse.pdf new file mode 100644 index 0000000..5140824 Binary files /dev/null and b/figs/loci_hac_iff_loop_gain_diag_inverse.pdf differ diff --git a/figs/loci_hac_iff_loop_gain_diag_inverse.png b/figs/loci_hac_iff_loop_gain_diag_inverse.png new file mode 100644 index 0000000..d5a54b4 Binary files /dev/null and b/figs/loci_hac_iff_loop_gain_diag_inverse.png differ diff --git a/figs/loci_hac_iff_loop_gain_jacobian_cok.pdf b/figs/loci_hac_iff_loop_gain_jacobian_cok.pdf new file mode 100644 index 0000000..ae73137 Binary files /dev/null and b/figs/loci_hac_iff_loop_gain_jacobian_cok.pdf differ diff --git a/figs/loci_hac_iff_loop_gain_jacobian_cok.png b/figs/loci_hac_iff_loop_gain_jacobian_cok.png new file mode 100644 index 0000000..6a0c2f1 Binary files /dev/null and b/figs/loci_hac_iff_loop_gain_jacobian_cok.png differ diff --git a/figs/loci_hac_iff_loop_gain_svd.pdf b/figs/loci_hac_iff_loop_gain_svd.pdf new file mode 100644 index 0000000..7ed30b5 Binary files /dev/null and b/figs/loci_hac_iff_loop_gain_svd.pdf differ diff --git a/figs/loci_hac_iff_loop_gain_svd.png b/figs/loci_hac_iff_loop_gain_svd.png new file mode 100644 index 0000000..b813d1c Binary files /dev/null and b/figs/loci_hac_iff_loop_gain_svd.png differ diff --git a/figs/loop_gain_hac_iff_struts.pdf b/figs/loop_gain_hac_iff_struts.pdf index b8d87e4..a223e21 100644 Binary files a/figs/loop_gain_hac_iff_struts.pdf and b/figs/loop_gain_hac_iff_struts.pdf differ diff --git a/figs/loop_gain_hac_iff_struts.png b/figs/loop_gain_hac_iff_struts.png index 32e3022..222d70c 100644 Binary files a/figs/loop_gain_hac_iff_struts.png and b/figs/loop_gain_hac_iff_struts.png differ diff --git a/figs/nano_hexapod_damped_bode_plot.pdf b/figs/nano_hexapod_damped_bode_plot.pdf new file mode 100644 index 0000000..83ebf41 Binary files /dev/null and b/figs/nano_hexapod_damped_bode_plot.pdf differ diff --git a/figs/nano_hexapod_damped_bode_plot.png b/figs/nano_hexapod_damped_bode_plot.png new file mode 100644 index 0000000..32f2b29 Binary files /dev/null and b/figs/nano_hexapod_damped_bode_plot.png differ diff --git a/figs/nano_hexapod_enc_bode_plot.pdf b/figs/nano_hexapod_enc_bode_plot.pdf new file mode 100644 index 0000000..c09316c Binary files /dev/null and b/figs/nano_hexapod_enc_bode_plot.pdf differ diff --git a/figs/nano_hexapod_enc_bode_plot.png b/figs/nano_hexapod_enc_bode_plot.png new file mode 100644 index 0000000..a9b5821 Binary files /dev/null and b/figs/nano_hexapod_enc_bode_plot.png differ diff --git a/figs/nano_hexapod_identification_comp_simscape.pdf b/figs/nano_hexapod_identification_comp_simscape.pdf new file mode 100644 index 0000000..495a569 Binary files /dev/null and b/figs/nano_hexapod_identification_comp_simscape.pdf differ diff --git a/figs/nano_hexapod_identification_comp_simscape.png b/figs/nano_hexapod_identification_comp_simscape.png new file mode 100644 index 0000000..7411e57 Binary files /dev/null and b/figs/nano_hexapod_identification_comp_simscape.png differ diff --git a/figs/nano_hexapod_identification_comp_simscape_full.pdf b/figs/nano_hexapod_identification_comp_simscape_full.pdf new file mode 100644 index 0000000..003f46d Binary files /dev/null and b/figs/nano_hexapod_identification_comp_simscape_full.pdf differ diff --git a/figs/nano_hexapod_identification_comp_simscape_full.png b/figs/nano_hexapod_identification_comp_simscape_full.png new file mode 100644 index 0000000..f71c070 Binary files /dev/null and b/figs/nano_hexapod_identification_comp_simscape_full.png differ diff --git a/figs/nano_hexapod_identification_damp_comp_simscape.pdf b/figs/nano_hexapod_identification_damp_comp_simscape.pdf new file mode 100644 index 0000000..ca696e8 Binary files /dev/null and b/figs/nano_hexapod_identification_damp_comp_simscape.pdf differ diff --git a/figs/nano_hexapod_identification_damp_comp_simscape.png b/figs/nano_hexapod_identification_damp_comp_simscape.png new file mode 100644 index 0000000..76b8f64 Binary files /dev/null and b/figs/nano_hexapod_identification_damp_comp_simscape.png differ diff --git a/figs/nano_hexapod_identification_damp_comp_simscape_both.pdf b/figs/nano_hexapod_identification_damp_comp_simscape_both.pdf new file mode 100644 index 0000000..f10a77a Binary files /dev/null and b/figs/nano_hexapod_identification_damp_comp_simscape_both.pdf differ diff --git a/figs/nano_hexapod_identification_damp_comp_simscape_both.png b/figs/nano_hexapod_identification_damp_comp_simscape_both.png new file mode 100644 index 0000000..ff2e8a0 Binary files /dev/null and b/figs/nano_hexapod_identification_damp_comp_simscape_both.png differ diff --git a/figs/nano_hexapod_iff_bode_plot.pdf b/figs/nano_hexapod_iff_bode_plot.pdf new file mode 100644 index 0000000..5ab7732 Binary files /dev/null and b/figs/nano_hexapod_iff_bode_plot.pdf differ diff --git a/figs/nano_hexapod_iff_bode_plot.png b/figs/nano_hexapod_iff_bode_plot.png new file mode 100644 index 0000000..83e5ab1 Binary files /dev/null and b/figs/nano_hexapod_iff_bode_plot.png differ diff --git a/figs/nano_hexapod_signals_hac_iff.pdf b/figs/nano_hexapod_signals_hac_iff.pdf new file mode 100644 index 0000000..4fa39b0 Binary files /dev/null and b/figs/nano_hexapod_signals_hac_iff.pdf differ diff --git a/figs/nano_hexapod_signals_hac_iff.png b/figs/nano_hexapod_signals_hac_iff.png new file mode 100644 index 0000000..ed18047 Binary files /dev/null and b/figs/nano_hexapod_signals_hac_iff.png differ diff --git a/figs/nano_hexapod_signals_hac_iff.svg b/figs/nano_hexapod_signals_hac_iff.svg new file mode 100644 index 0000000..3802238 Binary files /dev/null and b/figs/nano_hexapod_signals_hac_iff.svg differ diff --git a/figs/nano_hexapod_signals_iff.pdf b/figs/nano_hexapod_signals_iff.pdf new file mode 100644 index 0000000..7c1b7c9 Binary files /dev/null and b/figs/nano_hexapod_signals_iff.pdf differ diff --git a/figs/nano_hexapod_signals_iff.png b/figs/nano_hexapod_signals_iff.png new file mode 100644 index 0000000..ed18047 Binary files /dev/null and b/figs/nano_hexapod_signals_iff.png differ diff --git a/figs/nano_hexapod_signals_iff.svg b/figs/nano_hexapod_signals_iff.svg new file mode 100644 index 0000000..3802238 Binary files /dev/null and b/figs/nano_hexapod_signals_iff.svg differ diff --git a/figs/nass_ref_rx_ry.pdf b/figs/nass_ref_rx_ry.pdf new file mode 100644 index 0000000..9608178 Binary files /dev/null and b/figs/nass_ref_rx_ry.pdf differ diff --git a/figs/nass_ref_rx_ry.png b/figs/nass_ref_rx_ry.png new file mode 100644 index 0000000..22f08a8 Binary files /dev/null and b/figs/nass_ref_rx_ry.png differ diff --git a/figs/nass_ref_xy_plane.pdf b/figs/nass_ref_xy_plane.pdf new file mode 100644 index 0000000..70a10bd Binary files /dev/null and b/figs/nass_ref_xy_plane.pdf differ diff --git a/figs/nass_ref_xy_plane.png b/figs/nass_ref_xy_plane.png new file mode 100644 index 0000000..2eb1058 Binary files /dev/null and b/figs/nass_ref_xy_plane.png differ diff --git a/figs/nass_scan_conclusion_slide.svg b/figs/nass_scan_conclusion_slide.svg new file mode 100644 index 0000000..aa09710 Binary files /dev/null and b/figs/nass_scan_conclusion_slide.svg differ diff --git a/figs/nass_scans_first_test_exp.pdf b/figs/nass_scans_first_test_exp.pdf index 03b96da..a1e921c 100644 Binary files a/figs/nass_scans_first_test_exp.pdf and b/figs/nass_scans_first_test_exp.pdf differ diff --git a/figs/nass_scans_first_test_exp.png b/figs/nass_scans_first_test_exp.png index a471a1c..6cd3eac 100644 Binary files a/figs/nass_scans_first_test_exp.png and b/figs/nass_scans_first_test_exp.png differ diff --git a/figs/picture_added_3_masses.jpg b/figs/picture_added_3_masses.jpg new file mode 100644 index 0000000..ed4bb5d Binary files /dev/null and b/figs/picture_added_3_masses.jpg differ diff --git a/figs/picture_unbalanced_payload.jpg b/figs/picture_unbalanced_payload.jpg new file mode 100644 index 0000000..4d1a54e Binary files /dev/null and b/figs/picture_unbalanced_payload.jpg differ diff --git a/figs/reduced_coupling_iff_masses.pdf b/figs/reduced_coupling_iff_masses.pdf new file mode 100644 index 0000000..673c016 Binary files /dev/null and b/figs/reduced_coupling_iff_masses.pdf differ diff --git a/figs/reduced_coupling_iff_masses.png b/figs/reduced_coupling_iff_masses.png new file mode 100644 index 0000000..5767955 Binary files /dev/null and b/figs/reduced_coupling_iff_masses.png differ diff --git a/figs/tilt_scan_example_trajectory.pdf b/figs/tilt_scan_example_trajectory.pdf new file mode 100644 index 0000000..0eb7047 Binary files /dev/null and b/figs/tilt_scan_example_trajectory.pdf differ diff --git a/figs/tilt_scan_example_trajectory.png b/figs/tilt_scan_example_trajectory.png new file mode 100644 index 0000000..b4565d3 Binary files /dev/null and b/figs/tilt_scan_example_trajectory.png differ diff --git a/figs/tilt_scan_example_trajectory_struts.pdf b/figs/tilt_scan_example_trajectory_struts.pdf new file mode 100644 index 0000000..ec10501 Binary files /dev/null and b/figs/tilt_scan_example_trajectory_struts.pdf differ diff --git a/figs/tilt_scan_example_trajectory_struts.png b/figs/tilt_scan_example_trajectory_struts.png new file mode 100644 index 0000000..9ad78d6 Binary files /dev/null and b/figs/tilt_scan_example_trajectory_struts.png differ diff --git a/figs/yz_scan_example_trajectory.pdf b/figs/yz_scan_example_trajectory.pdf index e4aa04f..ded9297 100644 Binary files a/figs/yz_scan_example_trajectory.pdf and b/figs/yz_scan_example_trajectory.pdf differ diff --git a/figs/yz_scan_example_trajectory.png b/figs/yz_scan_example_trajectory.png index 2c05e1d..8863412 100644 Binary files a/figs/yz_scan_example_trajectory.png and b/figs/yz_scan_example_trajectory.png differ diff --git a/figs/yz_scan_example_trajectory_struts.pdf b/figs/yz_scan_example_trajectory_struts.pdf index e74fa13..920b37e 100644 Binary files a/figs/yz_scan_example_trajectory_struts.pdf and b/figs/yz_scan_example_trajectory_struts.pdf differ diff --git a/figs/yz_scan_example_trajectory_struts.png b/figs/yz_scan_example_trajectory_struts.png index 0ceac54..9468648 100644 Binary files a/figs/yz_scan_example_trajectory_struts.png and b/figs/yz_scan_example_trajectory_struts.png differ diff --git a/figs/yz_scan_example_trajectory_yz_plane.pdf b/figs/yz_scan_example_trajectory_yz_plane.pdf index 702b1a1..850bf72 100644 Binary files a/figs/yz_scan_example_trajectory_yz_plane.pdf and b/figs/yz_scan_example_trajectory_yz_plane.pdf differ diff --git a/figs/yz_scan_example_trajectory_yz_plane.png b/figs/yz_scan_example_trajectory_yz_plane.png index 7bd4cff..b9eafc4 100644 Binary files a/figs/yz_scan_example_trajectory_yz_plane.png and b/figs/yz_scan_example_trajectory_yz_plane.png differ diff --git a/figs/yz_scans_exp_results_first_K.pdf b/figs/yz_scans_exp_results_first_K.pdf index dd8fc51..c3232a4 100644 Binary files a/figs/yz_scans_exp_results_first_K.pdf and b/figs/yz_scans_exp_results_first_K.pdf differ diff --git a/matlab/src/generateXYZTrajectory.m b/matlab/src/generateXYZTrajectory.m index e3a15da..3c2e69f 100644 --- a/matlab/src/generateXYZTrajectory.m +++ b/matlab/src/generateXYZTrajectory.m @@ -12,9 +12,9 @@ function [ref] = generateXYZTrajectory(args) arguments args.points double {mustBeNumeric} = zeros(2, 3) % [m] - args.ti (1,1) double {mustBeNumeric, mustBePositive} = 1 % Time to go to first point and after last point [s] - args.tw (1,1) double {mustBeNumeric, mustBePositive} = 0.5 % Time wait between each point [s] - args.tm (1,1) double {mustBeNumeric, mustBePositive} = 1 % Motion time between points [s] + args.ti (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % Time to go to first point and after last point [s] + args.tw (1,1) double {mustBeNumeric, mustBeNonnegative} = 0.5 % Time wait between each point [s] + args.tm (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % Motion time between points [s] args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % Sampling Time [s] end diff --git a/matlab/src/generateYZScanTrajectory.m b/matlab/src/generateYZScanTrajectory.m index d40da82..e23b168 100644 --- a/matlab/src/generateYZScanTrajectory.m +++ b/matlab/src/generateYZScanTrajectory.m @@ -10,17 +10,17 @@ function [ref] = generateYZScanTrajectory(args) % - ref - Reference Signal arguments - args.y_tot (1,1) double {mustBeNumeric} = 10e-6 % [m] - args.z_tot (1,1) double {mustBeNumeric} = 10e-6 % [m] + args.y_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [m] + args.z_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [m] args.n (1,1) double {mustBeInteger, mustBePositive} = 10 % [-] args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-4 % [s] - args.ti (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] - args.tw (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] - args.ty (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] - args.tz (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] + args.ti (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] + args.tw (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] + args.ty (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] + args.tz (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] end time_i = 0:args.Ts:args.ti; diff --git a/ref.bib b/ref.bib index 0bd32bc..1c67b3f 100644 --- a/ref.bib +++ b/ref.bib @@ -22,3 +22,26 @@ url = {https://doi.org/10.3990/1.9789036530163}, year = 2010, } + +@book{indri20_mechat_robot, + author = {Indri, Marina and Oboe, Roberto}, + title = {Mechatronics and Robotics: New Trends and Challenges}, + year = {2020}, + publisher = {CRC Press}, +} + +@book{skogestad07_multiv_feedb_contr, + author = {Skogestad, Sigurd and Postlethwaite, Ian}, + title = {Multivariable Feedback Control: Analysis and Design - Second Edition}, + year = {2007}, + publisher = {John Wiley}, + isbn = {978-0470011683}, + keywords = {favorite}, +} + +@article{oomen15_ident_robus_contr_compl_system, + author = {Oomen, Tom and Steinbuch, Maarten}, + title = {Identification for Robust Control of Complex Systems: Algorithm and Motion Application}, + journal = {Control-oriented modelling and identification: theory and applications, IET}, + year = {2015}, +} diff --git a/test-bench-nano-hexapod.html b/test-bench-nano-hexapod.html index afadbf6..f982462 100644 --- a/test-bench-nano-hexapod.html +++ b/test-bench-nano-hexapod.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Nano-Hexapod - Test Bench @@ -33,159 +33,228 @@ UP | HOME -
+

Nano-Hexapod - Test Bench

-
+

Table of Contents

-
+
    -
  • 1. Encoders fixed to the Struts - Dynamics +
  • 1. Encoders fixed to the Struts - Dynamics
  • -
  • 2. Encoders fixed to the plates - Dynamics +
  • 2. Encoders fixed to the plates - Dynamics
      -
    • 2.1. Identification of the dynamics +
    • 2.1. Identification of the dynamics
    • -
    • 2.2. Comparison with the Simscape Model +
    • 2.2. Comparison with the Simscape Model
    • -
    • 2.3. Integral Force Feedback +
    • 2.3. Integral Force Feedback
    • -
    • 2.4. Conclusion
    • +
    • 2.4. Effect of Payload mass - Robust IFF +
        +
      • 2.4.1. Measured Frequency Response Functions +
      • -
      • 3. Decentralized High Authority Control with Integral Force Feedback -
          -
        • 3.1. High Authority Controller -
        • -
        • 3.2. Reference Tracking - Trajectories +
        • 2.5. Comparison with the Simscape model +
        • +
        • 3. Decentralized High Authority Control with Integral Force Feedback +
            +
          • 3.1. Reference Tracking - Trajectories + +
          • +
          • 3.2. First Basic High Authority Controller + +
          • +
          • 3.3. Interaction Analysis and Decoupling + +
          • +
          • 3.4. Robust High Authority Controller +
          • -
          • 4. Functions -
              -
            • 4.1. generateXYZTrajectory -
            • -
            • 4.2. generateYZScanTrajectory +
            • 4. Functions @@ -198,19 +267,19 @@

              -This document is dedicated to the experimental study of the nano-hexapod shown in Figure 1. +This document is dedicated to the experimental study of the nano-hexapod shown in Figure 1.

              -
              +

              IMG_20210608_152917.jpg

              Figure 1: Nano-Hexapod

              -
              +

              -Here are the documentation of the equipment used for this test bench (lots of them are shwon in Figure 2): +Here are the documentation of the equipment used for this test bench (lots of them are shwon in Figure 2):

              • Voltage Amplifier: PiezoDrive PD200
              • @@ -223,25 +292,25 @@ Here are the documentation of the equipment used for this test bench (lots of th
              -
              +

              IMG_20210608_154722.jpg

              Figure 2: Nano-Hexapod and the control electronics

              -In Figure 3 is shown a block diagram of the experimental setup. -When possible, the notations are consistent with this diagram and summarized in Table 1. +In Figure 3 is shown a block diagram of the experimental setup. +When possible, the notations are consistent with this diagram and summarized in Table 1.

              -
              +

              nano_hexapod_signals.png

              Figure 3: Block diagram of the system with named signals

              - +
              @@ -362,16 +431,16 @@ When possible, the notations are consistent with this diagram and summarized in This document is divided in the following sections:

                -
              • Section 1: the dynamics of the nano-hexapod when the encoders are fixed to the struts is studied.
              • -
              • Section 2: the same is done when the encoders are fixed to the plates.
              • -
              • Section 3: a decentralized HAC-LAC strategy is studied and implemented.
              • +
              • Section 1: the dynamics of the nano-hexapod when the encoders are fixed to the struts is studied.
              • +
              • Section 2: the same is done when the encoders are fixed to the plates.
              • +
              • Section 3: a decentralized HAC-LAC strategy is studied and implemented.
              -
              -

              1 Encoders fixed to the Struts - Dynamics

              +
              +

              1. Encoders fixed to the Struts - Dynamics

              - +

              In this section, the encoders are fixed to the struts. @@ -381,103 +450,103 @@ In this section, the encoders are fixed to the struts. It is divided in the following sections:

                -
              • Section 1.1: the transfer function matrix from the actuators to the force sensors and to the encoders is experimentally identified.
              • -
              • Section 1.2: the obtained FRF matrix is compared with the dynamics of the simscape model
              • -
              • Section 1.3: decentralized Integral Force Feedback (IFF) is applied and its performances are evaluated.
              • -
              • Section 1.4: a modal analysis of the nano-hexapod is performed
              • +
              • Section 1.1: the transfer function matrix from the actuators to the force sensors and to the encoders is experimentally identified.
              • +
              • Section 1.2: the obtained FRF matrix is compared with the dynamics of the simscape model
              • +
              • Section 1.3: decentralized Integral Force Feedback (IFF) is applied and its performances are evaluated.
              • +
              • Section 1.4: a modal analysis of the nano-hexapod is performed
              -
              -

              1.1 Identification of the dynamics

              +
              +

              1.1. Identification of the dynamics

              - +

              -
              -

              1.1.1 Load Measurement Data

              +
              +

              1.1.1. Load Measurement Data

              -
              %% Load Identification Data
              +
              %% Load Identification Data
               meas_data_lf = {};
               
              -for i = 1:6
              -    meas_data_lf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_lf.mat', i), 't', 'Va', 'Vs', 'de')};
              -    meas_data_hf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_hf.mat', i), 't', 'Va', 'Vs', 'de')};
              +for i = 1:6
              +    meas_data_lf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_lf.mat', i), 't', 'Va', 'Vs', 'de')};
              +    meas_data_hf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_hf.mat', i), 't', 'Va', 'Vs', 'de')};
               end
               
              -
              -

              1.1.2 Spectral Analysis - Setup

              +
              +

              1.1.2. Spectral Analysis - Setup

              -
              %% Setup useful variables
              -% Sampling Time [s]
              -Ts = (meas_data_lf{1}.t(end) - (meas_data_lf{1}.t(1)))/(length(meas_data_lf{1}.t)-1);
              +
              %% Setup useful variables
              +% Sampling Time [s]
              +Ts = (meas_data_lf{1}.t(end) - (meas_data_lf{1}.t(1)))/(length(meas_data_lf{1}.t)-1);
               
              -% Sampling Frequency [Hz]
              -Fs = 1/Ts;
              +% Sampling Frequency [Hz]
              +Fs = 1/Ts;
               
              -% Hannning Windows
              -win = hanning(ceil(1*Fs));
              +% Hannning Windows
              +win = hanning(ceil(1*Fs));
               
              -% And we get the frequency vector
              -[~, f] = tfestimate(meas_data_lf{1}.Va, meas_data_lf{1}.de, win, [], [], 1/Ts);
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_data_lf{1}.Va, meas_data_lf{1}.de, win, [], [], 1/Ts);
               
              -i_lf = f < 250; % Points for low frequency excitation
              -i_hf = f > 250; % Points for high frequency excitation
              +i_lf = f < 250; % Points for low frequency excitation
              +i_hf = f > 250; % Points for high frequency excitation
               
              -
              -

              1.1.3 Transfer function from Actuator to Encoder

              +
              +

              1.1.3. Transfer function from Actuator to Encoder

              -First, let’s compute the coherence from the excitation voltage and the displacement as measured by the encoders (Figure 4). +First, let’s compute the coherence from the excitation voltage and the displacement as measured by the encoders (Figure 4).

              -
              %% Coherence
              +
              %% Coherence
               coh_dvf = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    coh_dvf_lf = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
              -    coh_dvf_hf = mscohere(meas_data_hf{i}.Va, meas_data_hf{i}.de, win, [], [], 1/Ts);
              -    coh_dvf(:,:,i) = [coh_dvf_lf(i_lf, :); coh_dvf_hf(i_hf, :)];
              +for i = 1:6
              +    coh_dvf_lf = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
              +    coh_dvf_hf = mscohere(meas_data_hf{i}.Va, meas_data_hf{i}.de, win, [], [], 1/Ts);
              +    coh_dvf(:,:,i) = [coh_dvf_lf(i_lf, :); coh_dvf_hf(i_hf, :)];
               end
               
              -
              +

              enc_struts_dvf_coh.png

              Figure 4: Obtained coherence for the DVF plant

              -Then the 6x6 transfer function matrix is estimated (Figure 5). +Then the 6x6 transfer function matrix is estimated (Figure 5).

              -
              %% DVF Plant (transfer function from u to dLm)
              +
              %% DVF Plant (transfer function from u to dLm)
               G_dvf = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    G_dvf_lf = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
              -    G_dvf_hf = tfestimate(meas_data_hf{i}.Va, meas_data_hf{i}.de, win, [], [], 1/Ts);
              -    G_dvf(:,:,i) = [G_dvf_lf(i_lf, :); G_dvf_hf(i_hf, :)];
              +for i = 1:6
              +    G_dvf_lf = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
              +    G_dvf_hf = tfestimate(meas_data_hf{i}.Va, meas_data_hf{i}.de, win, [], [], 1/Ts);
              +    G_dvf(:,:,i) = [G_dvf_lf(i_lf, :); G_dvf_hf(i_hf, :)];
               end
               
              -
              +

              enc_struts_dvf_frf.png

              Figure 5: Measured FRF for the DVF plant

              @@ -485,49 +554,49 @@ G_dvf = zeros(length(f), 6, 6);
              -
              -

              1.1.4 Transfer function from Actuator to Force Sensor

              +
              +

              1.1.4. Transfer function from Actuator to Force Sensor

              -First, let’s compute the coherence from the excitation voltage and the displacement as measured by the encoders (Figure 6). +First, let’s compute the coherence from the excitation voltage and the displacement as measured by the encoders (Figure 6).

              -
              %% Coherence for the IFF plant
              +
              %% Coherence for the IFF plant
               coh_iff = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    coh_iff_lf = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
              -    coh_iff_hf = mscohere(meas_data_hf{i}.Va, meas_data_hf{i}.Vs, win, [], [], 1/Ts);
              -    coh_iff(:,:,i) = [coh_iff_lf(i_lf, :); coh_iff_hf(i_hf, :)];
              +for i = 1:6
              +    coh_iff_lf = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
              +    coh_iff_hf = mscohere(meas_data_hf{i}.Va, meas_data_hf{i}.Vs, win, [], [], 1/Ts);
              +    coh_iff(:,:,i) = [coh_iff_lf(i_lf, :); coh_iff_hf(i_hf, :)];
               end
               
              -
              +

              enc_struts_iff_coh.png

              Figure 6: Obtained coherence for the IFF plant

              -Then the 6x6 transfer function matrix is estimated (Figure 7). +Then the 6x6 transfer function matrix is estimated (Figure 7).

              -
              %% IFF Plant
              +
              %% IFF Plant
               G_iff = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    G_iff_lf = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
              -    G_iff_hf = tfestimate(meas_data_hf{i}.Va, meas_data_hf{i}.Vs, win, [], [], 1/Ts);
              -    G_iff(:,:,i) = [G_iff_lf(i_lf, :); G_iff_hf(i_hf, :)];
              +for i = 1:6
              +    G_iff_lf = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
              +    G_iff_hf = tfestimate(meas_data_hf{i}.Va, meas_data_hf{i}.Vs, win, [], [], 1/Ts);
              +    G_iff(:,:,i) = [G_iff_lf(i_lf, :); G_iff_hf(i_hf, :)];
               end
               
              -
              +

              enc_struts_iff_frf.png

              Figure 7: Measured FRF for the IFF plant

              @@ -535,8 +604,8 @@ G_iff = zeros(length(f), 6, 6);
              -
              -

              1.1.5 Save Identified Plants

              +
              +

              1.1.5. Save Identified Plants

              save('matlab/mat/identified_plants_enc_struts.mat', 'f', 'Ts', 'G_iff', 'G_dvf')
              @@ -546,58 +615,58 @@ G_iff = zeros(length(f), 6, 6);
               
              -
              -

              1.2 Comparison with the Simscape Model

              +
              +

              1.2. Comparison with the Simscape Model

              - +

              In this section, the measured dynamics is compared with the dynamics estimated from the Simscape model.

              -
              -

              1.2.1 Load measured FRF

              +
              +

              1.2.1. Load measured FRF

              -
              %% Load data
              +
              %% Load data
               load('identified_plants_enc_struts.mat', 'f', 'Ts', 'G_iff', 'G_dvf')
               
              -
              -

              1.2.2 Dynamics from Actuator to Force Sensors

              +
              +

              1.2.2. Dynamics from Actuator to Force Sensors

              -
              %% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
                                                      'actuator_type', '2dof');
               
              -
              %% Identify the IFF Plant (transfer function from u to taum)
              +
              %% Identify the IFF Plant (transfer function from u to taum)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
               
              -Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              -
              +

              enc_struts_iff_comp_simscape.png

              Figure 8: Diagonal elements of the IFF Plant

              -
              +

              enc_struts_iff_comp_offdiag_simscape.png

              Figure 9: Off diagonal elements of the IFF Plant

              @@ -605,37 +674,37 @@ Giff = exp(-s*Ts)
              -
              -

              1.2.3 Dynamics from Actuator to Encoder

              +
              +

              1.2.3. Dynamics from Actuator to Encoder

              -
              %% Initialization of the Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              +
              %% Initialization of the Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
                                                      'actuator_type', 'flexible');
               
              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              -Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              -
              +

              enc_struts_dvf_comp_simscape.png

              Figure 10: Diagonal elements of the DVF Plant

              -
              +

              enc_struts_dvf_comp_offdiag_simscape.png

              Figure 11: Off diagonal elements of the DVF Plant

              @@ -643,20 +712,20 @@ Gdvf = exp(-s*Ts)
              -
              -

              1.2.4 Effect of a change in bending damping of the joints

              +
              +

              1.2.4. Effect of a change in bending damping of the joints

              -
              %% Tested bending dampings [Nm/(rad/s)]
              -cRs = [1e-3, 5e-3, 1e-2, 5e-2, 1e-1];
              +
              %% Tested bending dampings [Nm/(rad/s)]
              +cRs = [1e-3, 5e-3, 1e-2, 5e-2, 1e-1];
               
              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              @@ -664,24 +733,24 @@ io(io_i) = linio([mdl, '/D'], 1, -
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
              +
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
               Gs = {zeros(length(cRs), 1)};
               
              -for i = 1:length(cRs)
              -    n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                           'flex_top_type', '4dof', ...
              -                                           'motion_sensor_type', 'struts', ...
              -                                           'actuator_type', 'flexible', ...
              -                                           'flex_bot_cRx', cRs(i), ...
              -                                           'flex_bot_cRy', cRs(i), ...
              -                                           'flex_top_cRx', cRs(i), ...
              -                                           'flex_top_cRy', cRs(i));
              +for i = 1:length(cRs)
              +    n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                           'flex_top_type', '4dof', ...
              +                                           'motion_sensor_type', 'struts', ...
              +                                           'actuator_type', 'flexible', ...
              +                                           'flex_bot_cRx', cRs(i), ...
              +                                           'flex_bot_cRy', cRs(i), ...
              +                                           'flex_top_cRx', cRs(i), ...
              +                                           'flex_top_cRy', cRs(i));
               
              -    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
                   G.InputName  = {'Va1', 'Va2', 'Va3', 'Va4', 'Va5', 'Va6'};
                   G.OutputName = {'dL1', 'dL2', 'dL3', 'dL4', 'dL5', 'dL6'};
               
              -    Gs(i) = {G};
              +    Gs(i) = {G};
               end
               
              @@ -693,58 +762,58 @@ Gs = {zeros(length(cRs), 1)};
              -
              -

              1.2.5 Effect of a change in damping factor of the APA

              +
              +

              1.2.5. Effect of a change in damping factor of the APA

              -
              %% Tested bending dampings [Nm/(rad/s)]
              -xis = [1e-3, 5e-3, 1e-2, 5e-2, 1e-1];
              +
              %% Tested bending dampings [Nm/(rad/s)]
              +xis = [1e-3, 5e-3, 1e-2, 5e-2, 1e-1];
               
              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              -
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
              +
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
               Gs = {zeros(length(xis), 1)};
               
              -for i = 1:length(xis)
              -    n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                           'flex_top_type', '4dof', ...
              -                                           'motion_sensor_type', 'struts', ...
              -                                           'actuator_type', 'flexible', ...
              -                                           'actuator_xi', xis(i));
              +for i = 1:length(xis)
              +    n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                           'flex_top_type', '4dof', ...
              +                                           'motion_sensor_type', 'struts', ...
              +                                           'actuator_type', 'flexible', ...
              +                                           'actuator_xi', xis(i));
               
              -    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
                   G.InputName  = {'Va1', 'Va2', 'Va3', 'Va4', 'Va5', 'Va6'};
                   G.OutputName = {'dL1', 'dL2', 'dL3', 'dL4', 'dL5', 'dL6'};
               
              -    Gs(i) = {G};
              +    Gs(i) = {G};
               end
               
              -
              +

              bode_Va_dL_effect_xi_damp.png

              Figure 12: Effect of the APA damping factor \(\xi\) on the dynamics from \(u\) to \(d\mathcal{L}\)

              -
              +

              Damping factor \(\xi\) has a large impact on the damping of the “spurious resonances” at 200Hz and 300Hz.

              -
              +

              Why is the damping factor does not change the damping of the first peak?

              @@ -753,8 +822,8 @@ Why is the damping factor does not change the damping of the first peak?
              -
              -

              1.2.6 Effect of a change in stiffness damping coef of the APA

              +
              +

              1.2.6. Effect of a change in stiffness damping coef of the APA

              m_coef = 1e1;
              @@ -762,41 +831,41 @@ Why is the damping factor does not change the damping of the first peak?
               
              -
              %% Tested bending dampings [Nm/(rad/s)]
              -k_coefs = [1e-6, 5e-6, 1e-5, 5e-5, 1e-4];
              +
              %% Tested bending dampings [Nm/(rad/s)]
              +k_coefs = [1e-6, 5e-6, 1e-5, 5e-5, 1e-4];
               
              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              -
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
              +
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
               Gs = {zeros(length(k_coefs), 1)};
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
                                                      'actuator_type', 'flexible');
               
              -for i = 1:length(k_coefs)
              -    k_coef = k_coefs(i);
              +for i = 1:length(k_coefs)
              +    k_coef = k_coefs(i);
               
              -    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
                   G.InputName  = {'Va1', 'Va2', 'Va3', 'Va4', 'Va5', 'Va6'};
                   G.OutputName = {'dL1', 'dL2', 'dL3', 'dL4', 'dL5', 'dL6'};
               
              -    Gs(i) = {G};
              +    Gs(i) = {G};
               end
               
              -
              +

              bode_Va_dL_effect_k_coef.png

              Figure 13: Effect of a change of the damping “stiffness coeficient” on the transfer function from \(u\) to \(d\mathcal{L}\)

              @@ -804,50 +873,50 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'<
              -
              -

              1.2.7 Effect of a change in mass damping coef of the APA

              +
              +

              1.2.7. Effect of a change in mass damping coef of the APA

              -
              k_coef = 1e-6;
              +
              k_coef = 1e-6;
               
              -
              %% Tested bending dampings [Nm/(rad/s)]
              +
              %% Tested bending dampings [Nm/(rad/s)]
               m_coefs = [1e1, 5e1, 1e2, 5e2, 1e3];
               
              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              -
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
              +
              %% Idenfity the transfer function from actuator to encoder for all bending dampins
               Gs = {zeros(length(m_coefs), 1)};
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
                                                      'actuator_type', 'flexible');
               
              -for i = 1:length(m_coefs)
              -    m_coef = m_coefs(i);
              +for i = 1:length(m_coefs)
              +    m_coef = m_coefs(i);
               
              -    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +    G = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
                   G.InputName  = {'Va1', 'Va2', 'Va3', 'Va4', 'Va5', 'Va6'};
                   G.OutputName = {'dL1', 'dL2', 'dL3', 'dL4', 'dL5', 'dL6'};
               
              -    Gs(i) = {G};
              +    Gs(i) = {G};
               end
               
              -
              +

              bode_Va_dL_effect_m_coef.png

              Figure 14: Effect of a change of the damping “mass coeficient” on the transfer function from \(u\) to \(d\mathcal{L}\)

              @@ -855,37 +924,37 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'<
              -
              -

              1.2.8 Using Flexible model

              +
              +

              1.2.8. Using Flexible model

              -
              d_aligns = [[-0.05,  -0.3,  0];
              +
              d_aligns = [[-0.05,  -0.3,  0];
                           [ 0,      0.5,  0];
              -            [-0.1,   -0.3,  0];
              +            [-0.1,   -0.3,  0];
                           [ 0,      0.3,  0];
              -            [-0.05,   0.05, 0];
              -            [0,       0,    0]]*1e-3;
              +            [-0.05,   0.05, 0];
              +            [0,       0,    0]]*1e-3;
               
              d_aligns = zeros(6,3);
              -% d_aligns(1,:) = [-0.05,  -0.3,  0]*1e-3;
              -d_aligns(2,:) = [ 0,      0.3,  0]*1e-3;
              +% d_aligns(1,:) = [-0.05,  -0.3,  0]*1e-3;
              +d_aligns(2,:) = [ 0,      0.3,  0]*1e-3;
               
              -
              %% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              -                                       'actuator_type', 'flexible', ...
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
              +                                       'actuator_type', 'flexible', ...
                                                      'actuator_d_align', d_aligns);
               
              -
              +

              Why do we have smaller resonances when using flexible APA? On the test bench we have the same resonance as the 2DoF model. @@ -895,80 +964,80 @@ Could it be due to the compliance in other dof of the flexible model?

              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              -Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              -
              %% Identify the IFF Plant (transfer function from u to taum)
              +
              %% Identify the IFF Plant (transfer function from u to taum)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
               
              -Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              -
              -

              1.2.9 Flexible model + encoders fixed to the plates

              +
              +

              1.2.9. Flexible model + encoders fixed to the plates

              -
              %% Identify the IFF Plant (transfer function from u to taum)
              +
              %% Identify the IFF Plant (transfer function from u to taum)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/D'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
               
              -
              d_aligns = [[-0.05,  -0.3,  0];
              +
              d_aligns = [[-0.05,  -0.3,  0];
                           [ 0,      0.5,  0];
              -            [-0.1,   -0.3,  0];
              +            [-0.1,   -0.3,  0];
                           [ 0,      0.3,  0];
              -            [-0.05,   0.05, 0];
              -            [0,       0,    0]]*1e-3;
              +            [-0.05,   0.05, 0];
              +            [0,       0,    0]]*1e-3;
               
              -
              %% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              -                                       'actuator_type', 'flexible', ...
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
              +                                       'actuator_type', 'flexible', ...
                                                      'actuator_d_align', d_aligns);
               
              -
              Gdvf_struts = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +
              Gdvf_struts = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              -
              %% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              -                                       'actuator_type', 'flexible', ...
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'plates', ...
              +                                       'actuator_type', 'flexible', ...
                                                      'actuator_d_align', d_aligns);
               
              -
              Gdvf_plates = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +
              Gdvf_plates = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              -
              +

              dvf_plant_comp_struts_plates.png

              Figure 15: Comparison of the dynamics from \(V_a\) to \(d_L\) when the encoders are fixed to the struts (blue) and to the plates (red). APA are modeled as a flexible element.

              @@ -977,11 +1046,11 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'<
              -
              -

              1.3 Integral Force Feedback

              +
              +

              1.3. Integral Force Feedback

              - +

              In this section, the Integral Force Feedback (IFF) control strategy is applied to the nano-hexapod. @@ -989,7 +1058,7 @@ The main goal of this to add damping to the nano-hexapod’s modes.

              -The control architecture is shown in Figure 16 where \(\bm{K}_\text{IFF}\) is a diagonal \(6 \times 6\) controller. +The control architecture is shown in Figure 16 where \(\bm{K}_\text{IFF}\) is a diagonal \(6 \times 6\) controller.

              @@ -997,7 +1066,7 @@ The system as then a new input \(\bm{u}^\prime\), and the transfer function from

              -
              +

              control_architecture_iff_struts.png

              Figure 16: Integral Force Feedback Strategy

              @@ -1007,28 +1076,28 @@ The system as then a new input \(\bm{u}^\prime\), and the transfer function from This section is structured as follow:

                -
              • Section 1.3.1: Using the Simscape model (APA taken as 2DoF model), the transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified. Based on the obtained dynamics, the control law is developed and the optimal gain is estimated using the Root Locus.
              • -
              • Section 1.3.2: Still using the Simscape model, the effect of the IFF gain on the the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is studied.
              • -
              • Section 1.3.3: The same is performed experimentally: several IFF gains are used and the damped plant is identified each time.
              • -
              • Section 1.3.4: The damped model and the identified damped system are compared for the optimal IFF gain. It is found that IFF indeed adds a lot of damping into the system. However it is not efficient in damping the spurious struts modes.
              • -
              • Section 1.3.5: Finally, a “flexible” model of the APA is used in the Simscape model and the optimally damped model is compared with the measurements.
              • +
              • Section 1.3.1: Using the Simscape model (APA taken as 2DoF model), the transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified. Based on the obtained dynamics, the control law is developed and the optimal gain is estimated using the Root Locus.
              • +
              • Section 1.3.2: Still using the Simscape model, the effect of the IFF gain on the the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is studied.
              • +
              • Section 1.3.3: The same is performed experimentally: several IFF gains are used and the damped plant is identified each time.
              • +
              • Section 1.3.4: The damped model and the identified damped system are compared for the optimal IFF gain. It is found that IFF indeed adds a lot of damping into the system. However it is not efficient in damping the spurious struts modes.
              • +
              • Section 1.3.5: Finally, a “flexible” model of the APA is used in the Simscape model and the optimally damped model is compared with the measurements.
              -
              -

              1.3.1 IFF Control Law and Optimal Gain

              +
              +

              1.3.1. IFF Control Law and Optimal Gain

              - +

              Let’s use a model of the Nano-Hexapod with the encoders fixed to the struts and the APA taken as 2DoF model.

              -
              %% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
                                                      'actuator_type', '2dof');
               
              @@ -1037,12 +1106,12 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'< The transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified.

              -
              %% Identify the IFF Plant (transfer function from u to taum)
              +
              %% Identify the IFF Plant (transfer function from u to taum)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
               
              -Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              @@ -1050,21 +1119,21 @@ Giff = exp(-s*Ts)
              -
              %% IFF Controller
              -Kiff_g1 = -(1/(s + 2*pi*40))*...    % LPF: provides integral action above 40Hz
              -           (s/(s + 2*pi*30))*...    % HPF: limit low frequency gain
              -           (1/(1 + s/2/pi/500))*... % LPF: more robust to high frequency resonances
              -           eye(6);                  % Diagonal 6x6 controller
              +
              %% IFF Controller
              +Kiff_g1 = -(1/(s + 2*pi*40))*...    % LPF: provides integral action above 40Hz
              +           (s/(s + 2*pi*30))*...    % HPF: limit low frequency gain
              +           (1/(1 + s/2/pi/500))*... % LPF: more robust to high frequency resonances
              +           eye(6);                  % Diagonal 6x6 controller
               

              -Then, the poles of the system are shown in the complex plane as a function of the controller gain (i.e. Root Locus plot) in Figure 17. +Then, the poles of the system are shown in the complex plane as a function of the controller gain (i.e. Root Locus plot) in Figure 17. A gain of \(400\) is chosen as the “optimal” gain as it visually seems to be the gain that adds the maximum damping to all the suspension modes simultaneously.

              -
              +

              enc_struts_iff_root_locus.png

              Figure 17: Root Locus for the IFF control strategy

              @@ -1074,8 +1143,8 @@ A gain of \(400\) is chosen as the “optimal” gain as it visually see Then the “optimal” IFF controller is:

              -
              %% IFF controller with Optimal gain
              -Kiff = 400*Kiff_g1;
              +
              %% IFF controller with Optimal gain
              +Kiff = 400*Kiff_g1;
               
              @@ -1088,11 +1157,11 @@ And it is saved for further use.

              -The bode plots of the “diagonal” elements of the loop gain are shown in Figure 18. +The bode plots of the “diagonal” elements of the loop gain are shown in Figure 18. It is shown that the phase and gain margins are quite high and the loop gain is large arround the resonances.

              -
              +

              enc_struts_iff_opt_loop_gain.png

              Figure 18: Bode plot of the “decentralized loop gain” \(G_\text{iff}(i,i) \times K_\text{iff}(i,i)\)

              @@ -1100,22 +1169,22 @@ It is shown that the phase and gain margins are quite high and the loop gain is
              -
              -

              1.3.2 Effect of IFF on the plant - Simulations

              +
              +

              1.3.2. Effect of IFF on the plant - Simulations

              - +

              Still using the Simscape model with encoders fixed to the struts and 2DoF APA, the IFF strategy is tested.

              -
              %% Initialize the Simscape model in closed loop
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              -                                       'actuator_type', '2dof', ...
              +
              %% Initialize the Simscape model in closed loop
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
              +                                       'actuator_type', '2dof', ...
                                                      'controller_type', 'iff');
               
              @@ -1124,7 +1193,7 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'< The following IFF gains are tried:

              -
              %% Tested IFF gains
              +
              %% Tested IFF gains
               iff_gains = [4, 10, 20, 40, 100, 200, 400];
               
              @@ -1133,27 +1202,27 @@ iff_gains = [4, 10, 20, 40, 100, 200, 400]; And the transfer functions from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) are identified for all the IFF gains.

              -
              %% Identify the (damped) transfer function from u to dLm for different values of the IFF gain
              +
              %% Identify the (damped) transfer function from u to dLm for different values of the IFF gain
               Gd_iff = {zeros(1, length(iff_gains))};
               
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'], 1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Strut Displacement (encoder)
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Strut Displacement (encoder)
               
              -for i = 1:length(iff_gains)
              -    Kiff = iff_gains(i)*Kiff_g1*eye(6); % IFF Controller
              -    Gd_iff(i) = {exp(-s*Ts)*linearize(mdl, io, 0.0, options)};
              +for i = 1:length(iff_gains)
              +    Kiff = iff_gains(i)*Kiff_g1*eye(6); % IFF Controller
              +    Gd_iff(i) = {exp(-s*Ts)*linearize(mdl, io, 0.0, options)};
               
              -    isstable(Gd_iff{i})
              +    isstable(Gd_iff{i})
               end
               

              -The obtained dynamics are shown in Figure 19. +The obtained dynamics are shown in Figure 19.

              -
              +

              enc_struts_iff_gains_effect_dvf_plant.png

              Figure 19: Effect of the IFF gain \(g\) on the transfer function from \(\bm{\tau}\) to \(d\bm{\mathcal{L}}_m\)

              @@ -1161,97 +1230,97 @@ The obtained dynamics are shown in Figure 19.
              -
              -

              1.3.3 Effect of IFF on the plant - Experimental Results

              +
              +

              1.3.3. Effect of IFF on the plant - Experimental Results

              - +

              The IFF strategy is applied experimentally and the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified for all the defined values of the gain.

              -
              -
              1.3.3.1 Load Data
              +
              +
              1.3.3.1. Load Data

              First load the identification data.

              -
              %% Load Identification Data
              +
              %% Load Identification Data
               meas_iff_gains = {};
               
              -for i = 1:length(iff_gains)
              -    meas_iff_gains(i) = {load(sprintf('mat/iff_strut_1_noise_g_%i.mat', iff_gains(i)), 't', 'Vexc', 'Vs', 'de', 'u')};
              +for i = 1:length(iff_gains)
              +    meas_iff_gains(i) = {load(sprintf('mat/iff_strut_1_noise_g_%i.mat', iff_gains(i)), 't', 'Vexc', 'Vs', 'de', 'u')};
               end
               
              -
              -
              1.3.3.2 Spectral Analysis - Setup
              +
              +
              1.3.3.2. Spectral Analysis - Setup

              And define the useful variables that will be used for the identification using the tfestimate function.

              -
              %% Setup useful variables
              -% Sampling Time [s]
              -Ts = (meas_iff_gains{1}.t(end) - (meas_iff_gains{1}.t(1)))/(length(meas_iff_gains{1}.t)-1);
              +
              %% Setup useful variables
              +% Sampling Time [s]
              +Ts = (meas_iff_gains{1}.t(end) - (meas_iff_gains{1}.t(1)))/(length(meas_iff_gains{1}.t)-1);
               
              -% Sampling Frequency [Hz]
              -Fs = 1/Ts;
              +% Sampling Frequency [Hz]
              +Fs = 1/Ts;
               
              -% Hannning Windows
              -win = hanning(ceil(1*Fs));
              +% Hannning Windows
              +win = hanning(ceil(1*Fs));
               
              -% And we get the frequency vector
              -[~, f] = tfestimate(meas_iff_gains{1}.Vexc, meas_iff_gains{1}.de, win, [], [], 1/Ts);
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_iff_gains{1}.Vexc, meas_iff_gains{1}.de, win, [], [], 1/Ts);
               
              -
              -
              1.3.3.3 DVF Plant
              +
              +
              1.3.3.3. DVF Plant

              The transfer functions are estimated for all the values of the gain.

              -
              %% DVF Plant (transfer function from u to dLm)
              +
              %% DVF Plant (transfer function from u to dLm)
               G_iff_gains = {};
               
              -for i = 1:length(iff_gains)
              -    G_iff_gains{i} = tfestimate(meas_iff_gains{i}.Vexc, meas_iff_gains{i}.de(:,1), win, [], [], 1/Ts);
              +for i = 1:length(iff_gains)
              +    G_iff_gains{i} = tfestimate(meas_iff_gains{i}.Vexc, meas_iff_gains{i}.de(:,1), win, [], [], 1/Ts);
               end
               

              -The obtained dynamics as shown in the bode plot in Figure 20. +The obtained dynamics as shown in the bode plot in Figure 20. The dashed curves are the results obtained using the model, and the solid curves the results from the experimental identification.

              -
              +

              comp_iff_gains_dvf_plant.png

              Figure 20: Transfer function from \(u\) to \(d\mathcal{L}_m\) for multiple values of the IFF gain

              -The bode plot is then zoomed on the suspension modes of the nano-hexapod in Figure 21. +The bode plot is then zoomed on the suspension modes of the nano-hexapod in Figure 21.

              -
              +

              comp_iff_gains_dvf_plant_zoom.png

              Figure 21: Transfer function from \(u\) to \(d\mathcal{L}_m\) for multiple values of the IFF gain (Zoom)

              -
              +

              The IFF control strategy is very effective for the damping of the suspension modes. It however does not damp the modes at 200Hz, 300Hz and 400Hz (flexible modes of the APA). @@ -1265,11 +1334,11 @@ Also, the experimental results and the models obtained from the Simscape model a

              -
              -
              1.3.3.4 Experimental Results - Comparison of the un-damped and fully damped system
              +
              +
              1.3.3.4. Experimental Results - Comparison of the un-damped and fully damped system

              -The un-damped and damped experimental plants are compared in Figure 22 (diagonal terms). +The un-damped and damped experimental plants are compared in Figure 22 (diagonal terms).

              @@ -1278,7 +1347,7 @@ However, there is little to no effect on the flexible modes of the struts and of

              -
              +

              comp_undamped_opt_iff_gain_diagonal.png

              Figure 22: Comparison of the diagonal elements of the tranfer function from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) without active damping and with optimal IFF gain

              @@ -1287,95 +1356,95 @@ However, there is little to no effect on the flexible modes of the struts and of
              -
              -

              1.3.4 Experimental Results - Damped Plant with Optimal gain

              +
              +

              1.3.4. Experimental Results - Damped Plant with Optimal gain

              - +

              Let’s now look at the \(6 \times 6\) damped plant with the optimal gain \(g = 400\).

              -
              -
              1.3.4.1 Load Data
              +
              +
              1.3.4.1. Load Data

              The experimental data are loaded.

              -
              %% Load Identification Data
              +
              %% Load Identification Data
               meas_iff_struts = {};
               
              -for i = 1:6
              -    meas_iff_struts(i) = {load(sprintf('mat/iff_strut_%i_noise_g_400.mat', i), 't', 'Vexc', 'Vs', 'de', 'u')};
              +for i = 1:6
              +    meas_iff_struts(i) = {load(sprintf('mat/iff_strut_%i_noise_g_400.mat', i), 't', 'Vexc', 'Vs', 'de', 'u')};
               end
               
              -
              -
              1.3.4.2 Spectral Analysis - Setup
              +
              +
              1.3.4.2. Spectral Analysis - Setup

              And the parameters useful for the spectral analysis are defined.

              -
              %% Setup useful variables
              -% Sampling Time [s]
              -Ts = (meas_iff_struts{1}.t(end) - (meas_iff_struts{1}.t(1)))/(length(meas_iff_struts{1}.t)-1);
              +
              %% Setup useful variables
              +% Sampling Time [s]
              +Ts = (meas_iff_struts{1}.t(end) - (meas_iff_struts{1}.t(1)))/(length(meas_iff_struts{1}.t)-1);
               
              -% Sampling Frequency [Hz]
              -Fs = 1/Ts;
              +% Sampling Frequency [Hz]
              +Fs = 1/Ts;
               
              -% Hannning Windows
              -win = hanning(ceil(1*Fs));
              +% Hannning Windows
              +win = hanning(ceil(1*Fs));
               
              -% And we get the frequency vector
              -[~, f] = tfestimate(meas_iff_struts{1}.Vexc, meas_iff_struts{1}.de, win, [], [], 1/Ts);
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_iff_struts{1}.Vexc, meas_iff_struts{1}.de, win, [], [], 1/Ts);
               
              -
              -
              1.3.4.3 DVF Plant
              +
              +
              1.3.4.3. DVF Plant

              Finally, the \(6 \times 6\) plant is identified using the tfestimate function.

              -
              %% DVF Plant (transfer function from u to dLm)
              +
              %% DVF Plant (transfer function from u to dLm)
               G_iff_opt = {};
               
              -for i = 1:6
              -    G_iff_opt{i} = tfestimate(meas_iff_struts{i}.Vexc, meas_iff_struts{i}.de, win, [], [], 1/Ts);
              +for i = 1:6
              +    G_iff_opt{i} = tfestimate(meas_iff_struts{i}.Vexc, meas_iff_struts{i}.de, win, [], [], 1/Ts);
               end
               

              -The obtained diagonal elements are compared with the model in Figure 23. +The obtained diagonal elements are compared with the model in Figure 23.

              -
              +

              damped_iff_plant_comp_diagonal.png

              Figure 23: Comparison of the diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)

              -And all the off-diagonal elements are compared with the model in Figure 24. +And all the off-diagonal elements are compared with the model in Figure 24.

              -
              +

              damped_iff_plant_comp_off_diagonal.png

              Figure 24: Comparison of the off-diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)

              -
              +

              With the IFF control strategy applied and the optimal gain used, the suspension modes are very well damped. Remains the un-damped flexible modes of the APA (200Hz, 300Hz, 400Hz), and the modes of the plates (700Hz). @@ -1390,11 +1459,11 @@ The Simscape model and the experimental results are in very good agreement.

              -
              -

              1.3.5 Comparison with the Flexible model

              +
              +

              1.3.5. Comparison with the Flexible model

              - +

              @@ -1406,21 +1475,21 @@ Now, let’s use a flexible model for the APA, and see if the obtained dampe First, the nano-hexapod is initialized.

              -
              %% Estimated misalignement of the struts
              -d_aligns = [[-0.05,  -0.3,  0];
              +
              %% Estimated misalignement of the struts
              +d_aligns = [[-0.05,  -0.3,  0];
                           [ 0,      0.5,  0];
              -            [-0.1,   -0.3,  0];
              +            [-0.1,   -0.3,  0];
                           [ 0,      0.3,  0];
              -            [-0.05,   0.05, 0];
              -            [0,       0,    0]]*1e-3;
              +            [-0.05,   0.05, 0];
              +            [0,       0,    0]]*1e-3;
               
               
              -%% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'struts', ...
              -                                       'actuator_type', 'flexible', ...
              -                                       'actuator_d_align', d_aligns, ...
              +%% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'struts', ...
              +                                       'actuator_type', 'flexible', ...
              +                                       'actuator_d_align', d_aligns, ...
                                                      'controller_type', 'iff');
               
              @@ -1429,7 +1498,7 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'< And the “optimal” controller is loaded.

              -
              %% Optimal IFF controller
              +
              %% Optimal IFF controller
               load('Kiff.mat', 'Kiff');
               
              @@ -1438,21 +1507,21 @@ load('Kiff.mat', 'Kiff' The transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified using the Simscape model.

              -
              %% Linearized inputs/outputs
              +
              %% Linearized inputs/outputs
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dL'],  1, 'openoutput'); io_i = io_i + 1; % Strut Displacement (encoder)
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'],  1, 'openoutput'); io_i = io_i + 1; % Strut Displacement (encoder)
               
              -%% Identification of the plant
              -Gd_iff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +%% Identification of the plant
              +Gd_iff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               

              -The obtained diagonal elements are shown in Figure 25 while the off-diagonal elements are shown in Figure 26. +The obtained diagonal elements are shown in Figure 25 while the off-diagonal elements are shown in Figure 26.

              -
              +

              enc_struts_iff_opt_damp_comp_flex_model_diag.png

              Figure 25: Diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) - comparison of the measured FRF and the identified dynamics using the flexible model

              @@ -1460,13 +1529,13 @@ The obtained diagonal elements are shown in Figure 25 -
              +

              enc_struts_iff_opt_damp_comp_flex_model_off_diag.png

              Figure 26: Off-diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) - comparison of the measured FRF and the identified dynamics using the flexible model

              -
              +

              Using flexible models for the APA, the agreement between the Simscape model of the nano-hexapod and the measured FRF is very good.

              @@ -1479,10 +1548,10 @@ Only the flexible mode of the top-plate is not appearing in the model which is v
              -
              -

              1.3.6 Conclusion

              +
              +

              1.3.6. Conclusion

              -
              +

              The decentralized Integral Force Feedback strategy applied on the nano-hexapod is very effective in damping all the suspension modes.

              @@ -1496,75 +1565,75 @@ The Simscape model (especially when using a flexible model for the APA) is shown
              -
              -

              1.4 Modal Analysis

              +
              +

              1.4. Modal Analysis

              - +

              -Several 3-axis accelerometers are fixed on the top platform of the nano-hexapod as shown in Figure 31. +Several 3-axis accelerometers are fixed on the top platform of the nano-hexapod as shown in Figure 31.

              -
              +

              accelerometers_nano_hexapod.jpg

              Figure 27: Location of the accelerometers on top of the nano-hexapod

              -The top platform is then excited using an instrumented hammer as shown in Figure 28. +The top platform is then excited using an instrumented hammer as shown in Figure 28.

              -
              +

              hammer_excitation_compliance_meas.jpg

              Figure 28: Example of an excitation using an instrumented hammer

              -From this experiment, the resonance frequencies and the associated mode shapes can be computed (Section 1.4.1). -Then, in Section 1.4.2, the vertical compliance of the nano-hexapod is experimentally estimated. -Finally, in Section 1.4.3, the measured compliance is compare with the estimated one from the Simscape model. +From this experiment, the resonance frequencies and the associated mode shapes can be computed (Section 1.4.1). +Then, in Section 1.4.2, the vertical compliance of the nano-hexapod is experimentally estimated. +Finally, in Section 1.4.3, the measured compliance is compare with the estimated one from the Simscape model.

              -
              -

              1.4.1 Obtained Mode Shapes

              +
              +

              1.4.1. Obtained Mode Shapes

              - +

              -We can observe the mode shapes of the first 6 modes that are the suspension modes (the plate is behaving as a solid body) in Figure 29. +We can observe the mode shapes of the first 6 modes that are the suspension modes (the plate is behaving as a solid body) in Figure 29.

              -
              +

              mode_shapes_annotated.gif

              Figure 29: Measured mode shapes for the first six modes

              -Then, there is a mode at 692Hz which corresponds to a flexible mode of the top plate (Figure 30). +Then, there is a mode at 692Hz which corresponds to a flexible mode of the top plate (Figure 30).

              -
              +

              ModeShapeFlex1_crop.gif

              Figure 30: First flexible mode at 692Hz

              -The obtained modes are summarized in Table 2. +The obtained modes are summarized in Table 2.

              -
              Table 1: List of signals
              +
              @@ -1628,11 +1697,11 @@ The obtained modes are summarized in Table 2. -
              -

              1.4.2 Nano-Hexapod Compliance - Effect of IFF

              +
              +

              1.4.2. Nano-Hexapod Compliance - Effect of IFF

              - +

              @@ -1651,8 +1720,8 @@ The top plate is excited vertically using the instrumented hammer two times: The data is loaded.

              -
              frf_ol  = load('Measurement_Z_axis.mat'); % Open-Loop
              -frf_iff = load('Measurement_Z_axis_damped.mat'); % IFF
              +
              frf_ol  = load('Measurement_Z_axis.mat'); % Open-Loop
              +frf_iff = load('Measurement_Z_axis_damped.mat'); % IFF
               
              @@ -1660,25 +1729,25 @@ frf_iff = load('Measurement_Z_axis_damped.mat'); The mean vertical motion of the top platform is computed by averaging all 5 accelerometers.

              -
              %% Multiply by 10 (gain in m/s^2/V) and divide by 5 (number of accelerometers)
              -d_frf_ol = 10/5*(frf_ol.FFT1_H1_4_1_RMS_Y_Mod + frf_ol.FFT1_H1_7_1_RMS_Y_Mod + frf_ol.FFT1_H1_10_1_RMS_Y_Mod + frf_ol.FFT1_H1_13_1_RMS_Y_Mod + frf_ol.FFT1_H1_16_1_RMS_Y_Mod)./(2*pi*frf_ol.FFT1_H1_16_1_RMS_X_Val).^2;
              -d_frf_iff = 10/5*(frf_iff.FFT1_H1_4_1_RMS_Y_Mod + frf_iff.FFT1_H1_7_1_RMS_Y_Mod + frf_iff.FFT1_H1_10_1_RMS_Y_Mod + frf_iff.FFT1_H1_13_1_RMS_Y_Mod + frf_iff.FFT1_H1_16_1_RMS_Y_Mod)./(2*pi*frf_iff.FFT1_H1_16_1_RMS_X_Val).^2;
              +
              %% Multiply by 10 (gain in m/s^2/V) and divide by 5 (number of accelerometers)
              +d_frf_ol = 10/5*(frf_ol.FFT1_H1_4_1_RMS_Y_Mod + frf_ol.FFT1_H1_7_1_RMS_Y_Mod + frf_ol.FFT1_H1_10_1_RMS_Y_Mod + frf_ol.FFT1_H1_13_1_RMS_Y_Mod + frf_ol.FFT1_H1_16_1_RMS_Y_Mod)./(2*pi*frf_ol.FFT1_H1_16_1_RMS_X_Val).^2;
              +d_frf_iff = 10/5*(frf_iff.FFT1_H1_4_1_RMS_Y_Mod + frf_iff.FFT1_H1_7_1_RMS_Y_Mod + frf_iff.FFT1_H1_10_1_RMS_Y_Mod + frf_iff.FFT1_H1_13_1_RMS_Y_Mod + frf_iff.FFT1_H1_16_1_RMS_Y_Mod)./(2*pi*frf_iff.FFT1_H1_16_1_RMS_X_Val).^2;
               

              -The vertical compliance (magnitude of the transfer function from a vertical force applied on the top plate to the vertical motion of the top plate) is shown in Figure 31. +The vertical compliance (magnitude of the transfer function from a vertical force applied on the top plate to the vertical motion of the top plate) is shown in Figure 31.

              -
              +

              compliance_vertical_comp_iff.png

              Figure 31: Measured vertical compliance with and without IFF

              -
              +

              -From Figure 31, it is clear that the IFF control strategy is very effective in damping the suspensions modes of the nano-hexapod. +From Figure 31, it is clear that the IFF control strategy is very effective in damping the suspensions modes of the nano-hexapod. It also has the effect of (slightly) degrading the vertical compliance at low frequency.

              @@ -1690,11 +1759,11 @@ It also seems some damping can be added to the modes at around 205Hz which are f
              -
              -

              1.4.3 Comparison with the Simscape Model

              +
              +

              1.4.3. Comparison with the Simscape Model

              - +

              @@ -1703,11 +1772,11 @@ Let’s now compare the measured vertical compliance with the vertical compl

              The transfer function from a vertical external force to the absolute motion of the top platform is identified (with and without IFF) using the Simscape model. -The comparison is done in Figure 32. +The comparison is done in Figure 32. Again, the model is quite accurate!

              -
              +

              compliance_vertical_comp_model_iff.png

              Figure 32: Measured vertical compliance with and without IFF

              @@ -1716,17 +1785,17 @@ Again, the model is quite accurate!
              -
              -

              1.5 Conclusion

              +
              +

              1.5. Conclusion

              -
              +

              From the previous analysis, several conclusions can be drawn:

                -
              • Decentralized IFF is very effective in damping the “suspension” modes of the nano-hexapod (Figure 22)
              • -
              • Decentralized IFF does not damp the “spurious” modes of the struts nor the flexible modes of the top plate (Figure 22)
              • -
              • Even though the Simscape model and the experimentally measured FRF are in good agreement (Figures 25 and 26), the obtain dynamics from the control inputs \(\bm{u}\) and the encoders \(d\bm{\mathcal{L}}_m\) is very difficult to control
              • +
              • Decentralized IFF is very effective in damping the “suspension” modes of the nano-hexapod (Figure 22)
              • +
              • Decentralized IFF does not damp the “spurious” modes of the struts nor the flexible modes of the top plate (Figure 22)
              • +
              • Even though the Simscape model and the experimentally measured FRF are in good agreement (Figures 25 and 26), the obtain dynamics from the control inputs \(\bm{u}\) and the encoders \(d\bm{\mathcal{L}}_m\) is very difficult to control

              @@ -1739,18 +1808,18 @@ The goal is to be less sensitive to the flexible modes of the struts.

              -
              -

              2 Encoders fixed to the plates - Dynamics

              +
              +

              2. Encoders fixed to the plates - Dynamics

              - +

              -In this section, the encoders are fixed to the plates rather than to the struts as shown in Figure 33. +In this section, the encoders are fixed to the plates rather than to the struts as shown in Figure 33.

              -
              +

              IMG_20210625_083801.jpg

              Figure 33: Nano-Hexapod with encoders fixed to the struts

              @@ -1760,32 +1829,32 @@ In this section, the encoders are fixed to the plates rather than to the struts It is structured as follow:

                -
              • Section 2.1: The dynamics of the nano-hexapod is identified.
              • -
              • Section 2.2: The identified dynamics is compared with the Simscape model.
              • -
              • Section 2.3: The Integral Force Feedback (IFF) control strategy is applied and the dynamics of the damped nano-hexapod is identified and compare with the Simscape model.
              • +
              • Section 2.1: The dynamics of the nano-hexapod is identified.
              • +
              • Section 2.2: The identified dynamics is compared with the Simscape model.
              • +
              • Section 2.3: The Integral Force Feedback (IFF) control strategy is applied and the dynamics of the damped nano-hexapod is identified and compare with the Simscape model.
              -
              -

              2.1 Identification of the dynamics

              +
              +

              2.1. Identification of the dynamics

              - +

              In this section, the dynamics of the nano-hexapod with the encoders fixed to the plates is identified.

              -First, the measurement data are loaded in Section 2.1.1, then the transfer function matrix from the actuators to the encoders are estimated in Section 2.1.2. -Finally, the transfer function matrix from the actuators to the force sensors is estimated in Section 2.1.3. +First, the measurement data are loaded in Section 2.1.1, then the transfer function matrix from the actuators to the encoders are estimated in Section 2.1.2. +Finally, the transfer function matrix from the actuators to the force sensors is estimated in Section 2.1.3.

              -
              -

              2.1.1 Data Loading and Spectral Analysis Setup

              +
              +

              2.1.1. Data Loading and Spectral Analysis Setup

              - +

              @@ -1793,43 +1862,43 @@ The actuators are excited one by one using a low pass filtered white noise. For each excitation, the 6 force sensors and 6 encoders are measured and saved.

              -
              %% Load Identification Data
              +
              %% Load Identification Data
               meas_data_lf = {};
               
              -for i = 1:6
              -    meas_data_lf(i) = {load(sprintf('mat/frf_exc_strut_%i_enc_plates_noise.mat', i), 't', 'Va', 'Vs', 'de')};
              +for i = 1:6
              +    meas_data_lf(i) = {load(sprintf('mat/frf_exc_strut_%i_enc_plates_noise.mat', i), 't', 'Va', 'Vs', 'de')};
               end
               
              -
              -

              2.1.2 Transfer function from Actuator to Encoder

              +
              +

              2.1.2. Transfer function from Actuator to Encoder

              - +

              Let’s compute the coherence from the excitation voltage \(\bm{u}\) and the displacement \(d\bm{\mathcal{L}}_m\) as measured by the encoders.

              -
              %% Coherence
              +
              %% Coherence
               coh_dvf = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    coh_dvf(:, :, i) = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
              +for i = 1:6
              +    coh_dvf(:, :, i) = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
               end
               

              -The obtained coherence shown in Figure 34 is quite good up to 400Hz. +The obtained coherence shown in Figure 34 is quite good up to 400Hz.

              -
              +

              enc_plates_dvf_coh.png

              Figure 34: Obtained coherence for the DVF plant

              @@ -1839,65 +1908,65 @@ The obtained coherence shown in Figure 34 is quite goo Then the 6x6 transfer function matrix is estimated.

              -
              %% DVF Plant (transfer function from u to dLm)
              +
              %% DVF Plant (transfer function from u to dLm)
               G_dvf = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    G_dvf(:,:,i) = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
              +for i = 1:6
              +    G_dvf(:,:,i) = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
               end
               

              -The diagonal and off-diagonal terms of this transfer function matrix are shown in Figure 35. +The diagonal and off-diagonal terms of this transfer function matrix are shown in Figure 35.

              -
              +

              enc_plates_dvf_frf.png

              Figure 35: Measured FRF for the DVF plant

              -
              +

              -From Figure 35, we can draw few conclusions on the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) when the encoders are fixed to the plates: +From Figure 35, we can draw few conclusions on the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) when the encoders are fixed to the plates:

              • the decoupling is rather good at low frequency (below the first suspension mode). -The low frequency gain is constant for the off diagonal terms, whereas when the encoders where fixed to the struts, the low frequency gain of the off-diagonal terms were going to zero (Figure 5).
              • +The low frequency gain is constant for the off diagonal terms, whereas when the encoders where fixed to the struts, the low frequency gain of the off-diagonal terms were going to zero (Figure 5).
              • the flexible modes of the struts at 226Hz and 337Hz are indeed shown in the transfer functions, but their amplitudes are rather low.
              • -
              • the diagonal terms have alternating poles and zeros up to at least 600Hz: the flexible modes of the struts are not affecting the alternating pole/zero pattern. This what not the case when the encoders were fixed to the struts (Figure 5).
              • +
              • the diagonal terms have alternating poles and zeros up to at least 600Hz: the flexible modes of the struts are not affecting the alternating pole/zero pattern. This what not the case when the encoders were fixed to the struts (Figure 5).
              -
              -

              2.1.3 Transfer function from Actuator to Force Sensor

              +
              +

              2.1.3. Transfer function from Actuator to Force Sensor

              - +

              Let’s now compute the coherence from the excitation voltage \(\bm{u}\) and the voltage \(\bm{\tau}_m\) generated by the Force senors.

              -
              %% Coherence for the IFF plant
              +
              %% Coherence for the IFF plant
               coh_iff = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    coh_iff(:,:,i) = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
              +for i = 1:6
              +    coh_iff(:,:,i) = mscohere(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
               end
               

              -The coherence is shown in Figure 36, and is very good for from 10Hz up to 2kHz. +The coherence is shown in Figure 36, and is very good for from 10Hz up to 2kHz.

              -
              +

              enc_plates_iff_coh.png

              Figure 36: Obtained coherence for the IFF plant

              @@ -1907,28 +1976,28 @@ The coherence is shown in Figure 36, and is very good Then the 6x6 transfer function matrix is estimated.

              -
              %% IFF Plant
              +
              %% IFF Plant
               G_iff = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    G_iff(:,:,i) = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
              +for i = 1:6
              +    G_iff(:,:,i) = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
               end
               

              -The bode plot of the diagonal and off-diagonal terms are shown in Figure 37. +The bode plot of the diagonal and off-diagonal terms are shown in Figure 37.

              -
              +

              enc_plates_iff_frf.png

              Figure 37: Measured FRF for the IFF plant

              -
              +

              -It is shown in Figure 38 that: +It is shown in Figure 38 that:

              • The IFF plant has alternating poles and zeros
              • @@ -1940,8 +2009,8 @@ It is shown in Figure 38 that:
              -
              -

              2.1.4 Save Identified Plants

              +
              +

              2.1.4. Save Identified Plants

              The identified dynamics is saved for further use. @@ -1954,46 +2023,46 @@ The identified dynamics is saved for further use.

              -
              -

              2.2 Comparison with the Simscape Model

              +
              +

              2.2. Comparison with the Simscape Model

              - +

              -In this section, the measured dynamics done in Section 2.1 is compared with the dynamics estimated from the Simscape model. +In this section, the measured dynamics done in Section 2.1 is compared with the dynamics estimated from the Simscape model.

              -
              -

              2.2.1 Identification Setup

              +
              +

              2.2.1. Identification Setup

              The nano-hexapod is initialized with the APA taken as flexible models.

              -
              %% Initialize Nano-Hexapod
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'plates', ...
                                                      'actuator_type', 'flexible');
               
              -
              -

              2.2.2 Dynamics from Actuator to Force Sensors

              +
              +

              2.2.2. Dynamics from Actuator to Force Sensors

              Then the transfer function from \(\bm{u}\) to \(\bm{\tau}_m\) is identified using the Simscape model.

              -
              %% Identify the IFF Plant (transfer function from u to taum)
              +
              %% Identify the IFF Plant (transfer function from u to taum)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dum'],  1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors
               
              -Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              @@ -2001,27 +2070,27 @@ Giff = exp(-s*Ts)
                -
              • Figure 38: the individual transfer function from \(u_1\) (the DAC voltage for the first actuator) to the force sensors of all 6 struts are compared
              • -
              • Figure 39: all the diagonal elements are compared
              • -
              • Figure 40: all the off-diagonal elements are compared
              • +
              • Figure 38: the individual transfer function from \(u_1\) (the DAC voltage for the first actuator) to the force sensors of all 6 struts are compared
              • +
              • Figure 39: all the diagonal elements are compared
              • +
              • Figure 40: all the off-diagonal elements are compared
              -
              +

              enc_plates_iff_comp_simscape_all.png

              Figure 38: IFF Plant for the first actuator input and all the force senosrs

              -
              +

              enc_plates_iff_comp_simscape.png

              Figure 39: Diagonal elements of the IFF Plant

              -
              +

              enc_plates_iff_comp_offdiag_simscape.png

              Figure 40: Off diagonal elements of the IFF Plant

              @@ -2029,19 +2098,19 @@ The identified dynamics is compared with the measured FRF:
              -
              -

              2.2.3 Dynamics from Actuator to Encoder

              +
              +

              2.2.3. Dynamics from Actuator to Encoder

              Now, the dynamics from the DAC voltage \(\bm{u}\) to the encoders \(d\bm{\mathcal{L}}_m\) is estimated using the Simscape model.

              -
              %% Identify the DVF Plant (transfer function from u to dLm)
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders
               
              -Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              @@ -2049,27 +2118,27 @@ Gdvf = exp(-s*Ts)
                -
              • Figure 41: the individual transfer function from \(u_3\) (the DAC voltage for the actuator number 3) to the six encoders
              • -
              • Figure 42: all the diagonal elements are compared
              • -
              • Figure 43: all the off-diagonal elements are compared
              • +
              • Figure 41: the individual transfer function from \(u_3\) (the DAC voltage for the actuator number 3) to the six encoders
              • +
              • Figure 42: all the diagonal elements are compared
              • +
              • Figure 43: all the off-diagonal elements are compared
              -
              +

              enc_plates_dvf_comp_simscape_all.png

              Figure 41: DVF Plant for the first actuator input and all the encoders

              -
              +

              enc_plates_dvf_comp_simscape.png

              Figure 42: Diagonal elements of the DVF Plant

              -
              +

              enc_plates_dvf_comp_offdiag_simscape.png

              Figure 43: Off diagonal elements of the DVF Plant

              @@ -2077,10 +2146,59 @@ The identified dynamics is compared with the measured FRF:
              -
              -

              2.2.4 Conclusion

              +
              +

              2.2.4. Flexible Top Plate

              -
              +
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ...
              +                                       'flex_top_type', '3dof', ...
              +                                       'motion_sensor_type', 'struts', ...
              +                                       'actuator_type', '2dof', ...
              +                                       'top_plate_type', 'rigid');
              +
              +
              + +
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
              +clear io; io_i = 1;
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders
              +
              +Gdvf = linearize(mdl, io, 0.0, options);
              +
              +
              + +
              +
              size(Gdvf)
              +isstable(Gdvf)
              +
              +
              + +
              +
              [sys,g] = balreal(Gdvf);  % Compute balanced realization
              +elim = (g<1e-4);         % Small entries of g are negligible states
              +rsys = modred(sys,elim); % Remove negligible states
              +size(rsys)
              +
              +
              + +
              +
              %% Identify the IFF Plant (transfer function from u to taum)
              +clear io; io_i = 1;
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');   io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +
              +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +
              +
              +
              +
              + +
              +

              2.2.5. Conclusion

              +
              +

              The Simscape model is quite accurate for the transfer function matrices from \(\bm{u}\) to \(\bm{\tau}_m\) and from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) except at frequencies of the flexible modes of the top-plate. The Simscape model can therefore be used to develop the control strategies. @@ -2091,18 +2209,18 @@ The Simscape model can therefore be used to develop the control strategies.

              -
              -

              2.3 Integral Force Feedback

              +
              +

              2.3. Integral Force Feedback

              - +

              In this section, the Integral Force Feedback (IFF) control strategy is applied to the nano-hexapod in order to add damping to the suspension modes.

              -The control architecture is shown in Figure 44: +The control architecture is shown in Figure 44:

              • \(\bm{\tau}_m\) is the measured voltage of the 6 force sensors
              • @@ -2112,31 +2230,31 @@ The control architecture is shown in Figure 44:
              -
              +

              control_architecture_iff.png

              Figure 44: Integral Force Feedback Strategy

              -
              -

              2.3.1 Effect of IFF on the plant - Simscape Model

              +
              +

              2.3.1. Effect of IFF on the plant - Simscape Model

              - +

              The nano-hexapod is initialized with flexible APA and the encoders fixed to the struts.

              -
              %% Initialize the Simscape model in closed loop
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              +
              %% Initialize the Simscape model in closed loop
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'plates', ...
                                                      'actuator_type', 'flexible');
               
              @@ -2145,7 +2263,7 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type'< The same controller as the one developed when the encoder were fixed to the struts is used.

              -
              %% Optimal IFF controller
              +
              %% Optimal IFF controller
               load('Kiff.mat', 'Kiff')
               
              @@ -2154,10 +2272,10 @@ load('Kiff.mat', 'Kiff' The transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified.

              -
              %% Identify the (damped) transfer function from u to dLm for different values of the IFF gain
              +
              %% Identify the (damped) transfer function from u to dLm for different values of the IFF gain
               clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder)
              +io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder)
               
              @@ -2165,8 +2283,8 @@ io(io_i) = linio([mdl, '/dL'], 1, -
              %% Transfer function from u to dL (open-loop)
              -Gd_ol = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +
              %% Transfer function from u to dL (open-loop)
              +Gd_ol = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              @@ -2174,15 +2292,15 @@ Gd_ol = exp(-s*Ts)
              -
              %% Initialize the Simscape model in closed loop
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              -                                       'actuator_type', 'flexible', ...
              +
              %% Initialize the Simscape model in closed loop
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'plates', ...
              +                                       'actuator_type', 'flexible', ...
                                                      'controller_type', 'iff');
               
              -%% Transfer function from u to dL (IFF)
              -Gd_iff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              +%% Transfer function from u to dL (IFF)
              +Gd_iff = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
               
              @@ -2200,11 +2318,11 @@ It is first verified that the system is stable:

              -The diagonal and off-diagonal terms of the \(6 \times 6\) transfer function matrices identified are compared in Figure 45. +The diagonal and off-diagonal terms of the \(6 \times 6\) transfer function matrices identified are compared in Figure 45. It is shown, as was the case when the encoders were fixed to the struts, that the IFF control strategy is very effective in damping the suspension modes of the nano-hexapod.

              -
              +

              enc_plates_iff_gains_effect_dvf_plant.png

              Figure 45: Effect of the IFF control strategy on the transfer function from \(\bm{\tau}\) to \(d\bm{\mathcal{L}}_m\)

              @@ -2212,8 +2330,8 @@ It is shown, as was the case when the encoders were fixed to the struts, that th
              -
              -

              2.3.2 Effect of IFF on the plant - FRF

              +
              +

              2.3.2. Effect of IFF on the plant - FRF

              The IFF control strategy is experimentally implemented. @@ -2224,11 +2342,11 @@ The (damped) transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) The identification data are loaded:

              -
              %% Load Identification Data
              +
              %% Load Identification Data
               meas_iff_plates = {};
               
              -for i = 1:6
              -    meas_iff_plates(i) = {load(sprintf('mat/frf_exc_iff_strut_%i_enc_plates_noise.mat', i), 't', 'Va', 'Vs', 'de', 'u')};
              +for i = 1:6
              +    meas_iff_plates(i) = {load(sprintf('mat/frf_exc_iff_strut_%i_enc_plates_noise.mat', i), 't', 'Va', 'Vs', 'de', 'u')};
               end
               
              @@ -2237,14 +2355,14 @@ meas_iff_plates = {}; And the parameters used for the transfer function estimation are defined below.

              -
              % Sampling Time [s]
              -Ts = (meas_iff_plates{1}.t(end) - (meas_iff_plates{1}.t(1)))/(length(meas_iff_plates{1}.t)-1);
              +
              % Sampling Time [s]
              +Ts = (meas_iff_plates{1}.t(end) - (meas_iff_plates{1}.t(1)))/(length(meas_iff_plates{1}.t)-1);
               
              -% Hannning Windows
              -win = hanning(ceil(1*Fs));
              +% Hannning Windows
              +win = hanning(ceil(1/Ts));
               
              -% And we get the frequency vector
              -[~, f] = tfestimate(meas_iff_plates{1}.Va, meas_iff_plates{1}.de, win, [], [], 1/Ts);
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_iff_plates{1}.Va, meas_iff_plates{1}.de, win, [], [], 1/Ts);
               
              @@ -2252,26 +2370,26 @@ win = hanning(ceil(1*Fs)); The estimation is performed using the tfestimate command.

              -
              %% Estimation of the transfer function matrix from u to dL when IFF is applied
              +
              %% Estimation of the transfer function matrix from u to dL when IFF is applied
               G_enc_iff_opt = zeros(length(f), 6, 6);
               
              -for i = 1:6
              -    G_enc_iff_opt(:,:,i) = tfestimate(meas_iff_plates{i}.Va, meas_iff_plates{i}.de, win, [], [], 1/Ts);
              +for i = 1:6
              +    G_enc_iff_opt(:,:,i) = tfestimate(meas_iff_plates{i}.Va, meas_iff_plates{i}.de, win, [], [], 1/Ts);
               end
               

              -The obtained diagonal and off-diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) are shown in Figure 46 both without and with IFF. +The obtained diagonal and off-diagonal elements of the transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) are shown in Figure 46 both without and with IFF.

              -
              +

              enc_plant_plates_effect_iff.png

              Figure 46: Effect of the IFF control strategy on the transfer function from \(\bm{\tau}\) to \(d\bm{\mathcal{L}}_m\)

              -
              +

              As was predicted with the Simscape model, the IFF control strategy is very effective in damping the suspension modes of the nano-hexapod. Little damping is also applied on the first flexible mode of the strut at 235Hz. @@ -2282,42 +2400,42 @@ However, no damping is applied on other modes, such as the flexible modes of the

              -
              -

              2.3.3 Comparison of the measured FRF and the Simscape model

              +
              +

              2.3.3. Comparison of the measured FRF and the Simscape model

              Let’s now compare the obtained damped plants obtained experimentally with the one extracted from Simscape:

                -
              • Figure 47: the individual transfer function from \(u_1^\prime\) to the six encoders are comapred
              • -
              • Figure 48: all the diagonal elements are compared
              • -
              • Figure 49: all the off-diagonal elements are compared
              • +
              • Figure 47: the individual transfer function from \(u_1^\prime\) to the six encoders are comapred
              • +
              • Figure 48: all the diagonal elements are compared
              • +
              • Figure 49: all the off-diagonal elements are compared
              -
              +

              enc_plates_opt_iff_comp_simscape_all.png

              Figure 47: FRF from one actuator to all the encoders when the plant is damped using IFF

              -
              +

              damped_iff_plates_plant_comp_diagonal.png

              Figure 48: Comparison of the diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)

              -
              +

              damped_iff_plates_plant_comp_off_diagonal.png

              Figure 49: Comparison of the off-diagonal elements of the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) with active damping (IFF) applied with an optimal gain \(g = 400\)

              -
              +

              -From Figures 48 and 49, it is clear that the Simscape model very well represents the dynamics of the nano-hexapod. +From Figures 48 and 49, it is clear that the Simscape model very well represents the dynamics of the nano-hexapod. This is true to around 400Hz, then the dynamics depends on the flexible modes of the top plate which are not modelled.

              @@ -2325,8 +2443,8 @@ This is true to around 400Hz, then the dynamics depends on the flexible modes of
              -
              -

              2.3.4 Save Damped Plant

              +
              +

              2.3.4. Save Damped Plant

              The experimentally identified plant is saved for further use. @@ -2344,10 +2462,698 @@ The experimentally identified plant is saved for further use.

              -
              -

              2.4 Conclusion

              +
              +

              2.4. Effect of Payload mass - Robust IFF

              -
              +

              + +

              +

              +In this section, the encoders are fixed to the plates, and we identify the dynamics for several payloads. +The added payload are half cylinders, and three layers can be added for a total of around 40kg (Figure 50). +

              + + +
              +

              picture_added_3_masses.jpg +

              +

              Figure 50: Picture of the nano-hexapod with added mass

              +
              + +

              +First the dynamics from \(\bm{u}\) to \(d\mathcal{L}_m\) and \(\bm{\tau}_m\) is identified. +Then, the Integral Force Feedback controller is developed and applied as shown in Figure 51. +Finally, the dynamics from \(\bm{u}^\prime\) to \(d\mathcal{L}_m\) is identified and the added damping can be estimated. +

              + + +
              +

              nano_hexapod_signals_iff.png +

              +

              Figure 51: Block Diagram of the experimental setup and model

              +
              +
              +
              +

              2.4.1. Measured Frequency Response Functions

              +
              +
              +
              +
              2.4.1.1. Compute FRF in open-loop
              +
              +

              +The identification is performed without added mass, and with one, two and three layers of added cylinders. +

              +
              +
              i_masses = 0:3;
              +
              +
              + +

              +The following data are loaded: +

              +
                +
              • Va: the excitation voltage (corresponding to \(u_i\))
              • +
              • Vs: the generated voltage by the 6 force sensors (corresponding to \(\bm{\tau}_m\))
              • +
              • de: the measured motion by the 6 encoders (corresponding to \(d\bm{\mathcal{L}}_m\))
              • +
              +
              +
              %% Load Identification Data
              +meas_added_mass = {};
              +
              +for i_mass = i_masses
              +    for i_strut = 1:6
              +        meas_added_mass(i_strut, i_mass+1) = {load(sprintf('frf_data_exc_strut_%i_realigned_vib_table_%im.mat', i_strut, i_mass), 't', 'Va', 'Vs', 'de')};
              +    end
              +end
              +
              +
              + +

              +The window win and the frequency vector f are defined. +

              +
              +
              % Sampling Time [s]
              +Ts = (meas_added_mass{1,1}.t(end) - (meas_added_mass{1,1}.t(1)))/(length(meas_added_mass{1,1}.t)-1);
              +
              +% Hannning Windows
              +win = hanning(ceil(1/Ts));
              +
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_added_mass{1,1}.Va, meas_added_mass{1,1}.de, win, [], [], 1/Ts);
              +
              +
              + +

              +Finally the \(6 \times 6\) transfer function matrices from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\) and from \(\bm{u}\) to \(\bm{\tau}_m\) are identified: +

              +
              +
              %% DVF Plant (transfer function from u to dLm)
              +G_dL = {};
              +
              +for i_mass = i_masses
              +    G_dL(i_mass+1) = {zeros(length(f), 6, 6)};
              +    for i_strut = 1:6
              +        G_dL{i_mass+1}(:,:,i_strut) = tfestimate(meas_added_mass{i_strut, i_mass+1}.Va, meas_added_mass{i_strut, i_mass+1}.de, win, [], [], 1/Ts);
              +    end
              +end
              +
              +%% IFF Plant (transfer function from u to taum)
              +G_tau = {};
              +
              +for i_mass = i_masses
              +    G_tau(i_mass+1) = {zeros(length(f), 6, 6)};
              +    for i_strut = 1:6
              +        G_tau{i_mass+1}(:,:,i_strut) = tfestimate(meas_added_mass{i_strut, i_mass+1}.Va, meas_added_mass{i_strut, i_mass+1}.Vs, win, [], [], 1/Ts);
              +    end
              +end
              +
              +
              + +

              +The identified dynamics are then saved for further use. +

              +
              +
              save('mat/frf_vib_table_m.mat', 'f', 'Ts', 'G_tau', 'G_dL')
              +
              +
              +
              +
              +
              + +
              +

              2.4.2. Transfer function from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\)

              +
              +

              +The transfer functions from \(u_i\) to \(d\mathcal{L}_{m,i}\) are shown in Figure 52. +

              + + +
              +

              comp_plant_payloads_dvf.png +

              +

              Figure 52: Measured Frequency Response Functions from \(u_i\) to \(d\mathcal{L}_{m,i}\) for all 4 payload conditions

              +
              + + +
              +

              +From Figure 52, we can observe few things: +

              +
                +
              • The obtained dynamics is changing a lot between the case without mass and when there is at least one added mass.
              • +
              • Between 1, 2 and 3 added masses, the dynamics is not much different, and it would be easier to design a controller only for these cases.
              • +
              • The flexible modes of the top plate is first decreased a lot when the first mass is added (from 700Hz to 400Hz). +This is due to the fact that the added mass is composed of two half cylinders which are not fixed together. +Therefore is adds a lot of mass to the top plate without adding a lot of rigidity in one direction. +When more than 1 mass layer is added, the half cylinders are added with some angles such that rigidity are added in all directions (see Figure 50). +In that case, the frequency of these flexible modes are increased. +In practice, the payload should be one solid body, and we should not see a massive decrease of the frequency of this flexible mode.
              • +
              • Flexible modes of the top plate are becoming less problematic as masses are added.
              • +
              • First flexible mode of the strut at 230Hz is not much decreased when mass is added. +However, its apparent amplitude is much decreased.
              • +
              + +
              +
              +
              + +
              +

              2.4.3. Transfer function from \(\bm{u}\) to \(\bm{\tau}_m\)

              +
              +

              +The transfer functions from \(u_i\) to \(\tau_{m,i}\) are shown in Figure 53. +

              + + +
              +

              comp_plant_payloads_iff.png +

              +

              Figure 53: Measured Frequency Response Functions from \(u_i\) to \(\tau_{m,i}\) for all 4 payload conditions

              +
              + +
              +

              +From Figure 53, we can see that for all added payloads, the transfer function from \(u_i\) to \(\tau_{m,i}\) always has alternating poles and zeros. +

              + +
              +
              +
              +
              + +
              +

              2.5. Comparison with the Simscape model

              +
              +
              +
              +

              2.5.1. System Identification

              +
              +

              +Let’s initialize the simscape model with the nano-hexapod fixed on top of the vibration table. +

              +
              +
              support.type = 1; % On top of vibration table
              +
              +
              + +

              +The model of the nano-hexapod is defined as shown bellow: +

              +
              +
              %% Initialize Nano-Hexapod
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ...
              +                                       'flex_top_type', '3dof', ...
              +                                       'motion_sensor_type', 'plates', ...
              +                                       'actuator_type', '2dof');
              +
              +
              + +

              +And finally, we add the same payloads as during the experiments: +

              +
              +
              payload.type = 1; % Payload / 1 "mass layer"
              +
              +
              + +

              +First perform the identification for the transfer functions from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\): +

              +
              +
              %% Identify the DVF Plant (transfer function from u to dLm)
              +clear io; io_i = 1;
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders
              +
              +%% Identification for all the added payloads
              +G_dL = {};
              +
              +for i = i_masses
              +    fprintf('i = %i\n', i)
              +    payload.type = i;
              +    G_dL(i+1) = {exp(-s*frf_ol.Ts)*linearize(mdl, io, 0.0, options)};
              +end
              +
              +
              + +
              +
              %% Identify the IFF Plant (transfer function from u to taum)
              +clear io; io_i = 1;
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors
              +
              +%% Identification for all the added payloads
              +G_tau = {};
              +
              +for i = 0:3
              +    fprintf('i = %i\n', i)
              +    payload.type = i;
              +    G_tau(i+1) = {exp(-s*frf_ol.Ts)*linearize(mdl, io, 0.0, options)};
              +end
              +
              +
              + +

              +The identified dynamics are then saved for further use. +

              +
              +
              save('mat/sim_vib_table_m.mat', 'G_tau', 'G_dL')
              +
              +
              +
              +
              + +
              +

              2.5.2. Transfer function from \(\bm{u}\) to \(d\bm{\mathcal{L}}_m\)

              +
              +

              +The measured FRF and the identified dynamics from \(u_i\) to \(d\mathcal{L}_{m,i}\) are compared in Figure 54. +A zoom near the “suspension” modes is shown in Figure 55. +

              + + +
              +

              comp_masses_model_exp_dvf.png +

              +

              Figure 54: Comparison of the transfer functions from \(u_i\) to \(d\mathcal{L}_{m,i}\) - measured FRF and identification from the Simscape model

              +
              + + +
              +

              comp_masses_model_exp_dvf_zoom.png +

              +

              Figure 55: Comparison of the transfer functions from \(u_i\) to \(d\mathcal{L}_{m,i}\) - measured FRF and identification from the Simscape model (Zoom)

              +
              + +
              +

              +The Simscape model is very accurately representing the measured dynamics up. +Only the flexible modes of the struts and of the top plate are not represented here as these elements are modelled as rigid bodies. +

              + +
              +
              +
              + +
              +

              2.5.3. Transfer function from \(\bm{u}\) to \(\bm{\tau}_m\)

              +
              +

              +The measured FRF and the identified dynamics from \(u_i\) to \(\tau_{m,i}\) are compared in Figure 56. +A zoom near the “suspension” modes is shown in Figure 57. +

              + + +
              +

              comp_masses_model_exp_iff.png +

              +

              Figure 56: Comparison of the transfer functions from \(u_i\) to \(\tau_{m,i}\) - measured FRF and identification from the Simscape model

              +
              + + +
              +

              comp_masses_model_exp_iff_zoom.png +

              +

              Figure 57: Comparison of the transfer functions from \(u_i\) to \(\tau_{m,i}\) - measured FRF and identification from the Simscape model (Zoom)

              +
              +
              +
              +
              + +
              +

              2.6. Integral Force Feedback Controller

              +
              +
              +
              +

              2.6.1. Robust IFF Controller

              +
              +

              +Based on the measured FRF from \(u_i\) to \(\tau_{m,i}\), the following IFF controller is developed: +

              +
              +
              %% IFF Controller
              +Kiff_g1 = (1/(s + 2*pi*20))*... % LPF: provides integral action above 20[Hz]
              +          (s/(s + 2*pi*20))*... % HPF: limit low frequency gain
              +          (1/(1 + s/2/pi/400)); % LPF: more robust to high frequency resonances
              +
              +
              + +

              +Then, the Root Locus plot of Figure 58 is used to estimate the optimal gain. +This Root Locus plot is computed from the Simscape model. +

              + +
              +

              iff_root_locus_masses.png +

              +

              Figure 58: Root Locus for the IFF control strategy (for all payload conditions).

              +
              + +

              +The found optimal IFF controller is: +

              +
              +
              %% Optimal controller
              +g_opt = -2e2;
              +Kiff = g_opt*Kiff_g1*eye(6);
              +
              +
              + +

              +It is saved for further use. +

              +
              +
              save('mat/Kiff_opt.mat', 'Kiff')
              +
              +
              + +

              +The corresponding experimental loop gains are shown in Figure 59. +

              + +
              +

              iff_loop_gain_masses.png +

              +

              Figure 59: Loop gain for the Integral Force Feedback controller

              +
              + +
              +

              +Based on the above analysis: +

              +
                +
              • The same IFF controller can be used to damp the suspension modes for all payload conditions
              • +
              • The IFF controller should be robust
              • +
              + +
              +
              +
              + +
              +

              2.6.2. Estimated Damped Plant from the Simscape model

              +
              +

              +Let’s initialize the simscape model with the nano-hexapod fixed on top of the vibration table. +

              +
              +
              support.type = 1; % On top of vibration table
              +
              +
              + +

              +The model of the nano-hexapod is defined as shown bellow: +

              +
              +
              %% Initialize the Simscape model in closed loop
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ...
              +                                       'flex_top_type', '3dof', ...
              +                                       'motion_sensor_type', 'plates', ...
              +                                       'actuator_type', '2dof', ...
              +                                       'controller_type', 'iff');
              +
              +
              + +

              +And finally, we add the same payloads as during the experiments: +

              +
              +
              payload.type = 1; % Payload / 1 "mass layer"
              +
              +
              + +
              +
              %% Identify the (damped) transfer function from u to dLm
              +clear io; io_i = 1;
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder)
              +
              +%% Identify for all add masses
              +G_dL = {};
              +
              +for i = i_masses
              +    payload.type = i;
              +    G_dL(i+1) = {exp(-s*frf_ol.Ts)*linearize(mdl, io, 0.0, options)};
              +end
              +
              +
              + +

              +The identified dynamics are then saved for further use. +

              +
              +
              save('mat/sim_iff_vib_table_m.mat', 'G_dL');
              +
              +
              + +
              +
              sim_iff = load('sim_iff_vib_table_m.mat', 'G_dL');
              +
              +
              + + +
              +

              damped_plant_model_masses.png +

              +

              Figure 60: Transfer function from \(u_i\) to \(d\mathcal{L}_{m,i}\) (without active damping) and from \(u^\prime_i\) to \(d\mathcal{L}_{m,i}\) (with IFF)

              +
              +
              +
              + +
              +

              2.6.3. Compute the identified FRF with IFF

              +
              +

              +The identification is performed without added mass, and with one, two and three layers of added cylinders. +

              +
              +
              i_masses = 0:3;
              +
              +
              + +

              +The following data are loaded: +

              +
                +
              • Va: the excitation voltage for the damped plant (corresponding to \(u^\prime_i\))
              • +
              • de: the measured motion by the 6 encoders (corresponding to \(d\bm{\mathcal{L}}_m\))
              • +
              +
              +
              %% Load Identification Data
              +meas_added_mass = {};
              +
              +for i_mass = i_masses
              +    for i_strut = 1:6
              +        meas_iff_mass(i_strut, i_mass+1) = {load(sprintf('frf_data_exc_strut_%i_iff_vib_table_%im.mat', i_strut, i_mass), 't', 'Va', 'de')};
              +    end
              +end
              +
              +
              + +

              +The window win and the frequency vector f are defined. +

              +
              +
              % Sampling Time [s]
              +Ts = (meas_iff_mass{1,1}.t(end) - (meas_iff_mass{1,1}.t(1)))/(length(meas_iff_mass{1,1}.t)-1);
              +
              +% Hannning Windows
              +win = hanning(ceil(1/Ts));
              +
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_iff_mass{1,1}.Va, meas_iff_mass{1,1}.de, win, [], [], 1/Ts);
              +
              +
              + +

              +Finally the \(6 \times 6\) transfer function matrix from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is estimated: +

              +
              +
              %% DVF Plant (transfer function from u to dLm)
              +G_dL = {};
              +
              +for i_mass = i_masses
              +    G_dL(i_mass+1) = {zeros(length(f), 6, 6)};
              +    for i_strut = 1:6
              +        G_dL{i_mass+1}(:,:,i_strut) = tfestimate(meas_iff_mass{i_strut, i_mass+1}.Va, meas_iff_mass{i_strut, i_mass+1}.de, win, [], [], 1/Ts);
              +    end
              +end
              +
              +
              + +

              +The identified dynamics are then saved for further use. +

              +
              +
              save('mat/frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL');
              +
              +
              +
              +
              + +
              +

              2.6.4. Comparison of the measured FRF and the Simscape model

              +
              +

              +The following figures are computed: +

              +
                +
              • Figure 61: the measured damped FRF are displayed
              • +
              • Figure 62: the open-loop and damped FRF are compared (diagonal elements)
              • +
              • Figure 63: the obtained damped FRF is compared with the identified damped from using the Simscape model
              • +
              + + +
              +

              damped_iff_plant_meas_frf.png +

              +

              Figure 61: Diagonal and off-diagonal of the measured FRF matrix for the damped plant

              +
              + + +
              +

              comp_undamped_damped_plant_meas_frf.png +

              +

              Figure 62: Damped and Undamped measured FRF (diagonal elements)

              +
              + + +
              +

              comp_iff_plant_frf_sim.png +

              +

              Figure 63: Comparison of the measured FRF and the identified dynamics from the Simscape model

              +
              + +
              +

              +The IFF control strategy effectively damps all the suspensions modes of the nano-hexapod whatever the payload is. +The obtained plant is easier to control (provided the flexible modes of the top platform are well damped). +

              + +
              +
              +
              + +
              +

              2.6.5. Change of coupling with IFF

              +
              +

              +The added damping using IFF reduces the coupling in the system near the suspensions modes that are damped. +It can be estimated by taking the ratio of the diagonal-term and the off-diagonal term. +

              + +

              +This is shown in Figure 64. +

              + + +
              +

              reduced_coupling_iff_masses.png +

              +

              Figure 64: Comparison of the coupling with and without IFF

              +
              +
              +
              +
              + +
              +

              2.7. Un-Balanced mass

              +
              +
              +
              +

              2.7.1. Introduction

              +
              + +
              +

              picture_unbalanced_payload.jpg +

              +

              Figure 65: Nano-Hexapod with unbalanced payload

              +
              +
              +
              + +
              +

              2.7.2. Compute the identified FRF with IFF

              +
              +

              +The following data are loaded: +

              +
                +
              • Va: the excitation voltage for the damped plant (corresponding to \(u^\prime_i\))
              • +
              • de: the measured motion by the 6 encoders (corresponding to \(d\bm{\mathcal{L}}_m\))
              • +
              +
              +
              %% Load Identification Data
              +meas_added_mass = {zeros(6,1)};
              +
              +for i_strut = 1:6
              +    meas_iff_mass(i_strut) = {load(sprintf('frf_data_exc_strut_%i_iff_vib_table_1m_unbalanced.mat', i_strut), 't', 'Va', 'de')};
              +end
              +
              +
              + +

              +The window win and the frequency vector f are defined. +

              +
              +
              % Sampling Time [s]
              +Ts = (meas_iff_mass{1}.t(end) - (meas_iff_mass{1}.t(1)))/(length(meas_iff_mass{1}.t)-1);
              +
              +% Hannning Windows
              +win = hanning(ceil(1/Ts));
              +
              +% And we get the frequency vector
              +[~, f] = tfestimate(meas_iff_mass{1}.Va, meas_iff_mass{1}.de, win, [], [], 1/Ts);
              +
              +
              + +

              +Finally the \(6 \times 6\) transfer function matrix from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is estimated: +

              +
              +
              %% DVF Plant (transfer function from u to dLm)
              +G_dL = zeros(length(f), 6, 6);
              +for i_strut = 1:6
              +    G_dL(:,:,i_strut) = tfestimate(meas_iff_mass{i_strut}.Va, meas_iff_mass{i_strut}.de, win, [], [], 1/Ts);
              +end
              +
              +
              + +

              +The identified dynamics are then saved for further use. +

              +
              +
              save('mat/frf_iff_unbalanced_vib_table_m.mat', 'f', 'Ts', 'G_dL');
              +
              +
              +
              +
              + +
              +

              2.7.3. Effect of an unbalanced payload

              +
              +

              +The transfer functions from \(u_i\) to \(d\mathcal{L}_i\) are shown in Figure 66. +Due to the unbalanced payload, the system is not symmetrical anymore, and therefore each of the diagonal elements are not equal. +This is due to the fact that each strut is not affected by the same inertia. +

              + + +
              +

              frf_damp_unbalanced_mass.png +

              +

              Figure 66: Transfer function from \(u_i\) to \(d\mathcal{L}_i\) for the nano-hexapod with an unbalanced payload

              +
              +
              +
              +
              + + + +
              +

              2.8. Conclusion

              +
              +

              In this section, the dynamics of the nano-hexapod with the encoders fixed to the plates is studied.

              @@ -2357,8 +3163,8 @@ It has been found that:

              • The measured dynamics is in agreement with the dynamics of the simscape model, up to the flexible modes of the top plate. -See figures 39 and 40 for the transfer function to the force sensors and Figures 42 and 43for the transfer functions to the encoders
              • -
              • The Integral Force Feedback strategy is very effective in damping the suspension modes of the nano-hexapod (Figure 46).
              • +See figures 39 and 40 for the transfer function to the force sensors and Figures 42 and 43for the transfer functions to the encoders +
              • The Integral Force Feedback strategy is very effective in damping the suspension modes of the nano-hexapod (Figure 46).
              • The transfer function from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) show nice dynamical properties and is a much better candidate for the high-authority-control than when the encoders were fixed to the struts. At least up to the flexible modes of the top plate, the diagonal elements of the transfer function matrix have alternating poles and zeros, and the phase is moving smoothly. Only the flexible modes of the top plates seems to be problematic for control.
              • @@ -2369,23 +3175,23 @@ Only the flexible modes of the top plates seems to be problematic for control.
              -
              -

              3 Decentralized High Authority Control with Integral Force Feedback

              +
              +

              3. Decentralized High Authority Control with Integral Force Feedback

              - +

              -In this section is studied the HAC-LAC architecture for the Nano-Hexapod. +In this section is studied the HAC-IFF architecture for the Nano-Hexapod. More precisely:

                -
              • The LAC control is a decentralized force feedback as studied in Section 2.3
              • +
              • The LAC control is a decentralized integral force feedback as studied in Section 2.3
              • The HAC control is a decentralized controller working in the frame of the struts

              -The corresponding control architecture is shown in Figure 50 with: +The corresponding control architecture is shown in Figure 67 with:

              • \(\bm{r}_{\mathcal{X}_n}\): the \(6 \times 1\) reference signal in the cartesian frame
              • @@ -2398,86 +3204,267 @@ The corresponding control architecture is shown in Figure
              -
              +

              control_architecture_hac_iff_struts.png

              -

              Figure 50: HAC-LAC: IFF + Control in the frame of the legs

              +

              Figure 67: HAC-LAC: IFF + Control in the frame of the legs

              +

              +This part is structured as follow: +

                -
              • Section 3.1: the decentralized high authority controller is tuned using the Simscape model
              • -
              • Section 3.3: the controller is implemented and tested experimentally
              • -
              • Section 3.2: some reference tracking tests are performed
              • +
              • Section 3.1: some reference tracking tests are performed
              • +
              • Section 3.2: the decentralized high authority controller is tuned using the Simscape model and is implemented and tested experimentally
              • +
              • Section 3.3: an interaction analysis is performed, from which the best decoupling strategy can be determined
              • +
              • Section 3.4: Robust High Authority Controller are designed
              -
              -

              3.1 High Authority Controller

              +
              +

              3.1. Reference Tracking - Trajectories

              - +

              -In this section, the decentralized high authority controller \(\bm{K}_{\mathcal{L}}\) is first tuned using the Simscape model. +In this section, several trajectories representing the wanted pose (position and orientation) of the top platform with respect to the bottom platform are defined.

              + +

              +These trajectories will be used to test the HAC-LAC architecture. +

              + +

              +In order to transform the wanted pose to the wanted displacement of the 6 struts, the inverse kinematic is required. +As a first approximation, the Jacobian matrix \(\bm{J}\) can be used instead of using the full inverse kinematic equations. +

              + +

              +Therefore, the control architecture with the input trajectory \(\bm{r}_{\mathcal{X}_n}\) is shown in Figure 68. +

              + + +
              +

              control_architecture_hac_iff_struts_L.png +

              +

              Figure 68: HAC-LAC: IFF + Control in the frame of the legs

              -
              -

              3.1.1 Simscape Model

              + +

              +In the following sections, several reference trajectories are defined: +

              +
                +
              • Section 3.1.1: simple scans in the Y-Z plane
              • +
              • Section 3.1.2: scans in tilt are performed
              • +
              • Section 3.1.3: scans with X-Y-Z translations in order to draw the word “NASS”
              • +
              +
              +
              +

              3.1.1. Y-Z Scans

              -First initialized the nano-hexapod with a flexible APA model and with the IFF control strategy. + +A function generateYZScanTrajectory has been developed (accessible here) in order to easily generate scans in the Y-Z plane. +

              + +

              +For instance, the following generated trajectory is represented in Figure 69.

              -
              %% Initialize the Simscape model
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              -                                       'actuator_type', 'flexible', ...
              -                                       'controller_type', 'iff');
              +
              %% Generate the Y-Z trajectory scan
              +Rx_yz = generateYZScanTrajectory(...
              +    'y_tot', 4e-6, ... % Length of Y scans [m]
              +    'z_tot', 4e-6, ... % Total Z distance [m]
              +    'n', 5, ...     % Number of Y scans
              +    'Ts', 1e-3, ... % Sampling Time [s]
              +    'ti', 1, ...    % Time to go to initial position [s]
              +    'tw', 0, ...    % Waiting time between each points [s]
              +    'ty', 0.6, ...  % Time for a scan in Y [s]
              +    'tz', 0.2);     % Time for a scan in Z [s]
              +
              +
              + + +
              +

              yz_scan_example_trajectory_yz_plane.png +

              +

              Figure 69: Generated scan in the Y-Z plane

              +
              + +

              +The Y and Z positions as a function of time are shown in Figure 70. +

              + + +
              +

              yz_scan_example_trajectory.png +

              +

              Figure 70: Y and Z trajectories as a function of time

              +
              + +

              +Using the Jacobian matrix, it is possible to compute the wanted struts lengths as a function of time: +

              +\begin{equation} + \bm{r}_{d\mathcal{L}} = \bm{J} \bm{r}_{\mathcal{X}_n} +\end{equation} + +
              +
              %% Compute the reference in the frame of the legs
              +dL_ref = [J*Rx_yz(:, 2:7)']';
               

              -Then the controller is loaded +The reference signal for the strut length is shown in Figure 71.

              -
              -
              %% Load the decentralized IFF controller
              -load('Kiff.mat', 'Kiff')
              -
              -
              -

              -The inputs and outputs for the transfer function estimation are defined. +

              +

              yz_scan_example_trajectory_struts.png

              -
              -
              %% Identify the (damped) transfer function from u to dLm for different values of the IFF gain
              -clear io; io_i = 1;
              -io(io_i) = linio([mdl, '/du'],  1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              -io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder)
              -
              -
              - -

              -And the plant from \(\bm{u}^\prime\) to \(d\bm{\mathcal{L}}_m\) is identified and the bode plot of its diagonal terms are shown in Figure 51. -

              -
              -
              %% Identified of the damped TF from u' to dL
              -Gd_iff_opt = exp(-s*Ts)*linearize(mdl, io, 0.0, options);
              -
              -
              - - -
              -

              hac_iff_struts_enc_plates_plant_bode.png -

              -

              Figure 51: Transfer functions from \(u\) to \(d\mathcal{L}_m\) with IFF (diagonal and off-diagonal elements)

              +

              Figure 71: Trajectories for the 6 individual struts

              -
              -

              3.1.2 HAC Controller

              +
              +

              3.1.2. Tilt Scans

              +

              + +

              + +

              +A function generalSpiralAngleTrajectory has been developed in order to easily generate \(R_x,R_y\) tilt scans. +

              + +

              +For instance, the following generated trajectory is represented in Figure 72. +

              +
              +
              %% Generate the "tilt-spiral" trajectory scan
              +R_tilt = generateSpiralAngleTrajectory(...
              +    'R_tot',  20e-6, ... % Total Tilt [ad]
              +    'n_turn', 5, ...     % Number of scans
              +    'Ts',     1e-3, ...  % Sampling Time [s]
              +    't_turn', 1, ...     % Turn time [s]
              +    't_end',  1);        % End time to go back to zero [s]
              +
              +
              + + +
              +

              tilt_scan_example_trajectory.png +

              +

              Figure 72: Generated “spiral” scan

              +
              + +

              +The reference signal for the strut length is shown in Figure 73. +

              + +
              +

              tilt_scan_example_trajectory_struts.png +

              +

              Figure 73: Trajectories for the 6 individual struts - Tilt scan

              +
              +
              +
              + +
              +

              3.1.3. “NASS” reference path

              +
              +

              + +In this section, a reference path that “draws” the work “NASS” is developed. +

              + +

              +First, a series of points representing each letter are defined. +Between each letter, a negative Z motion is performed. +

              +
              +
              %% List of points that draws "NASS"
              +ref_path = [ ...
              +    0, 0,0; % Initial Position
              +    0,0,1; 0,4,1; 3,0,1; 3,4,1; % N
              +    3,4,0; 4,0,0; % Transition
              +    4,0,1; 4,3,1; 5,4,1; 6,4,1; 7,3,1; 7,2,1; 4,2,1; 4,3,1; 5,4,1; 6,4,1; 7,3,1; 7,0,1; % A
              +    7,0,0; 8,0,0; % Transition
              +    8,0,1; 11,0,1; 11,2,1; 8,2,1; 8,4,1; 11,4,1; % S
              +    11,4,0; 12,0,0; % Transition
              +    12,0,1; 15,0,1; 15,2,1; 12,2,1; 12,4,1; 15,4,1; % S
              +    15,4,0;
              +           ];
              +
              +%% Center the trajectory arround zero
              +ref_path = ref_path - (max(ref_path) - min(ref_path))/2;
              +
              +%% Define the X-Y-Z cuboid dimensions containing the trajectory
              +X_max = 10e-6;
              +Y_max =  4e-6;
              +Z_max =  2e-6;
              +
              +ref_path = ([X_max, Y_max, Z_max]./max(ref_path)).*ref_path; % [m]
              +
              +
              + +

              +Then, using the generateXYZTrajectory function, the \(6 \times 1\) trajectory signal is computed. +

              +
              +
              %% Generating the trajectory
              +Rx_nass = generateXYZTrajectory('points', ref_path);
              +
              +
              + +

              +The trajectory in the X-Y plane is shown in Figure 74 (the transitions between the letters are removed). +

              + +
              +

              ref_track_test_nass.png +

              +

              Figure 74: Reference path corresponding to the “NASS” acronym

              +
              + +

              +It can also be better viewed in a 3D representation as in Figure 75. +

              + + +
              +

              ref_track_test_nass_3d.png +

              +

              Figure 75: Reference path that draws “NASS” - 3D view

              +
              +
              +
              +
              + +
              +

              3.2. First Basic High Authority Controller

              +
              +

              + +

              +

              +In this section, a simple decentralized high authority controller \(\bm{K}_{\mathcal{L}}\) is developed to work without any payload. +

              + +

              +The diagonal controller is tuned using classical Loop Shaping in Section 3.2.1. +The stability is verified in Section 3.2.2 using the Simscape model. +

              +
              +
              +

              3.2.1. HAC Controller

              +
              +

              + +

              +

              Let’s first try to design a first decentralized controller with:

              @@ -2488,31 +3475,39 @@ Let’s first try to design a first decentralized controller with:

              -After some very basic and manual loop shaping, the following controller is developed: +After some very basic and manual loop shaping, A diagonal controller is developed. +Each diagonal terms are identical and are composed of:

              +
                +
              • A lead around 100Hz
              • +
              • A first order low pass filter starting at 200Hz to add some robustness to high frequency modes
              • +
              • A notch at 700Hz to cancel the flexible modes of the top plate
              • +
              • A pure integrator
              • +
              +
              -
              %% Lead to increase phase margin
              -a  = 2;  % Amount of phase lead / width of the phase lead / high frequency gain
              -wc = 2*pi*100; % Frequency with the maximum phase lead [rad/s]
              +
              %% Lead to increase phase margin
              +a  = 2;  % Amount of phase lead / width of the phase lead / high frequency gain
              +wc = 2*pi*100; % Frequency with the maximum phase lead [rad/s]
               
              -H_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)));
              +H_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)));
               
              -%% Low Pass filter to increase robustness
              -H_lpf = 1/(1 + s/2/pi/200);
              +%% Low Pass filter to increase robustness
              +H_lpf = 1/(1 + s/2/pi/200);
               
              -%% Notch at the top-plate resonance
              +%% Notch at the top-plate resonance
               gm = 0.02;
               xi = 0.3;
              -wn = 2*pi*700;
              +wn = 2*pi*700;
               
              -H_notch = (s^2 + 2*gm*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2);
              +H_notch = (s^2 + 2*gm*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2);
               
              -%% Decentralized HAC
              -Khac_iff_struts = -(1/(2.87e-5)) * ... % Gain
              -                  H_lead * ...       % Lead
              -                  H_notch * ...      % Notch
              -                  (2*pi*100/s) * ... % Integrator
              -                  eye(6);            % 6x6 Diagonal
              +%% Decentralized HAC
              +Khac_iff_struts = -(1/(2.87e-5)) * ... % Gain
              +                  H_lead * ...       % Lead
              +                  H_notch * ...      % Notch
              +                  (2*pi*100/s) * ... % Integrator
              +                  eye(6);            % 6x6 Diagonal
               
              @@ -2525,53 +3520,64 @@ This controller is saved for further use.

              -The Loop Gain is computed and shown in Figure 52. +The experimental loop gain is computed and shown in Figure 76.

              -
              Lhac_iff_struts = Khac_iff_struts*Gd_iff_opt;
              +
              L_hac_iff_struts = pagemtimes(permute(frf_iff.G_dL{1}, [2 3 1]), squeeze(freqresp(Khac_iff_struts, frf_iff.f, 'Hz')));
               
              -
              +

              loop_gain_hac_iff_struts.png

              -

              Figure 52: Diagonal and off-diagonal elements of the Loop gain for “HAC-IFF-Struts”

              +

              Figure 76: Diagonal and off-diagonal elements of the Loop gain for “HAC-IFF-Struts”

              -
              -

              3.1.3 Verification of the Stability using the Simscape model

              -
              +
              +

              3.2.2. Verification of the Stability using the Simscape model

              +
              +

              + +

              +

              The HAC-IFF control strategy is implemented using Simscape.

              -
              %% Initialize the Simscape model in closed loop
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              -                                       'flex_top_type', '4dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              -                                       'actuator_type', 'flexible', ...
              +
              %% Initialize the Simscape model in closed loop
              +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ...
              +                                       'flex_top_type', '4dof', ...
              +                                       'motion_sensor_type', 'plates', ...
              +                                       'actuator_type', 'flexible', ...
                                                      'controller_type', 'hac-iff-struts');
               
              +
              +
              %% Identify the (damped) transfer function from u to dLm
              +clear io; io_i = 1;
              +io(io_i) = linio([mdl, '/du'], 1, 'openinput');  io_i = io_i + 1; % Actuator Inputs
              +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder)
              +
              +
              +

              We identify the closed-loop system.

              -
              %% Identification
              +
              %% Identification
               Gd_iff_hac_opt = linearize(mdl, io, 0.0, options);
               
              -

              And verify that it is indeed stable.

              -
              %% Verify the stability
              +
              %% Verify the stability
               isstable(Gd_iff_hac_opt)
               
              @@ -2582,296 +3588,19 @@ isstable(Gd_iff_hac_opt)
              -
              -

              3.1.4 Experimental Loop Gain

              -
              -

              -Now, the loop gain is estimated from the measured FRF. -

              -
              -
              L_frf = zeros(size(G_enc_iff_opt));
              -
              -for i = 1:size(G_enc_iff_opt, 1)
              -    L_frf(i, :, :) = squeeze(G_enc_iff_opt(i,:,:))*freqresp(Khac_iff_struts, f(i), 'Hz');
              -end
              -
              -
              - -

              -The bode plot of the loop gain is shown in Figure 53. -

              - -
              -

              hac_iff_plates_exp_loop_gain_diag.png -

              -

              Figure 53: Diagonal and Off-diagonal elements of the Loop gain (experimental data)

              -
              -
              -
              -
              - -
              -

              3.2 Reference Tracking - Trajectories

              -
              -

              - -

              -

              -In this section, several trajectories representing the wanted pose (position and orientation) of the top platform with respect to the bottom platform are defined. -

              - -

              -These trajectories will be used to test the HAC-LAC architecture. -

              - -

              -In order to transform the wanted pose to the wanted displacement of the 6 struts, the inverse kinematic is required. -As a first approximation, the Jacobian matrix can be used instead of using the full inverse kinematic equations. -

              - -

              -Therefore, the control architecture with the input trajectory \(\bm{r}_{\mathcal{X}_n}\) is shown in Figure 54. -

              - - -
              -

              control_architecture_hac_iff_L.png -

              -

              Figure 54: HAC-LAC: IFF + Control in the frame of the legs

              -
              - -

              -In the following sections, several reference trajectories are defined: -

              -
                -
              • Section 3.2.1: simple scans in the Y-Z plane
              • -
              • Section 3.2.2: scans in tilt are performed
              • -
              • Section 3.2.3: scans with X-Y-Z translations in order to draw the word “NASS”
              • -
              -
              -
              -

              3.2.1 Y-Z Scans

              -
              -

              - -

              -
              -
              -
              3.2.1.1 Generate the Scan
              -
              -

              -A function generateYZScanTrajectory has been developed (accessible here) in order to easily generate scans in the Y-Z plane. -

              - -

              -For instance, the following generated trajectory is represented in Figure 55. -

              -
              -
              %% Generate the Y-Z trajectory scan
              -Rx_yz = generateYZScanTrajectory(...
              -    'y_tot', 4e-6, ... % Length of Y scans [m]
              -    'z_tot', 8e-6, ... % Total Z distance [m]
              -    'n', 5, ...     % Number of Y scans
              -    'Ts', 1e-3, ... % Sampling Time [s]
              -    'ti', 2, ...    % Time to go to initial position [s]
              -    'tw', 0.5, ...  % Waiting time between each points [s]
              -    'ty', 2, ...    % Time for a scan in Y [s]
              -    'tz', 1);       % Time for a scan in Z [s]
              -
              -
              - - -
              -

              yz_scan_example_trajectory_yz_plane.png -

              -

              Figure 55: Generated scan in the Y-Z plane

              -
              - -

              -The Y and Z positions as a function of time are shown in Figure 56. -

              - - -
              -

              yz_scan_example_trajectory.png -

              -

              Figure 56: Y and Z trajectories as a function of time

              -
              -
              -
              - -
              -
              3.2.1.2 Reference Signal for the Strut lengths
              -
              -

              -Using the Jacobian matrix, it is possible to compute the wanted struts lengths as a function of time: -

              -\begin{equation} - \bm{r}_{d\mathcal{L}} = \bm{J} \bm{r}_{\mathcal{X}_n} -\end{equation} - -
              -
              dL_ref = [n_hexapod.geometry.J*Rx_yz(:, 2:7)']';
              -
              -
              - -

              -The reference signal for the strut length is shown in Figure 57. -

              - -
              -

              yz_scan_example_trajectory_struts.png -

              -

              Figure 57: Trajectories for the 6 individual struts

              -
              -
              -
              - -
              -
              3.2.1.3 Time domain simulation with 2DoF model
              -
              -

              -Before trying to follow this reference with the nano-hexapod, let’s try to do it using the Simscape model. -

              - -

              -The nano-hexapod is initialized with the APA modelled as 2DoF system (for the simulation to run quickly). -

              -
              -
              %% Initialize the Simscape model in closed loop
              -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ...
              -                                       'flex_top_type', '3dof', ...
              -                                       'motion_sensor_type', 'plates', ...
              -                                       'actuator_type', '2dof', ...
              -                                       'controller_type', 'hac-iff-struts');
              -
              -
              - -

              -The reference path as well as the measured motion are compared in Figure 58. -

              - -
              -

              ref_track_hac_iff_struts_yz_plane.png -

              -

              Figure 58: Simulated Y-Z motion

              -
              - -

              -The motion errors are computed and shown in Figure 59. -It is clear that the hexapod is indeed tracking the reference path. -However, in this simulation, no disturbances are included nor sensor noises. -

              - -
              -

              ref_track_hac_iff_struts_pos_error.png -

              -

              Figure 59: Positioning errors as a function of time

              -
              -
              -
              -
              - -
              -

              3.2.2 Tilt Scans

              -
              -

              - -

              -
              -
              - -
              -

              3.2.3 “NASS” reference path

              +
              +

              3.2.3. Experimental Validation

              - -In this section, a reference path that “draws” the work “NASS” is developed. +Both the Integral Force Feedback controller (developed in Section 2.3) and the high authority controller working in the frame of the struts (developed in Section 3.2) are implemented experimentally.

              -First, a series of points representing each letter are defined. -Between each letter, a negative Z motion is performed. -

              -
              -
              %% List of points that draws "NASS"
              -ref_path = [ ...
              -    0, 0,0; % Initial Position
              -    0,0,1; 0,4,1; 3,0,1; 3,4,1; % N
              -    3,4,0; 4,0,0; % Transition
              -    4,0,1; 4,3,1; 5,4,1; 6,4,1; 7,3,1; 7,2,1; 4,2,1; 4,3,1; 5,4,1; 6,4,1; 7,3,1; 7,0,1; % A
              -    7,0,0; 8,0,0; % Transition
              -    8,0,1; 11,0,1; 11,2,1; 8,2,1; 8,4,1; 11,4,1; % S
              -    11,4,0; 12,0,0; % Transition
              -    12,0,1; 15,0,1; 15,2,1; 12,2,1; 12,4,1; 15,4,1; % S
              -    15,4,0;
              -           ];
              -
              -%% Center the trajectory arround zero
              -ref_path = ref_path - (max(ref_path) - min(ref_path))/2;
              -
              -%% Define the X-Y-Z cuboid dimensions containing the trajectory
              -X_max = 10e-6;
              -Y_max =  4e-6;
              -Z_max =  2e-6;
              -
              -ref_path = ([X_max, Y_max, Z_max]./max(ref_path)).*ref_path; % [m]
              -
              -
              - -

              -Then, using the generateXYZTrajectory function, the \(6 \times 1\) trajectory signal is computed. -

              -
              -
              %% Generating the trajectory
              -Rx_nass = generateXYZTrajectory('points', ref_path);
              -
              -
              - -

              -The trajectory in the X-Y plane is shown in Figure 60 (the transitions between the letters are removed). -

              - -
              -

              ref_track_test_nass.png -

              -

              Figure 60: Reference path corresponding to the “NASS” acronym

              -
              - -

              -It can also be better viewed in a 3D representation as in Figure 61. -

              - - -
              -

              ref_track_test_nass_3d.png -

              -

              Figure 61: Reference path that draws “NASS” - 3D view

              -
              -
              -
              -
              - -
              -

              3.3 First Experimental Tests with the HAC

              -
              -

              - -

              -

              -Both the Integral Force Feedback controller (developed in Section 2.3) and the high authority controller working in the frame of the struts (developed in Section 3.1) are implemented experimentally. -

              -
              - -
              -

              3.3.1 Initial Controller

              -
              -

              -The controller designed in Section 3.1 is implemented experimentally and some reference tracking tests are performed. +Two reference tracking experiments are performed to evaluate the stability and performances of the implemented control.

              -
              %% Load the experimental data
              +
              %% Load the experimental data
               load('hac_iff_struts_yz_scans.mat', 't', 'de')
               
              @@ -2880,25 +3609,39 @@ load('hac_iff_struts_yz_scans.mat',
              -
              %% Pose of the top platform from the encoder values
              +
              %% Pose of the top platform from the encoder values
               load('jacobian.mat', 'J');
              -Xe = [inv(J)*de']';
              +Xe = [inv(J)*de']';
              +
              +
              + +
              +
              %% Generate the Y-Z trajectory scan
              +Rx_yz = generateYZScanTrajectory(...
              +    'y_tot', 4e-6, ... % Length of Y scans [m]
              +    'z_tot', 8e-6, ... % Total Z distance [m]
              +    'n', 5, ...     % Number of Y scans
              +    'Ts', 1e-3, ... % Sampling Time [s]
              +    'ti', 1, ...    % Time to go to initial position [s]
              +    'tw', 0, ...    % Waiting time between each points [s]
              +    'ty', 0.6, ...  % Time for a scan in Y [s]
              +    'tz', 0.2);     % Time for a scan in Z [s]
               

              -The reference path as well as the measured position are partially shown in the Y-Z plane in Figure 62. +The reference path as well as the measured position are partially shown in the Y-Z plane in Figure 77.

              -
              +

              yz_scans_exp_results_first_K.png

              -

              Figure 62: Measured position \(\bm{\mathcal{X}}_n\) and reference signal \(\bm{r}_{\mathcal{X}_n}\) in the Y-Z plane - Zoom on a change of direction

              +

              Figure 77: Measured position \(\bm{\mathcal{X}}_n\) and reference signal \(\bm{r}_{\mathcal{X}_n}\) in the Y-Z plane - Zoom on a change of direction

              -
              +

              -It is clear from Figure 62 that the position of the nano-hexapod effectively tracks to reference signal. +It is clear from Figure 77 that the position of the nano-hexapod effectively tracks to reference signal. However, oscillations with amplitudes as large as 50nm can be observe.

              @@ -2912,54 +3655,54 @@ In the next section, the controller is re-designed to improve the stability marg
              -
              -

              3.3.2 Controller with increased stability margins

              -
              +
              +

              3.2.4. Controller with increased stability margins

              +

              The High Authority Controller is re-designed in order to improve the stability margins.

              -
              %% Lead
              -a  = 5;  % Amount of phase lead / width of the phase lead / high frequency gain
              -wc = 2*pi*110; % Frequency with the maximum phase lead [rad/s]
              +
              %% Lead
              +a  = 5;  % Amount of phase lead / width of the phase lead / high frequency gain
              +wc = 2*pi*110; % Frequency with the maximum phase lead [rad/s]
               
              -H_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)));
              +H_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)));
               
              -%% Low Pass Filter
              -H_lpf = 1/(1 + s/2/pi/300);
              +%% Low Pass Filter
              +H_lpf = 1/(1 + s/2/pi/300);
               
              -%% Notch
              +%% Notch
               gm = 0.02;
               xi = 0.5;
              -wn = 2*pi*700;
              +wn = 2*pi*700;
               
              -H_notch = (s^2 + 2*gm*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2);
              +H_notch = (s^2 + 2*gm*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2);
               
              -%% HAC Controller
              -Khac_iff_struts = -2.2e4 * ... % Gain
              -            H_lead * ...       % Lead
              -            H_lpf * ...        % Lead
              -            H_notch * ...      % Notch
              -            (2*pi*100/s) * ... % Integrator
              -            eye(6);            % 6x6 Diagonal
              +%% HAC Controller
              +Khac_iff_struts = -2.2e4 * ... % Gain
              +            H_lead * ...       % Lead
              +            H_lpf * ...        % Lead
              +            H_notch * ...      % Notch
              +            (2*pi*100/s) * ... % Integrator
              +            eye(6);            % 6x6 Diagonal
               

              -The bode plot of the new loop gain is shown in Figure 63. +The bode plot of the new loop gain is shown in Figure 78.

              -
              +

              hac_iff_plates_exp_loop_gain_redesigned_K.png

              -

              Figure 63: Loop Gain for the updated decentralized HAC controller

              +

              Figure 78: Loop Gain for the updated decentralized HAC controller

              This new controller is implemented experimentally and several tracking tests are performed.

              -
              %% Load Measurements
              +
              %% Load Measurements
               load('hac_iff_more_lead_nass_scan.mat', 't', 'de')
               
              @@ -2968,43 +3711,43 @@ load('hac_iff_more_lead_nass_scan.mat',
              -
              %% Compute the pose of the top platform
              +
              %% Compute the pose of the top platform
               load('jacobian.mat', 'J');
              -Xe = [inv(J)*de']';
              +Xe = [inv(J)*de']';
               

              -The measured motion as well as the trajectory are shown in Figure 64. +The measured motion as well as the trajectory are shown in Figure 79.

              -
              +

              nass_scans_first_test_exp.png

              -

              Figure 64: Measured position \(\bm{\mathcal{X}}_n\) and reference signal \(\bm{r}_{\mathcal{X}_n}\) for the “NASS” trajectory

              +

              Figure 79: Measured position \(\bm{\mathcal{X}}_n\) and reference signal \(\bm{r}_{\mathcal{X}_n}\) for the “NASS” trajectory

              -The trajectory and measured motion are also shown in the X-Y plane in Figure 65. +The trajectory and measured motion are also shown in the X-Y plane in Figure 80.

              -
              +

              ref_track_nass_exp_hac_iff_struts.png

              -

              Figure 65: Reference path and measured motion in the X-Y plane

              +

              Figure 80: Reference path and measured motion in the X-Y plane

              -The orientations errors as a function of time are shown in Figure 66. +The orientation errors during all the scans are shown in Figure 81.

              -
              -

              ref_track_nass_exp_hac_iff_struts_errors_angle.png +

              +

              nass_ref_rx_ry.png

              -

              Figure 66: Orientation errors as a function of time during the “NASS” trajectory

              +

              Figure 81: Orientation errors during the scan

              -
              +

              Using the updated High Authority Controller, the nano-hexapod can follow trajectories with high accuracy (the position errors are in the order of 50nm peak to peak, and the orientation errors 300nrad peak to peak).

              @@ -3013,283 +3756,1157 @@ Using the updated High Authority Controller, the nano-hexapod can follow traject
              + +
              +

              3.3. Interaction Analysis and Decoupling

              +
              +

              + +

              +

              +In this section, the interaction in the identified plant is estimated using the Relative Gain Array (RGA) (Skogestad and Postlethwaite 2007, 3.4). +

              + +

              +Then, several decoupling strategies are compared for the nano-hexapod. +

              + +

              +The RGA Matrix is defined as follow: +

              +\begin{equation} + \text{RGA}(G(f)) = G(f) \times (G(f)^{-1})^T +\end{equation} + +

              +Then, the RGA number is defined: +

              +\begin{equation} +\text{RGA-num}(f) = \| \text{I - RGA(G(f))} \|_{\text{sum}} +\end{equation} + + +

              +In this section, the plant with 2 added mass is studied. +

              +
              +
              +

              3.3.1. Parameters

              +
              +
              +
              wc = 100; % Wanted crossover frequency [Hz]
              +[~, i_wc] = min(abs(frf_iff.f - wc)); % Indice corresponding to wc
              +
              -
              -

              4 Functions

              +
              +
              %% Plant to be decoupled
              +frf_coupled = frf_iff.G_dL{2};
              +G_coupled = sim_iff.G_dL{2};
              +
              +
              +
              +
              + +
              +

              3.3.2. No Decoupling (Decentralized)

              +
              +

              + +

              + + +
              +

              decoupling_arch_decentralized.png +

              +

              Figure 82: Block diagram representing the plant.

              +
              + + +
              +

              interaction_decentralized_plant.png +

              +

              Figure 83: Bode Plot of the decentralized plant (diagonal and off-diagonal terms)

              +
              + + +
              +

              interaction_rga_decentralized.png +

              +

              Figure 84: RGA number for the decentralized plant

              +
              +
              +
              + +
              +

              3.3.3. Static Decoupling

              +
              +

              + +

              + + +
              +

              decoupling_arch_static.png +

              +

              Figure 85: Decoupling using the inverse of the DC gain of the plant

              +
              + +

              +The DC gain is evaluated from the model as be have bad low frequency identification. +

              + +
              Table 2: Description of the identified modes
              + + +++ ++ ++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              -62011.53910.64299.3660.7-4016.5-4373.6
              3914.4-61991.2-4356.8-4019.2640.24281.6
              -4020.0-4370.5-62004.53914.64295.8653.8
              660.94292.43903.3-62012.2-4366.5-4008.9
              4302.8655.6-4025.8-4377.8-62006.03919.7
              -4377.9-4013.2668.64303.73906.8-62019.3
              + + +
              +

              interaction_static_dec_plant.png +

              +

              Figure 86: Bode Plot of the static decoupled plant

              +
              + + +
              +

              interaction_rga_static_dec.png +

              +

              Figure 87: RGA number for the statically decoupled plant

              +
              +
              +
              + +
              +

              3.3.4. Decoupling at the Crossover

              +
              +

              + +

              + + +
              +

              decoupling_arch_crossover.png +

              +

              Figure 88: Decoupling using the inverse of a dynamical model \(\bm{\hat{G}}\) of the plant dynamics \(\bm{G}\)

              +
              + + + + +++ ++ ++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              67229.83769.3-13704.6-23084.8-6318.223378.7
              3486.267708.923220.0-6314.5-22699.8-14060.6
              -5731.722471.766701.43070.2-13205.6-21944.6
              -23305.5-14542.62743.270097.624846.8-5295.0
              -14882.9-22957.8-5344.425786.270484.62979.9
              24353.3-5195.2-22449.0-14459.22203.669484.2
              + + +
              +

              interaction_wc_plant.png +

              +

              Figure 89: Bode Plot of the plant decoupled at the crossover

              +
              + +
              +
              %% Compute RGA Matrix
              +RGA_wc = zeros(size(frf_coupled));
              +for i = 1:length(frf_iff.f)
              +    RGA_wc(i,:,:) = squeeze(G_dL_wc(i,:,:)).*inv(squeeze(G_dL_wc(i,:,:))).';
              +end
              +
              +%% Compute RGA-number
              +RGA_wc_sum = zeros(size(RGA_wc, 1), 1);
              +for i = 1:size(RGA_wc, 1)
              +    RGA_wc_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_wc(i,:,:)))));
              +end
              +
              +
              + + +
              +

              interaction_rga_wc.png +

              +

              Figure 90: RGA number for the plant decoupled at the crossover

              +
              +
              +
              + +
              +

              3.3.5. SVD Decoupling

              +
              +

              + +

              + + +
              +

              decoupling_arch_svd.png +

              +

              Figure 91: Decoupling using the Singular Value Decomposition

              +
              + + +
              +

              interaction_svd_plant.png +

              +

              Figure 92: Bode Plot of the plant decoupled using the Singular Value Decomposition

              +
              + +
              +
              %% Compute the RGA matrix for the SVD decoupled plant
              +RGA_svd = zeros(size(frf_coupled));
              +for i = 1:length(frf_iff.f)
              +    RGA_svd(i,:,:) = squeeze(G_dL_svd(i,:,:)).*inv(squeeze(G_dL_svd(i,:,:))).';
              +end
              +
              +%% Compute the RGA-number
              +RGA_svd_sum = zeros(size(RGA_svd, 1), 1);
              +for i = 1:length(frf_iff.f)
              +    RGA_svd_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_svd(i,:,:)))));
              +end
              +
              +
              + +
              +
              %% RGA Number for the SVD decoupled plant
              +figure;
              +plot(frf_iff.f, RGA_svd_sum, 'k-');
              +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
              +xlabel('Frequency [Hz]'); ylabel('RGA Number');
              +xlim([10, 1e3]); ylim([1e-2, 1e2]);
              +
              +
              + + +
              +

              interaction_rga_svd.png +

              +

              Figure 93: RGA number for the plant decoupled using the SVD

              +
              +
              +
              + +
              +

              3.3.6. Dynamic decoupling

              +
              +

              + +

              + + +
              +

              decoupling_arch_dynamic.png +

              +

              Figure 94: Decoupling using the inverse of a dynamical model \(\bm{\hat{G}}\) of the plant dynamics \(\bm{G}\)

              +
              + + +
              +

              interaction_dynamic_dec_plant.png +

              +

              Figure 95: Bode Plot of the dynamically decoupled plant

              +
              + + +
              +

              interaction_rga_dynamic_dec.png +

              +

              Figure 96: RGA number for the dynamically decoupled plant

              +
              +
              +
              + +
              +

              3.3.7. Jacobian Decoupling - Center of Stiffness

              +
              +

              + +

              + + +
              +

              decoupling_arch_jacobian_cok.png +

              +

              Figure 97: Decoupling using Jacobian matrices evaluated at the Center of Stiffness

              +
              + + +
              +

              interaction_J_cok_plant.png +

              +

              Figure 98: Bode Plot of the plant decoupled using the Jacobian evaluated at the “center of stiffness”

              +
              + + +
              +

              interaction_rga_J_cok.png +

              +

              Figure 99: RGA number for the plant decoupled using the Jacobian evaluted at the Center of Stiffness

              +
              +
              +
              + +
              +

              3.3.8. Jacobian Decoupling - Center of Mass

              +
              +

              + +

              + + +
              +

              decoupling_arch_jacobian_com.png +

              +

              Figure 100: Decoupling using Jacobian matrices evaluated at the Center of Mass

              +
              + + +
              +

              interaction_J_com_plant.png +

              +

              Figure 101: Bode Plot of the plant decoupled using the Jacobian evaluated at the Center of Mass

              +
              + + +
              +

              interaction_rga_J_com.png +

              +

              Figure 102: RGA number for the plant decoupled using the Jacobian evaluted at the Center of Mass

              +
              +
              +
              + +
              +

              3.3.9. Decoupling Comparison

              +
              +

              + +

              + +

              +Let’s now compare all of the decoupling methods (Figure 103). +

              + +
              +

              +From Figure 103, the following remarks are made: +

              +
                +
              • Decentralized plant: well decoupled below suspension modes
              • +
              • Static inversion: similar to the decentralized plant as the decentralized plant has already a good decoupling at low frequency
              • +
              • Crossover inversion: the decoupling is improved around the crossover frequency as compared to the decentralized plant. However, the decoupling is increased at lower frequency.
              • +
              • SVD decoupling: Very good decoupling up to 235Hz. Especially between 100Hz and 200Hz.
              • +
              • Dynamic Inversion: the plant is very well decoupled at frequencies where the model is accurate (below 235Hz where flexible modes are not modelled).
              • +
              • Jacobian - Stiffness: good decoupling at low frequency. The decoupling increases at the frequency of the suspension modes, but is acceptable up to the strut flexible modes (235Hz).
              • +
              • Jacobian - Mass: bad decoupling at low frequency. Better decoupling above the frequency of the suspension modes, and acceptable decoupling up to the strut flexible modes (235Hz).
              • +
              + +
              + + +
              +

              interaction_compare_rga_numbers.png +

              +

              Figure 103: Comparison of the obtained RGA-numbers for all the decoupling methods

              +
              +
              +
              + +
              +

              3.3.10. Decoupling Robustness

              +
              +

              + +

              + +

              +Let’s now see how the decoupling is changing when changing the payload’s mass. +

              +
              +
              frf_new = frf_iff.G_dL{3};
              +
              +
              + +

              +The obtained RGA-numbers are shown in Figure 104. +

              + +
              +

              +From Figure 104: +

              +
                +
              • The decoupling using the Jacobian evaluated at the “center of stiffness” seems to give the most robust results.
              • +
              + +
              + + +
              +

              interaction_compare_rga_numbers_rob.png +

              +

              Figure 104: Change of the RGA-number with a change of the payload. Indication of the robustness of the inversion method.

              +
              +
              +
              + +
              +

              3.3.11. Conclusion

              +
              +
              +

              +Several decoupling methods can be used: +

              +
                +
              • SVD
              • +
              • Inverse
              • +
              • Jacobian (CoK)
              • +
              + +
              + + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              Table 3: Summary of the interaction analysis and different decoupling strategies
              MethodRGADiag PlantRobustness
              Decentralized--Equal++
              Static dec.--Equal++
              Crossover dec.-Equal0
              SVD++Diff+
              Dynamic dec.++Unity, equal-
              Jacobian - CoK+Diff++
              Jacobian - CoM0Diff+
              +
              +
              +
              + +
              +

              3.4. Robust High Authority Controller

              +
              +

              + +

              +

              +In this section we wish to develop a robust High Authority Controller (HAC) that is working for all payloads. +

              + +

              +(Indri and Oboe 2020) +

              +
              +
              +

              3.4.1. Using Jacobian evaluated at the center of stiffness

              +
              +
              +
              +
              3.4.1.1. Decoupled Plant
              +
              +
              +
              G_nom = frf_iff.G_dL{2}; % Nominal Plant
              +
              +
              + + +
              +

              bode_plot_hac_iff_plant_jacobian_cok.png +

              +

              Figure 105: Bode plot of the decoupled plant using the Jacobian evaluated at the Center of Stiffness

              +
              +
              +
              + +
              +
              3.4.1.2. SISO Controller Design
              +
              +

              +As the diagonal elements of the plant are not equal, several SISO controllers are designed and then combined to form a diagonal controller. +All the diagonal terms of the controller consists of: +

              +
                +
              • A double integrator to have high gain at low frequency
              • +
              • A lead around the crossover frequency to increase stability margins
              • +
              • Two second order low pass filters above the crossover frequency to increase the robustness to high frequency modes
              • +
              +
              +
              + +
              +
              3.4.1.3. Obtained Loop Gain
              +
              + +
              +

              bode_plot_hac_iff_loop_gain_jacobian_cok.png +

              +

              Figure 106: Bode plot of the Loop Gain when using the Jacobian evaluated at the Center of Stiffness to decouple the system

              +
              + +
              +
              %% Controller to be implemented
              +Kd = inv(J_cok')*input_normalize*ss(Kd_diag)*inv(Js_cok);
              +
              +
              +
              +
              + +
              +
              3.4.1.4. Verification of the Stability
              +
              +

              +Now the stability of the feedback loop is verified using the generalized Nyquist criteria. +

              + + +
              +

              loci_hac_iff_loop_gain_jacobian_cok.png +

              +

              Figure 107: Loci of \(L(j\omega)\) in the complex plane.

              +
              +
              +
              + +
              +
              3.4.1.5. Save for further analysis
              +
              +
              +
              save('mat/Khac_iff_struts_jacobian_cok.mat', 'Kd')
              +
              +
              +
              +
              +
              + +
              +

              3.4.2. Using Singular Value Decomposition

              +
              +
              +
              +
              3.4.2.1. Decoupled Plant
              +
              +
              +
              G_nom = frf_iff.G_dL{2}; % Nominal Plant
              +
              +
              + + +
              +

              bode_plot_hac_iff_plant_svd.png +

              +

              Figure 108: Bode plot of the decoupled plant using the SVD

              +
              +
              +
              + +
              +
              3.4.2.2. Controller Design
              +
              +
              +
              3.4.2.3. Loop Gain
              +
              + +
              +

              bode_plot_hac_iff_loop_gain_svd.png +

              +

              Figure 109: Bode plot of Loop Gain when using the SVD

              +
              +
              +
              + +
              +
              3.4.2.4. Stability Verification
              +
              +
              +
              %% Compute the Eigenvalues of the loop gain
              +Ldet = zeros(3, 6, length(frf_iff.f));
              +
              +for i = 1:3
              +    Lmimo = pagemtimes(permute(frf_iff.G_dL{i}, [2,3,1]),squeeze(freqresp(Kd, frf_iff.f, 'Hz')));
              +    for i_f = 2:length(frf_iff.f)
              +        Ldet(i,:, i_f) = eig(squeeze(Lmimo(:,:,i_f)));
              +    end
              +end
              +
              +
              + + +
              +

              loci_hac_iff_loop_gain_svd.png +

              +

              Figure 110: Locis of \(L(j\omega)\) in the complex plane.

              +
              +
              +
              + +
              +
              3.4.2.5. Save for further analysis
              +
              +
              +
              save('mat/Khac_iff_struts_svd.mat', 'Kd')
              +
              +
              +
              +
              +
              +
              +
              + +
              +

              4. Functions

              -
              -

              4.1 generateXYZTrajectory

              +
              +

              4.1. generateXYZTrajectory

              - +

              -
              -

              Function description

              -
              +
              +

              Function description

              +
              function [ref] = generateXYZTrajectory(args)
              -% generateXYZTrajectory -
              +% generateXYZTrajectory -
               %
              -% Syntax: [ref] = generateXYZTrajectory(args)
              +% Syntax: [ref] = generateXYZTrajectory(args)
               %
              -% Inputs:
              -%    - args
              +% Inputs:
              +%    - args
               %
              -% Outputs:
              -%    - ref - Reference Signal
              +% Outputs:
              +%    - ref - Reference Signal
               
              -
              -

              Optional Parameters

              -
              +
              +

              Optional Parameters

              +
              -
              arguments
              -    args.points double {mustBeNumeric} = zeros(2, 3) % [m]
              +
              arguments
              +    args.points double {mustBeNumeric} = zeros(2, 3) % [m]
               
              -    args.ti    (1,1) double {mustBeNumeric, mustBePositive} = 1 % Time to go to first point and after last point [s]
              -    args.tw    (1,1) double {mustBeNumeric, mustBePositive} = 0.5 % Time wait between each point [s]
              -    args.tm    (1,1) double {mustBeNumeric, mustBePositive} = 1 % Motion time between points [s]
              +    args.ti    (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % Time to go to first point and after last point [s]
              +    args.tw    (1,1) double {mustBeNumeric, mustBeNonnegative} = 0.5 % Time wait between each point [s]
              +    args.tm    (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % Motion time between points [s]
               
              -    args.Ts    (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % Sampling Time [s]
              +    args.Ts    (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % Sampling Time [s]
               end
               
              -
              -

              Initialize Time Vectors

              -
              +
              +

              Initialize Time Vectors

              +
              -
              time_i = 0:args.Ts:args.ti;
              -time_w = 0:args.Ts:args.tw;
              -time_m = 0:args.Ts:args.tm;
              +
              time_i = 0:args.Ts:args.ti;
              +time_w = 0:args.Ts:args.tw;
              +time_m = 0:args.Ts:args.tm;
               
              -
              -

              XYZ Trajectory

              -
              +
              +

              XYZ Trajectory

              +
              -
              % Go to initial position
              -xyz = (args.points(1,:))'*(time_i/args.ti);
              +
              % Go to initial position
              +xyz = (args.points(1,:))'*(time_i/args.ti);
               
              -% Wait
              -xyz = [xyz, xyz(:,end).*ones(size(time_w))];
              +% Wait
              +xyz = [xyz, xyz(:,end).*ones(size(time_w))];
               
              -% Scans
              -for i = 2:size(args.points, 1)
              -    % Go to next point
              -    xyz = [xyz, xyz(:,end) + (args.points(i,:)' - xyz(:,end))*(time_m/args.tm)];
              -    % Wait a litle bit
              -    xyz = [xyz, xyz(:,end).*ones(size(time_w))];
              +% Scans
              +for i = 2:size(args.points, 1)
              +    % Go to next point
              +    xyz = [xyz, xyz(:,end) + (args.points(i,:)' - xyz(:,end))*(time_m/args.tm)];
              +    % Wait a litle bit
              +    xyz = [xyz, xyz(:,end).*ones(size(time_w))];
               end
               
              -% End motion
              -xyz = [xyz, xyz(:,end) - xyz(:,end)*(time_i/args.ti)];
              +% End motion
              +xyz = [xyz, xyz(:,end) - xyz(:,end)*(time_i/args.ti)];
               
              -
              -

              Reference Signal

              -
              +
              +

              Reference Signal

              +
              -
              t = 0:args.Ts:args.Ts*(length(xyz) - 1);
              +
              t = 0:args.Ts:args.Ts*(length(xyz) - 1);
               
              ref = zeros(length(xyz), 7);
               
              -ref(:, 1) = t;
              -ref(:, 2:4) = xyz';
              +ref(:, 1) = t;
              +ref(:, 2:4) = xyz';
               
              -
              -

              4.2 generateYZScanTrajectory

              +
              +

              4.2. generateYZScanTrajectory

              - +

              -
              -

              Function description

              -
              +
              +

              Function description

              +
              function [ref] = generateYZScanTrajectory(args)
              -% generateYZScanTrajectory -
              +% generateYZScanTrajectory -
               %
              -% Syntax: [ref] = generateYZScanTrajectory(args)
              +% Syntax: [ref] = generateYZScanTrajectory(args)
               %
              -% Inputs:
              -%    - args
              +% Inputs:
              +%    - args
               %
              -% Outputs:
              -%    - ref - Reference Signal
              +% Outputs:
              +%    - ref - Reference Signal
               
              -
              -

              Optional Parameters

              -
              +
              +

              Optional Parameters

              +
              -
              arguments
              -    args.y_tot (1,1) double {mustBeNumeric} = 10e-6 % [m]
              -    args.z_tot (1,1) double {mustBeNumeric} = 10e-6 % [m]
              +
              arguments
              +    args.y_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [m]
              +    args.z_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [m]
               
              -    args.n     (1,1) double {mustBeInteger, mustBePositive} = 10 % [-]
              +    args.n     (1,1) double {mustBeInteger, mustBePositive} = 10 % [-]
               
              -    args.Ts    (1,1) double {mustBeNumeric, mustBePositive} = 1e-4 % [s]
              +    args.Ts    (1,1) double {mustBeNumeric, mustBePositive} = 1e-4 % [s]
               
              -    args.ti    (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
              -    args.tw    (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
              -    args.ty    (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
              -    args.tz    (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
              +    args.ti    (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s]
              +    args.tw    (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s]
              +    args.ty    (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s]
              +    args.tz    (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s]
               end
               
              -
              -

              Initialize Time Vectors

              -
              +
              +

              Initialize Time Vectors

              +
              -
              time_i = 0:args.Ts:args.ti;
              -time_w = 0:args.Ts:args.tw;
              -time_y = 0:args.Ts:args.ty;
              -time_z = 0:args.Ts:args.tz;
              +
              time_i = 0:args.Ts:args.ti;
              +time_w = 0:args.Ts:args.tw;
              +time_y = 0:args.Ts:args.ty;
              +time_z = 0:args.Ts:args.tz;
               
              -
              -

              Y and Z vectors

              -
              +
              +

              Y and Z vectors

              +
              -
              % Go to initial position
              -y = (time_i/args.ti)*(args.y_tot/2);
              +
              % Go to initial position
              +y = (time_i/args.ti)*(args.y_tot/2);
               
              -% Wait
              -y = [y, y(end)*ones(size(time_w))];
              +% Wait
              +y = [y, y(end)*ones(size(time_w))];
               
              -% Scans
              -for i = 1:args.n
              -    if mod(i,2) == 0
              -        y = [y, -(args.y_tot/2) + (time_y/args.ty)*args.y_tot];
              +% Scans
              +for i = 1:args.n
              +    if mod(i,2) == 0
              +        y = [y, -(args.y_tot/2) + (time_y/args.ty)*args.y_tot];
                   else
              -        y = [y,  (args.y_tot/2) - (time_y/args.ty)*args.y_tot];
              +        y = [y,  (args.y_tot/2) - (time_y/args.ty)*args.y_tot];
                   end
               
              -    if i < args.n
              -        y = [y, y(end)*ones(size(time_z))];
              +    if i < args.n
              +        y = [y, y(end)*ones(size(time_z))];
                   end
               end
               
              -% Wait a litle bit
              -y = [y, y(end)*ones(size(time_w))];
              +% Wait a litle bit
              +y = [y, y(end)*ones(size(time_w))];
               
              -% End motion
              -y = [y, y(end) - y(end)*time_i/args.ti];
              +% End motion
              +y = [y, y(end) - y(end)*time_i/args.ti];
               
              -
              % Go to initial position
              -z = (time_i/args.ti)*(args.z_tot/2);
              +
              % Go to initial position
              +z = (time_i/args.ti)*(args.z_tot/2);
               
              -% Wait
              -z = [z, z(end)*ones(size(time_w))];
              +% Wait
              +z = [z, z(end)*ones(size(time_w))];
               
              -% Scans
              -for i = 1:args.n
              -    z = [z, z(end)*ones(size(time_y))];
              +% Scans
              +for i = 1:args.n
              +    z = [z, z(end)*ones(size(time_y))];
               
              -    if i < args.n
              -        z = [z, z(end) - (time_z/args.tz)*args.z_tot/(args.n-1)];
              +    if i < args.n
              +        z = [z, z(end) - (time_z/args.tz)*args.z_tot/(args.n-1)];
                   end
               end
               
              -% Wait a litle bit
              -z = [z, z(end)*ones(size(time_w))];
              +% Wait a litle bit
              +z = [z, z(end)*ones(size(time_w))];
               
              -% End motion
              -z = [z, z(end) - z(end)*time_i/args.ti];
              +% End motion
              +z = [z, z(end) - z(end)*time_i/args.ti];
               
              -
              -

              Reference Signal

              -
              +
              +

              Reference Signal

              +
              -
              t = 0:args.Ts:args.Ts*(length(y) - 1);
              +
              t = 0:args.Ts:args.Ts*(length(y) - 1);
               
              ref = zeros(length(y), 7);
               
              -ref(:, 1) = t;
              -ref(:, 3) = y;
              -ref(:, 4) = z;
              +ref(:, 1) = t;
              +ref(:, 3) = y;
              +ref(:, 4) = z;
               
              -
              -

              4.3 getTransformationMatrixAcc

              +
              +

              4.3. generateSpiralAngleTrajectory

              - +

              -
              -

              Function description

              -
              +
              +

              Function description

              +
              -
              function [M] = getTransformationMatrixAcc(Opm, Osm)
              -% getTransformationMatrixAcc -
              +
              function [ref] = generateSpiralAngleTrajectory(args)
              +% generateSpiralAngleTrajectory -
               %
              -% Syntax: [M] = getTransformationMatrixAcc(Opm, Osm)
              +% Syntax: [ref] = generateSpiralAngleTrajectory(args)
               %
              -% Inputs:
              -%    - Opm - Nx3 (N = number of accelerometer measurements) X,Y,Z position of accelerometers
              -%    - Opm - Nx3 (N = number of accelerometer measurements) Unit vectors representing the accelerometer orientation
              +% Inputs:
              +%    - args
               %
              -% Outputs:
              -%    - M - Transformation Matrix
              +% Outputs:
              +%    - ref - Reference Signal
               
              -
              -

              Transformation matrix from motion of the solid body to accelerometer measurements

              -
              +
              +

              Optional Parameters

              +
              +
              +
              arguments
              +    args.R_tot  (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [rad]
              +    args.n_turn (1,1) double {mustBeInteger, mustBePositive} = 5 % [-]
              +    args.Ts     (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [s]
              +    args.t_turn (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
              +    args.t_end  (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
              +end
              +
              +
              +
              +
              + +
              +

              Initialize Time Vectors

              +
              +
              +
              time_s = 0:args.Ts:args.n_turn*args.t_turn;
              +time_e = 0:args.Ts:args.t_end;
              +
              +
              +
              +
              + +
              +

              Rx and Ry vectors

              +
              +
              +
              Rx = sin(2*pi*time_s/args.t_turn).*(args.R_tot*time_s/(args.n_turn*args.t_turn));
              +Ry = cos(2*pi*time_s/args.t_turn).*(args.R_tot*time_s/(args.n_turn*args.t_turn));
              +
              +
              + +
              +
              Rx = [Rx, 0*time_e];
              +Ry = [Ry, Ry(end) - Ry(end)*time_e/args.t_end];
              +
              +
              +
              +
              + +
              +

              Reference Signal

              +
              +
              +
              t = 0:args.Ts:args.Ts*(length(Rx) - 1);
              +
              +
              + +
              +
              ref = zeros(length(Rx), 7);
              +
              +ref(:, 1) = t;
              +ref(:, 5) = Rx;
              +ref(:, 6) = Ry;
              +
              +
              +
              +
              +
              + +
              +

              4.4. getTransformationMatrixAcc

              +
              +

              + +

              +
              + +
              +

              Function description

              +
              +
              +
              function [M] = getTransformationMatrixAcc(Opm, Osm)
              +% getTransformationMatrixAcc -
              +%
              +% Syntax: [M] = getTransformationMatrixAcc(Opm, Osm)
              +%
              +% Inputs:
              +%    - Opm - Nx3 (N = number of accelerometer measurements) X,Y,Z position of accelerometers
              +%    - Opm - Nx3 (N = number of accelerometer measurements) Unit vectors representing the accelerometer orientation
              +%
              +% Outputs:
              +%    - M - Transformation Matrix
              +
              +
              +
              +
              + +
              +

              Transformation matrix from motion of the solid body to accelerometer measurements

              +

              Let’s try to estimate the x-y-z acceleration of any point of the solid body from the acceleration/angular acceleration of the solid body expressed in \(\{O\}\). For any point \(p_i\) of the solid body (corresponding to an accelerometer), we can write: @@ -3352,7 +4969,7 @@ a_i = \begin{bmatrix} And finally we can combine the 6 (line) vectors for the 6 accelerometers to write that in a matrix form. We obtain Eq. \eqref{eq:M_matrix}.

              -
              +

              The transformation from solid body acceleration \({}^O\vec{x}\) from sensor measured acceleration \(\vec{a}\) is:

              @@ -3376,12 +4993,12 @@ Let’s define such matrix using matlab:
              M = zeros(length(Opm), 6);
               
              -for i = 1:length(Opm)
              -    Ri = [0,         Opm(3,i), -Opm(2,i);
              -         -Opm(3,i),  0,         Opm(1,i);
              -          Opm(2,i), -Opm(1,i),  0];
              -    M(i, 1:3) = Osm(:,i)';
              -    M(i, 4:6) = Osm(:,i)'*Ri;
              +for i = 1:length(Opm)
              +    Ri = [0,         Opm(3,i), -Opm(2,i);
              +         -Opm(3,i),  0,         Opm(1,i);
              +          Opm(2,i), -Opm(1,i),  0];
              +    M(i, 1:3) = Osm(:,i)';
              +    M(i, 4:6) = Osm(:,i)'*Ri;
               end
               
              @@ -3395,70 +5012,76 @@ Let’s define such matrix using matlab:
              -
              -

              4.4 getJacobianNanoHexapod

              -
              +
              +

              4.5. getJacobianNanoHexapod

              +

              - +

              -
              -

              Function description

              -
              +
              +

              Function description

              +
              function [J] = getJacobianNanoHexapod(Hbm)
              -% getJacobianNanoHexapod -
              +% getJacobianNanoHexapod -
               %
              -% Syntax: [J] = getJacobianNanoHexapod(Hbm)
              +% Syntax: [J] = getJacobianNanoHexapod(Hbm)
               %
              -% Inputs:
              -%    - Hbm - Height of {B} w.r.t. {M} [m]
              +% Inputs:
              +%    - Hbm - Height of {B} w.r.t. {M} [m]
               %
              -% Outputs:
              -%    - J - Jacobian Matrix
              +% Outputs:
              +%    - J - Jacobian Matrix
               
              -
              -

              Transformation matrix from motion of the solid body to accelerometer measurements

              -
              +
              +

              Transformation matrix from motion of the solid body to accelerometer measurements

              +
              -
              Fa = [[-86.05,  -74.78, 22.49],
              -      [ 86.05,  -74.78, 22.49],
              -      [ 107.79, -37.13, 22.49],
              +
              Fa = [[-86.05,  -74.78, 22.49],
              +      [ 86.05,  -74.78, 22.49],
              +      [ 107.79, -37.13, 22.49],
                     [ 21.74,  111.91, 22.49],
              -      [-21.74,  111.91, 22.49],
              -      [-107.79, -37.13, 22.49]]'*1e-3; % Ai w.r.t. {F} [m]
              +      [-21.74,  111.91, 22.49],
              +      [-107.79, -37.13, 22.49]]'*1e-3; % Ai w.r.t. {F} [m]
               
              -Mb = [[-28.47, -106.25, -22.50],
              -      [ 28.47, -106.25, -22.50],
              -      [ 106.25, 28.47,  -22.50],
              -      [ 77.78,  77.78,  -22.50],
              -      [-77.78,  77.78,  -22.50],
              -      [-106.25, 28.47,  -22.50]]'*1e-3; % Bi w.r.t. {M} [m]
              +Mb = [[-28.47, -106.25, -22.50],
              +      [ 28.47, -106.25, -22.50],
              +      [ 106.25, 28.47,  -22.50],
              +      [ 77.78,  77.78,  -22.50],
              +      [-77.78,  77.78,  -22.50],
              +      [-106.25, 28.47,  -22.50]]'*1e-3; % Bi w.r.t. {M} [m]
               
              -H = 95e-3; % Stewart platform height [m]
              -Fb = Mb + [0; 0; H]; % Bi w.r.t. {F} [m]
              +H = 95e-3; % Stewart platform height [m]
              +Fb = Mb + [0; 0; H]; % Bi w.r.t. {F} [m]
               
              -si = Fb - Fa;
              -si = si./vecnorm(si); % Normalize
              +si = Fb - Fa;
              +si = si./vecnorm(si); % Normalize
               
              -Bb = Mb - [0; 0; Hbm];
              +Bb = Mb - [0; 0; Hbm];
               
              -J = [si', cross(Bb, si)'];
              +J = [si', cross(Bb, si)'];
               
              + +

              Bibliography

              +
              +
              Indri, Marina, and Roberto Oboe. 2020. Mechatronics and Robotics: New Trends and Challenges. CRC Press.
              +
              Skogestad, Sigurd, and Ian Postlethwaite. 2007. Multivariable Feedback Control: Analysis and Design - Second Edition. John Wiley.
              +

              Author: Dehaeze Thomas

              -

              Created: 2021-07-02 ven. 18:25

              +

              Created: 2021-08-11 mer. 00:07

              diff --git a/test-bench-nano-hexapod.org b/test-bench-nano-hexapod.org index 00a174f..6724428 100644 --- a/test-bench-nano-hexapod.org +++ b/test-bench-nano-hexapod.org @@ -16,6 +16,7 @@ #+LaTeX_CLASS: scrreprt #+LaTeX_CLASS_OPTIONS: [a4paper, 10pt, DIV=12, parskip=full] #+LaTeX_HEADER_EXTRA: \input{preamble.tex} +#+LATEX_HEADER_EXTRA: \addbibresource{ref.bib} #+PROPERTY: header-args:matlab :session *MATLAB* #+PROPERTY: header-args:matlab+ :comments org @@ -120,7 +121,7 @@ When possible, the notations are consistent with this diagram and summarized in #+name: tab:list_signals #+caption: List of signals #+attr_latex: :environment tabularx :width \linewidth :align Xllll -#+attr_latex: :center t :booktabs t :float t +#+attr_latex: :center t :booktabs t | | *Unit* | *Matlab* | *Vector* | *Elements* | |------------------------------------+-----------+-----------+-----------------------+----------------------| | Control Input (wanted DAC voltage) | =[V]= | =u= | $\bm{u}$ | $u_i$ | @@ -2633,16 +2634,16 @@ The obtained modes are summarized in Table [[tab:description_modes]]. #+name: tab:description_modes #+caption: Description of the identified modes #+attr_latex: :environment tabularx :width 0.7\linewidth :align ccX -#+attr_latex: :center t :booktabs t :float t -| Mode | Freq. [Hz] | Description | -|------+------------+----------------------------------------------| -| 1 | 105 | Suspension Mode: Y-translation | -| 2 | 107 | Suspension Mode: X-translation | -| 3 | 131 | Suspension Mode: Z-translation | -| 4 | 161 | Suspension Mode: Y-tilt | -| 5 | 162 | Suspension Mode: X-tilt | -| 6 | 180 | Suspension Mode: Z-rotation | -| 7 | 692 | (flexible) Membrane mode of the top platform | +#+attr_latex: :center t :booktabs t +| *Mode* | *Freq. [Hz]* | *Description* | +|--------+--------------+----------------------------------------------| +| 1 | 105 | Suspension Mode: Y-translation | +| 2 | 107 | Suspension Mode: X-translation | +| 3 | 131 | Suspension Mode: Z-translation | +| 4 | 161 | Suspension Mode: Y-tilt | +| 5 | 162 | Suspension Mode: X-tilt | +| 6 | 180 | Suspension Mode: Z-rotation | +| 7 | 692 | (flexible) Membrane mode of the top platform | *** Nano-Hexapod Compliance - Effect of IFF <> @@ -3263,9 +3264,6 @@ for i =1:6 set(gca,'ColorOrderIndex',i) plot(f, abs(G_dvf(:,i, i)), ... 'DisplayName', sprintf('$G_{dvf}(%i,%i)$', i, i)); - set(gca,'ColorOrderIndex',i) - plot(f, abs(G_dvf(:,i, i)), ... - 'HandleVisibility', 'off'); end plot(f, abs(G_dvf(:, 1, 2)), 'color', [0, 0, 0, 0.2], ... 'DisplayName', '$G_{dvf}(i,j)$'); @@ -3504,13 +3502,302 @@ n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ... 'actuator_type', 'flexible'); #+end_src +*** TODO Paper MEDSI :noexport: +#+begin_src matlab +%% Initialize Nano-Hexapod +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ... + 'flex_top_type', '4dof', ... + 'motion_sensor_type', 'plates', ... + 'actuator_type', 'flexible'); +#+end_src + +#+begin_src matlab +%% Identify the DVF Plant (transfer function from u to dLm) +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders + +Gdvf = exp(-s*Ts)*linearize(mdl, io, 0.0, options); +#+end_src + +#+begin_src matlab +%% Identify the IFF Plant (transfer function from u to taum) +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors + +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options); +#+end_src + +#+begin_src matlab :exports none +%% Diagonal elements of the DVF plant +freqs = logspace(log10(20), 3, 1000); + +colors = colororder; + +figure; +tiledlayout(3, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +plot(f, abs(G_dvf(:,1, 1)), 'color', [colors(1,:),0.2], ... + 'DisplayName', 'FRF') +for i = 2:6 + set(gca,'ColorOrderIndex',2) + plot(f, abs(G_dvf(:,i, i)), 'color', [colors(1,:),0.2], ... + 'HandleVisibility', 'off'); +end +set(gca,'ColorOrderIndex',2); +plot(freqs, abs(squeeze(freqresp(Gdvf(1,1), freqs, 'Hz'))), '-', ... + 'DisplayName', 'Model') +% for i = 2:6 +% set(gca,'ColorOrderIndex',2); +% plot(freqs, abs(squeeze(freqresp(Gdvf(i,i), freqs, 'Hz'))), '-', ... +% 'HandleVisibility', 'off'); +% end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([3e-7, 1e-3]); +legend('location', 'southwest', 'FontSize', 8); + +ax1b = nexttile([2,1]); +hold on; +plot(f, abs(G_iff(:,1, 1)), 'color', [colors(1,:),0.2]) +for i = 2:6 + set(gca,'ColorOrderIndex',2) + plot(f, abs(G_iff(:,i, i)), 'color', [colors(1,:),0.2]); +end +set(gca,'ColorOrderIndex',2); +plot(freqs, abs(squeeze(freqresp(Giff(1,1), freqs, 'Hz'))), '-') +% for i = 2:6 +% set(gca,'ColorOrderIndex',2); +% plot(freqs, abs(squeeze(freqresp(Giff(i,i), freqs, 'Hz'))), '-'); +% end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [V/V]'); set(gca, 'XTickLabel',[]); +ylim([3e-2, 1e2]); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_dvf(:,i, i)), 'color', [colors(1,:),0.2]); +end +for i = 1:1 + set(gca,'ColorOrderIndex',2); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gdvf(i,i), freqs, 'Hz'))), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-90, 180]); +yticks([-180, -90, 0, 90, 180]); + +ax2b = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_iff(:,i, i)), 'color', [colors(1,:),0.2]); +end +for i = 1:1 + set(gca,'ColorOrderIndex',2); + plot(freqs, 180/pi*angle(squeeze(freqresp(Giff(i,i), freqs, 'Hz'))), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-90, 180]); +yticks([-180, -90, 0, 90, 180]); + +linkaxes([ax1,ax2,ax1b,ax2b],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_identification_comp_simscape.pdf', 'width', 'half', 'height', 'normal'); +#+end_src + +#+name: fig:nano_hexapod_identification_comp_simscape +#+caption: +#+RESULTS: +[[file:figs/nano_hexapod_identification_comp_simscape.png]] + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_identification_comp_simscape_full.pdf', 'width', 'full', 'height', 'normal'); +#+end_src + +[[file:figs/nano_hexapod_identification_comp_simscape_full.png]] + +*** MEDSI Talk :noexport: + +#+begin_src matlab :exports none +%% Diagonal elements of the DVF plant +freqs = logspace(log10(20), 3, 1000); + +colors = colororder; + +figure; +tiledlayout(3, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +plot(f, abs(G_dvf(:,1, 1)), 'color', [colors(1,:),0.2], ... + 'DisplayName', 'FRF - $d_{e,i}/V_{a,i}$') +for i = 2:6 + plot(f, abs(G_dvf(:,i, i)), 'color', [colors(1,:),0.2], ... + 'HandleVisibility', 'off'); +end +plot(freqs, abs(squeeze(freqresp(Gdvf(1,1), freqs, 'Hz'))), '--', 'color', colors(1,:), ... + 'DisplayName', 'Model - $d_{e,i}/V_{a,i}$') +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([3e-7, 1e-3]); +legend('location', 'northwest', 'FontSize', 8); + +ax1b = nexttile([2,1]); +hold on; +for i = [2,5] + plot(f, abs(G_dvf(:,1, i)), 'color', [colors(i,:),0.5], ... + 'DisplayName', sprintf('FRF - $d_{e,1}/V_{a,%i}$', i)); +end +for i = [2,5] + plot(freqs, abs(squeeze(freqresp(Gdvf(1,i), freqs, 'Hz'))), '--', 'color', colors(i,:), ... + 'DisplayName', sprintf('Model - $d_{e,1}/V_{a,%i}$', i)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +set(gca, 'YTickLabel',[]); set(gca, 'XTickLabel',[]); +ylim([3e-7, 1e-3]); +legend('location', 'northwest', 'FontSize', 8); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_dvf(:,i, i)), 'color', [colors(1,:),0.2]); +end +plot(freqs, 180/pi*angle(squeeze(freqresp(Gdvf(i,i), freqs, 'Hz'))), '--', 'color', colors(1,:)); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); + +ax2b = nexttile; +hold on; +for i = [2,5] + plot(f, 180/pi*angle(G_dvf(:,1,i)), 'color', [colors(i,:),0.5]); +end +for i = [2,5] + plot(freqs, 180/pi*angle(squeeze(freqresp(Gdvf(1,i), freqs, 'Hz'))), '--', 'color', colors(i,:)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +set(gca, 'YTickLabel',[]); xlabel('Frequency [Hz]'); +ylim([-180, 180]); + +linkaxes([ax1,ax2,ax1b,ax2b],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_enc_bode_plot.pdf', 'width', 1500, 'height', 'tall'); +#+end_src + +#+name: fig:nano_hexapod_enc_bode_plot +#+caption: +#+RESULTS: +[[file:figs/nano_hexapod_enc_bode_plot.png]] + +#+begin_src matlab :exports none +%% Diagonal elements of the IFF plant +freqs = logspace(log10(20), 3, 1000); + +colors = colororder; + +figure; +tiledlayout(3, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +plot(f, abs(G_iff(:,1, 1)), 'color', [colors(1,:),0.2], ... + 'DisplayName', 'FRF - $V_{s,i}/V_{a,i}$') +for i = 2:6 + plot(f, abs(G_iff(:,i, i)), 'color', [colors(1,:),0.2], ... + 'HandleVisibility', 'off'); +end +plot(freqs, abs(squeeze(freqresp(Giff(1,1), freqs, 'Hz'))), '--', 'color', colors(1,:), ... + 'DisplayName', 'Model - $V_{s,i}/V_{a,i}$') +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [V/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-2, 1e2]); +legend('location', 'northwest', 'FontSize', 8); + +ax1b = nexttile([2,1]); +hold on; +for i = [2,3] + plot(f, abs(G_iff(:,1, i)), 'color', [colors(i,:),0.5], ... + 'DisplayName', sprintf('FRF - $V_{s,1}/V_{a,%i}$', i)); +end +for i = [2,3] + plot(freqs, abs(squeeze(freqresp(Giff(1,i), freqs, 'Hz'))), '--', 'color', colors(i,:), ... + 'DisplayName', sprintf('Model - $V_{s,1}/V_{a,%i}$', i)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +set(gca, 'YTickLabel',[]); set(gca, 'XTickLabel',[]); +ylim([1e-2, 1e2]); +legend('location', 'northwest', 'FontSize', 8); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_iff(:,i, i)), 'color', [colors(1,:),0.2]); +end +plot(freqs, 180/pi*angle(squeeze(freqresp(Giff(i,i), freqs, 'Hz'))), '--', 'color', colors(1,:)); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); + +ax2b = nexttile; +hold on; +for i = [2,3] + plot(f, 180/pi*angle(G_iff(:,1,i)), 'color', [colors(i,:),0.5]); +end +for i = [2,3] + plot(freqs, 180/pi*angle(squeeze(freqresp(Giff(1,i), freqs, 'Hz'))), '--', 'color', colors(i,:)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +set(gca, 'YTickLabel',[]); xlabel('Frequency [Hz]'); +ylim([-180, 180]); + +linkaxes([ax1,ax2,ax1b,ax2b],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_iff_bode_plot.pdf', 'width', 1500, 'height', 'tall'); +#+end_src + +#+name: fig:nano_hexapod_iff_bode_plot +#+caption: +#+RESULTS: +[[file:figs/nano_hexapod_iff_bode_plot.png]] + +#+begin_src matlab +#+end_src + *** Dynamics from Actuator to Force Sensors Then the transfer function from $\bm{u}$ to $\bm{\tau}_m$ is identified using the Simscape model. #+begin_src matlab %% Identify the IFF Plant (transfer function from u to taum) clear io; io_i = 1; -io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs -io(io_i) = linio([mdl, '/dum'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options); #+end_src @@ -3891,6 +4178,161 @@ exportFig('figs/enc_plates_dvf_comp_offdiag_simscape.pdf', 'width', 'wide', 'hei #+RESULTS: [[file:figs/enc_plates_dvf_comp_offdiag_simscape.png]] +*** TODO Flexible Top Plate +#+begin_src matlab +%% Initialize Nano-Hexapod +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ... + 'flex_top_type', '3dof', ... + 'motion_sensor_type', 'struts', ... + 'actuator_type', '2dof', ... + 'top_plate_type', 'rigid'); +#+end_src + +#+begin_src matlab +%% Identify the DVF Plant (transfer function from u to dLm) +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders + +Gdvf = linearize(mdl, io, 0.0, options); +#+end_src + +#+begin_src matlab +size(Gdvf) +isstable(Gdvf) +#+end_src + +#+begin_src matlab +[sys,g] = balreal(Gdvf); % Compute balanced realization +elim = (g<1e-4); % Small entries of g are negligible states +rsys = modred(sys,elim); % Remove negligible states +size(rsys) +#+end_src + +#+begin_src matlab :exports none +%% Diagonal elements of the DVF plant +freqs = logspace(-1, 3, 1000); + +figure; +hold on; +for i = 1:6 + plot(freqs, abs(squeeze(freqresp(Gdvf(i,i), freqs, 'Hz'))), '-', ... + 'DisplayName', sprintf('%i', i)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); +ylim([1e-8, 1e-3]); +xlim([freqs(1), freqs(end)]); +legend('location', 'northeast'); +#+end_src + +#+begin_src matlab :exports none +%% Diagonal elements of the DVF plant +freqs = 2*logspace(1, 3, 1000); + +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +plot(f, abs(G_dvf(:,1, 1)), 'color', [0,0,0,0.2], ... + 'DisplayName', '$d\mathcal{L}_{m,i}/u_i$ - FRF') +for i = 2:6 + set(gca,'ColorOrderIndex',2) + plot(f, abs(G_dvf(:,i, i)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); +end +set(gca,'ColorOrderIndex',2); +plot(freqs, abs(squeeze(freqresp(Gdvf(1,1), freqs, 'Hz'))), '-', ... + 'DisplayName', '$d\mathcal{L}_{m,i}/u_i$ - Model') +for i = 2:6 + set(gca,'ColorOrderIndex',2); + plot(freqs, abs(squeeze(freqresp(Gdvf(i,i), freqs, 'Hz'))), '-', ... + 'HandleVisibility', 'off'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-8, 1e-3]); +legend('location', 'northeast'); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_dvf(:,i, i)), 'color', [0,0,0,0.2]); +end +for i = 1:6 + set(gca,'ColorOrderIndex',2); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gdvf(i,i), freqs, 'Hz'))), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab +%% Identify the IFF Plant (transfer function from u to taum) +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors + +Giff = exp(-s*Ts)*linearize(mdl, io, 0.0, options); +#+end_src + +#+begin_src matlab :exports none +%% Bode plot of the identified IFF Plant (Simscape) and measured FRF data +freqs = 2*logspace(1, 3, 1000); + +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +plot(f, abs(G_iff(:,1, 1)), 'color', [0,0,0,0.2], ... + 'DisplayName', '$\tau_{m,i}/u_i$ - FRF') +for i = 2:6 + set(gca,'ColorOrderIndex',2) + plot(f, abs(G_iff(:,i, i)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); +end +set(gca,'ColorOrderIndex',2); +plot(freqs, abs(squeeze(freqresp(Giff(1,1), freqs, 'Hz'))), '-', ... + 'DisplayName', '$\tau_{m,i}/u_i$ - Model') +for i = 2:6 + set(gca,'ColorOrderIndex',2); + plot(freqs, abs(squeeze(freqresp(Giff(i,i), freqs, 'Hz'))), '-', ... + 'HandleVisibility', 'off'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [V/V]'); set(gca, 'XTickLabel',[]); +legend('location', 'southeast'); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_iff(:,i, i)), 'color', [0,0,0,0.2]); +end +for i = 1:6 + set(gca,'ColorOrderIndex',2); + plot(freqs, 180/pi*angle(squeeze(freqresp(Giff(i,i), freqs, 'Hz'))), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + *** Conclusion #+begin_important The Simscape model is quite accurate for the transfer function matrices from $\bm{u}$ to $\bm{\tau}_m$ and from $\bm{u}$ to $d\bm{\mathcal{L}}_m$ except at frequencies of the flexible modes of the top-plate. @@ -4143,7 +4585,7 @@ And the parameters used for the transfer function estimation are defined below. Ts = (meas_iff_plates{1}.t(end) - (meas_iff_plates{1}.t(1)))/(length(meas_iff_plates{1}.t)-1); % Hannning Windows -win = hanning(ceil(1*Fs)); +win = hanning(ceil(1/Ts)); % And we get the frequency vector [~, f] = tfestimate(meas_iff_plates{1}.Va, meas_iff_plates{1}.de, win, [], [], 1/Ts); @@ -4209,7 +4651,7 @@ ax2 = nexttile; hold on; for i = 1:6 set(gca,'ColorOrderIndex',1); - plot(f, 180/pi*angle(G_dvf(:,1,1)), '-') + plot(f, 180/pi*angle(G_dvf(:,i,i)), '-') set(gca,'ColorOrderIndex',2); plot(f, 180/pi*angle(G_enc_iff_opt(:,i,i)), '-') end @@ -4461,6 +4903,375 @@ From Figures [[fig:damped_iff_plates_plant_comp_diagonal]] and [[fig:damped_iff_ This is true to around 400Hz, then the dynamics depends on the flexible modes of the top plate which are not modelled. #+end_important +*** TODO Paper MEDSI :noexport: +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +freqs = logspace(log10(20), 3, 1000); + +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +% Undamped FRF +plot(f, abs(G_dvf(:,1, 1)), 'color', [0,0,0,0.2], ... + 'DisplayName', '$d\mathcal{L}/u$') +for i = 2:6 + set(gca,'ColorOrderIndex',2) + plot(f, abs(G_dvf(:,i, i)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); +end + +% Diagonal Elements FRF +plot(f, abs(G_enc_iff_opt(:,1,1)), 'color', [colors(1,:), 0.2], ... + 'DisplayName', 'FRF - $d\mathcal{L}/u^\prime$') +for i = 2:6 + plot(f, abs(G_enc_iff_opt(:,i,i)), 'color', [colors(1,:), 0.2], ... + 'HandleVisibility', 'off'); +end + +% Diagonal Elements Model +set(gca,'ColorOrderIndex',2) +plot(freqs, abs(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '--', ... + 'DisplayName', 'Model') + +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-7, 1e-3]); +legend('location', 'southwest', 'FontSize', 8); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(f, 180/pi*angle(G_dvf(:,i, i)), 'color', [0,0,0,0.2]); + plot(f, 180/pi*angle(G_enc_iff_opt(:,i,i)), 'color', [colors(1,:), 0.2]); +end +set(gca,'ColorOrderIndex',2) +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '--'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-90, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_identification_damp_comp_simscape.pdf', 'width', 'half', 'height', 'normal'); +#+end_src + +#+RESULTS: +[[file:figs/nano_hexapod_identification_damp_comp_simscape.png]] + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +freqs = logspace(log10(20), 3, 1000); + +figure; +tiledlayout(3, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +% Undamped FRF +plot(f, abs(G_dvf(:,1, 1)), 'color', [0,0,0,0.2], ... + 'DisplayName', '$d\mathcal{L}/u$') +for i = 2:6 + set(gca,'ColorOrderIndex',2) + plot(f, abs(G_dvf(:,i, i)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); +end + +% Diagonal Elements FRF +plot(f, abs(G_enc_iff_opt(:,1,1)), 'color', [colors(1,:), 0.2], ... + 'DisplayName', '$d\mathcal{L}/u^\prime$') +for i = 2:6 + plot(f, abs(G_enc_iff_opt(:,i,i)), 'color', [colors(1,:), 0.2], ... + 'HandleVisibility', 'off'); +end + +% Diagonal Elements Model +set(gca,'ColorOrderIndex',2) +plot(freqs, abs(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '-', 'LineWidth', 1, 'color', colors(2,:), ... + 'DisplayName', 'Model') +for i = 2:6 + plot(freqs, abs(squeeze(freqresp(Gd_iff(i,i), freqs, 'Hz'))), '-', 'LineWidth', 1, 'color', colors(2,:), ... + 'HandleVisibility', 'off'); +end + +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-7, 1e-3]); +legend('location', 'southwest', 'FontSize', 8); + +ax1b = nexttile([2,1]); +hold on; +% Off diagonal terms +plot(f, abs(G_dvf(:, 1, 2)), 'color', [0,0,0,0.2], ... + 'DisplayName', '$d\mathcal{L}_{m,i}/u_j$ - FRF') +for i = 1:5 + for j = i+1:6 + plot(f, abs(G_dvf(:, i, j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end + +% Off diagonal FRF +plot(f, abs(G_enc_iff_opt(:,1,2)), 'color', [colors(1,:), 0.2]) +for i = 1:5 + for j = i+1:6 + plot(f, abs(G_enc_iff_opt(:,i,j)), 'color', [colors(1,:), 0.2]); + end +end + +% Off diagonal Model +set(gca,'ColorOrderIndex',2) +plot(freqs, abs(squeeze(freqresp(Gd_iff(1,2), freqs, 'Hz'))), '-', 'LineWidth', 1) +for i = 1:5 + for j = i+1:6 + set(gca,'ColorOrderIndex',2) + plot(freqs, abs(squeeze(freqresp(Gd_iff(i,j), freqs, 'Hz')))); + end +end + +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +set(gca, 'XTickLabel',[]); set(gca, 'YTickLabel',[]); +ylim([1e-7, 1e-3]); + + +ax2 = nexttile; +hold on; +for i =1:6 + plot(f, 180/pi*angle(G_dvf(:,i, i)), 'color', [0,0,0,0.2]); + plot(f, 180/pi*angle(G_enc_iff_opt(:,i,i)), 'color', [colors(1,:), 0.2]); +end +set(gca,'ColorOrderIndex',2) +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '-', 'LineWidth', 1); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +ax2b = nexttile; +hold on; +% for i = 1:5 +% for j = i+1:6 +% plot(f, 180/pi*angle(G_dvf(:, i, j)), 'color', [0,0,0,0.2]); +% end +% end + +% Off diagonal FRF +for i = 1:5 + for j = i+1:6 + plot(f, 180/pi*angle(G_enc_iff_opt(:,i,j)), 'color', [colors(1,:), 0.2]); + end +end + +% Off diagonal Model +for i = 1:5 + for j = i+1:6 + set(gca,'ColorOrderIndex',2) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(i,j), freqs, 'Hz'))), 'LineWidth', 1); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); +hold off; +ylim([-180, 180]); +set(gca, 'YTickLabel',[]); + +linkaxes([ax1,ax2,ax1b,ax2b],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :exports none +i_in = 1; +i_out = 6; +#+end_src + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +freqs = logspace(log10(20), 3, 1000); + +figure; +tiledlayout(3, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +% OL - FRF +plot(f, abs(G_dvf(:,1, 1)), 'color', [colors(1,:), 0.5], ... + 'DisplayName', '$d\mathcal{L}/u$') + +% IFF - FRF +plot(f, abs(G_enc_iff_opt(:,1,1)), 'color', [colors(2,:), 0.5], ... + 'DisplayName', '$d\mathcal{L}/u^\prime$') + +% OL - Model +plot(freqs, abs(squeeze(freqresp(Gd_ol(1,1), freqs, 'Hz'))), '--', 'LineWidth', 1, 'color', colors(1,:), ... + 'DisplayName', 'Model') + +% IFF - Model +plot(freqs, abs(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '--', 'LineWidth', 1, 'color', colors(2,:), ... + 'DisplayName', 'Model') + +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-7, 1e-3]); +legend('location', 'southwest', 'FontSize', 8); + +ax1b = nexttile([2,1]); +hold on; +plot(f, abs(G_dvf(:,i_out,i_in)), '-', 'color', [colors(1,:), 0.5]) +plot(f, abs(G_enc_iff_opt(:,i_out,i_in)), '-', 'color', [colors(2,:), 0.5]) +plot(freqs, abs(squeeze(freqresp(Gd_ol(i_out,i_in), freqs, 'Hz'))), '--', 'color', colors(1,:), 'LineWidth', 1) +plot(freqs, abs(squeeze(freqresp(Gd_iff(i_out,i_in), freqs, 'Hz'))), '--', 'color', colors(2,:), 'LineWidth', 1) +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +set(gca, 'XTickLabel',[]); set(gca, 'YTickLabel',[]); +ylim([1e-7, 1e-3]); + + +ax2 = nexttile; +hold on; +plot(f, 180/pi*angle(G_dvf(:,1, 1)), '-', 'color', [colors(1,:), 0.5]); +plot(f, 180/pi*angle(G_enc_iff_opt(:,1,1)), '-', 'color', [colors(2,:), 0.5]); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_ol(1,1), freqs, 'Hz'))), '--', 'color', colors(1,:), 'LineWidth', 1); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '--', 'color', colors(2,:), 'LineWidth', 1); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +ax2b = nexttile; +hold on; +plot(f, 180/pi*angle(G_dvf(:,i_out,i_in)), '-', 'color', [colors(1,:), 0.5]); +plot(f, 180/pi*angle(G_enc_iff_opt(:,i_out,i_in)), '-', 'color', [colors(2,:), 0.5]); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_ol(i_out,i_in), freqs, 'Hz'))), '--', 'color', colors(1,:), 'LineWidth', 1); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(i_out,i_in), freqs, 'Hz'))), '--', 'color', colors(2,:), 'LineWidth', 1); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); +hold off; +ylim([-180, 180]); +set(gca, 'YTickLabel',[]); + +linkaxes([ax1,ax2,ax1b,ax2b],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_identification_damp_comp_simscape_both.pdf', 'width', 'half', 'height', 'normal'); +#+end_src + +#+RESULTS: +[[file:figs/nano_hexapod_identification_damp_comp_simscape_both.png]] + +*** MEDSI Talk :noexport: +#+begin_src matlab +%% Load identification data +load('identified_plants_enc_plates.mat', 'f', 'Ts', 'G_iff', 'G_dvf') +#+end_src + +#+begin_src matlab :exports none +%% Diagonal elements of the DVF plant +freqs = logspace(log10(20), 3, 1000); + +colors = colororder; + +figure; +tiledlayout(3, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +plot(f, abs(G_dvf(:,1, 1)), 'color', [colors(1,:),0.2], ... + 'DisplayName', 'FRF - $d_{e,i}/V_{a,i}$') +for i = 2:6 + plot(f, abs(G_dvf(:,i, i)), 'color', [colors(1,:),0.2], ... + 'HandleVisibility', 'off'); +end +plot(f, abs(G_enc_iff_opt(:,1, 1)), 'color', [colors(2,:),0.2], ... + 'DisplayName', 'FRF - $d_{e,i}/V_{a,i}^\prime$') +for i = 2:6 + plot(f, abs(G_enc_iff_opt(:,i, i)), 'color', [colors(2,:),0.2], ... + 'HandleVisibility', 'off'); +end +plot(freqs, abs(squeeze(freqresp(Gd_ol(1,1), freqs, 'Hz'))), '--', 'color', colors(1,:), ... + 'DisplayName', 'Model - $d_{e,i}/V_{a,i}$') +plot(freqs, abs(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '--', 'color', colors(2,:), ... + 'DisplayName', 'Model - $d_{e,i}/V_{a,i}^\prime$') +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([3e-7, 1e-3]); +legend('location', 'northwest', 'FontSize', 8); + +ax1b = nexttile([2,1]); +hold on; +plot(f, abs(G_dvf(:,1, 2)), 'color', [colors(1,:),0.5], ... + 'DisplayName', 'FRF - $d_{e,1}/V_{a,2}$') +plot(f, abs(G_enc_iff_opt(:,1, 2)), 'color', [colors(2,:),0.5], ... + 'DisplayName', 'FRF - $d_{e,1}/V_{a,2}^\prime$') +plot(freqs, abs(squeeze(freqresp(Gd_ol(1,2), freqs, 'Hz'))), '--', 'color', colors(1,:), ... + 'DisplayName', 'Model - $d_{e,1}/V_{a,2}$') +plot(freqs, abs(squeeze(freqresp(Gd_iff(1,2), freqs, 'Hz'))), '--', 'color', colors(2,:), ... + 'DisplayName', 'Model - $d_{e,1}/V_{a,2}^\prime$') +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +set(gca, 'YTickLabel',[]); set(gca, 'XTickLabel',[]); +ylim([3e-7, 1e-3]); +legend('location', 'northwest', 'FontSize', 8); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(f, 180/pi*angle(G_dvf(:,i, i)), 'color', [colors(1,:),0.2]); +end +for i = 1:6 + plot(f, 180/pi*angle(G_enc_iff_opt(:,i, i)), 'color', [colors(2,:),0.2]); +end +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_ol(1,1), freqs, 'Hz'))), '--', 'color', colors(1,:)); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(1,1), freqs, 'Hz'))), '--', 'color', colors(2,:)); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); + +ax2b = nexttile; +hold on; +plot(f, 180/pi*angle(G_dvf(:,1, 2)), 'color', [colors(1,:),0.5]); +plot(f, 180/pi*angle(G_enc_iff_opt(:,1, 2)), 'color', [colors(2,:),0.5]); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_ol(1,2), freqs, 'Hz'))), '--', 'color', colors(1,:)); +plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff(1,2), freqs, 'Hz'))), '--', 'color', colors(2,:)); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +set(gca, 'YTickLabel',[]); xlabel('Frequency [Hz]'); +ylim([-180, 180]); + +linkaxes([ax1,ax2,ax1b,ax2b],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nano_hexapod_damped_bode_plot.pdf', 'width', 1500, 'height', 'tall'); +#+end_src + +#+name: fig:nano_hexapod_damped_bode_plot +#+caption: +#+RESULTS: +[[file:figs/nano_hexapod_damped_bode_plot.png]] + *** Save Damped Plant The experimentally identified plant is saved for further use. #+begin_src matlab :exports none:tangle no @@ -4471,82 +5282,1211 @@ save('matlab/mat/damped_plant_enc_plates.mat', 'f', 'Ts', 'G_enc_iff_opt') save('mat/damped_plant_enc_plates.mat', 'f', 'Ts', 'G_enc_iff_opt') #+end_src -** Conclusion -#+begin_important -In this section, the dynamics of the nano-hexapod with the encoders fixed to the plates is studied. +** Effect of Payload mass - Robust IFF +<> +*** Introduction :ignore: +In this section, the encoders are fixed to the plates, and we identify the dynamics for several payloads. +The added payload are half cylinders, and three layers can be added for a total of around 40kg (Figure [[fig:picture_added_3_masses]]). -It has been found that: -- The measured dynamics is in agreement with the dynamics of the simscape model, up to the flexible modes of the top plate. - See figures [[fig:enc_plates_iff_comp_simscape]] and [[fig:enc_plates_iff_comp_offdiag_simscape]] for the transfer function to the force sensors and Figures [[fig:enc_plates_dvf_comp_simscape]] and [[fig:enc_plates_dvf_comp_offdiag_simscape]]for the transfer functions to the encoders -- The Integral Force Feedback strategy is very effective in damping the suspension modes of the nano-hexapod (Figure [[fig:enc_plant_plates_effect_iff]]). -- The transfer function from $\bm{u}^\prime$ to $d\bm{\mathcal{L}}_m$ show nice dynamical properties and is a much better candidate for the high-authority-control than when the encoders were fixed to the struts. - At least up to the flexible modes of the top plate, the diagonal elements of the transfer function matrix have alternating poles and zeros, and the phase is moving smoothly. - Only the flexible modes of the top plates seems to be problematic for control. -#+end_important +#+name: fig:picture_added_3_masses +#+caption: Picture of the nano-hexapod with added mass +#+attr_latex: :width \linewidth +[[file:figs/picture_added_3_masses.jpg]] -* Decentralized High Authority Control with Integral Force Feedback -<> +First the dynamics from $\bm{u}$ to $d\mathcal{L}_m$ and $\bm{\tau}_m$ is identified. +Then, the Integral Force Feedback controller is developed and applied as shown in Figure [[fig:nano_hexapod_signals_iff]]. +Finally, the dynamics from $\bm{u}^\prime$ to $d\mathcal{L}_m$ is identified and the added damping can be estimated. -** Introduction :ignore: +#+begin_src latex :file nano_hexapod_signals_iff.pdf +\definecolor{instrumentation}{rgb}{0, 0.447, 0.741} +\definecolor{mechanics}{rgb}{0.8500, 0.325, 0.098} +\definecolor{control}{rgb}{0.4660, 0.6740, 0.1880} -In this section is studied the HAC-LAC architecture for the Nano-Hexapod. -More precisely: -- The LAC control is a decentralized force feedback as studied in Section [[sec:enc_plates_iff]] -- The HAC control is a decentralized controller working in the frame of the struts - -The corresponding control architecture is shown in Figure [[fig:control_architecture_hac_iff_struts]] with: -- $\bm{r}_{\mathcal{X}_n}$: the $6 \times 1$ reference signal in the cartesian frame -- $\bm{r}_{d\mathcal{L}}$: the $6 \times 1$ reference signal transformed in the frame of the struts thanks to the inverse kinematic -- $\bm{\epsilon}_{d\mathcal{L}}$: the $6 \times 1$ length error of the 6 struts -- $\bm{u}^\prime$: input of the damped plant -- $\bm{u}$: generated DAC voltages -- $\bm{\tau}_m$: measured force sensors -- $d\bm{\mathcal{L}}_m$: measured displacement of the struts by the encoders - -#+begin_src latex :file control_architecture_hac_iff_struts.pdf \begin{tikzpicture} % Blocs - \node[block={3.0cm}{2.0cm}] (P) {Plant}; - \coordinate[] (inputF) at ($(P.south west)!0.5!(P.north west)$); - \coordinate[] (outputF) at ($(P.south east)!0.8!(P.north east)$); - \coordinate[] (outputL) at ($(P.south east)!0.2!(P.north east)$); + \node[block={4.0cm}{3.0cm}, fill=mechanics!20!white] (nano_hexapod) {Mechanics}; + \coordinate[] (inputF) at (nano_hexapod.west); + \coordinate[] (outputL) at ($(nano_hexapod.south east)!0.8!(nano_hexapod.north east)$); + \coordinate[] (outputF) at ($(nano_hexapod.south east)!0.2!(nano_hexapod.north east)$); - \node[block, above=0.4 of P] (Kiff) {$\bm{K}_\text{IFF}$}; - \node[addb, left= of inputF] (addF) {}; - \node[block, left= of addF] (K) {$\bm{K}_\mathcal{L}$}; - \node[addb={+}{}{}{}{-}, left= of K] (subr) {}; - \node[block, align=center, left= of subr] (J) {Inverse\\Kinematics}; + \node[block, left= 0.8 of inputF, fill=instrumentation!20!white, align=center] (F_stack) {\tiny Actuator \\ \tiny stacks}; + \node[block, left= 0.8 of F_stack, fill=instrumentation!20!white] (PD200) {PD200}; + \node[DAC, left= 0.8 of PD200, fill=instrumentation!20!white] (F_DAC) {DAC}; + \node[block, right=0.8 of outputF, fill=instrumentation!20!white, align=center] (Fm_stack){\tiny Sensor \\ \tiny stack}; + \node[ADC, right=0.8 of Fm_stack,fill=instrumentation!20!white] (Fm_ADC) {ADC}; + \node[block, right=0.8 of outputL, fill=instrumentation!20!white] (encoder) {\tiny Encoder}; + \node[addb, left= 0.8 of F_DAC, fill=control!20!white] (add_iff) {}; + \node[block, below=0.8 of add_iff, fill=control!20!white] (Kiff) {\tiny $K_{\text{IFF}}(s)$}; % Connections and labels - \draw[->] (outputF) -- ++(1, 0) node[below left]{$\bm{\tau}_m$}; - \draw[->] ($(outputF) + (0.6, 0)$)node[branch]{} |- (Kiff.east); - \draw[->] (Kiff.west) -| (addF.north); - \draw[->] (addF.east) -- (inputF) node[above left]{$\bm{u}$}; + \draw[->] (add_iff.east) node[above right]{$\bm{u}$} node[below right]{$[V]$} -- node[sloped]{$/$} (F_DAC.west); + \draw[->] (F_DAC.east) -- node[midway, above]{$\tilde{\bm{u}}$}node[midway, below]{$[V]$} (PD200.west); + \draw[->] (PD200.east) -- node[midway, above]{$\bm{u}_a$}node[midway, below]{$[V]$} (F_stack.west); + \draw[->] (F_stack.east) -- (inputF) node[above left]{$\bm{\tau}$}node[below left]{$[N]$}; - \draw[->] (outputL) -- ++(1, 0) node[above left]{$d\bm{\mathcal{L}_m}$}; - \draw[->] ($(outputL) + (0.6, 0)$)node[branch]{} -- ++(0, -1) -| (subr.south); - \draw[->] (subr.east) -- (K.west) node[above left]{$\bm{\epsilon}_{d\mathcal{L}}$}; - \draw[->] (K.east) -- (addF.west) node[above left]{$\bm{u}^\prime$}; + \draw[->] (outputF) -- (Fm_stack.west) node[above left]{$\bm{\epsilon}$} node[below left]{$[m]$}; + \draw[->] (Fm_stack.east) -- node[midway, above]{$\tilde{\bm{\tau}}_m$}node[midway, below]{$[V]$} (Fm_ADC.west); + \draw[->] (Fm_ADC.east) -- node[sloped]{$/$} ++(0.8, 0)coordinate(end) node[above left]{$\bm{\tau}_m$}node[below left]{$[V]$}; - \draw[->] (J.east) -- (subr.west) node[above left]{$\bm{r}_{d\mathcal{L}}$}; - \draw[<-] (J.west)node[above left]{$\bm{r}_{\mathcal{X}_n}$} -- ++(-1, 0); + \draw[->] (outputL) -- (encoder.west) node[above left]{$d\bm{\mathcal{L}}$} node[below left]{$[m]$}; + \draw[->] (encoder.east) -- node[sloped]{$/$} (encoder-|end) node[above left]{$d\bm{\mathcal{L}}_m$}node[below left]{$[m]$}; + + \draw[->] ($(Fm_ADC.east)+(0.14,0)$) node[branch]{} -- node[sloped]{$/$} ++(0, -1.8) -| (Kiff.south); + \draw[->] (Kiff.north) -- node[sloped]{$/$} (add_iff.south); + \draw[->] ($(add_iff.west)+(-0.8,0)$) node[above right]{$\bm{u}^\prime$} node[below right]{$[V]$} -- node[sloped]{$/$} (add_iff.west); + + % Nano-Hexapod + \begin{scope}[on background layer] + \node[fit={(F_stack.west|-nano_hexapod.south) (Fm_stack.east|-nano_hexapod.north)}, fill=black!20!white, draw, inner sep=2pt] (system) {}; + \node[above] at (system.north) {Nano-Hexapod}; + \end{scope} \end{tikzpicture} #+end_src -#+name: fig:control_architecture_hac_iff_struts -#+caption: HAC-LAC: IFF + Control in the frame of the legs +#+name: fig:nano_hexapod_signals_iff +#+caption: Block Diagram of the experimental setup and model #+RESULTS: -[[file:figs/control_architecture_hac_iff_struts.png]] +[[file:figs/nano_hexapod_signals_iff.png]] -- Section [[sec:hac_iff_struts_controller]]: the decentralized high authority controller is tuned using the Simscape model -- Section [[sec:hac_iff_struts_first_tests]]: the controller is implemented and tested experimentally -- Section [[sec:hac_iff_struts_ref_track]]: some reference tracking tests are performed +*** Measured Frequency Response Functions +**** Introduction :ignore: +**** 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 + +**** Compute FRF in open-loop +#+begin_src matlab :tangle no :exports none +addpath('./matlab/mat/'); +#+end_src + +#+begin_src matlab :eval no :exports none +addpath('./mat/'); +#+end_src + +The identification is performed without added mass, and with one, two and three layers of added cylinders. +#+begin_src matlab +i_masses = 0:3; +#+end_src + +The following data are loaded: +- =Va=: the excitation voltage (corresponding to $u_i$) +- =Vs=: the generated voltage by the 6 force sensors (corresponding to $\bm{\tau}_m$) +- =de=: the measured motion by the 6 encoders (corresponding to $d\bm{\mathcal{L}}_m$) +#+begin_src matlab +%% Load Identification Data +meas_added_mass = {}; + +for i_mass = i_masses + for i_strut = 1:6 + meas_added_mass(i_strut, i_mass+1) = {load(sprintf('frf_data_exc_strut_%i_realigned_vib_table_%im.mat', i_strut, i_mass), 't', 'Va', 'Vs', 'de')}; + end +end +#+end_src + +The window =win= and the frequency vector =f= are defined. +#+begin_src matlab +% Sampling Time [s] +Ts = (meas_added_mass{1,1}.t(end) - (meas_added_mass{1,1}.t(1)))/(length(meas_added_mass{1,1}.t)-1); + +% Hannning Windows +win = hanning(ceil(1/Ts)); + +% And we get the frequency vector +[~, f] = tfestimate(meas_added_mass{1,1}.Va, meas_added_mass{1,1}.de, win, [], [], 1/Ts); +#+end_src + +Finally the $6 \times 6$ transfer function matrices from $\bm{u}$ to $d\bm{\mathcal{L}}_m$ and from $\bm{u}$ to $\bm{\tau}_m$ are identified: +#+begin_src matlab +%% DVF Plant (transfer function from u to dLm) +G_dL = {}; + +for i_mass = i_masses + G_dL(i_mass+1) = {zeros(length(f), 6, 6)}; + for i_strut = 1:6 + G_dL{i_mass+1}(:,:,i_strut) = tfestimate(meas_added_mass{i_strut, i_mass+1}.Va, meas_added_mass{i_strut, i_mass+1}.de, win, [], [], 1/Ts); + end +end + +%% IFF Plant (transfer function from u to taum) +G_tau = {}; + +for i_mass = i_masses + G_tau(i_mass+1) = {zeros(length(f), 6, 6)}; + for i_strut = 1:6 + G_tau{i_mass+1}(:,:,i_strut) = tfestimate(meas_added_mass{i_strut, i_mass+1}.Va, meas_added_mass{i_strut, i_mass+1}.Vs, win, [], [], 1/Ts); + end +end +#+end_src + +The identified dynamics are then saved for further use. +#+begin_src matlab :exports none :tangle no +save('matlab/mat/frf_vib_table_m.mat', 'f', 'Ts', 'G_tau', 'G_dL') +#+end_src + +#+begin_src matlab :eval no +save('mat/frf_vib_table_m.mat', 'f', 'Ts', 'G_tau', 'G_dL') +#+end_src + +*** Transfer function from $\bm{u}$ to $d\bm{\mathcal{L}}_m$ +The transfer functions from $u_i$ to $d\mathcal{L}_{m,i}$ are shown in Figure [[fig:comp_plant_payloads_dvf]]. + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + plot(frf_ol.f, abs(frf_ol.G_dL{i_mass+1}(:,1, 1)), 'color', colors(i_mass+1,:), ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u_i$ - %i', i_mass)); + for i = 2:6 + plot(frf_ol.f, abs(frf_ol.G_dL{i_mass+1}(:,i, i)), 'color', colors(i_mass+1,:), ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-8, 1e-3]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i =1:6 + plot(frf_ol.f, 180/pi*angle(frf_ol.G_dL{i_mass+1}(:,i, i)), 'color', colors(i_mass+1,:)); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-90, 180]) + +linkaxes([ax1,ax2],'x'); +xlim([20, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_plant_payloads_dvf.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_plant_payloads_dvf +#+caption: Measured Frequency Response Functions from $u_i$ to $d\mathcal{L}_{m,i}$ for all 4 payload conditions +#+RESULTS: +[[file:figs/comp_plant_payloads_dvf.png]] -** High Authority Controller -<> +#+begin_important +From Figure [[fig:comp_plant_payloads_dvf]], we can observe few things: +- The obtained dynamics is changing a lot between the case without mass and when there is at least one added mass. +- Between 1, 2 and 3 added masses, the dynamics is not much different, and it would be easier to design a controller only for these cases. +- The flexible modes of the top plate is first decreased a lot when the first mass is added (from 700Hz to 400Hz). + This is due to the fact that the added mass is composed of two half cylinders which are not fixed together. + Therefore is adds a lot of mass to the top plate without adding a lot of rigidity in one direction. + When more than 1 mass layer is added, the half cylinders are added with some angles such that rigidity are added in all directions (see Figure [[fig:picture_added_3_masses]]). + In that case, the frequency of these flexible modes are increased. + In practice, the payload should be one solid body, and we should not see a massive decrease of the frequency of this flexible mode. +- Flexible modes of the top plate are becoming less problematic as masses are added. +- First flexible mode of the strut at 230Hz is not much decreased when mass is added. + However, its apparent amplitude is much decreased. +#+end_important + +*** Transfer function from $\bm{u}$ to $\bm{\tau}_m$ +The transfer functions from $u_i$ to $\tau_{m,i}$ are shown in Figure [[fig:comp_plant_payloads_iff]]. + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + set(gca, 'ColorOrderIndex', i_mass+1) + plot(frf_ol.f, abs(frf_ol.G_tau{i_mass+1}(:,1, 1)), ... + 'DisplayName', sprintf('$\\tau_{m,i}/u_i$ - %i', i_mass)); + for i = 2:6 + set(gca, 'ColorOrderIndex', i_mass+1) + plot(frf_ol.f, abs(frf_ol.G_tau{i_mass+1}(:,i, i)), ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [V/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-2, 1e2]); +legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 3); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i =1:6 + set(gca,'ColorOrderIndex',i_mass+1) + plot(frf_ol.f, 180/pi*angle(frf_ol.G_tau{i_mass+1}(:,i, i))); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); + +linkaxes([ax1,ax2],'x'); +xlim([20, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_plant_payloads_iff.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_plant_payloads_iff +#+caption: Measured Frequency Response Functions from $u_i$ to $\tau_{m,i}$ for all 4 payload conditions +#+RESULTS: +[[file:figs/comp_plant_payloads_iff.png]] + +#+begin_important +From Figure [[fig:comp_plant_payloads_iff]], we can see that for all added payloads, the transfer function from $u_i$ to $\tau_{m,i}$ always has alternating poles and zeros. +#+end_important + +** Comparison with the Simscape model *** Introduction :ignore: -In this section, the decentralized high authority controller $\bm{K}_{\mathcal{L}}$ is first tuned using the Simscape model. +*** 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 + +#+begin_src matlab :tangle no +addpath('./matlab/mat/'); +addpath('./matlab/src/'); +addpath('./matlab/'); +#+end_src + +#+begin_src matlab :eval no +addpath('./mat/'); +addpath('./src/'); +#+end_src + +#+begin_src matlab :tangle no +%% Add all useful folders to the path +addpath('matlab/nass-simscape/matlab/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/png/') +addpath('matlab/nass-simscape/src/') +addpath('matlab/nass-simscape/mat/') +addpath('matlab/vibration-table/matlab/') +addpath('matlab/vibration-table/STEPS/') +#+end_src + +#+begin_src matlab :eval no +%% Add all useful folders to the path +addpath('nass-simscape/matlab/nano_hexapod/') +addpath('nass-simscape/STEPS/nano_hexapod/') +addpath('nass-simscape/STEPS/png/') +addpath('nass-simscape/src/') +addpath('nass-simscape/mat/') +addpath('vibration-table/matlab/') +#+end_src + +#+begin_src matlab +%% Load the identified FRF +frf_ol = load('frf_vib_table_m.mat', 'f', 'Ts', 'G_tau', 'G_dL'); +#+end_src + +#+begin_src matlab +i_masses = 0:3; +#+end_src + +#+begin_src matlab +%% Open Simulink Model +mdl = 'nano_hexapod_simscape'; + +options = linearizeOptions; +options.SampleTime = 0; + +open(mdl) + +Rx = zeros(1, 7); + +colors = colororder; +#+end_src + +*** System Identification +Let's initialize the simscape model with the nano-hexapod fixed on top of the vibration table. +#+begin_src matlab +support.type = 1; % On top of vibration table +#+end_src + +The model of the nano-hexapod is defined as shown bellow: +#+begin_src matlab +%% Initialize Nano-Hexapod +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ... + 'flex_top_type', '3dof', ... + 'motion_sensor_type', 'plates', ... + 'actuator_type', '2dof'); +#+end_src + +And finally, we add the same payloads as during the experiments: +#+begin_src matlab +payload.type = 1; % Payload / 1 "mass layer" +#+end_src + +First perform the identification for the transfer functions from $\bm{u}$ to $d\bm{\mathcal{L}}_m$: +#+begin_src matlab +%% Identify the DVF Plant (transfer function from u to dLm) +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Encoders + +%% Identification for all the added payloads +G_dL = {}; + +for i = i_masses + fprintf('i = %i\n', i) + payload.type = i; + G_dL(i+1) = {exp(-s*frf_ol.Ts)*linearize(mdl, io, 0.0, options)}; +end +#+end_src + +#+begin_src matlab +%% Identify the IFF Plant (transfer function from u to taum) +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/Fm'], 1, 'openoutput'); io_i = io_i + 1; % Force Sensors + +%% Identification for all the added payloads +G_tau = {}; + +for i = 0:3 + fprintf('i = %i\n', i) + payload.type = i; + G_tau(i+1) = {exp(-s*frf_ol.Ts)*linearize(mdl, io, 0.0, options)}; +end +#+end_src + +The identified dynamics are then saved for further use. +#+begin_src matlab :exports none :tangle no +save('matlab/mat/sim_vib_table_m.mat', 'G_tau', 'G_dL') +#+end_src + +#+begin_src matlab :eval no +save('mat/sim_vib_table_m.mat', 'G_tau', 'G_dL') +#+end_src + +*** Transfer function from $\bm{u}$ to $d\bm{\mathcal{L}}_m$ +#+begin_src matlab :exports none +sim_m = load('sim_vib_table_m.mat', 'G_tau', 'G_dL'); +#+end_src + +The measured FRF and the identified dynamics from $u_i$ to $d\mathcal{L}_{m,i}$ are compared in Figure [[fig:comp_masses_model_exp_dvf]]. +A zoom near the "suspension" modes is shown in Figure [[fig:comp_masses_model_exp_dvf_zoom]]. + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +freqs = 2*logspace(1,3,1000); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + plot(frf_ol.f, abs(frf_ol.G_dL{i_mass+1}(:,1, 1)), 'color', [colors(i_mass+1,:), 0.2], ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u_i$ - FRF %i', i_mass)); + for i = 2:6 + plot(frf_ol.f, abs(frf_ol.G_dL{i_mass+1}(:,i, i)), 'color', [colors(i_mass+1,:), 0.2], ... + 'HandleVisibility', 'off'); + end + set(gca, 'ColorOrderIndex', i_mass+1) + plot(freqs, abs(squeeze(freqresp(sim_m.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '--', ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u_i$ - Sim %i', i_mass)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-8, 1e-3]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i =1:6 + plot(frf_ol.f, 180/pi*angle(frf_ol.G_dL{i_mass+1}(:,i, i)), 'color', [colors(i_mass+1,:), 0.2]); + end + set(gca, 'ColorOrderIndex', i_mass+1) + plot(freqs, 180/pi*angle(squeeze(freqresp(sim_m.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '--'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:45:360); +ylim([-45, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([20, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_masses_model_exp_dvf.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_masses_model_exp_dvf +#+caption: Comparison of the transfer functions from $u_i$ to $d\mathcal{L}_{m,i}$ - measured FRF and identification from the Simscape model +#+RESULTS: +[[file:figs/comp_masses_model_exp_dvf.png]] + +#+begin_src matlab :exports none :tangle no +ax1.YLim = [1e-6, 5e-4]; +xlim([40, 2e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_masses_model_exp_dvf_zoom.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_masses_model_exp_dvf_zoom +#+caption: Comparison of the transfer functions from $u_i$ to $d\mathcal{L}_{m,i}$ - measured FRF and identification from the Simscape model (Zoom) +#+RESULTS: +[[file:figs/comp_masses_model_exp_dvf_zoom.png]] + +#+begin_important +The Simscape model is very accurately representing the measured dynamics up. +Only the flexible modes of the struts and of the top plate are not represented here as these elements are modelled as rigid bodies. +#+end_important + +*** Transfer function from $\bm{u}$ to $\bm{\tau}_m$ +The measured FRF and the identified dynamics from $u_i$ to $\tau_{m,i}$ are compared in Figure [[fig:comp_masses_model_exp_iff]]. +A zoom near the "suspension" modes is shown in Figure [[fig:comp_masses_model_exp_iff_zoom]]. + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +freqs = 2*logspace(1,3,1000); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = 0:3 + plot(frf_ol.f, abs(frf_ol.G_tau{i_mass+1}(:,1, 1)), 'color', [colors(i_mass+1,:), 0.2], ... + 'DisplayName', sprintf('$d\\tau_{m,i}/u_i$ - FRF %i', i_mass)); + for i = 2:6 + plot(frf_ol.f, abs(frf_ol.G_tau{i_mass+1}(:,i, i)), 'color', [colors(i_mass+1,:), 0.2], ... + 'HandleVisibility', 'off'); + end + plot(freqs, abs(squeeze(freqresp(sim_m.G_tau{i_mass+1}(1,1), freqs, 'Hz'))), '--', 'color', colors(i_mass+1,:), ... + 'DisplayName', sprintf('$\\tau_{m,i}/u_i$ - Sim %i', i_mass)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [V/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-2, 1e2]); +legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i_mass = 0:3 + for i =1:6 + plot(frf_ol.f, 180/pi*angle(frf_ol.G_tau{i_mass+1}(:,i, i)), 'color', [colors(i_mass+1,:), 0.2]); + end + plot(freqs, 180/pi*angle(squeeze(freqresp(sim_m.G_tau{i_mass+1}(i,i), freqs, 'Hz'))), '--', 'color', colors(i_mass+1,:)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); + +linkaxes([ax1,ax2],'x'); +xlim([20, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_masses_model_exp_iff.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_masses_model_exp_iff +#+caption: Comparison of the transfer functions from $u_i$ to $\tau_{m,i}$ - measured FRF and identification from the Simscape model +#+RESULTS: +[[file:figs/comp_masses_model_exp_iff.png]] + +#+begin_src matlab :exports none :tangle no +xlim([40, 2e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_masses_model_exp_iff_zoom.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_masses_model_exp_iff_zoom +#+caption: Comparison of the transfer functions from $u_i$ to $\tau_{m,i}$ - measured FRF and identification from the Simscape model (Zoom) +#+RESULTS: +[[file:figs/comp_masses_model_exp_iff_zoom.png]] + +** Integral Force Feedback Controller +*** Introduction :ignore: +*** 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 + +#+begin_src matlab :tangle no +addpath('./matlab/mat/'); +addpath('./matlab/src/'); +addpath('./matlab/'); +#+end_src + +#+begin_src matlab :eval no +addpath('./mat/'); +addpath('./src/'); +#+end_src + +#+begin_src matlab :tangle no +%% Add all useful folders to the path +addpath('matlab/nass-simscape/matlab/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/png/') +addpath('matlab/nass-simscape/src/') +addpath('matlab/nass-simscape/mat/') +addpath('matlab/vibration-table/matlab/') +addpath('matlab/vibration-table/STEPS/') +#+end_src + +#+begin_src matlab :eval no +%% Add all useful folders to the path +addpath('nass-simscape/matlab/nano_hexapod/') +addpath('nass-simscape/STEPS/nano_hexapod/') +addpath('nass-simscape/STEPS/png/') +addpath('nass-simscape/src/') +addpath('nass-simscape/mat/') +addpath('vibration-table/matlab/') +#+end_src + +#+begin_src matlab +%% Load the identified FRF and Simscape model +frf_ol = load('frf_vib_table_m.mat', 'f', 'Ts', 'G_tau', 'G_dL'); +sim_ol = load('sim_vib_table_m.mat', 'G_tau', 'G_dL'); +#+end_src + +#+begin_src matlab +i_masses = 0:3; +#+end_src + +#+begin_src matlab +%% Open Simulink Model +mdl = 'nano_hexapod_simscape'; + +options = linearizeOptions; +options.SampleTime = 0; + +Rx = zeros(1, 7); + +colors = colororder; +#+end_src + +*** Robust IFF Controller +Based on the measured FRF from $u_i$ to $\tau_{m,i}$, the following IFF controller is developed: +#+begin_src matlab +%% IFF Controller +Kiff_g1 = (1/(s + 2*pi*20))*... % LPF: provides integral action above 20[Hz] + (s/(s + 2*pi*20))*... % HPF: limit low frequency gain + (1/(1 + s/2/pi/400)); % LPF: more robust to high frequency resonances +#+end_src + +Then, the Root Locus plot of Figure [[fig:iff_root_locus_masses]] is used to estimate the optimal gain. +This Root Locus plot is computed from the Simscape model. +#+begin_src matlab :exports none +%% Root Locus for IFF +gains = -logspace(1, 3, 100); + +figure; + +hold on; +% Pure Integrator +for i_mass = 0:3 + plot(real(pole(sim_ol.G_tau{i_mass+1})), imag(pole(sim_ol.G_tau{i_mass+1})), 'x', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('OL Poles - %i', i_mass)); + plot(real(tzero(sim_ol.G_tau{i_mass+1})), imag(tzero(sim_ol.G_tau{i_mass+1})), 'o', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); +end + +for i_mass = 0:3 + for g = gains + clpoles = pole(feedback(sim_ol.G_tau{i_mass+1}, g*Kiff_g1*eye(6), +1)); + plot(real(clpoles), imag(clpoles), '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + end +end + +g_opt = -2e2; + +clpoles = pole(feedback(sim_ol.G_tau{1}, g_opt*Kiff_g1*eye(6), +1)); +plot(real(clpoles), imag(clpoles), 'kx', ... + 'DisplayName', sprintf('$g = %.0f$', g_opt)); +for i_mass = 1:3 + clpoles = pole(feedback(sim_ol.G_tau{i_mass+1}, g_opt*Kiff_g1*eye(6), +1)); + plot(real(clpoles), imag(clpoles), 'kx', ... + 'HandleVisibility', 'off'); +end +hold off; +axis square; +xlim([-600, 0]); ylim([0, 1400]); +xlabel('Real Part'); ylabel('Imaginary Part'); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 3); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/iff_root_locus_masses.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:iff_root_locus_masses +#+caption: Root Locus for the IFF control strategy (for all payload conditions). +#+RESULTS: +[[file:figs/iff_root_locus_masses.png]] + +#+begin_src matlab :exports none +%% Verify close-loop stability for all payloads +for i_mass = 0:3 + clpoles = pole(feedback(sim_ol.G_tau{i_mass+1}, g_opt*Kiff_g1*eye(6), +1)); + sum(real(clpoles)>0) +end +#+end_src + +The found optimal IFF controller is: +#+begin_src matlab +%% Optimal controller +g_opt = -2e2; +Kiff = g_opt*Kiff_g1*eye(6); +#+end_src + +It is saved for further use. +#+begin_src matlab :exports none :tangle no +save('matlab/mat/Kiff_opt.mat', 'Kiff') +#+end_src + +#+begin_src matlab :eval no +save('mat/Kiff_opt.mat', 'Kiff') +#+end_src + +The corresponding experimental loop gains are shown in Figure [[fig:iff_loop_gain_masses]]. +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = 0:3 + for i = 1:6 + plot(frf_ol.f, abs(squeeze(freqresp(Kiff(i,i), frf_ol.f, 'Hz')).*frf_ol.G_tau{i_mass+1}(:,i,i)), '-', 'color', [colors(i_mass+1,:), 0.2]); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Loop Gain [-]'); set(gca, 'XTickLabel',[]); +ylim([1e-2, 1e2]); + +ax2 = nexttile; +hold on; +for i_mass = 0:3 + for i = 1:6 + plot(frf_ol.f, 180/pi*angle(squeeze(freqresp(-Kiff(i,i), frf_ol.f, 'Hz')).*frf_ol.G_tau{i_mass+1}(:,i,i)), '-', 'color', [colors(i_mass+1,:), 0.2]); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/iff_loop_gain_masses.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:iff_loop_gain_masses +#+caption: Loop gain for the Integral Force Feedback controller +#+RESULTS: +[[file:figs/iff_loop_gain_masses.png]] + +#+begin_important +Based on the above analysis: +- The same IFF controller can be used to damp the suspension modes for all payload conditions +- The IFF controller should be robust +#+end_important + +*** Estimated Damped Plant from the Simscape model +Let's initialize the simscape model with the nano-hexapod fixed on top of the vibration table. +#+begin_src matlab +support.type = 1; % On top of vibration table +#+end_src + +The model of the nano-hexapod is defined as shown bellow: +#+begin_src matlab +%% Initialize the Simscape model in closed loop +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ... + 'flex_top_type', '3dof', ... + 'motion_sensor_type', 'plates', ... + 'actuator_type', '2dof', ... + 'controller_type', 'iff'); +#+end_src + +And finally, we add the same payloads as during the experiments: +#+begin_src matlab +payload.type = 1; % Payload / 1 "mass layer" +#+end_src + +#+begin_src matlab :exports none +%% Open Simscape Model +open(mdl) + +%% Make sure IFF controller is loaded +load('mat/Kiff_opt.mat', 'Kiff') +#+end_src + +#+begin_src matlab +%% Identify the (damped) transfer function from u to dLm +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder) + +%% Identify for all add masses +G_dL = {}; + +for i = i_masses + payload.type = i; + G_dL(i+1) = {exp(-s*frf_ol.Ts)*linearize(mdl, io, 0.0, options)}; +end +#+end_src + +The identified dynamics are then saved for further use. +#+begin_src matlab :exports none :tangle no +save('matlab/mat/sim_iff_vib_table_m.mat', 'G_dL'); +#+end_src + +#+begin_src matlab :eval no +save('mat/sim_iff_vib_table_m.mat', 'G_dL'); +#+end_src + +#+begin_src matlab +sim_iff = load('sim_iff_vib_table_m.mat', 'G_dL'); +#+end_src + +#+begin_src matlab :exports none +%% Verify Stability +for i = i_masses + isstable(sim_iff.G_dL{i+1}) +end +#+end_src + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +freqs = logspace(1,3,1000); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + for i = 1 + plot(freqs, abs(squeeze(freqresp(sim_ol.G_dL{i_mass+1}(i,i), freqs, 'Hz'))), '-', 'color', [colors(i_mass+1, :), 0.5], ... + 'DisplayName', sprintf('$d\\mathcal{L}_i/u_i$ - %i', i_mass)); + plot(freqs, abs(squeeze(freqresp(sim_iff.G_dL{i_mass+1}(i,i), freqs, 'Hz'))), '-', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('$d\\mathcal{L}_i/u^\\prime_i$ - %i', i_mass)); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-7, 1e-3]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 4); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i = 1 + plot(freqs, 180/pi*angle(squeeze(freqresp(sim_ol.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '-', 'color', [colors(i_mass+1, :), 0.5]); + plot(freqs, 180/pi*angle(squeeze(freqresp(sim_iff.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '-', 'color', colors(i_mass+1, :)); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/damped_plant_model_masses.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:damped_plant_model_masses +#+caption: Transfer function from $u_i$ to $d\mathcal{L}_{m,i}$ (without active damping) and from $u^\prime_i$ to $d\mathcal{L}_{m,i}$ (with IFF) +#+RESULTS: +[[file:figs/damped_plant_model_masses.png]] + +*** Compute the identified FRF with IFF +The identification is performed without added mass, and with one, two and three layers of added cylinders. +#+begin_src matlab +i_masses = 0:3; +#+end_src + +The following data are loaded: +- =Va=: the excitation voltage for the damped plant (corresponding to $u^\prime_i$) +- =de=: the measured motion by the 6 encoders (corresponding to $d\bm{\mathcal{L}}_m$) +#+begin_src matlab +%% Load Identification Data +meas_added_mass = {}; + +for i_mass = i_masses + for i_strut = 1:6 + meas_iff_mass(i_strut, i_mass+1) = {load(sprintf('frf_data_exc_strut_%i_iff_vib_table_%im.mat', i_strut, i_mass), 't', 'Va', 'de')}; + end +end +#+end_src + +The window =win= and the frequency vector =f= are defined. +#+begin_src matlab +% Sampling Time [s] +Ts = (meas_iff_mass{1,1}.t(end) - (meas_iff_mass{1,1}.t(1)))/(length(meas_iff_mass{1,1}.t)-1); + +% Hannning Windows +win = hanning(ceil(1/Ts)); + +% And we get the frequency vector +[~, f] = tfestimate(meas_iff_mass{1,1}.Va, meas_iff_mass{1,1}.de, win, [], [], 1/Ts); +#+end_src + +Finally the $6 \times 6$ transfer function matrix from $\bm{u}^\prime$ to $d\bm{\mathcal{L}}_m$ is estimated: +#+begin_src matlab +%% DVF Plant (transfer function from u to dLm) +G_dL = {}; + +for i_mass = i_masses + G_dL(i_mass+1) = {zeros(length(f), 6, 6)}; + for i_strut = 1:6 + G_dL{i_mass+1}(:,:,i_strut) = tfestimate(meas_iff_mass{i_strut, i_mass+1}.Va, meas_iff_mass{i_strut, i_mass+1}.de, win, [], [], 1/Ts); + end +end +#+end_src + +The identified dynamics are then saved for further use. +#+begin_src matlab :exports none :tangle no +save('matlab/mat/frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); +#+end_src + +#+begin_src matlab :eval no +save('mat/frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); +#+end_src + +*** Comparison of the measured FRF and the Simscape model +#+begin_src matlab :exports none +%% Load the Measured FRF of the damped plant +frf_iff = load('frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); +#+end_src + +The following figures are computed: +- Figure [[fig:damped_iff_plant_meas_frf]]: the measured damped FRF are displayed +- Figure [[fig:comp_undamped_damped_plant_meas_frf]]: the open-loop and damped FRF are compared (diagonal elements) +- Figure [[fig:comp_iff_plant_frf_sim]]: the obtained damped FRF is compared with the identified damped from using the Simscape model + +#+begin_src matlab :exports none +%% Diagonal and Off Diagonal elements of the damped plants +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,1)), 'color', colors(i_mass+1,:), ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u^\\prime_i$ - %i', i_mass)); + for i = 2:6 + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i,i)), 'color', colors(i_mass+1,:), ... + 'HandleVisibility', 'off'); + end + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,2)), 'color', [colors(i_mass+1,:), 0.2], ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u^\\prime_j$ - %i', i_mass)); + for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i,j)), 'color', [colors(i_mass+1,:), 0.2], ... + 'HandleVisibility', 'off'); + end + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude $d_L/V_a$ [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-9, 1e-4]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i =1:6 + plot(frf_iff.f, 180/pi*angle(frf_iff.G_dL{i_mass+1}(:,i, i)), 'color', colors(i_mass+1,:)); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/damped_iff_plant_meas_frf.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:damped_iff_plant_meas_frf +#+caption: Diagonal and off-diagonal of the measured FRF matrix for the damped plant +#+RESULTS: +[[file:figs/damped_iff_plant_meas_frf.png]] + +#+begin_src matlab :exports none +%% Comparison of the OL and IFF identified FRF +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + plot(frf_ol.f, abs(frf_ol.G_dL{i_mass+1}(:,1,1)), '-', 'color', [colors(i_mass+1, :), 0.5], ... + 'DisplayName', sprintf('$d\\mathcal{L}_i/u_i$ - %i', i_mass)); + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,1)), '-', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('$d\\mathcal{L}_i/u^\\prime_i$ - %i', i_mass)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude $d_L/V_a$ [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-7, 1e-3]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + plot(frf_ol.f, 180/pi*angle(frf_ol.G_dL{i_mass+1}(:,1,1)), '-', 'color', [colors(i_mass+1, :), 0.5]); + plot(frf_iff.f, 180/pi*angle(frf_iff.G_dL{i_mass+1}(:,1,1)), '-', 'color', colors(i_mass+1, :)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_undamped_damped_plant_meas_frf.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_undamped_damped_plant_meas_frf +#+caption: Damped and Undamped measured FRF (diagonal elements) +#+RESULTS: +[[file:figs/comp_undamped_damped_plant_meas_frf.png]] + +#+begin_src matlab :exports none +%% Comparison of the measured FRF and identified TF of the damped plant +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +freqs = logspace(1,3,1000); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1, 1)), 'color', [colors(i_mass+1,:), 0.2], ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u^\\prime_i$ - FRF %i', i_mass)); + for i = 2:6 + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i, i)), 'color', [colors(i_mass+1,:), 0.2], ... + 'HandleVisibility', 'off'); + end + set(gca, 'ColorOrderIndex', i_mass+1) + plot(freqs, abs(squeeze(freqresp(sim_iff.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '--', ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,i}/u^\\prime_i$ - Sim %i', i_mass)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-8, 1e-4]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i =1:6 + plot(frf_iff.f, 180/pi*angle(frf_iff.G_dL{i_mass+1}(:,i, i)), 'color', [colors(i_mass+1,:), 0.2]); + end + set(gca, 'ColorOrderIndex', i_mass+1) + plot(freqs, 180/pi*angle(squeeze(freqresp(sim_iff.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '--'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/comp_iff_plant_frf_sim.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:comp_iff_plant_frf_sim +#+caption: Comparison of the measured FRF and the identified dynamics from the Simscape model +#+RESULTS: +[[file:figs/comp_iff_plant_frf_sim.png]] + +#+begin_important +The IFF control strategy effectively damps all the suspensions modes of the nano-hexapod whatever the payload is. +The obtained plant is easier to control (provided the flexible modes of the top platform are well damped). +#+end_important + +*** Change of coupling with IFF +The added damping using IFF reduces the coupling in the system near the suspensions modes that are damped. +It can be estimated by taking the ratio of the diagonal-term and the off-diagonal term. + +This is shown in Figure [[fig:reduced_coupling_iff_masses]]. + +#+begin_src matlab :exports none +%% Estimation of the coupling and comparison between OL and IFF +figure; +tiledlayout(2, 2, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile; +hold on; +i_mass = 0 +plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,1,2))./abs(frf_ol.G_dL{i_mass+1}(:,1,1)), 'color', [colors(1,:), 0.5], ... + 'DisplayName', 'OL - 0'); +plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,2))./abs(frf_iff.G_dL{i_mass+1}(:,1,1)), 'color', [colors(2,:), 0.5], ... + 'DisplayName', 'IFF - 0'); +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,i,j))./abs(frf_ol.G_dL{i_mass+1}(:,i,i)), 'color', [colors(1,:), 0.5], ... + 'HandleVisibility', 'off'); + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i,j))./abs(frf_iff.G_dL{i_mass+1}(:,i,i)), 'color', [colors(2,:), 0.5], ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +set(gca, 'XTickLabel',[]); ylabel('Amplitude [-]'); +legend('location', 'northwest', 'FontSize', 8); + +ax2 = nexttile; +hold on; +i_mass = 1 +plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,1,2))./abs(frf_ol.G_dL{i_mass+1}(:,1,1)), 'color', [colors(1,:), 0.5], ... + 'DisplayName', 'OL - 0'); +plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,2))./abs(frf_iff.G_dL{i_mass+1}(:,1,1)), 'color', [colors(2,:), 0.5], ... + 'DisplayName', 'IFF - 0'); +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,i,j))./abs(frf_ol.G_dL{i_mass+1}(:,i,i)), 'color', [colors(1,:), 0.5], ... + 'HandleVisibility', 'off'); + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i,j))./abs(frf_iff.G_dL{i_mass+1}(:,i,i)), 'color', [colors(2,:), 0.5], ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +set(gca, 'XTickLabel',[]); set(gca, 'YTickLabel',[]); +legend('location', 'northwest', 'FontSize', 8); + +ax3 = nexttile; +hold on; +i_mass = 2 +plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,1,2))./abs(frf_ol.G_dL{i_mass+1}(:,1,1)), 'color', [colors(1,:), 0.5], ... + 'DisplayName', 'OL - 0'); +plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,2))./abs(frf_iff.G_dL{i_mass+1}(:,1,1)), 'color', [colors(2,:), 0.5], ... + 'DisplayName', 'IFF - 0'); +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,i,j))./abs(frf_ol.G_dL{i_mass+1}(:,i,i)), 'color', [colors(1,:), 0.5], ... + 'HandleVisibility', 'off'); + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i,j))./abs(frf_iff.G_dL{i_mass+1}(:,i,i)), 'color', [colors(2,:), 0.5], ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Amplitude [-]'); +legend('location', 'northwest', 'FontSize', 8); + +ax4 = nexttile; +hold on; +i_mass = 3 +plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,1,2))./abs(frf_ol.G_dL{i_mass+1}(:,1,1)), 'color', [colors(1,:), 0.5], ... + 'DisplayName', 'OL - 0'); +plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,1,2))./abs(frf_iff.G_dL{i_mass+1}(:,1,1)), 'color', [colors(2,:), 0.5], ... + 'DisplayName', 'IFF - 0'); +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(frf_ol.G_dL{i_mass+1}(:,i,j))./abs(frf_ol.G_dL{i_mass+1}(:,i,i)), 'color', [colors(1,:), 0.5], ... + 'HandleVisibility', 'off'); + plot(frf_iff.f, abs(frf_iff.G_dL{i_mass+1}(:,i,j))./abs(frf_iff.G_dL{i_mass+1}(:,i,i)), 'color', [colors(2,:), 0.5], ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); set(gca, 'YTickLabel',[]); +legend('location', 'northwest', 'FontSize', 8); + +linkaxes([ax1,ax2,ax3,ax4],'xy'); +ylim([0, 1]); xlim([10, 5e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/reduced_coupling_iff_masses.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:reduced_coupling_iff_masses +#+caption: Comparison of the coupling with and without IFF +#+RESULTS: +[[file:figs/reduced_coupling_iff_masses.png]] + +** Un-Balanced mass +*** Introduction + +#+name: fig:picture_unbalanced_payload +#+caption: Nano-Hexapod with unbalanced payload +#+attr_latex: :width \linewidth +[[file:figs/picture_unbalanced_payload.jpg]] *** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) @@ -4564,31 +6504,34 @@ addpath('./matlab/'); #+end_src #+begin_src matlab :eval no -%% Add useful folders to the path addpath('./mat/'); addpath('./src/'); #+end_src #+begin_src matlab :tangle no +%% Add all useful folders to the path addpath('matlab/nass-simscape/matlab/nano_hexapod/') addpath('matlab/nass-simscape/STEPS/nano_hexapod/') addpath('matlab/nass-simscape/STEPS/png/') addpath('matlab/nass-simscape/src/') addpath('matlab/nass-simscape/mat/') +addpath('matlab/vibration-table/matlab/') +addpath('matlab/vibration-table/STEPS/') #+end_src #+begin_src matlab :eval no -%% Add other useful folders to the path related to the Simscape model +%% Add all useful folders to the path addpath('nass-simscape/matlab/nano_hexapod/') addpath('nass-simscape/STEPS/nano_hexapod/') addpath('nass-simscape/STEPS/png/') addpath('nass-simscape/src/') addpath('nass-simscape/mat/') +addpath('vibration-table/matlab/') +addpath('vibration-table/STEPS/') #+end_src #+begin_src matlab -%% Load the FRF of the transfer function from u to dL with IFF -load('damped_plant_enc_plates.mat', 'f', 'Ts', 'G_enc_iff_opt') +i_masses = 0:3; #+end_src #+begin_src matlab @@ -4598,181 +6541,87 @@ mdl = 'nano_hexapod_simscape'; options = linearizeOptions; options.SampleTime = 0; -open(mdl) - -%% Initialize the Rerference path to zero Rx = zeros(1, 7); -%% Colors for the figures colors = colororder; #+end_src -*** Simscape Model -First initialized the nano-hexapod with a flexible APA model and with the IFF control strategy. + + +*** Compute the identified FRF with IFF +The following data are loaded: +- =Va=: the excitation voltage for the damped plant (corresponding to $u^\prime_i$) +- =de=: the measured motion by the 6 encoders (corresponding to $d\bm{\mathcal{L}}_m$) #+begin_src matlab -%% Initialize the Simscape model -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ... - 'flex_top_type', '4dof', ... - 'motion_sensor_type', 'plates', ... - 'actuator_type', 'flexible', ... - 'controller_type', 'iff'); -#+end_src +%% Load Identification Data +meas_added_mass = {zeros(6,1)}; -Then the controller is loaded -#+begin_src matlab -%% Load the decentralized IFF controller -load('Kiff.mat', 'Kiff') -#+end_src - -The inputs and outputs for the transfer function estimation are defined. -#+begin_src matlab -%% Identify the (damped) transfer function from u to dLm for different values of the IFF gain -clear io; io_i = 1; -io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs -io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder) -#+end_src - -And the plant from $\bm{u}^\prime$ to $d\bm{\mathcal{L}}_m$ is identified and the bode plot of its diagonal terms are shown in Figure [[fig:hac_iff_struts_enc_plates_plant_bode]]. -#+begin_src matlab -%% Identified of the damped TF from u' to dL -Gd_iff_opt = exp(-s*Ts)*linearize(mdl, io, 0.0, options); -#+end_src - -#+begin_src matlab :exports none -%% Bode plot for the transfer function from u' to dLm -freqs = 2*logspace(1, 3, 1000); - -figure; -tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); - -ax1 = nexttile([2,1]); -hold on; -% Diagonal Elements Model -plot(freqs, abs(squeeze(freqresp(Gd_iff_opt(1,1), freqs, 'Hz'))), 'color', colors(1,:), ... - 'DisplayName', 'Diagonal'); -for i = 2:6 - plot(freqs, abs(squeeze(freqresp(Gd_iff_opt(i,i), freqs, 'Hz'))), 'color', colors(1,:), ... - 'HandleVisibility', 'off'); +for i_strut = 1:6 + meas_iff_mass(i_strut) = {load(sprintf('frf_data_exc_strut_%i_iff_vib_table_1m_unbalanced.mat', i_strut), 't', 'Va', 'de')}; end -plot(freqs, abs(squeeze(freqresp(Gd_iff_opt(1,2), freqs, 'Hz'))), 'color', [colors(2,:), 0.2], ... - 'DisplayName', 'Off-Diag'); -for i = 1:5 - for j = i+1:6 - plot(freqs, abs(squeeze(freqresp(Gd_iff_opt(i,j), freqs, 'Hz'))), 'color', [colors(2,:), 0.2], ... - 'HandleVisibility', 'off'); - end -end -hold off; -set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); -ylabel('Amplitude $d\mathcal{L}_m/u^\prime$ [m/V]'); set(gca, 'XTickLabel',[]); -ylim([1e-8, 1e-4]); -legend('location', 'northeast') - -ax2 = nexttile; -hold on; -for i =1:6 - plot(freqs, 180/pi*angle(squeeze(freqresp(Gd_iff_opt(i,i), freqs, 'Hz'))), 'color', colors(1,:)); -end -hold off; -set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); -xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); -hold off; -yticks(-360:90:360); -ylim([-180, 180]); - -linkaxes([ax1,ax2],'x'); -xlim([20, 2e3]); #+end_src -#+begin_src matlab :tangle no :exports results :results file replace -exportFig('figs/hac_iff_struts_enc_plates_plant_bode.pdf', 'width', 'wide', 'height', 'tall'); -#+end_src - -#+name: fig:hac_iff_struts_enc_plates_plant_bode -#+caption: Transfer functions from $u$ to $d\mathcal{L}_m$ with IFF (diagonal and off-diagonal elements) -#+RESULTS: -[[file:figs/hac_iff_struts_enc_plates_plant_bode.png]] - -*** HAC Controller -Let's first try to design a first decentralized controller with: -- a bandwidth of 100Hz -- sufficient phase margin -- simple and understandable components - -After some very basic and manual loop shaping, the following controller is developed: +The window =win= and the frequency vector =f= are defined. #+begin_src matlab -%% Lead to increase phase margin -a = 2; % Amount of phase lead / width of the phase lead / high frequency gain -wc = 2*pi*100; % Frequency with the maximum phase lead [rad/s] +% Sampling Time [s] +Ts = (meas_iff_mass{1}.t(end) - (meas_iff_mass{1}.t(1)))/(length(meas_iff_mass{1}.t)-1); -H_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a))); +% Hannning Windows +win = hanning(ceil(1/Ts)); -%% Low Pass filter to increase robustness -H_lpf = 1/(1 + s/2/pi/200); - -%% Notch at the top-plate resonance -gm = 0.02; -xi = 0.3; -wn = 2*pi*700; - -H_notch = (s^2 + 2*gm*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2); - -%% Decentralized HAC -Khac_iff_struts = -(1/(2.87e-5)) * ... % Gain - H_lead * ... % Lead - H_notch * ... % Notch - (2*pi*100/s) * ... % Integrator - eye(6); % 6x6 Diagonal +% And we get the frequency vector +[~, f] = tfestimate(meas_iff_mass{1}.Va, meas_iff_mass{1}.de, win, [], [], 1/Ts); #+end_src -This controller is saved for further use. +Finally the $6 \times 6$ transfer function matrix from $\bm{u}^\prime$ to $d\bm{\mathcal{L}}_m$ is estimated: +#+begin_src matlab +%% DVF Plant (transfer function from u to dLm) +G_dL = zeros(length(f), 6, 6); +for i_strut = 1:6 + G_dL(:,:,i_strut) = tfestimate(meas_iff_mass{i_strut}.Va, meas_iff_mass{i_strut}.de, win, [], [], 1/Ts); +end +#+end_src + +The identified dynamics are then saved for further use. #+begin_src matlab :exports none :tangle no -save('matlab/mat/Khac_iff_struts.mat', 'Khac_iff_struts') +save('matlab/mat/frf_iff_unbalanced_vib_table_m.mat', 'f', 'Ts', 'G_dL'); #+end_src #+begin_src matlab :eval no -save('mat/Khac_iff_struts.mat', 'Khac_iff_struts') +save('mat/frf_iff_unbalanced_vib_table_m.mat', 'f', 'Ts', 'G_dL'); #+end_src -The Loop Gain is computed and shown in Figure [[fig:loop_gain_hac_iff_struts]]. -#+begin_src matlab -Lhac_iff_struts = Khac_iff_struts*Gd_iff_opt; +*** Effect of an unbalanced payload +#+begin_src matlab :exports none +%% Load the Measured FRF of the damped plant +frf_unb_iff = load('frf_iff_unbalanced_vib_table_m.mat', 'f', 'Ts', 'G_dL'); #+end_src +The transfer functions from $u_i$ to $d\mathcal{L}_i$ are shown in Figure [[fig:frf_damp_unbalanced_mass]]. +Due to the unbalanced payload, the system is not symmetrical anymore, and therefore each of the diagonal elements are not equal. +This is due to the fact that each strut is not affected by the same inertia. + #+begin_src matlab :exports none -%% Bode plot for the transfer function from u to dLm -freqs = 2*logspace(0, 3, 1000); - +%% Diagonal and Off Diagonal elements of the damped plants figure; tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); ax1 = nexttile([2,1]); hold on; -% Diagonal Elements Model -plot(freqs, abs(squeeze(freqresp(Lhac_iff_struts(i,i), freqs, 'Hz'))), 'color', colors(1,:), ... - 'DisplayName', 'Diagonal'); -for i = 2:6 - plot(freqs, abs(squeeze(freqresp(Lhac_iff_struts(i,i), freqs, 'Hz'))), 'color', colors(1,:), ... - 'HandleVisibility', 'off'); -end -plot(freqs, abs(squeeze(freqresp(Lhac_iff_struts(1,2), freqs, 'Hz'))), 'color', [colors(2,:), 0.2], ... - 'DisplayName', 'Off-Diag'); -for i = 1:5 - for j = i+1:6 - plot(freqs, abs(squeeze(freqresp(Lhac_iff_struts(i,j), freqs, 'Hz'))), 'color', [colors(2,:), 0.2], ... - 'HandleVisibility', 'off'); - end +for i = 1:6 + plot(frf_unb_iff.f, abs(frf_unb_iff.G_dL(:,i,i)), 'color', colors(i,:), ... + 'DisplayName', sprintf('$d\\mathcal{L}_{m,%i}/u^\\prime_%i$', i, i)); end hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); -ylabel('Loop Gain [-]'); set(gca, 'XTickLabel',[]); -ylim([1e-3, 1e2]); -legend('location', 'northeast'); +ylabel('Amplitude $d_L/V_a$ [m/V]'); set(gca, 'XTickLabel',[]); +ylim([5e-8, 3e-5]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); ax2 = nexttile; hold on; for i =1:6 - plot(freqs, 180/pi*angle(squeeze(freqresp(Lhac_iff_struts(i,i), freqs, 'Hz'))), 'color', colors(1,:)); + plot(frf_unb_iff.f, 180/pi*angle(frf_unb_iff.G_dL(:,i, i)), 'color', colors(i,:)); end hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); @@ -4782,110 +6631,175 @@ yticks(-360:90:360); ylim([-180, 180]); linkaxes([ax1,ax2],'x'); -xlim([2, 2e3]); +xlim([10, 1e3]); #+end_src #+begin_src matlab :tangle no :exports results :results file replace -exportFig('figs/loop_gain_hac_iff_struts.pdf', 'width', 'wide', 'height', 'tall'); +exportFig('figs/frf_damp_unbalanced_mass.pdf', 'width', 'wide', 'height', 'tall'); #+end_src -#+name: fig:loop_gain_hac_iff_struts -#+caption: Diagonal and off-diagonal elements of the Loop gain for "HAC-IFF-Struts" +#+name: fig:frf_damp_unbalanced_mass +#+caption: Transfer function from $u_i$ to $d\mathcal{L}_i$ for the nano-hexapod with an unbalanced payload #+RESULTS: -[[file:figs/loop_gain_hac_iff_struts.png]] +[[file:figs/frf_damp_unbalanced_mass.png]] + + + +** Conclusion +#+begin_important +In this section, the dynamics of the nano-hexapod with the encoders fixed to the plates is studied. + +It has been found that: +- The measured dynamics is in agreement with the dynamics of the simscape model, up to the flexible modes of the top plate. + See figures [[fig:enc_plates_iff_comp_simscape]] and [[fig:enc_plates_iff_comp_offdiag_simscape]] for the transfer function to the force sensors and Figures [[fig:enc_plates_dvf_comp_simscape]] and [[fig:enc_plates_dvf_comp_offdiag_simscape]]for the transfer functions to the encoders +- The Integral Force Feedback strategy is very effective in damping the suspension modes of the nano-hexapod (Figure [[fig:enc_plant_plates_effect_iff]]). +- The transfer function from $\bm{u}^\prime$ to $d\bm{\mathcal{L}}_m$ show nice dynamical properties and is a much better candidate for the high-authority-control than when the encoders were fixed to the struts. + At least up to the flexible modes of the top plate, the diagonal elements of the transfer function matrix have alternating poles and zeros, and the phase is moving smoothly. + Only the flexible modes of the top plates seems to be problematic for control. +#+end_important + +* Noise Budgeting :noexport: +** Introduction :ignore: + +Noise sources: +- PD200 => plant +- DAC => plant x 20 +- Encoder => direct output +- ADC (Force Sensor) => added when closing the loop (controller + plant) + +Disturbances Sources: +- Ground motion + +** 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 + +#+begin_src matlab :tangle no +addpath('./matlab/mat/'); +addpath('./matlab/src/'); +addpath('./matlab/'); +#+end_src + +#+begin_src matlab :eval no +addpath('./mat/'); +addpath('./src/'); +#+end_src -*** Verification of the Stability using the Simscape model -The HAC-IFF control strategy is implemented using Simscape. #+begin_src matlab -%% Initialize the Simscape model in closed loop -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ... - 'flex_top_type', '4dof', ... - 'motion_sensor_type', 'plates', ... - 'actuator_type', 'flexible', ... - 'controller_type', 'hac-iff-struts'); +i_masses = 0:3; #+end_src -We identify the closed-loop system. #+begin_src matlab -%% Identification -Gd_iff_hac_opt = linearize(mdl, io, 0.0, options); +colors = colororder; #+end_src - -And verify that it is indeed stable. -#+begin_src matlab :results value replace :exports both -%% Verify the stability -isstable(Gd_iff_hac_opt) -#+end_src - -#+RESULTS: -: 1 - -*** Experimental Loop Gain -Now, the loop gain is estimated from the measured FRF. +** Measurements #+begin_src matlab -L_frf = zeros(size(G_enc_iff_opt)); - -for i = 1:size(G_enc_iff_opt, 1) - L_frf(i, :, :) = squeeze(G_enc_iff_opt(i,:,:))*freqresp(Khac_iff_struts, f(i), 'Hz'); -end +noise_enc = load('noise_meas_100s_20kHz.mat', 't', 'x'); +noise_enc.Ts = (noise_enc.t(end) - (noise_enc.t(1)))/(length(noise_enc.t)-1); +noise_enc.win = hanning(ceil(1/noise_enc.Ts)); +noise_enc.x = noise_enc.x - noise_enc.x(1); +[noise_enc.pxx, noise_enc.f] = pwelch(noise_enc.x, noise_enc.win, [], [], 1/noise_enc.Ts); #+end_src -The bode plot of the loop gain is shown in Figure [[fig:hac_iff_plates_exp_loop_gain_diag]]. #+begin_src matlab :exports none -%% Bode plot for the transfer function from u to dLm -freqs = 2*logspace(1, 3, 1000); +noise_ol = load('noise_meas_2m_ol.mat', 't', 'Vs', 'de'); +noise_ol.Ts = (noise_ol.t(end) - (noise_ol.t(1)))/(length(noise_ol.t)-1); +noise_ol.win = hanning(ceil(1/noise_ol.Ts)); +[noise_ol.pxx, noise_ol.f] = pwelch(noise_ol.de(:,1), noise_ol.win, [], [], 1/noise_ol.Ts); +#+end_src +#+begin_src matlab :exports none +noise_iff = load('noise_meas_2m_iff.mat', 't', 'de'); +noise_iff.Ts = (noise_iff.t(end) - (noise_iff.t(1)))/(length(noise_iff.t)-1); +noise_iff.win = hanning(ceil(1/noise_iff.Ts)); +[noise_iff.pxx, noise_iff.f] = pwelch(noise_iff.de(:,1), noise_iff.win, [], [], 1/noise_iff.Ts); +#+end_src + +#+begin_src matlab :exports none figure; -tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); - -ax1 = nexttile([2,1]); hold on; -% Diagonal Elements FRF -plot(f, abs(L_frf(:,1,1)), 'color', colors(1,:), ... - 'DisplayName', 'Diagonal'); -for i = 2:6 - plot(f, abs(L_frf(:,i,i)), 'color', colors(1,:), ... - 'HandleVisibility', 'off'); -end -plot(f, abs(L_frf(:,1,2)), 'color', [colors(2,:), 0.2], ... - 'DisplayName', 'Off-Diag'); -for i = 1:5 - for j = i+1:6 - plot(f, abs(L_frf(:,i,j)), 'color', [colors(2,:), 0.2], ... - 'HandleVisibility', 'off'); - end -end +plot(noise_ol.f, sqrt(noise_ol.pxx), 'DisplayName', 'OL'); +plot(noise_iff.f, sqrt(noise_iff.pxx), 'DisplayName', 'IFF'); +plot(noise_enc.f, sqrt(noise_enc.pxx), 'DisplayName', 'Encoder'); hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); -ylabel('Loop Gain [-]'); set(gca, 'XTickLabel',[]); -ylim([1e-3, 1e2]); +xlabel('Frequency [Hz]'); ylabel('ASD [$m/\sqrt{Hz}$]'); legend('location', 'northeast'); - -ax2 = nexttile; -hold on; -for i =1:6 - plot(f, 180/pi*angle(L_frf(:,i,i)), 'color', colors(1,:)); -end -hold off; -set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); -xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); -hold off; -yticks(-360:90:360); -ylim([-180, 180]); - -linkaxes([ax1,ax2],'x'); -xlim([1, 2e3]); +xlim([1, Fs/2]); ylim([1e-11, 1e-7]); #+end_src -#+begin_src matlab :tangle no :exports results :results file replace -exportFig('figs/hac_iff_plates_exp_loop_gain_diag.pdf', 'width', 'wide', 'height', 'tall'); + +* Decentralized High Authority Control with Integral Force Feedback +<> + +** Introduction :ignore: + +In this section is studied the HAC-IFF architecture for the Nano-Hexapod. +More precisely: +- The LAC control is a decentralized integral force feedback as studied in Section [[sec:enc_plates_iff]] +- The HAC control is a decentralized controller working in the frame of the struts + +The corresponding control architecture is shown in Figure [[fig:control_architecture_hac_iff_struts]] with: +- $\bm{r}_{\mathcal{X}_n}$: the $6 \times 1$ reference signal in the cartesian frame +- $\bm{r}_{d\mathcal{L}}$: the $6 \times 1$ reference signal transformed in the frame of the struts thanks to the inverse kinematic +- $\bm{\epsilon}_{d\mathcal{L}}$: the $6 \times 1$ length error of the 6 struts +- $\bm{u}^\prime$: input of the damped plant +- $\bm{u}$: generated DAC voltages +- $\bm{\tau}_m$: measured force sensors +- $d\bm{\mathcal{L}}_m$: measured displacement of the struts by the encoders + +#+begin_src latex :file control_architecture_hac_iff_struts.pdf +\definecolor{instrumentation}{rgb}{0, 0.447, 0.741} +\definecolor{mechanics}{rgb}{0.8500, 0.325, 0.098} +\definecolor{control}{rgb}{0.4660, 0.6740, 0.1880} + +\begin{tikzpicture} + % Blocs + \node[block={3.0cm}{2.0cm}, fill=black!20!white] (P) {Plant}; + \coordinate[] (inputF) at ($(P.south west)!0.5!(P.north west)$); + \coordinate[] (outputF) at ($(P.south east)!0.2!(P.north east)$); + \coordinate[] (outputL) at ($(P.south east)!0.8!(P.north east)$); + + \node[block, below=0.4 of P, fill=control!20!white] (Kiff) {$\bm{K}_\text{IFF}$}; + \node[block, left=0.8 of inputF, fill=instrumentation!20!white] (pd200) {\tiny PD200}; + \node[addb, left=0.8 of pd200, fill=control!20!white] (addF) {}; + \node[block, left=0.8 of addF, fill=control!20!white] (K) {$\bm{K}_\mathcal{L}$}; + \node[addb={+}{}{-}{}{}, left=0.8 of K, fill=control!20!white] (subr) {}; + \node[block, align=center, left= of subr, fill=control!20!white] (J) {\tiny Inverse\\\tiny Kinematics}; + + % Connections and labels + \draw[->] (outputF) -- ++(1.0, 0) node[above left]{$\bm{\tau}_m$}; + \draw[->] ($(outputF) + (0.6, 0)$)node[branch]{} |- (Kiff.east); + \draw[->] (Kiff.west) -| (addF.south); + \draw[->] (addF.east) -- (pd200.west) node[above left]{$\bm{u}$}; + \draw[->] (pd200.east) -- (inputF) node[above left]{$\bm{u}_a$}; + + \draw[->] (outputL) -- ++(1.0, 0) node[below left]{$d\bm{\mathcal{L}_m}$}; + \draw[->] ($(outputL) + (0.6, 0)$)node[branch]{} -- ++(0, 1) -| (subr.north); + \draw[->] (subr.east) -- (K.west) node[above left]{$\bm{\epsilon}_{d\mathcal{L}}$}; + \draw[->] (K.east) -- (addF.west) node[above left]{$\bm{u}^\prime$}; + + \draw[->] (J.east) -- (subr.west) node[above left]{$\bm{r}_{d\mathcal{L}}$}; + \draw[<-] (J.west)node[above left]{$\bm{r}_{\mathcal{X}_n}$} -- ++(-1, 0); +\end{tikzpicture} #+end_src -#+name: fig:hac_iff_plates_exp_loop_gain_diag -#+caption: Diagonal and Off-diagonal elements of the Loop gain (experimental data) +#+name: fig:control_architecture_hac_iff_struts +#+caption: HAC-LAC: IFF + Control in the frame of the legs #+RESULTS: -[[file:figs/hac_iff_plates_exp_loop_gain_diag.png]] +[[file:figs/control_architecture_hac_iff_struts.png]] + +This part is structured as follow: +- Section [[sec:hac_iff_struts_ref_track]]: some reference tracking tests are performed +- Section [[sec:hac_iff_struts_controller]]: the decentralized high authority controller is tuned using the Simscape model and is implemented and tested experimentally +- Section [[sec:interaction_analysis]]: an interaction analysis is performed, from which the best decoupling strategy can be determined +- Section [[sec:robust_hac_design]]: Robust High Authority Controller are designed ** Reference Tracking - Trajectories <> @@ -4895,33 +6809,39 @@ In this section, several trajectories representing the wanted pose (position and These trajectories will be used to test the HAC-LAC architecture. In order to transform the wanted pose to the wanted displacement of the 6 struts, the inverse kinematic is required. -As a first approximation, the Jacobian matrix can be used instead of using the full inverse kinematic equations. +As a first approximation, the Jacobian matrix $\bm{J}$ can be used instead of using the full inverse kinematic equations. Therefore, the control architecture with the input trajectory $\bm{r}_{\mathcal{X}_n}$ is shown in Figure [[fig:control_architecture_hac_iff_L]]. -#+begin_src latex :file control_architecture_hac_iff_L.pdf +#+begin_src latex :file control_architecture_hac_iff_struts_L.pdf +\definecolor{instrumentation}{rgb}{0, 0.447, 0.741} +\definecolor{mechanics}{rgb}{0.8500, 0.325, 0.098} +\definecolor{control}{rgb}{0.4660, 0.6740, 0.1880} + \begin{tikzpicture} % Blocs - \node[block={3.0cm}{3.0cm}] (P) {Plant}; + \node[block={3.0cm}{2.0cm}, fill=black!20!white] (P) {Plant}; \coordinate[] (inputF) at ($(P.south west)!0.5!(P.north west)$); - \coordinate[] (outputF) at ($(P.south east)!0.8!(P.north east)$); - \coordinate[] (outputL) at ($(P.south east)!0.2!(P.north east)$); + \coordinate[] (outputF) at ($(P.south east)!0.2!(P.north east)$); + \coordinate[] (outputL) at ($(P.south east)!0.8!(P.north east)$); - \node[block, above=0.4 of P] (Kiff) {$\bm{K}_\text{IFF}$}; - \node[addb, left= of inputF] (addF) {}; - \node[block, left= of addF] (K) {$\bm{K}_\mathcal{L}$}; - \node[addb={+}{}{}{}{-}, left= of K] (subr) {}; - \node[block, left= of subr] (J) {$J$}; + \node[block, below=0.4 of P, fill=control!20!white] (Kiff) {$\bm{K}_\text{IFF}$}; + \node[block, left=0.8 of inputF, fill=instrumentation!20!white] (pd200) {\tiny PD200}; + \node[addb, left=0.8 of pd200, fill=control!20!white] (addF) {}; + \node[block, left=0.8 of addF, fill=control!20!white] (K) {$\bm{K}_\mathcal{L}$}; + \node[addb={+}{}{-}{}{}, left=0.8 of K, fill=control!20!white] (subr) {}; + \node[block, align=center, left= of subr, fill=control!20!white] (J) {$\bm{J}$}; % Connections and labels - \draw[->] (outputF) -- ++(1, 0) node[below left]{$\bm{\tau}_m$}; + \draw[->] (outputF) -- ++(1.0, 0) node[above left]{$\bm{\tau}_m$}; \draw[->] ($(outputF) + (0.6, 0)$)node[branch]{} |- (Kiff.east); - \draw[->] (Kiff.west) -| (addF.north); - \draw[->] (addF.east) -- (inputF) node[above left]{$\bm{u}$}; + \draw[->] (Kiff.west) -| (addF.south); + \draw[->] (addF.east) -- (pd200.west) node[above left]{$\bm{u}$}; + \draw[->] (pd200.east) -- (inputF) node[above left]{$\bm{u}_a$}; - \draw[->] (outputL) -- ++(1, 0) node[above left]{$d\bm{\mathcal{L}}$}; - \draw[->] ($(outputL) + (0.6, 0)$)node[branch]{} -- ++(0, -1) -| (subr.south); - \draw[->] (subr.east) -- (K.west) node[above left]{$\bm{\epsilon}_{d\mathcal{L}_m}$}; + \draw[->] (outputL) -- ++(1.0, 0) node[below left]{$d\bm{\mathcal{L}_m}$}; + \draw[->] ($(outputL) + (0.6, 0)$)node[branch]{} -- ++(0, 1) -| (subr.north); + \draw[->] (subr.east) -- (K.west) node[above left]{$\bm{\epsilon}_{d\mathcal{L}}$}; \draw[->] (K.east) -- (addF.west) node[above left]{$\bm{u}^\prime$}; \draw[->] (J.east) -- (subr.west) node[above left]{$\bm{r}_{d\mathcal{L}}$}; @@ -4932,7 +6852,7 @@ Therefore, the control architecture with the input trajectory $\bm{r}_{\mathcal{ #+name: fig:control_architecture_hac_iff_L #+caption: HAC-LAC: IFF + Control in the frame of the legs #+RESULTS: -[[file:figs/control_architecture_hac_iff_L.png]] +[[file:figs/control_architecture_hac_iff_struts_L.png]] In the following sections, several reference trajectories are defined: - Section [[sec:yz_scans]]: simple scans in the Y-Z plane @@ -4959,39 +6879,8 @@ addpath('./mat/'); addpath('./src/'); #+end_src -#+begin_src matlab :tangle no -%% Add all useful folders to the path -addpath('matlab/nass-simscape/matlab/nano_hexapod/') -addpath('matlab/nass-simscape/STEPS/nano_hexapod/') -addpath('matlab/nass-simscape/STEPS/png/') -addpath('matlab/nass-simscape/src/') -addpath('matlab/nass-simscape/mat/') -#+end_src - -#+begin_src matlab :eval no -%% Add all useful folders to the path -addpath('nass-simscape/matlab/nano_hexapod/') -addpath('nass-simscape/STEPS/nano_hexapod/') -addpath('nass-simscape/STEPS/png/') -addpath('nass-simscape/src/') -addpath('nass-simscape/mat/') -#+end_src - -#+begin_src matlab -%% Open Simulink Model -mdl = 'nano_hexapod_simscape'; - -options = linearizeOptions; -options.SampleTime = 0; - -open(mdl) - -colors = colororder; -#+end_src - *** Y-Z Scans <> -**** Generate the Scan A function =generateYZScanTrajectory= has been developed (accessible [[sec:generateYZScanTrajectory][here]]) in order to easily generate scans in the Y-Z plane. For instance, the following generated trajectory is represented in Figure [[fig:yz_scan_example_trajectory_yz_plane]]. @@ -4999,13 +6888,13 @@ For instance, the following generated trajectory is represented in Figure [[fig: %% Generate the Y-Z trajectory scan Rx_yz = generateYZScanTrajectory(... 'y_tot', 4e-6, ... % Length of Y scans [m] - 'z_tot', 8e-6, ... % Total Z distance [m] + 'z_tot', 4e-6, ... % Total Z distance [m] 'n', 5, ... % Number of Y scans 'Ts', 1e-3, ... % Sampling Time [s] - 'ti', 2, ... % Time to go to initial position [s] - 'tw', 0.5, ... % Waiting time between each points [s] - 'ty', 2, ... % Time for a scan in Y [s] - 'tz', 1); % Time for a scan in Z [s] + 'ti', 1, ... % Time to go to initial position [s] + 'tw', 0, ... % Waiting time between each points [s] + 'ty', 0.6, ... % Time for a scan in Y [s] + 'tz', 0.2); % Time for a scan in Z [s] #+end_src #+begin_src matlab :exports none @@ -5049,18 +6938,23 @@ exportFig('figs/yz_scan_example_trajectory.pdf', 'width', 'wide', 'height', 'nor #+RESULTS: [[file:figs/yz_scan_example_trajectory.png]] -**** Reference Signal for the Strut lengths Using the Jacobian matrix, it is possible to compute the wanted struts lengths as a function of time: \begin{equation} \bm{r}_{d\mathcal{L}} = \bm{J} \bm{r}_{\mathcal{X}_n} \end{equation} +#+begin_src matlab :exports none +load('jacobian.mat', 'J'); +#+end_src + #+begin_src matlab -dL_ref = [n_hexapod.geometry.J*Rx_yz(:, 2:7)']'; +%% Compute the reference in the frame of the legs +dL_ref = [J*Rx_yz(:, 2:7)']'; #+end_src The reference signal for the strut length is shown in Figure [[fig:yz_scan_example_trajectory_struts]]. #+begin_src matlab :exports none +%% Plot the reference in the frame of the legs figure; hold on; for i=1:6 @@ -5081,93 +6975,67 @@ exportFig('figs/yz_scan_example_trajectory_struts.pdf', 'width', 'wide', 'height #+RESULTS: [[file:figs/yz_scan_example_trajectory_struts.png]] -**** Time domain simulation with 2DoF model -Before trying to follow this reference with the nano-hexapod, let's try to do it using the Simscape model. - -The nano-hexapod is initialized with the APA modelled as 2DoF system (for the simulation to run quickly). -#+begin_src matlab -%% Initialize the Simscape model in closed loop -n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ... - 'flex_top_type', '3dof', ... - 'motion_sensor_type', 'plates', ... - 'actuator_type', '2dof', ... - 'controller_type', 'hac-iff-struts'); -#+end_src - -#+begin_src matlab :exports none -%% Run the simulation -set_param(mdl,'StopTime', num2str(Rx_yz(end,1))) -set_param(mdl,'SimulationCommand','start') -#+end_src - -#+begin_src matlab :exports none -%% Reset motion at t=0 -out.X.Data = out.X.Data - out.X.Data(1,:); -#+end_src - -The reference path as well as the measured motion are compared in Figure [[fig:ref_track_hac_iff_struts_yz_plane]]. -#+begin_src matlab :exports none -%% Plot both the reference path and the measured motion -figure; -hold on; -set(gca,'ColorOrderIndex',2) -plot(1e6*out.X.Data(:,2), 1e6*out.X.Data(:,3), '-', ... - 'DisplayName', 'Meas. Motion') -plot(1e6*Rx_yz(:,3), 1e6*Rx_yz(:,4), 'k--', ... - 'DisplayName', 'Reference Path') -hold off; -xlabel('X displacement [$\mu m$]'); ylabel('Y displacement [$\mu m$]'); -legend('location', 'southwest'); -#+end_src - -#+begin_src matlab :tangle no :exports results :results file replace -exportFig('figs/ref_track_hac_iff_struts_yz_plane.pdf', 'width', 'wide', 'height', 'tall'); -#+end_src - -#+name: fig:ref_track_hac_iff_struts_yz_plane -#+caption: Simulated Y-Z motion -#+RESULTS: -[[file:figs/ref_track_hac_iff_struts_yz_plane.png]] - -The motion errors are computed and shown in Figure [[fig:ref_track_hac_iff_struts_pos_error]]. -It is clear that the hexapod is indeed tracking the reference path. -However, in this simulation, no disturbances are included nor sensor noises. -#+begin_src matlab :exports none -%% Motion errors -figure; -tiledlayout(1, 2, 'TileSpacing', 'None', 'Padding', 'None'); - -ax1 = nexttile; -hold on; -plot(out.X.Time, 1e9*(out.X.Data(:,1) - Rx_yz(:,2)), 'DisplayName', '$\epsilon_x$') -plot(out.X.Time, 1e9*(out.X.Data(:,2) - Rx_yz(:,3)), 'DisplayName', '$\epsilon_y$') -plot(out.X.Time, 1e9*(out.X.Data(:,3) - Rx_yz(:,4)), 'DisplayName', '$\epsilon_z$') -hold off; -xlabel('Time [s]'); ylabel('Position Errors [nm]'); -legend('location', 'northeast'); - -ax2 = nexttile; -hold on; -plot(out.X.Time, 1e6*(out.X.Data(:,4) - Rx_yz(:,5)), 'DisplayName', '$\epsilon_{R_x}$') -plot(out.X.Time, 1e6*(out.X.Data(:,5) - Rx_yz(:,6)), 'DisplayName', '$\epsilon_{R_y}$') -plot(out.X.Time, 1e6*(out.X.Data(:,6) - Rx_yz(:,7)), 'DisplayName', '$\epsilon_{R_z}$') -hold off; -xlabel('Time [s]'); ylabel('Orientation Errors [$\mu rad$]'); -legend('location', 'northeast'); -#+end_src - -#+begin_src matlab :tangle no :exports results :results file replace -exportFig('figs/ref_track_hac_iff_struts_pos_error.pdf', 'width', 'full', 'height', 'tall'); -#+end_src - -#+name: fig:ref_track_hac_iff_struts_pos_error -#+caption: Positioning errors as a function of time -#+RESULTS: -[[file:figs/ref_track_hac_iff_struts_pos_error.png]] - -*** TODO Tilt Scans +*** Tilt Scans <> +A function =generalSpiralAngleTrajectory= has been developed in order to easily generate $R_x,R_y$ tilt scans. + +For instance, the following generated trajectory is represented in Figure [[fig:tilt_scan_example_trajectory]]. +#+begin_src matlab +%% Generate the "tilt-spiral" trajectory scan +R_tilt = generateSpiralAngleTrajectory(... + 'R_tot', 20e-6, ... % Total Tilt [ad] + 'n_turn', 5, ... % Number of scans + 'Ts', 1e-3, ... % Sampling Time [s] + 't_turn', 1, ... % Turn time [s] + 't_end', 1); % End time to go back to zero [s] +#+end_src + +#+begin_src matlab :exports none +%% Plot the trajectory +figure; +plot(1e6*R_tilt(:,5), 1e6*R_tilt(:,6)); +xlabel('$R_x$ [$\mu$rad]'); ylabel('$R_y$ [$\mu$rad]'); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/tilt_scan_example_trajectory.pdf', 'width', 'normal', 'height', 'normal'); +#+end_src + +#+name: fig:tilt_scan_example_trajectory +#+caption: Generated "spiral" scan +#+RESULTS: +[[file:figs/tilt_scan_example_trajectory.png]] + +#+begin_src matlab :exports none +%% Compute the reference in the frame of the legs +load('jacobian.mat', 'J'); +dL_ref = [J*R_tilt(:, 2:7)']'; +#+end_src + +The reference signal for the strut length is shown in Figure [[fig:tilt_scan_example_trajectory_struts]]. +#+begin_src matlab :exports none +%% Plot the reference in the frame of the legs +figure; +hold on; +for i=1:6 + plot(R_tilt(:,1), dL_ref(:, i), ... + 'DisplayName', sprintf('$r_{d\\mathcal{L}_%i}$', i)) +end +xlabel('Time [s]'); ylabel('Strut Motion [m]'); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); +yticks(1e-6*[-5:5]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/tilt_scan_example_trajectory_struts.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:tilt_scan_example_trajectory_struts +#+caption: Trajectories for the 6 individual struts - Tilt scan +#+RESULTS: +[[file:figs/tilt_scan_example_trajectory_struts.png]] + *** "NASS" reference path <> In this section, a reference path that "draws" the work "NASS" is developed. @@ -5244,11 +7112,13 @@ exportFig('figs/ref_track_test_nass_3d.pdf', 'width', 'normal', 'height', 'norma #+RESULTS: [[file:figs/ref_track_test_nass_3d.png]] -** First Experimental Tests with the HAC -<> - +** First Basic High Authority Controller +<> *** Introduction :ignore: -Both the Integral Force Feedback controller (developed in Section [[sec:enc_plates_iff]]) and the high authority controller working in the frame of the struts (developed in Section [[sec:hac_iff_struts_controller]]) are implemented experimentally. +In this section, a simple decentralized high authority controller $\bm{K}_{\mathcal{L}}$ is developed to work without any payload. + +The diagonal controller is tuned using classical Loop Shaping in Section [[sec:hac_iff_no_payload_tuning]]. +The stability is verified in Section [[sec:hac_iff_no_payload_stability]] using the Simscape model. *** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) @@ -5277,6 +7147,8 @@ addpath('matlab/nass-simscape/STEPS/nano_hexapod/') addpath('matlab/nass-simscape/STEPS/png/') addpath('matlab/nass-simscape/src/') addpath('matlab/nass-simscape/mat/') +addpath('matlab/vibration-table/matlab/') +addpath('matlab/vibration-table/STEPS/') #+end_src #+begin_src matlab :eval no @@ -5286,6 +7158,14 @@ addpath('nass-simscape/STEPS/nano_hexapod/') addpath('nass-simscape/STEPS/png/') addpath('nass-simscape/src/') addpath('nass-simscape/mat/') +addpath('vibration-table/matlab/') +addpath('vibration-table/STEPS/') +#+end_src + +#+begin_src matlab +%% Load the identified FRF and Simscape model +frf_iff = load('frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); +sim_iff = load('sim_iff_vib_table_m.mat', 'G_dL'); #+end_src #+begin_src matlab @@ -5304,8 +7184,160 @@ Rx = zeros(1, 7); colors = colororder; #+end_src -*** Initial Controller -The controller designed in Section [[sec:hac_iff_struts_controller]] is implemented experimentally and some reference tracking tests are performed. +*** HAC Controller +<> + +Let's first try to design a first decentralized controller with: +- a bandwidth of 100Hz +- sufficient phase margin +- simple and understandable components + +After some very basic and manual loop shaping, A diagonal controller is developed. +Each diagonal terms are identical and are composed of: +- A lead around 100Hz +- A first order low pass filter starting at 200Hz to add some robustness to high frequency modes +- A notch at 700Hz to cancel the flexible modes of the top plate +- A pure integrator + +#+begin_src matlab +%% Lead to increase phase margin +a = 2; % Amount of phase lead / width of the phase lead / high frequency gain +wc = 2*pi*100; % Frequency with the maximum phase lead [rad/s] + +H_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a))); + +%% Low Pass filter to increase robustness +H_lpf = 1/(1 + s/2/pi/200); + +%% Notch at the top-plate resonance +gm = 0.02; +xi = 0.3; +wn = 2*pi*700; + +H_notch = (s^2 + 2*gm*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2); + +%% Decentralized HAC +Khac_iff_struts = -(1/(2.87e-5)) * ... % Gain + H_lead * ... % Lead + H_notch * ... % Notch + (2*pi*100/s) * ... % Integrator + eye(6); % 6x6 Diagonal +#+end_src + +This controller is saved for further use. +#+begin_src matlab :exports none :tangle no +save('matlab/mat/Khac_iff_struts.mat', 'Khac_iff_struts') +#+end_src + +#+begin_src matlab :eval no +save('mat/Khac_iff_struts.mat', 'Khac_iff_struts') +#+end_src + +The experimental loop gain is computed and shown in Figure [[fig:loop_gain_hac_iff_struts]]. +#+begin_src matlab +L_hac_iff_struts = pagemtimes(permute(frf_iff.G_dL{1}, [2 3 1]), squeeze(freqresp(Khac_iff_struts, frf_iff.f, 'Hz'))); +#+end_src + +#+begin_src matlab :exports none +%% Bode plot of the Loop Gain +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + + +ax1 = nexttile([2,1]); +hold on; +% Diagonal Elements Model +plot(frf_iff.f, abs(squeeze(L_hac_iff_struts(1,1,:))), 'color', colors(1,:), ... + 'DisplayName', 'Diagonal'); +for i = 2:6 + plot(frf_iff.f, abs(squeeze(L_hac_iff_struts(i,i,:))), 'color', colors(1,:), ... + 'HandleVisibility', 'off'); +end +plot(frf_iff.f, abs(squeeze(L_hac_iff_struts(1,2,:))), 'color', [colors(2,:), 0.2], ... + 'DisplayName', 'Off-Diag'); +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(squeeze(L_hac_iff_struts(i,j,:))), 'color', [colors(2,:), 0.2], ... + 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Loop Gain [-]'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e2]); +legend('location', 'northeast'); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(squeeze(L_hac_iff_struts(i,i,:))), 'color', colors(1,:)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([2, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/loop_gain_hac_iff_struts.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:loop_gain_hac_iff_struts +#+caption: Diagonal and off-diagonal elements of the Loop gain for "HAC-IFF-Struts" +#+RESULTS: +[[file:figs/loop_gain_hac_iff_struts.png]] + +*** Verification of the Stability using the Simscape model +<> + +The HAC-IFF control strategy is implemented using Simscape. +#+begin_src matlab +%% Initialize the Simscape model in closed loop +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '4dof', ... + 'flex_top_type', '4dof', ... + 'motion_sensor_type', 'plates', ... + 'actuator_type', 'flexible', ... + 'controller_type', 'hac-iff-struts'); +#+end_src + +#+begin_src matlab :exports none +support.type = 1; % On top of vibration table +payload.type = 3; % Payload / 1 "mass layer" + +load('Kiff_opt.mat', 'Kiff'); +#+end_src + +#+begin_src matlab +%% Identify the (damped) transfer function from u to dLm +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder) +#+end_src + +We identify the closed-loop system. +#+begin_src matlab +%% Identification +Gd_iff_hac_opt = linearize(mdl, io, 0.0, options); +#+end_src + +And verify that it is indeed stable. +#+begin_src matlab :results value replace :exports both +%% Verify the stability +isstable(Gd_iff_hac_opt) +#+end_src + +#+RESULTS: +: 1 + +*** Experimental Validation +Both the Integral Force Feedback controller (developed in Section [[sec:enc_plates_iff]]) and the high authority controller working in the frame of the struts (developed in Section [[sec:hac_iff_struts_controller]]) are implemented experimentally. + +Two reference tracking experiments are performed to evaluate the stability and performances of the implemented control. #+begin_src matlab %% Load the experimental data @@ -5324,6 +7356,19 @@ load('jacobian.mat', 'J'); Xe = [inv(J)*de']'; #+end_src +#+begin_src matlab +%% Generate the Y-Z trajectory scan +Rx_yz = generateYZScanTrajectory(... + 'y_tot', 4e-6, ... % Length of Y scans [m] + 'z_tot', 8e-6, ... % Total Z distance [m] + 'n', 5, ... % Number of Y scans + 'Ts', 1e-3, ... % Sampling Time [s] + 'ti', 1, ... % Time to go to initial position [s] + 'tw', 0, ... % Waiting time between each points [s] + 'ty', 0.6, ... % Time for a scan in Y [s] + 'tz', 0.2); % Time for a scan in Z [s] +#+end_src + The reference path as well as the measured position are partially shown in the Y-Z plane in Figure [[fig:yz_scans_exp_results_first_K]]. #+begin_src matlab :exports none %% Position and reference signal in the Y-Z plane @@ -5400,16 +7445,12 @@ Khac_iff_struts = -2.2e4 * ... % Gain #+begin_src matlab :exports none %% Load the FRF of the transfer function from u to dL with IFF -load('damped_plant_enc_plates.mat', 'f', 'Ts', 'G_enc_iff_opt') +frf_iff = load('frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); #+end_src #+begin_src matlab :exports none %% Compute the Loop Gain -L_frf = zeros(size(G_enc_iff_opt)); - -for i = 1:size(G_enc_iff_opt, 1) - L_frf(i, :, :) = squeeze(G_enc_iff_opt(i,:,:))*freqresp(Khac_iff_struts, f(i), 'Hz'); -end +L_frf = pagemtimes(permute(frf_iff.G_dL{1}, [2 3 1]), squeeze(freqresp(Khac_iff_struts, frf_iff.f, 'Hz'))); #+end_src The bode plot of the new loop gain is shown in Figure [[fig:hac_iff_plates_exp_loop_gain_redesigned_K]]. @@ -5423,17 +7464,17 @@ tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); ax1 = nexttile([2,1]); hold on; % Diagonal Elements FRF -plot(f, abs(L_frf(:,1,1)), 'color', colors(1,:), ... +plot(frf_iff.f, abs(squeeze(L_frf(1,1,:))), 'color', colors(1,:), ... 'DisplayName', 'Diagonal'); for i = 2:6 - plot(f, abs(L_frf(:,i,i)), 'color', colors(1,:), ... + plot(frf_iff.f, abs(squeeze(L_frf(i,i,:))), 'color', colors(1,:), ... 'HandleVisibility', 'off'); end -plot(f, abs(L_frf(:,1,2)), 'color', [colors(2,:), 0.2], ... +plot(frf_iff.f, abs(squeeze(L_frf(1,2,:))), 'color', [colors(2,:), 0.2], ... 'DisplayName', 'Off-Diag'); for i = 1:5 for j = i+1:6 - plot(f, abs(L_frf(:,i,j)), 'color', [colors(2,:), 0.2], ... + plot(frf_iff.f, abs(squeeze(L_frf(i,j,:))), 'color', [colors(2,:), 0.2], ... 'HandleVisibility', 'off'); end end @@ -5446,7 +7487,7 @@ legend('location', 'northeast'); ax2 = nexttile; hold on; for i =1:6 - plot(f, 180/pi*angle(L_frf(:,i,i)), 'color', colors(1,:)); + plot(frf_iff.f, 180/pi*angle(squeeze(L_frf(i,i,:))), 'color', colors(1,:)); end hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); @@ -5496,8 +7537,8 @@ The measured motion as well as the trajectory are shown in Figure [[fig:nass_sca %% Plot the X-Y-Z "NASS" trajectory figure; hold on; -plot3(Xe(:,1), Xe(:,2), Xe(:,3)) -plot3(Rx_nass(:,2), Rx_nass(:,3), Rx_nass(:,4)) +plot3(Xe(1:100:end,1), Xe(1:100:end,2), Xe(1:100:end,3)) +plot3(Rx_nass(1:100:end,2), Rx_nass(1:100:end,3), Rx_nass(1:100:end,4)) hold off; xlabel('x [$\mu m$]'); ylabel('y [$\mu m$]'); zlabel('z [$\mu m$]'); view(-13, 41) @@ -5552,118 +7593,157 @@ exportFig('figs/ref_track_nass_exp_hac_iff_struts.pdf', 'width', 'full', 'height #+RESULTS: [[file:figs/ref_track_nass_exp_hac_iff_struts.png]] -The orientations errors as a function of time are shown in Figure [[fig:ref_track_nass_exp_hac_iff_struts_errors_angle]]. +The orientation errors during all the scans are shown in Figure [[fig:nass_ref_rx_ry]]. #+begin_src matlab :exports none %% Orientation Errors figure; hold on; -plot(t(t>10), 1e6*Xe(t>10,4), '-', 'DisplayName', '$\epsilon_{\theta_x}$'); -plot(t(t>10), 1e6*Xe(t>10,5), '-', 'DisplayName', '$\epsilon_{\theta_y}$'); -plot(t(t>10), 1e6*Xe(t>10,6), '-', 'DisplayName', '$\epsilon_{\theta_z}$'); +plot(t(t>20&t<20.1), 1e6*Xe(t>20&t<20.1,4), '-', 'DisplayName', '$\epsilon_{\theta_x}$'); +plot(t(t>20&t<20.1), 1e6*Xe(t>20&t<20.1,5), '-', 'DisplayName', '$\epsilon_{\theta_y}$'); +plot(t(t>20&t<20.1), 1e6*Xe(t>20&t<20.1,6), '-', 'DisplayName', '$\epsilon_{\theta_z}$'); hold off; xlabel('Time [s]'); ylabel('Orientation Error [$\mu$ rad]'); legend('location', 'northeast'); #+end_src -#+begin_src matlab :tangle no :exports results :results file replace -exportFig('figs/ref_track_nass_exp_hac_iff_struts_errors_angle.pdf', 'width', 'wide', 'height', 'normal'); +#+begin_src matlab :exports none +%% Orientation Errors +figure; +hold on; +plot(1e9*Xe(100000:100:end,4), 1e9*Xe(100000:100:end,5), '.'); +th = 0:pi/50:2*pi; +xunit = 90 * cos(th); +yunit = 90 * sin(th); +plot(xunit, yunit, '--'); +hold off; +xlabel('$R_x$ [nrad]'); ylabel('$R_y$ [nrad]'); +xlim([-100, 100]); +ylim([-100, 100]); #+end_src -#+name: fig:ref_track_nass_exp_hac_iff_struts_errors_angle -#+caption: Orientation errors as a function of time during the "NASS" trajectory +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/nass_ref_rx_ry.pdf', 'width', 500, 'height', 500); +#+end_src + +#+name: fig:nass_ref_rx_ry +#+caption: Orientation errors during the scan #+RESULTS: -[[file:figs/ref_track_nass_exp_hac_iff_struts_errors_angle.png]] +[[file:figs/nass_ref_rx_ry.png]] #+begin_important Using the updated High Authority Controller, the nano-hexapod can follow trajectories with high accuracy (the position errors are in the order of 50nm peak to peak, and the orientation errors 300nrad peak to peak). #+end_important +** Interaction Analysis and Decoupling +<> +*** Introduction :ignore: + +In this section, the interaction in the identified plant is estimated using the Relative Gain Array (RGA) [[cite:skogestad07_multiv_feedb_contr][Chap. 3.4]]. + +Then, several decoupling strategies are compared for the nano-hexapod. + +The RGA Matrix is defined as follow: +\begin{equation} + \text{RGA}(G(f)) = G(f) \times (G(f)^{-1})^T +\end{equation} + +Then, the RGA number is defined: +\begin{equation} +\text{RGA-num}(f) = \| \text{I - RGA(G(f))} \|_{\text{sum}} +\end{equation} +In this section, the plant with 2 added mass is studied. -*** Noise Budgeting :noexport: -The updated controller is implemented, and the encoder and force sensors signals are recorded while zero motion is imposed. +*** 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 + +#+begin_src matlab :tangle no +addpath('./matlab/mat/'); +addpath('./matlab/src/'); +addpath('./matlab/'); +#+end_src + +#+begin_src matlab :eval no +%% Add useful folders to the path +addpath('./mat/'); +addpath('./src/'); +#+end_src + +#+begin_src matlab :tangle no +addpath('matlab/nass-simscape/matlab/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/png/') +addpath('matlab/nass-simscape/src/') +addpath('matlab/nass-simscape/mat/') +addpath('matlab/vibration-table/matlab/') +addpath('matlab/vibration-table/STEPS/') +#+end_src + +#+begin_src matlab :eval no +%% Add other useful folders to the path related to the Simscape model +addpath('nass-simscape/matlab/nano_hexapod/') +addpath('nass-simscape/STEPS/nano_hexapod/') +addpath('nass-simscape/STEPS/png/') +addpath('nass-simscape/src/') +addpath('nass-simscape/mat/') +addpath('vibration-table/matlab/') +addpath('vibration-table/STEPS/') +#+end_src + +#+begin_src matlab +%% Load the identified FRF and Simscape model +frf_iff = load('frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); +sim_iff = load('sim_iff_vib_table_m.mat', 'G_dL'); +#+end_src + +#+begin_src matlab +i_masses = 0:3; +#+end_src + +#+begin_src matlab +%% Colors for the figures +colors = colororder; +#+end_src + +*** Parameters +#+begin_src matlab +wc = 100; % Wanted crossover frequency [Hz] +[~, i_wc] = min(abs(frf_iff.f - wc)); % Indice corresponding to wc +#+end_src + +#+begin_src matlab +%% Plant to be decoupled +frf_coupled = frf_iff.G_dL{2}; +G_coupled = sim_iff.G_dL{2}; +#+end_src + +*** No Decoupling (Decentralized) +<> + +#+begin_src latex :file decoupling_arch_decentralized.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + + % Connections and labels + \draw[<-] (G.west) -- ++(-1.8, 0) node[above right]{$\bm{\tau}$}; + \draw[->] (G.east) -- ++( 1.8, 0) node[above left]{$d\bm{\mathcal{L}}$}; +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_decentralized +#+caption: Block diagram representing the plant. +#+RESULTS: +[[file:figs/decoupling_arch_decentralized.png]] #+begin_src matlab :exports none -%% Load -load('hac_iff_more_lead_huddle.mat', 't', 'Va', 'Vs', 'de') -#+end_src - -#+begin_src matlab :exports none -%% Remove first seconds -Va = Va(t>15, :); -de = de(t>15, :); -Vs = Vs(t>15, :); -t = t( t>15, :); - -%% Reset time vector -t = t - t(1); -#+end_src - -#+begin_src matlab -% Sampling Time [s] -Ts = (t(end) - (t(1)))/(length(t)-1); - -% Sampling Frequency [Hz] -Fs = 1/Ts; - -% Hannning Windows -win = hanning(ceil(1*Fs)); - -% And we get the frequency vector -[~, f] = pwelch(de(:,1), win, 0, [], Fs); -#+end_src - -#+begin_src matlab -[pxx, f] = pwelch(de, win, 0, [], Fs); -#+end_src - -#+begin_src matlab :exports none -%% Amplitude spectral density of the residual motion -figure; -hold on; -for i = 1:6 - plot(f, sqrt(pxx(:, i)), '-'); -end -hold off; -xlabel('Frequency [Hz]'); ylabel('Amplitude Spectral Density [$m/\sqrt{Hz}$]'); -set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); -xlim([1, Fs/2]); -#+end_src - -#+begin_src matlab -figure; -plot(t, de) -#+end_src - -#+begin_src matlab -figure; -plot(t, Vs) -#+end_src - -#+begin_src matlab -rms(de) -#+end_src - -#+begin_src matlab -Xe = [inv(n_hexapod.geometry.J)*de']'; -#+end_src - -* Centralized High Authority Control with Integral Force Feedback :noexport: -** HAC Control - Cartesian Frame -#+begin_src matlab -load('damped_plant_enc_plates.mat', 'f', 'Ts', 'G_enc_iff_opt') -load('jacobian.mat', 'J'); -#+end_src - -From the transfer function from $\bm{\tau}$ to $d\bm{\mathcal{L}}_m$, let's compute the transfer function from $\bm{\mathcal{F}}$ to $d\bm{\mathcal{X}}_m$. -#+begin_src matlab -G_dvf_J = permute(pagemtimes(inv(J), pagemtimes(permute(G_enc_iff_opt, [2 3 1]), inv(J'))), [3 1 2]); -#+end_src - -#+begin_src matlab :exports none -labels = {'$D_x/F_{x}$', '$D_y/F_{y}$', '$D_z/F_{z}$', '$R_{x}/M_{x}$', '$R_{y}/M_{y}$', '$R_{R}/M_{z}$'}; - +%% Decentralized Plant figure; tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); @@ -5671,37 +7751,2071 @@ ax1 = nexttile([2,1]); hold on; for i = 1:5 for j = i+1:6 - plot(f, abs(G_dvf_J(:, i, j)), 'color', [0, 0, 0, 0.2], ... + plot(frf_iff.f, abs(frf_coupled(:,i,j)), 'color', [0,0,0,0.2], ... 'HandleVisibility', 'off'); end end -for i =1:6 - set(gca,'ColorOrderIndex',i) - plot(f, abs(G_dvf_J(:,i , i)), ... - 'DisplayName', labels{i}); +set(gca,'ColorOrderIndex',1) +for i = 1:6 + plot(frf_iff.f, abs(frf_coupled(:,i,i)), ... + 'DisplayName', sprintf('$y_%i/u_%i$', i, i)); end -plot(f, abs(G_dvf_J(:, 1, 2)), 'color', [0, 0, 0, 0.2], ... - 'DisplayName', '$D_i/F_j$'); +plot(frf_iff.f, abs(frf_coupled(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); -ylabel('Amplitude $d_e/V_a$ [m/V]'); set(gca, 'XTickLabel',[]); -ylim([1e-7, 1e-1]); -legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 3); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-9, 1e-4]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 3); ax2 = nexttile; hold on; for i =1:6 - set(gca,'ColorOrderIndex',i) - plot(f, 180/pi*angle(G_dvf_J(:,i , i))); + plot(frf_iff.f, 180/pi*angle(frf_coupled(:,i,i))); end hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); hold off; yticks(-360:90:360); +ylim([-180, 180]); linkaxes([ax1,ax2],'x'); -xlim([20, 2e3]); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_decentralized_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_decentralized_plant +#+caption: Bode Plot of the decentralized plant (diagonal and off-diagonal terms) +#+RESULTS: +[[file:figs/interaction_decentralized_plant.png]] + +#+begin_src matlab :exports none +%% Decentralized RGA +RGA_dec = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_dec(i,:,:) = squeeze(frf_coupled(i,:,:)).*inv(squeeze(frf_coupled(i,:,:))).'; +end + +RGA_dec_sum = zeros(length(frf_iff), 1); +for i = 1:length(frf_iff.f) + RGA_dec_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_dec(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% RGA for Decentralized plant +figure; +plot(frf_iff.f, RGA_dec_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_decentralized.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_decentralized +#+caption: RGA number for the decentralized plant +#+RESULTS: +[[file:figs/interaction_rga_decentralized.png]] + +*** Static Decoupling +<> + +#+begin_src latex :file decoupling_arch_static.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + \node[block, left=0.8 of G] (Ginv) {$\bm{\hat{G}}(j0)^{-1}$}; + + % Connections and labels + \draw[<-] (Ginv.west) -- ++(-1.8, 0) node[above right]{$\bm{u}$}; + \draw[->] (Ginv.east) -- (G.west) node[above left]{$\bm{\tau}$}; + \draw[->] (G.east) -- ++( 1.8, 0) node[above left]{$d\bm{\mathcal{L}}$}; + + \begin{scope}[on background layer] + \node[fit={(Ginv.south west) (G.north east)}, fill=black!10!white, draw, dashed, inner sep=16pt] (Gx) {}; + \node[below right] at (Gx.north west) {$\bm{G}_{\text{static}}$}; + \end{scope} +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_static +#+caption: Decoupling using the inverse of the DC gain of the plant +#+RESULTS: +[[file:figs/decoupling_arch_static.png]] + +The DC gain is evaluated from the model as be have bad low frequency identification. + +#+begin_src matlab :exports none +%% Compute the inverse of the DC gain +G_model = G_coupled; +G_model.outputdelay = 0; % necessary for further inversion +dc_inv = inv(dcgain(G_model)); + +%% Compute the inversed plant +G_dL_sta = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + G_dL_sta(i,:,:) = squeeze(frf_coupled(i,:,:))*dc_inv; +end +#+end_src + +#+begin_src matlab :exports results :results value table replace :tangle no +data2orgtable(dc_inv, {}, {}, ' %.1f '); +#+end_src + +#+RESULTS: +| -62011.5 | 3910.6 | 4299.3 | 660.7 | -4016.5 | -4373.6 | +| 3914.4 | -61991.2 | -4356.8 | -4019.2 | 640.2 | 4281.6 | +| -4020.0 | -4370.5 | -62004.5 | 3914.6 | 4295.8 | 653.8 | +| 660.9 | 4292.4 | 3903.3 | -62012.2 | -4366.5 | -4008.9 | +| 4302.8 | 655.6 | -4025.8 | -4377.8 | -62006.0 | 3919.7 | +| -4377.9 | -4013.2 | 668.6 | 4303.7 | 3906.8 | -62019.3 | + +#+begin_src matlab :exports none +%% Bode plot of the static decoupled plant +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_sta(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1) +for i = 1:6 + plot(frf_iff.f, abs(G_dL_sta(:,i,i)), ... + 'DisplayName', sprintf('$y_%i/u_%i$', i, i)); +end +plot(frf_iff.f, abs(G_dL_sta(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e1]); +legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_sta(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_static_dec_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_static_dec_plant +#+caption: Bode Plot of the static decoupled plant +#+RESULTS: +[[file:figs/interaction_static_dec_plant.png]] + +#+begin_src matlab :exports none +%% Compute RGA Matrix +RGA_sta = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_sta(i,:,:) = squeeze(G_dL_sta(i,:,:)).*inv(squeeze(G_dL_sta(i,:,:))).'; +end + +%% Compute RGA-number +RGA_sta_sum = zeros(length(frf_iff), 1); +for i = 1:size(RGA_sta, 1) + RGA_sta_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_sta(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Plot the RGA-number for statically decoupled plant +figure; +plot(frf_iff.f, RGA_sta_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_static_dec.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_static_dec +#+caption: RGA number for the statically decoupled plant +#+RESULTS: +[[file:figs/interaction_rga_static_dec.png]] + +*** Decoupling at the Crossover +<> + +#+begin_src latex :file decoupling_arch_crossover.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + \node[block, left=0.8 of G] (Ginv) {$\bm{\hat{G}}(j\omega_c)^{-1}$}; + + % Connections and labels + \draw[<-] (Ginv.west) -- ++(-1.8, 0) node[above right]{$\bm{u}$}; + \draw[->] (Ginv.east) -- (G.west) node[above left]{$\bm{\tau}$}; + \draw[->] (G.east) -- ++( 1.8, 0) node[above left]{$d\bm{\mathcal{L}}$}; + + \begin{scope}[on background layer] + \node[fit={(Ginv.south west) (G.north east)}, fill=black!10!white, draw, dashed, inner sep=16pt] (Gx) {}; + \node[below right] at (Gx.north west) {$\bm{G}_{\omega_c}$}; + \end{scope} +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_crossover +#+caption: Decoupling using the inverse of a dynamical model $\bm{\hat{G}}$ of the plant dynamics $\bm{G}$ +#+RESULTS: +[[file:figs/decoupling_arch_crossover.png]] + +#+begin_src matlab :exports none +%% Take complex matrix corresponding to the plant at 100Hz +V = squeeze(frf_coupled(i_wc,:,:)); + +%% Real approximation of inv(G(100Hz)) +D = pinv(real(V'*V)); +H1 = D*real(V'*diag(exp(1j*angle(diag(V*D*V.'))/2))); + +%% Compute the decoupled plant +G_dL_wc = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + G_dL_wc(i,:,:) = squeeze(frf_coupled(i,:,:))*H1; +end +#+end_src + +#+begin_src matlab :exports results :results value table replace :tangle no +data2orgtable(H1, {}, {}, ' %.1f '); +#+end_src + +#+RESULTS: +| 67229.8 | 3769.3 | -13704.6 | -23084.8 | -6318.2 | 23378.7 | +| 3486.2 | 67708.9 | 23220.0 | -6314.5 | -22699.8 | -14060.6 | +| -5731.7 | 22471.7 | 66701.4 | 3070.2 | -13205.6 | -21944.6 | +| -23305.5 | -14542.6 | 2743.2 | 70097.6 | 24846.8 | -5295.0 | +| -14882.9 | -22957.8 | -5344.4 | 25786.2 | 70484.6 | 2979.9 | +| 24353.3 | -5195.2 | -22449.0 | -14459.2 | 2203.6 | 69484.2 | + +#+begin_src matlab :exports none +%% Bode plot of the plant decoupled at the crossover +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_wc(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +for i = 1:6 + plot(frf_iff.f, abs(G_dL_wc(:,i,i)), ... + 'DisplayName', sprintf('$y_%i/u_%i$', i, i)); +end +plot(frf_iff.f, abs(G_dL_wc(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude $d_L/V_a$ [m/V]'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e1]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_wc(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_wc_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_wc_plant +#+caption: Bode Plot of the plant decoupled at the crossover +#+RESULTS: +[[file:figs/interaction_wc_plant.png]] + +#+begin_src matlab +%% Compute RGA Matrix +RGA_wc = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_wc(i,:,:) = squeeze(G_dL_wc(i,:,:)).*inv(squeeze(G_dL_wc(i,:,:))).'; +end + +%% Compute RGA-number +RGA_wc_sum = zeros(size(RGA_wc, 1), 1); +for i = 1:size(RGA_wc, 1) + RGA_wc_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_wc(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Plot the RGA-Number for the plant decoupled at crossover +figure; +plot(frf_iff.f, RGA_wc_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_wc.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_wc +#+caption: RGA number for the plant decoupled at the crossover +#+RESULTS: +[[file:figs/interaction_rga_wc.png]] + +*** SVD Decoupling +<> + +#+begin_src latex :file decoupling_arch_svd.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + + \node[block, left=0.8 of G.west] (V) {$V^{-T}$}; + \node[block, right=0.8 of G.east] (U) {$U^{-1}$}; + + % Connections and labels + \draw[<-] (V.west) -- ++(-1.0, 0) node[above right]{$u$}; + \draw[->] (V.east) -- (G.west) node[above left]{$\bm{\tau}$}; + \draw[->] (G.east) -- (U.west) node[above left]{$d\bm{\mathcal{L}}$}; + \draw[->] (U.east) -- ++( 1.0, 0) node[above left]{$y$}; + + \begin{scope}[on background layer] + \node[fit={(V.south west) (G.north-|U.east)}, fill=black!10!white, draw, dashed, inner sep=14pt] (Gsvd) {}; + \node[below right] at (Gsvd.north west) {$\bm{G}_{SVD}$}; + \end{scope} +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_svd +#+caption: Decoupling using the Singular Value Decomposition +#+RESULTS: +[[file:figs/decoupling_arch_svd.png]] + +#+begin_src matlab :exports none +%% Take complex matrix corresponding to the plant at 100Hz +V = squeeze(frf_coupled(i_wc,:,:)); + +%% Real approximation of G(100Hz) +D = pinv(real(V'*V)); +H1 = pinv(D*real(V'*diag(exp(1j*angle(diag(V*D*V.'))/2)))); + +%% Singular Value Decomposition +[U,S,V] = svd(H1); + +%% Compute the decoupled plant using SVD +G_dL_svd = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + G_dL_svd(i,:,:) = inv(U)*squeeze(frf_coupled(i,:,:))*inv(V'); +end +#+end_src + +#+begin_src matlab :exports none +%% Bode Plot of the SVD decoupled plant +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_svd(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1) +for i = 1:6 + plot(frf_iff.f, abs(G_dL_svd(:,i,i)), ... + 'DisplayName', sprintf('$y_%i/u_%i$', i, i)); +end +plot(frf_iff.f, abs(G_dL_svd(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-9, 1e-4]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 3); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_svd(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_svd_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_svd_plant +#+caption: Bode Plot of the plant decoupled using the Singular Value Decomposition +#+RESULTS: +[[file:figs/interaction_svd_plant.png]] + +#+begin_src matlab +%% Compute the RGA matrix for the SVD decoupled plant +RGA_svd = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_svd(i,:,:) = squeeze(G_dL_svd(i,:,:)).*inv(squeeze(G_dL_svd(i,:,:))).'; +end + +%% Compute the RGA-number +RGA_svd_sum = zeros(size(RGA_svd, 1), 1); +for i = 1:length(frf_iff.f) + RGA_svd_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_svd(i,:,:))))); +end +#+end_src + +#+begin_src matlab +%% RGA Number for the SVD decoupled plant +figure; +plot(frf_iff.f, RGA_svd_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_svd.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_svd +#+caption: RGA number for the plant decoupled using the SVD +#+RESULTS: +[[file:figs/interaction_rga_svd.png]] + +*** Dynamic decoupling +<> + +#+begin_src latex :file decoupling_arch_dynamic.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + \node[block, left=0.8 of G] (Ginv) {$\bm{\hat{G}}^{-1}$}; + + % Connections and labels + \draw[<-] (Ginv.west) -- ++(-1.8, 0) node[above right]{$\bm{u}$}; + \draw[->] (Ginv.east) -- (G.west) node[above left]{$\bm{\tau}$}; + \draw[->] (G.east) -- ++( 1.8, 0) node[above left]{$d\bm{\mathcal{L}}$}; + + \begin{scope}[on background layer] + \node[fit={(Ginv.south west) (G.north east)}, fill=black!10!white, draw, dashed, inner sep=16pt] (Gx) {}; + \node[below right] at (Gx.north west) {$\bm{G}_{\text{inv}}$}; + \end{scope} +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_dynamic +#+caption: Decoupling using the inverse of a dynamical model $\bm{\hat{G}}$ of the plant dynamics $\bm{G}$ +#+RESULTS: +[[file:figs/decoupling_arch_dynamic.png]] + +#+begin_src matlab :exports none +%% Compute the plant inverse from the model +G_model = G_coupled; +G_model.outputdelay = 0; % necessary for further inversion +G_inv = inv(G_model); + +%% Compute the decoupled plant +G_dL_inv = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + G_dL_inv(i,:,:) = squeeze(frf_coupled(i,:,:))*squeeze(evalfr(G_inv, 1j*2*pi*frf_iff.f(i))); +end +#+end_src + +#+begin_src matlab :exports none +%% Bode plot of the decoupled plant by full inversion +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_inv(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1) +for i = 1:6 + plot(frf_iff.f, abs(G_dL_inv(:,i,i)), ... + 'DisplayName', sprintf('$y_%i/u_%i$', i, i)); +end +plot(frf_iff.f, abs(G_dL_inv(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-4, 1e1]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_inv(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_dynamic_dec_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_dynamic_dec_plant +#+caption: Bode Plot of the dynamically decoupled plant +#+RESULTS: +[[file:figs/interaction_dynamic_dec_plant.png]] + +#+begin_src matlab :exports none +%% Compute the RGA matrix for the inverse based decoupled plant +RGA_inv = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_inv(i,:,:) = squeeze(G_dL_inv(i,:,:)).*inv(squeeze(G_dL_inv(i,:,:))).'; +end + +%% Compute the RGA-number +RGA_inv_sum = zeros(size(RGA_inv, 1), 1); +for i = 1:size(RGA_inv, 1) + RGA_inv_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_inv(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% RGA Number for the decoupled plant using full inversion +figure; +plot(frf_iff.f, RGA_inv_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_dynamic_dec.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_dynamic_dec +#+caption: RGA number for the dynamically decoupled plant +#+RESULTS: +[[file:figs/interaction_rga_dynamic_dec.png]] + +*** Jacobian Decoupling - Center of Stiffness +<> + +#+begin_src latex :file decoupling_arch_jacobian_cok.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + \node[block, left=0.8 of G] (Jt) {$J_{s,\{K\}}^{-T}$}; + \node[block, right=0.8 of G] (Ja) {$J_{a,\{K\}}^{-1}$}; + + % Connections and labels + \draw[<-] (Jt.west) -- ++(-1.8, 0) node[above right]{$\bm{\mathcal{F}}_{\{K\}}$}; + \draw[->] (Jt.east) -- (G.west) node[above left]{$\bm{\tau}$}; + \draw[->] (G.east) -- (Ja.west) node[above left]{$d\bm{\mathcal{L}}$}; + \draw[->] (Ja.east) -- ++( 1.8, 0) node[above left]{$\bm{\mathcal{X}}_{\{K\}}$}; + + \begin{scope}[on background layer] + \node[fit={(Jt.south west) (Ja.north east)}, fill=black!10!white, draw, dashed, inner sep=16pt] (Gx) {}; + \node[below right] at (Gx.north west) {$\bm{G}_{\{K\}}$}; + \end{scope} +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_jacobian_cok +#+caption: Decoupling using Jacobian matrices evaluated at the Center of Stiffness +#+RESULTS: +[[file:figs/decoupling_arch_jacobian_cok.png]] + +#+begin_src matlab :exports none +%% Initialize the Nano-Hexapod +n_hexapod = initializeNanoHexapodFinal('MO_B', -42e-3, ... + 'motion_sensor_type', 'plates'); + +%% Get the Jacobians +J_cok = n_hexapod.geometry.J; +Js_cok = n_hexapod.geometry.Js; + +%% Decouple plant using Jacobian (CoM) +G_dL_J_cok = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + G_dL_J_cok(i,:,:) = inv(Js_cok)*squeeze(frf_coupled(i,:,:))*inv(J_cok'); +end + +%% Normalize the plant input +[~, i_100] = min(abs(frf_iff.f - 100)); +input_normalize = diag(1./diag(abs(squeeze(G_dL_J_cok(i_100,:,:))))); + +for i = 1:length(frf_iff.f) + G_dL_J_cok(i,:,:) = squeeze(G_dL_J_cok(i,:,:))*input_normalize; +end +#+end_src + +#+begin_src matlab :exports none +%% Bode Plot of the SVD decoupled plant +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_J_cok(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1) +plot(frf_iff.f, abs(G_dL_J_cok(:,1,1)), ... + 'DisplayName', '$D_x/\tilde{\mathcal{F}}_x$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,2,2)), ... + 'DisplayName', '$D_y/\tilde{\mathcal{F}}_y$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,3,3)), ... + 'DisplayName', '$D_z/\tilde{\mathcal{F}}_z$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,4,4)), ... + 'DisplayName', '$R_x/\tilde{\mathcal{M}}_x$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,5,5)), ... + 'DisplayName', '$R_y/\tilde{\mathcal{M}}_y$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,6,6)), ... + 'DisplayName', '$R_z/\tilde{\mathcal{M}}_z$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e1]); +legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_J_cok(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_J_cok_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_J_cok_plant +#+caption: Bode Plot of the plant decoupled using the Jacobian evaluated at the "center of stiffness" +#+RESULTS: +[[file:figs/interaction_J_cok_plant.png]] + +#+begin_src matlab :exports none +%% Compute RGA Matrix +RGA_cok = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_cok(i,:,:) = squeeze(G_dL_J_cok(i,:,:)).*inv(squeeze(G_dL_J_cok(i,:,:))).'; +end + +%% Compute RGA-number +RGA_cok_sum = zeros(length(frf_iff.f), 1); +for i = 1:length(frf_iff.f) + RGA_cok_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_cok(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Plot the RGA-Number for the Jacobian (CoK) decoupled plant +figure; +plot(frf_iff.f, RGA_cok_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_J_cok.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_J_cok +#+caption: RGA number for the plant decoupled using the Jacobian evaluted at the Center of Stiffness +#+RESULTS: +[[file:figs/interaction_rga_J_cok.png]] + +*** Jacobian Decoupling - Center of Mass +<> + +#+begin_src latex :file decoupling_arch_jacobian_com.pdf :tangle no :exports results +\begin{tikzpicture} + \node[block] (G) {$\bm{G}$}; + \node[block, left=0.8 of G] (Jt) {$J_{s,\{M\}}^{-T}$}; + \node[block, right=0.8 of G] (Ja) {$J_{a,\{M\}}^{-1}$}; + + % Connections and labels + \draw[<-] (Jt.west) -- ++(-1.8, 0) node[above right]{$\bm{\mathcal{F}}_{\{M\}}$}; + \draw[->] (Jt.east) -- (G.west) node[above left]{$\bm{\tau}$}; + \draw[->] (G.east) -- (Ja.west) node[above left]{$d\bm{\mathcal{L}}$}; + \draw[->] (Ja.east) -- ++( 1.8, 0) node[above left]{$\bm{\mathcal{X}}_{\{M\}}$}; + + \begin{scope}[on background layer] + \node[fit={(Jt.south west) (Ja.north east)}, fill=black!10!white, draw, dashed, inner sep=16pt] (Gx) {}; + \node[below right] at (Gx.north west) {$\bm{G}_{\{M\}}$}; + \end{scope} +\end{tikzpicture} +#+end_src + +#+name: fig:decoupling_arch_jacobian_com +#+caption: Decoupling using Jacobian matrices evaluated at the Center of Mass +#+RESULTS: +[[file:figs/decoupling_arch_jacobian_com.png]] + +#+begin_src matlab :exports none +%% Initialize the Nano-Hexapod +n_hexapod = initializeNanoHexapodFinal('MO_B', 25e-3, ... + 'motion_sensor_type', 'plates'); + +%% Get the Jacobians +J_com = n_hexapod.geometry.J; +Js_com = n_hexapod.geometry.Js; + +%% Decouple plant using Jacobian (CoM) +G_dL_J_com = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + G_dL_J_com(i,:,:) = inv(Js_com)*squeeze(frf_coupled(i,:,:))*inv(J_com'); +end + +%% Normalize the plant input +[~, i_100] = min(abs(frf_iff.f - 100)); +input_normalize = diag(1./diag(abs(squeeze(G_dL_J_com(i_100,:,:))))); + +for i = 1:length(frf_iff.f) + G_dL_J_com(i,:,:) = squeeze(G_dL_J_com(i,:,:))*input_normalize; +end +#+end_src + +#+begin_src matlab :exports none +%% Bode Plot of the SVD decoupled plant +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_J_com(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1) +plot(frf_iff.f, abs(G_dL_J_com(:,1,1)), ... + 'DisplayName', '$D_x/\tilde{\mathcal{F}}_x$'); +plot(frf_iff.f, abs(G_dL_J_com(:,2,2)), ... + 'DisplayName', '$D_y/\tilde{\mathcal{F}}_y$'); +plot(frf_iff.f, abs(G_dL_J_com(:,3,3)), ... + 'DisplayName', '$D_z/\tilde{\mathcal{F}}_z$'); +plot(frf_iff.f, abs(G_dL_J_com(:,4,4)), ... + 'DisplayName', '$R_x/\tilde{\mathcal{M}}_x$'); +plot(frf_iff.f, abs(G_dL_J_com(:,5,5)), ... + 'DisplayName', '$R_y/\tilde{\mathcal{M}}_y$'); +plot(frf_iff.f, abs(G_dL_J_com(:,6,6)), ... + 'DisplayName', '$R_z/\tilde{\mathcal{M}}_z$'); +plot(frf_iff.f, abs(G_dL_J_com(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e1]); +legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_J_com(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_J_com_plant.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_J_com_plant +#+caption: Bode Plot of the plant decoupled using the Jacobian evaluated at the Center of Mass +#+RESULTS: +[[file:figs/interaction_J_com_plant.png]] + +#+begin_src matlab :exports none +%% Compute RGA Matrix +RGA_com = zeros(size(frf_coupled)); +for i = 1:length(frf_iff.f) + RGA_com(i,:,:) = squeeze(G_dL_J_com(i,:,:)).*inv(squeeze(G_dL_J_com(i,:,:))).'; +end + +%% Compute RGA-number +RGA_com_sum = zeros(size(RGA_com, 1), 1); +for i = 1:size(RGA_com, 1) + RGA_com_sum(i) = sum(sum(abs(eye(6) - squeeze(RGA_com(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Plot the RGA-Number for the Jacobian (CoM) decoupled plant +figure; +plot(frf_iff.f, RGA_com_sum, 'k-'); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_rga_J_com.pdf', 'width', 'wide', 'height', 'normal'); +#+end_src + +#+name: fig:interaction_rga_J_com +#+caption: RGA number for the plant decoupled using the Jacobian evaluted at the Center of Mass +#+RESULTS: +[[file:figs/interaction_rga_J_com.png]] + +*** Decoupling Comparison +<> + +Let's now compare all of the decoupling methods (Figure [[fig:interaction_compare_rga_numbers]]). + +#+begin_important +From Figure [[fig:interaction_compare_rga_numbers]], the following remarks are made: +- *Decentralized plant*: well decoupled below suspension modes +- *Static inversion*: similar to the decentralized plant as the decentralized plant has already a good decoupling at low frequency +- *Crossover inversion*: the decoupling is improved around the crossover frequency as compared to the decentralized plant. However, the decoupling is increased at lower frequency. +- *SVD decoupling*: Very good decoupling up to 235Hz. Especially between 100Hz and 200Hz. +- *Dynamic Inversion*: the plant is very well decoupled at frequencies where the model is accurate (below 235Hz where flexible modes are not modelled). +- *Jacobian - Stiffness*: good decoupling at low frequency. The decoupling increases at the frequency of the suspension modes, but is acceptable up to the strut flexible modes (235Hz). +- *Jacobian - Mass*: bad decoupling at low frequency. Better decoupling above the frequency of the suspension modes, and acceptable decoupling up to the strut flexible modes (235Hz). +#+end_important + +#+begin_src matlab :exports none +%% Comparison of the RGA-Numbers +figure; +hold on; +plot(frf_iff.f, RGA_dec_sum, 'DisplayName', 'Decentralized'); +plot(frf_iff.f, RGA_sta_sum, 'DisplayName', 'Static inv.'); +plot(frf_iff.f, RGA_wc_sum, 'DisplayName', 'Crossover inv.'); +plot(frf_iff.f, RGA_svd_sum, 'DisplayName', 'SVD'); +plot(frf_iff.f, RGA_inv_sum, 'DisplayName', 'Dynamic inv.'); +plot(frf_iff.f, RGA_cok_sum, 'DisplayName', 'Jacobian - CoK'); +plot(frf_iff.f, RGA_com_sum, 'DisplayName', 'Jacobian - CoM'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 2); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_compare_rga_numbers.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_compare_rga_numbers +#+caption: Comparison of the obtained RGA-numbers for all the decoupling methods +#+RESULTS: +[[file:figs/interaction_compare_rga_numbers.png]] + +*** Decoupling Robustness +<> + +Let's now see how the decoupling is changing when changing the payload's mass. +#+begin_src matlab +frf_new = frf_iff.G_dL{3}; +#+end_src + +#+begin_src matlab :exports none +%% Decentralized RGA +RGA_dec_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_dec_b(i,:,:) = squeeze(frf_new(i,:,:)).*inv(squeeze(frf_new(i,:,:))).'; +end + +RGA_dec_sum_b = zeros(length(frf_iff), 1); +for i = 1:length(frf_iff.f) + RGA_dec_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_dec_b(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Static Decoupling +G_dL_sta_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + G_dL_sta_b(i,:,:) = squeeze(frf_new(i,:,:))*dc_inv; +end + +RGA_sta_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_sta_b(i,:,:) = squeeze(G_dL_sta_b(i,:,:)).*inv(squeeze(G_dL_sta_b(i,:,:))).'; +end + +RGA_sta_sum_b = zeros(size(RGA_sta_b, 1), 1); +for i = 1:size(RGA_sta_b, 1) + RGA_sta_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_sta_b(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Crossover Decoupling +V = squeeze(frf_coupled(i_wc,:,:)); +D = pinv(real(V'*V)); +H1 = D*real(V'*diag(exp(1j*angle(diag(V*D*V.'))/2))); + +G_dL_wc_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + G_dL_wc_b(i,:,:) = squeeze(frf_new(i,:,:))*H1; +end + +RGA_wc_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_wc_b(i,:,:) = squeeze(G_dL_wc_b(i,:,:)).*inv(squeeze(G_dL_wc_b(i,:,:))).'; +end + +RGA_wc_sum_b = zeros(size(RGA_wc_b, 1), 1); +for i = 1:size(RGA_wc_b, 1) + RGA_wc_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_wc_b(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% SVD +V = squeeze(frf_coupled(i_wc,:,:)); +D = pinv(real(V'*V)); +H1 = pinv(D*real(V'*diag(exp(1j*angle(diag(V*D*V.'))/2)))); +[U,S,V] = svd(H1); + +G_dL_svd_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + G_dL_svd_b(i,:,:) = inv(U)*squeeze(frf_new(i,:,:))*inv(V'); +end + +RGA_svd_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_svd_b(i,:,:) = squeeze(G_dL_svd_b(i,:,:)).*inv(squeeze(G_dL_svd_b(i,:,:))).'; +end + +RGA_svd_sum_b = zeros(size(RGA_svd_b, 1), 1); +for i = 1:size(RGA_svd, 1) + RGA_svd_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_svd_b(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Dynamic Decoupling +G_model = G_coupled; +G_model.outputdelay = 0; % necessary for further inversion +G_inv = inv(G_model); + +G_dL_inv_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + G_dL_inv_b(i,:,:) = squeeze(frf_new(i,:,:))*squeeze(evalfr(G_inv, 1j*2*pi*frf_iff.f(i))); +end + +RGA_inv_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_inv_b(i,:,:) = squeeze(G_dL_inv_b(i,:,:)).*inv(squeeze(G_dL_inv_b(i,:,:))).'; +end + +RGA_inv_sum_b = zeros(size(RGA_inv_b, 1), 1); +for i = 1:size(RGA_inv_b, 1) + RGA_inv_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_inv_b(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Jacobian (CoK) +G_dL_J_cok_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + G_dL_J_cok_b(i,:,:) = inv(Js_cok)*squeeze(frf_new(i,:,:))*inv(J_cok'); +end + +RGA_cok_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_cok_b(i,:,:) = squeeze(G_dL_J_cok_b(i,:,:)).*inv(squeeze(G_dL_J_cok_b(i,:,:))).'; +end + +RGA_cok_sum_b = zeros(size(RGA_cok_b, 1), 1); +for i = 1:size(RGA_cok_b, 1) + RGA_cok_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_cok_b(i,:,:))))); +end +#+end_src + +#+begin_src matlab :exports none +%% Jacobian (CoM) +G_dL_J_com_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + G_dL_J_com_b(i,:,:) = inv(Js_com)*squeeze(frf_new(i,:,:))*inv(J_com'); +end + +RGA_com_b = zeros(size(frf_new)); +for i = 1:length(frf_iff.f) + RGA_com_b(i,:,:) = squeeze(G_dL_J_com_b(i,:,:)).*inv(squeeze(G_dL_J_com_b(i,:,:))).'; +end + +RGA_com_sum_b = zeros(size(RGA_com_b, 1), 1); +for i = 1:size(RGA_com_b, 1) + RGA_com_sum_b(i) = sum(sum(abs(eye(6) - squeeze(RGA_com_b(i,:,:))))); +end +#+end_src + +The obtained RGA-numbers are shown in Figure [[fig:interaction_compare_rga_numbers_rob]]. + +#+begin_important +From Figure [[fig:interaction_compare_rga_numbers_rob]]: +- The decoupling using the Jacobian evaluated at the "center of stiffness" seems to give the most robust results. +#+end_important + +#+begin_src matlab :exports none +%% Robustness of the Decoupling method +figure; +hold on; +plot(frf_iff.f, RGA_dec_sum, '-', 'DisplayName', 'Decentralized'); +plot(frf_iff.f, RGA_sta_sum, '-', 'DisplayName', 'Static inv.'); +plot(frf_iff.f, RGA_wc_sum, '-', 'DisplayName', 'Crossover inv.'); +plot(frf_iff.f, RGA_svd_sum, '-', 'DisplayName', 'SVD'); +plot(frf_iff.f, RGA_inv_sum, '-', 'DisplayName', 'Dynamic inv.'); +plot(frf_iff.f, RGA_cok_sum, '-', 'DisplayName', 'Jacobian - CoK'); +plot(frf_iff.f, RGA_com_sum, '-', 'DisplayName', 'Jacobian - CoM'); +set(gca,'ColorOrderIndex',1) +plot(frf_iff.f, RGA_dec_sum_b, '--', 'HandleVisibility', 'off'); +plot(frf_iff.f, RGA_sta_sum_b, '--', 'HandleVisibility', 'off'); +plot(frf_iff.f, RGA_wc_sum_b, '--', 'HandleVisibility', 'off'); +plot(frf_iff.f, RGA_svd_sum_b, '--', 'HandleVisibility', 'off'); +plot(frf_iff.f, RGA_inv_sum_b, '--', 'HandleVisibility', 'off'); +plot(frf_iff.f, RGA_cok_sum_b, '--', 'HandleVisibility', 'off'); +plot(frf_iff.f, RGA_com_sum_b, '--', 'HandleVisibility', 'off'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +xlabel('Frequency [Hz]'); ylabel('RGA Number'); +xlim([10, 1e3]); ylim([1e-2, 1e2]); +legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 2); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/interaction_compare_rga_numbers_rob.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:interaction_compare_rga_numbers_rob +#+caption: Change of the RGA-number with a change of the payload. Indication of the robustness of the inversion method. +#+RESULTS: +[[file:figs/interaction_compare_rga_numbers_rob.png]] + +*** Conclusion + +#+begin_important +Several decoupling methods can be used: +- SVD +- Inverse +- Jacobian (CoK) +#+end_important + +#+name: tab:interaction_analysis_conclusion +#+caption: Summary of the interaction analysis and different decoupling strategies +#+attr_latex: :environment tabularx :width \linewidth :align lccc +#+attr_latex: :center t :booktabs t +| *Method* | *RGA* | *Diag Plant* | *Robustness* | +|----------------+-------+--------------+--------------| +| Decentralized | -- | Equal | ++ | +| Static dec. | -- | Equal | ++ | +| Crossover dec. | - | Equal | 0 | +| SVD | ++ | Diff | + | +| Dynamic dec. | ++ | Unity, equal | - | +| Jacobian - CoK | + | Diff | ++ | +| Jacobian - CoM | 0 | Diff | + | + +** Robust High Authority Controller +<> +*** Introduction :ignore: +In this section we wish to develop a robust High Authority Controller (HAC) that is working for all payloads. + +cite:indri20_mechat_robot + +*** 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 + +#+begin_src matlab :tangle no +addpath('./matlab/mat/'); +addpath('./matlab/src/'); +addpath('./matlab/'); +#+end_src + +#+begin_src matlab :eval no +%% Add useful folders to the path +addpath('./mat/'); +addpath('./src/'); +#+end_src + +#+begin_src matlab :tangle no +addpath('matlab/nass-simscape/matlab/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/nano_hexapod/') +addpath('matlab/nass-simscape/STEPS/png/') +addpath('matlab/nass-simscape/src/') +addpath('matlab/nass-simscape/mat/') +addpath('matlab/vibration-table/matlab/') +addpath('matlab/vibration-table/STEPS/') +#+end_src + +#+begin_src matlab :eval no +%% Add other useful folders to the path related to the Simscape model +addpath('nass-simscape/matlab/nano_hexapod/') +addpath('nass-simscape/STEPS/nano_hexapod/') +addpath('nass-simscape/STEPS/png/') +addpath('nass-simscape/src/') +addpath('nass-simscape/mat/') +addpath('vibration-table/matlab/') +addpath('vibration-table/STEPS/') +#+end_src + +#+begin_src matlab +%% Load the identified FRF and Simscape model +frf_iff = load('frf_iff_vib_table_m.mat', 'f', 'Ts', 'G_dL'); +sim_iff = load('sim_iff_vib_table_m.mat', 'G_dL'); +#+end_src + +#+begin_src matlab +i_masses = 0:3; +#+end_src + +#+begin_src matlab +%% Colors for the figures +colors = colororder; +#+end_src + +*** Using Jacobian evaluated at the center of stiffness +**** Decoupled Plant +#+begin_src matlab +G_nom = frf_iff.G_dL{2}; % Nominal Plant +#+end_src + +#+begin_src matlab :exports none +%% Initialize the Nano-Hexapod +n_hexapod = initializeNanoHexapodFinal('MO_B', -42e-3, ... + 'motion_sensor_type', 'plates'); + +%% Get the Jacobians +J_cok = n_hexapod.geometry.J; +Js_cok = n_hexapod.geometry.Js; + +%% Decouple plant using Jacobian (CoM) +G_dL_J_cok = zeros(size(G_nom)); +for i = 1:length(frf_iff.f) + G_dL_J_cok(i,:,:) = inv(Js_cok)*squeeze(G_nom(i,:,:))*inv(J_cok'); +end + +%% Normalize the plant input +[~, i_100] = min(abs(frf_iff.f - 10)); +input_normalize = diag(1./diag(abs(squeeze(G_dL_J_cok(i_100,:,:))))); + +for i = 1:length(frf_iff.f) + G_dL_J_cok(i,:,:) = squeeze(G_dL_J_cok(i,:,:))*input_normalize; +end +#+end_src + +#+begin_src matlab :exports none +%% Bode Plot of the decoupled plant +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_J_cok(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1) +plot(frf_iff.f, abs(G_dL_J_cok(:,1,1)), ... + 'DisplayName', '$D_x/\tilde{\mathcal{F}}_x$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,2,2)), ... + 'DisplayName', '$D_y/\tilde{\mathcal{F}}_y$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,3,3)), ... + 'DisplayName', '$D_z/\tilde{\mathcal{F}}_z$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,4,4)), ... + 'DisplayName', '$R_x/\tilde{\mathcal{M}}_x$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,5,5)), ... + 'DisplayName', '$R_y/\tilde{\mathcal{M}}_y$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,6,6)), ... + 'DisplayName', '$R_z/\tilde{\mathcal{M}}_z$'); +plot(frf_iff.f, abs(G_dL_J_cok(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e1]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_J_cok(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/bode_plot_hac_iff_plant_jacobian_cok.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:bode_plot_hac_iff_plant_jacobian_cok +#+caption: Bode plot of the decoupled plant using the Jacobian evaluated at the Center of Stiffness +#+RESULTS: +[[file:figs/bode_plot_hac_iff_plant_jacobian_cok.png]] + +**** SISO Controller Design +As the diagonal elements of the plant are not equal, several SISO controllers are designed and then combined to form a diagonal controller. +All the diagonal terms of the controller consists of: +- A double integrator to have high gain at low frequency +- A lead around the crossover frequency to increase stability margins +- Two second order low pass filters above the crossover frequency to increase the robustness to high frequency modes + +#+begin_src matlab :exports none +%% Controller Ry,Rz + +% Wanted crossover frequency +wc_Rxy = 2*pi*80; + +% Lead +a = 8.0; % Amount of phase lead / width of the phase lead / high frequency gain +wc = wc_Rxy; % Frequency with the maximum phase lead [rad/s] +Kd_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)))/sqrt(a); + +% Integrator +w0_int = wc_Rxy/2; % [rad/s] +xi_int = 0.3; + +Kd_int = (1 + 2*xi_int/w0_int*s + s^2/w0_int^2)/(s^2/w0_int^2); + +% Low Pass Filter (High frequency robustness) +w0_lpf = wc_Rxy*2; % Cut-off frequency [rad/s] +xi_lpf = 0.6; % Damping Ratio + +Kd_lpf = 1/(1 + 2*xi_lpf/w0_lpf*s + s^2/w0_lpf^2); + +w0_lpf_b = wc_Rxy*4; % Cut-off frequency [rad/s] +xi_lpf_b = 0.7; % Damping Ratio + +Kd_lpf_b = 1/(1 + 2*xi_lpf_b/w0_lpf_b*s + s^2/w0_lpf_b^2); + +% Unity Gain frequency +[~, i_80] = min(abs(frf_iff.f - wc_Rxy/2/pi)); + +% Combination of all the elements +Kd_Rxy = ... + -1/abs(G_dL_J_cok(i_80,4,4)) * ... + Kd_lead/abs(evalfr(Kd_lead, 1j*wc_Rxy)) * ... % Lead (gain of 1 at wc) + Kd_int /abs(evalfr(Kd_int, 1j*wc_Rxy)) * ... + Kd_lpf_b/abs(evalfr(Kd_lpf_b, 1j*wc_Rxy)) * ... + Kd_lpf /abs(evalfr(Kd_lpf, 1j*wc_Rxy)); % Low Pass Filter +#+end_src + +#+begin_src matlab :exports none +%% Controller Dx,Dy,Rz + +% Wanted crossover frequency +wc_Dxy = 2*pi*100; + +% Lead +a = 8.0; % Amount of phase lead / width of the phase lead / high frequency gain +wc = wc_Dxy; % Frequency with the maximum phase lead [rad/s] +Kd_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)))/sqrt(a); + +% Integrator +w0_int = wc_Dxy/2; % [rad/s] +xi_int = 0.3; + +Kd_int = (1 + 2*xi_int/w0_int*s + s^2/w0_int^2)/(s^2/w0_int^2); + +% Low Pass Filter (High frequency robustness) +w0_lpf = wc_Dxy*2; % Cut-off frequency [rad/s] +xi_lpf = 0.6; % Damping Ratio + +Kd_lpf = 1/(1 + 2*xi_lpf/w0_lpf*s + s^2/w0_lpf^2); + +w0_lpf_b = wc_Dxy*4; % Cut-off frequency [rad/s] +xi_lpf_b = 0.7; % Damping Ratio + +Kd_lpf_b = 1/(1 + 2*xi_lpf_b/w0_lpf_b*s + s^2/w0_lpf_b^2); + +% Unity Gain frequency +[~, i_100] = min(abs(frf_iff.f - wc_Dxy/2/pi)); + +% Combination of all the elements +Kd_Dyx_Rz = ... + -1/abs(G_dL_J_cok(i_100,1,1)) * ... + Kd_int /abs(evalfr(Kd_int, 1j*wc_Dxy)) * ... % Integrator + Kd_lead/abs(evalfr(Kd_lead, 1j*wc_Dxy)) * ... % Lead (gain of 1 at wc) + Kd_lpf_b/abs(evalfr(Kd_lpf_b, 1j*wc_Dxy)) * ... % Lead (gain of 1 at wc) + Kd_lpf /abs(evalfr(Kd_lpf, 1j*wc_Dxy)); % Low Pass Filter +#+end_src + +#+begin_src matlab :exports none +%% Controller Dz + +% Wanted crossover frequency +wc_Dz = 2*pi*100; + +% Lead +a = 8.0; % Amount of phase lead / width of the phase lead / high frequency gain +wc = wc_Dz; % Frequency with the maximum phase lead [rad/s] +Kd_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)))/sqrt(a); + +% Integrator +w0_int = wc_Dz/2; % [rad/s] +xi_int = 0.3; + +Kd_int = (1 + 2*xi_int/w0_int*s + s^2/w0_int^2)/(s^2/w0_int^2); + +% Low Pass Filter (High frequency robustness) +w0_lpf = wc_Dz*2; % Cut-off frequency [rad/s] +xi_lpf = 0.6; % Damping Ratio + +Kd_lpf = 1/(1 + 2*xi_lpf/w0_lpf*s + s^2/w0_lpf^2); + +w0_lpf_b = wc_Dz*4; % Cut-off frequency [rad/s] +xi_lpf_b = 0.7; % Damping Ratio + +Kd_lpf_b = 1/(1 + 2*xi_lpf_b/w0_lpf_b*s + s^2/w0_lpf_b^2); + +% Unity Gain frequency +[~, i_100] = min(abs(frf_iff.f - wc_Dz/2/pi)); + +% Combination of all the elements +Kd_Dz = ... + -1/abs(G_dL_J_cok(i_100,3,3)) * ... + Kd_int /abs(evalfr(Kd_int, 1j*wc_Dz)) * ... % Integrator + Kd_lead/abs(evalfr(Kd_lead, 1j*wc_Dz)) * ... % Lead (gain of 1 at wc) + Kd_lpf_b/abs(evalfr(Kd_lpf_b, 1j*wc_Dz)) * ... % Lead (gain of 1 at wc) + Kd_lpf /abs(evalfr(Kd_lpf, 1j*wc_Dz)); % Low Pass Filter +#+end_src + +#+begin_src matlab :exports none +%% Diagonal Controller +Kd_diag = blkdiag(Kd_Dyx_Rz, Kd_Dyx_Rz, Kd_Dz, Kd_Rxy, Kd_Rxy, Kd_Dyx_Rz); +#+end_src + +**** Obtained Loop Gain +#+begin_src matlab :exports none +%% Experimental Loop Gain +Lmimo = permute(pagemtimes(permute(G_dL_J_cok, [2,3,1]), squeeze(freqresp(Kd_diag, frf_iff.f, 'Hz'))), [3,1,2]); +#+end_src + +#+begin_src matlab :exports none +%% Bode plot of the experimental Loop Gain +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:6 + plot(frf_iff.f, abs(Lmimo(:,i,i)), '-'); +end +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(squeeze(Lmimo(:,i,j))), 'color', [0,0,0,0.2]); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Loop Gain'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e+3]); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(frf_iff.f, 180/pi*angle(Lmimo(:,i,i)), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:45:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([1, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/bode_plot_hac_iff_loop_gain_jacobian_cok.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:bode_plot_hac_iff_loop_gain_jacobian_cok +#+caption: Bode plot of the Loop Gain when using the Jacobian evaluated at the Center of Stiffness to decouple the system +#+RESULTS: +[[file:figs/bode_plot_hac_iff_loop_gain_jacobian_cok.png]] + +#+begin_src matlab +%% Controller to be implemented +Kd = inv(J_cok')*input_normalize*ss(Kd_diag)*inv(Js_cok); +#+end_src + +**** Verification of the Stability +Now the stability of the feedback loop is verified using the generalized Nyquist criteria. + +#+begin_src matlab :exports none +%% Compute the Eigenvalues of the loop gain +Ldet = zeros(3, 6, length(frf_iff.f)); + +for i_mass = 1:3 + % Loop gain + Lmimo = pagemtimes(permute(frf_iff.G_dL{i_mass}, [2,3,1]),squeeze(freqresp(Kd, frf_iff.f, 'Hz'))); + for i_f = 2:length(frf_iff.f) + Ldet(i,:, i_f) = eig(squeeze(Lmimo(:,:,i_f))); + end +end +#+end_src + +#+begin_src matlab :exports none +%% Plot of the eigenvalues of L in the complex plane +figure; +hold on; +for i_mass = 2:3 + plot(real(squeeze(Ldet(i_mass, 1,:))), imag(squeeze(Ldet(i_mass, 1,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('%i masses', i_mass)); + plot(real(squeeze(Ldet(i_mass, 1,:))), -imag(squeeze(Ldet(i_mass, 1,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + for i = 1:6 + plot(real(squeeze(Ldet(i_mass, i,:))), imag(squeeze(Ldet(i_mass, i,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + plot(real(squeeze(Ldet(i_mass, i,:))), -imag(squeeze(Ldet(i_mass, i,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + end +end +plot(-1, 0, 'kx', 'HandleVisibility', 'off'); +hold off; +set(gca, 'XScale', 'lin'); set(gca, 'YScale', 'lin'); +xlabel('Real'); ylabel('Imag'); +legend('location', 'southeast'); +xlim([-3, 1]); ylim([-2, 2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/loci_hac_iff_loop_gain_jacobian_cok.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:loci_hac_iff_loop_gain_jacobian_cok +#+caption: Loci of $L(j\omega)$ in the complex plane. +#+RESULTS: +[[file:figs/loci_hac_iff_loop_gain_jacobian_cok.png]] + +**** Save for further analysis +#+begin_src matlab :exports none :tangle no +save('matlab/mat/Khac_iff_struts_jacobian_cok.mat', 'Kd') +#+end_src + +#+begin_src matlab :eval no +save('mat/Khac_iff_struts_jacobian_cok.mat', 'Kd') +#+end_src + +*** Using Singular Value Decomposition +**** Decoupled Plant +#+begin_src matlab +G_nom = frf_iff.G_dL{2}; % Nominal Plant +#+end_src + +#+begin_src matlab :exports none +%% Take complex matrix corresponding to the plant at 100Hz +wc = 100; % Wanted crossover frequency [Hz] +[~, i_wc] = min(abs(frf_iff.f - wc)); % Indice corresponding to wc + +V = squeeze(G_nom(i_wc,:,:)); + +%% Real approximation of G(100Hz) +D = pinv(real(V'*V)); +H1 = pinv(D*real(V'*diag(exp(1j*angle(diag(V*D*V.'))/2)))); + +%% Singular Value Decomposition +[U,S,V] = svd(H1); + +%% Compute the decoupled plant using SVD +G_dL_svd = zeros(size(G_nom)); +for i = 1:length(frf_iff.f) + G_dL_svd(i,:,:) = inv(U)*squeeze(G_nom(i,:,:))*inv(V'); +end +#+end_src + +#+begin_src matlab :exports none +%% Bode plot of the decoupled plant using SVD +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(G_dL_svd(:,i,j)), 'color', [0,0,0,0.2], ... + 'HandleVisibility', 'off'); + end +end +set(gca,'ColorOrderIndex',1); +for i = 1:6 + plot(frf_iff.f, abs(G_dL_svd(:,i,i)), ... + 'DisplayName', sprintf('$y_%i/u_%i$', i, i)); +end +plot(frf_iff.f, abs(G_dL_svd(:,1,2)), 'color', [0,0,0,0.2], ... + 'DisplayName', 'Coupling'); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-9, 1e-4]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 2); + +ax2 = nexttile; +hold on; +for i =1:6 + plot(frf_iff.f, 180/pi*angle(G_dL_svd(:,i,i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); +ylim([-180, 180]); + +linkaxes([ax1,ax2],'x'); +xlim([10, 1e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/bode_plot_hac_iff_plant_svd.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:bode_plot_hac_iff_plant_svd +#+caption: Bode plot of the decoupled plant using the SVD +#+RESULTS: +[[file:figs/bode_plot_hac_iff_plant_svd.png]] + +**** Controller Design +#+begin_src matlab :exports none +%% Lead +a = 6.0; % Amount of phase lead / width of the phase lead / high frequency gain +wc = 2*pi*100; % Frequency with the maximum phase lead [rad/s] +Kd_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)))/sqrt(a); + +%% Integrator +Kd_int = ((2*pi*50 + s)/(2*pi*0.1 + s))^2; + +%% Low Pass Filter (High frequency robustness) +w0_lpf = 2*pi*200; % Cut-off frequency [rad/s] +xi_lpf = 0.3; % Damping Ratio + +Kd_lpf = 1/(1 + 2*xi_lpf/w0_lpf*s + s^2/w0_lpf^2); + +%% Normalize Gain +Kd_norm = diag(1./abs(diag(squeeze(G_dL_svd(i_100,:,:))))); + +%% Diagonal Control +Kd_diag = ... + Kd_norm * ... % Normalize gain at 100Hz + Kd_int /abs(evalfr(Kd_int, 1j*2*pi*100)) * ... % Integrator + Kd_lead/abs(evalfr(Kd_lead, 1j*2*pi*100)) * ... % Lead (gain of 1 at wc) + Kd_lpf /abs(evalfr(Kd_lpf, 1j*2*pi*100)); % Low Pass Filter +#+end_src + +#+begin_src matlab :exports none +%% MIMO Controller +Kd = -inv(V') * ... % Output decoupling + ss(Kd_diag) * ... + inv(U); % Input decoupling +#+end_src + +**** Loop Gain +#+begin_src matlab :exports none +%% Experimental Loop Gain +Lmimo = permute(pagemtimes(permute(G_nom, [2,3,1]),squeeze(freqresp(Kd, frf_iff.f, 'Hz'))), [3,1,2]); +#+end_src + +#+begin_src matlab :exports none +%% Loop gain when using SVD +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:6 + plot(frf_iff.f, abs(Lmimo(:,i,i)), '-'); +end +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(squeeze(Lmimo(:,i,j))), 'color', [0,0,0,0.2]); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Loop Gain'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e+3]); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(frf_iff.f, 180/pi*angle(Lmimo(:,i,i)), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:30:360); +ylim([-180, 0]); + +linkaxes([ax1,ax2],'x'); +xlim([1, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/bode_plot_hac_iff_loop_gain_svd.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:bode_plot_hac_iff_loop_gain_svd +#+caption: Bode plot of Loop Gain when using the SVD +#+RESULTS: +[[file:figs/bode_plot_hac_iff_loop_gain_svd.png]] + +**** Stability Verification +#+begin_src matlab +%% Compute the Eigenvalues of the loop gain +Ldet = zeros(3, 6, length(frf_iff.f)); + +for i = 1:3 + Lmimo = pagemtimes(permute(frf_iff.G_dL{i}, [2,3,1]),squeeze(freqresp(Kd, frf_iff.f, 'Hz'))); + for i_f = 2:length(frf_iff.f) + Ldet(i,:, i_f) = eig(squeeze(Lmimo(:,:,i_f))); + end +end +#+end_src + +#+begin_src matlab :exports none +%% Plot of the eigenvalues of L in the complex plane +figure; +hold on; +for i_mass = 2:3 + plot(real(squeeze(Ldet(i_mass, 1,:))), imag(squeeze(Ldet(i_mass, 1,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('%i masses', i_mass)); + plot(real(squeeze(Ldet(i_mass, 1,:))), -imag(squeeze(Ldet(i_mass, 1,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + for i = 1:6 + plot(real(squeeze(Ldet(i_mass, i,:))), imag(squeeze(Ldet(i_mass, i,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + plot(real(squeeze(Ldet(i_mass, i,:))), -imag(squeeze(Ldet(i_mass, i,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + end +end +plot(-1, 0, 'kx', 'HandleVisibility', 'off'); +hold off; +set(gca, 'XScale', 'lin'); set(gca, 'YScale', 'lin'); +xlabel('Real'); ylabel('Imag'); +legend('location', 'southeast'); +xlim([-3, 1]); ylim([-2, 2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/loci_hac_iff_loop_gain_svd.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:loci_hac_iff_loop_gain_svd +#+caption: Locis of $L(j\omega)$ in the complex plane. +#+RESULTS: +[[file:figs/loci_hac_iff_loop_gain_svd.png]] + +**** Save for further analysis +#+begin_src matlab :exports none :tangle no +save('matlab/mat/Khac_iff_struts_svd.mat', 'Kd') +#+end_src + +#+begin_src matlab :eval no +save('mat/Khac_iff_struts_svd.mat', 'Kd') +#+end_src + +*** Using (diagonal) Dynamical Inverse :noexport: +**** Decoupled Plant +#+begin_src matlab +G_nom = frf_iff.G_dL{2}; % Nominal Plant +G_model = sim_iff.G_dL{2}; % Model of the Plant +#+end_src + +#+begin_src matlab :exports none +%% Simplified model of the diagonal term +balred_opts = balredOptions('FreqIntervals', 2*pi*[0, 1000], 'StateElimMethod', 'Truncate'); + +G_red = balred(G_model(1,1), 8, balred_opts); +G_red.outputdelay = 0; % necessary for further inversion +#+end_src + +#+begin_src matlab +%% Inverse +G_inv = inv(G_red); +[G_z, G_p, G_g] = zpkdata(G_inv); +p_uns = real(G_p{1}) > 0; +G_p{1}(p_uns) = -G_p{1}(p_uns); +G_inv_stable = zpk(G_z, G_p, G_g); +#+end_src + +#+begin_src matlab :exports none +%% "Uncertainty" of inversed plant +freqs = logspace(0,3,1000); + +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i_mass = i_masses + for i = 1 + plot(freqs, abs(squeeze(freqresp(G_inv_stable*sim_iff.G_dL{i_mass+1}(i,i), freqs, 'Hz'))), '-', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('$d\\mathcal{L}_i/u^\\prime_i$ - %i', i_mass)); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude'); set(gca, 'XTickLabel',[]); +ylim([1e-1, 1e1]); +legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 4); + +ax2 = nexttile; +hold on; +for i_mass = i_masses + for i = 1 + plot(freqs, 180/pi*angle(squeeze(freqresp(G_inv_stable*sim_iff.G_dL{i_mass+1}(1,1), freqs, 'Hz'))), '-', 'color', colors(i_mass+1, :)); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:15:360); +ylim([-45, 45]); + +linkaxes([ax1,ax2],'x'); +xlim([freqs(1), freqs(end)]); +#+end_src + +**** Controller Design +#+begin_src matlab :exports none +% Wanted crossover frequency +wc = 2*pi*80; +[~, i_wc] = min(abs(frf_iff.f - wc/2/pi)); + +%% Lead +a = 20.0; % Amount of phase lead / width of the phase lead / high frequency gain +Kd_lead = (1 + s/(wc/sqrt(a)))/(1 + s/(wc*sqrt(a)))/sqrt(a); + +%% Integrator +Kd_int = ((wc)/(2*pi*0.2 + s))^2; + +%% Low Pass Filter (High frequency robustness) +w0_lpf = 2*wc; % Cut-off frequency [rad/s] +xi_lpf = 0.3; % Damping Ratio + +Kd_lpf = 1/(1 + 2*xi_lpf/w0_lpf*s + s^2/w0_lpf^2); + +w0_lpf_b = wc*4; % Cut-off frequency [rad/s] +xi_lpf_b = 0.7; % Damping Ratio + +Kd_lpf_b = 1/(1 + 2*xi_lpf_b/w0_lpf_b*s + s^2/w0_lpf_b^2); + +%% Normalize Gain +Kd_norm = diag(1./abs(diag(squeeze(G_dL_svd(i_wc,:,:))))); + +%% Diagonal Control +Kd_diag = ... + G_inv_stable * ... % Normalize gain at 100Hz + Kd_int /abs(evalfr(Kd_int, 1j*wc)) * ... % Integrator + Kd_lead/abs(evalfr(Kd_lead, 1j*wc)) * ... % Lead (gain of 1 at wc) + Kd_lpf /abs(evalfr(Kd_lpf, 1j*wc)); % Low Pass Filter +#+end_src + +#+begin_src matlab :exports none +Kd = ss(Kd_diag)*eye(6); +#+end_src + +**** Loop Gain +#+begin_src matlab :exports none +%% Experimental Loop Gain +Lmimo = permute(pagemtimes(permute(G_nom, [2,3,1]),squeeze(freqresp(Kd, frf_iff.f, 'Hz'))), [3,1,2]); +#+end_src + +#+begin_src matlab :exports none +%% Loop gain when using SVD +figure; +tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile([2,1]); +hold on; +for i = 1:6 + plot(frf_iff.f, abs(Lmimo(:,i,i)), '-'); +end +for i = 1:5 + for j = i+1:6 + plot(frf_iff.f, abs(squeeze(Lmimo(:,i,j))), 'color', [0,0,0,0.2]); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Loop Gain'); set(gca, 'XTickLabel',[]); +ylim([1e-3, 1e+3]); + +ax2 = nexttile; +hold on; +for i = 1:6 + plot(frf_iff.f, 180/pi*angle(Lmimo(:,i,i)), '-'); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:30:360); +ylim([-180, 0]); + +linkaxes([ax1,ax2],'x'); +xlim([1, 2e3]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/bode_plot_hac_iff_loop_gain_diag_inverse.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:bode_plot_hac_iff_loop_gain_diag_inverse +#+caption: Bode plot of Loop Gain when using the Diagonal inversion +#+RESULTS: +[[file:figs/bode_plot_hac_iff_loop_gain_diag_inverse.png]] + +**** Stability Verification +MIMO Nyquist with eigenvalues +#+begin_src matlab +%% Compute the Eigenvalues of the loop gain +Ldet = zeros(3, 6, length(frf_iff.f)); + +for i = 1:3 + Lmimo = pagemtimes(permute(frf_iff.G_dL{i}, [2,3,1]),squeeze(freqresp(Kd, frf_iff.f, 'Hz'))); + for i_f = 2:length(frf_iff.f) + Ldet(i,:, i_f) = eig(squeeze(Lmimo(:,:,i_f))); + end +end +#+end_src + +#+begin_src matlab :exports none +%% Plot of the eigenvalues of L in the complex plane +figure; +hold on; +for i_mass = 2:3 + plot(real(squeeze(Ldet(i_mass, 1,:))), imag(squeeze(Ldet(i_mass, 1,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'DisplayName', sprintf('%i masses', i_mass)); + plot(real(squeeze(Ldet(i_mass, 1,:))), -imag(squeeze(Ldet(i_mass, 1,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + for i = 1:6 + plot(real(squeeze(Ldet(i_mass, i,:))), imag(squeeze(Ldet(i_mass, i,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + plot(real(squeeze(Ldet(i_mass, i,:))), -imag(squeeze(Ldet(i_mass, i,:))), ... + '.', 'color', colors(i_mass+1, :), ... + 'HandleVisibility', 'off'); + end +end +plot(-1, 0, 'kx', 'HandleVisibility', 'off'); +hold off; +set(gca, 'XScale', 'lin'); set(gca, 'YScale', 'lin'); +xlabel('Real'); ylabel('Imag'); +legend('location', 'southeast'); +xlim([-3, 1]); ylim([-2, 2]); +#+end_src + +#+begin_src matlab :tangle no :exports results :results file replace +exportFig('figs/loci_hac_iff_loop_gain_diag_inverse.pdf', 'width', 'wide', 'height', 'tall'); +#+end_src + +#+name: fig:loci_hac_iff_loop_gain_diag_inverse +#+caption: Locis of $L(j\omega)$ in the complex plane. +#+RESULTS: +[[file:figs/loci_hac_iff_loop_gain_diag_inverse.png]] + +#+begin_important +Even though the loop gain seems to be fine, the closed-loop system is unstable. +This might be due to the fact that there is large interaction in the plant. +We could look at the RGA-number to verify that. +#+end_important + +**** Save for further use +#+begin_src matlab :exports none :tangle no +save('matlab/mat/Khac_iff_struts_diag_inverse.mat', 'Kd') +#+end_src + +#+begin_src matlab :eval no +save('mat/Khac_iff_struts_diag_inverse.mat', 'Kd') +#+end_src + +*** Closed Loop Stability (Model) :noexport: +Verify stability using Simscape model +#+begin_src matlab +%% Initialize the Simscape model in closed loop +n_hexapod = initializeNanoHexapodFinal('flex_bot_type', '2dof', ... + 'flex_top_type', '3dof', ... + 'motion_sensor_type', 'plates', ... + 'actuator_type', '2dof', ... + 'controller_type', 'hac-iff-struts'); +#+end_src + +#+begin_src matlab +%% IFF Controller +Kiff = -g_opt*Kiff_g1*eye(6); +Khac_iff_struts = Kd*eye(6); +#+end_src + +#+begin_src matlab +%% Identify the (damped) transfer function from u to dLm for different values of the IFF gain +clear io; io_i = 1; +io(io_i) = linio([mdl, '/du'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs +io(io_i) = linio([mdl, '/dL'], 1, 'openoutput'); io_i = io_i + 1; % Plate Displacement (encoder) +#+end_src + +#+begin_src matlab +GG_cl = {}; + +for i = i_masses + payload.type = i; + GG_cl(i+1) = {exp(-s*Ts)*linearize(mdl, io, 0.0, options)}; +end +#+end_src + +#+begin_src matlab +for i = i_masses + isstable(GG_cl{i+1}) +end +#+end_src + +MIMO Nyquist +#+begin_src matlab +Kdm = Kd*eye(6); + +Ldet = zeros(3, length(fb(i_lim))); + +for i = 1:3 + Lmimo = pagemtimes(permute(G_damp_m{i}(i_lim,:,:), [2,3,1]),squeeze(freqresp(Kdm, fb(i_lim), 'Hz'))); + Ldet(i,:) = arrayfun(@(t) det(eye(6) + squeeze(Lmimo(:,:,t))), 1:size(Lmimo,3)); +end +#+end_src + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +hold on; +for i_mass = 3 + for i = 1 + plot(real(Ldet(i_mass,:)), imag(Ldet(i_mass,:)), ... + '-', 'color', colors(i_mass+1, :)); + end +end +hold off; +set(gca, 'XScale', 'lin'); set(gca, 'YScale', 'lin'); +xlabel('Real'); ylabel('Imag'); +xlim([-10, 1]); ylim([-4, 4]); +#+end_src + +MIMO Nyquist with eigenvalues +#+begin_src matlab +Kdm = Kd*eye(6); + +Ldet = zeros(3, 6, length(fb(i_lim))); + +for i = 1:3 + Lmimo = pagemtimes(permute(G_damp_m{i}(i_lim,:,:), [2,3,1]),squeeze(freqresp(Kdm, fb(i_lim), 'Hz'))); + for i_f = 1:length(fb(i_lim)) + Ldet(i,:, i_f) = eig(squeeze(Lmimo(:,:,i_f))); + end +end +#+end_src + +#+begin_src matlab :exports none +%% Bode plot for the transfer function from u to dLm +figure; +hold on; +for i_mass = 1 + for i = 1:6 + plot(real(squeeze(Ldet(i_mass, i,:))), imag(squeeze(Ldet(i_mass, i,:))), ... + '-', 'color', colors(i_mass+1, :)); + end +end +hold off; +set(gca, 'XScale', 'lin'); set(gca, 'YScale', 'lin'); +xlabel('Real'); ylabel('Imag'); +xlim([-10, 1]); ylim([-4, 2]); #+end_src @@ -5880,8 +9994,6 @@ save('mat/feedforward_iff.mat', 'Kff_iff_L') load('reference_path.mat', 'Rx_yz'); #+end_src - -* Further work :noexport: ** Feedback/Feedforward control in the frame of the struts *** Introduction :ignore: @@ -5963,9 +10075,9 @@ function [ref] = generateXYZTrajectory(args) arguments args.points double {mustBeNumeric} = zeros(2, 3) % [m] - args.ti (1,1) double {mustBeNumeric, mustBePositive} = 1 % Time to go to first point and after last point [s] - args.tw (1,1) double {mustBeNumeric, mustBePositive} = 0.5 % Time wait between each point [s] - args.tm (1,1) double {mustBeNumeric, mustBePositive} = 1 % Motion time between points [s] + args.ti (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % Time to go to first point and after last point [s] + args.tw (1,1) double {mustBeNumeric, mustBeNonnegative} = 0.5 % Time wait between each point [s] + args.tm (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % Motion time between points [s] args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % Sampling Time [s] end @@ -6053,17 +10165,17 @@ function [ref] = generateYZScanTrajectory(args) #+begin_src matlab arguments - args.y_tot (1,1) double {mustBeNumeric} = 10e-6 % [m] - args.z_tot (1,1) double {mustBeNumeric} = 10e-6 % [m] + args.y_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [m] + args.z_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [m] args.n (1,1) double {mustBeInteger, mustBePositive} = 10 % [-] args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-4 % [s] - args.ti (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] - args.tw (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] - args.ty (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] - args.tz (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] + args.ti (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] + args.tw (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] + args.ty (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] + args.tz (1,1) double {mustBeNumeric, mustBeNonnegative} = 1 % [s] end #+end_src @@ -6151,6 +10263,87 @@ ref(:, 3) = y; ref(:, 4) = z; #+end_src +** =generateSpiralAngleTrajectory= +:PROPERTIES: +:header-args:matlab+: :tangle matlab/src/generateSpiralAngleTrajectory.m +:header-args:matlab+: :comments none :mkdirp yes :eval no +:END: +<> + +*** Function description +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab +function [ref] = generateSpiralAngleTrajectory(args) +% generateSpiralAngleTrajectory - +% +% Syntax: [ref] = generateSpiralAngleTrajectory(args) +% +% Inputs: +% - args +% +% Outputs: +% - ref - Reference Signal +#+end_src + +*** Optional Parameters +:PROPERTIES: +:UNNUMBERED: t +:END: + +#+begin_src matlab +arguments + args.R_tot (1,1) double {mustBeNumeric, mustBePositive} = 10e-6 % [rad] + args.n_turn (1,1) double {mustBeInteger, mustBePositive} = 5 % [-] + args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [s] + args.t_turn (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] + args.t_end (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s] +end +#+end_src + +*** Initialize Time Vectors +:PROPERTIES: +:UNNUMBERED: t +:END: + +#+begin_src matlab +time_s = 0:args.Ts:args.n_turn*args.t_turn; +time_e = 0:args.Ts:args.t_end; +#+end_src + +*** Rx and Ry vectors +:PROPERTIES: +:UNNUMBERED: t +:END: + +#+begin_src matlab +Rx = sin(2*pi*time_s/args.t_turn).*(args.R_tot*time_s/(args.n_turn*args.t_turn)); +Ry = cos(2*pi*time_s/args.t_turn).*(args.R_tot*time_s/(args.n_turn*args.t_turn)); +#+end_src + +#+begin_src matlab +Rx = [Rx, 0*time_e]; +Ry = [Ry, Ry(end) - Ry(end)*time_e/args.t_end]; +#+end_src + +*** Reference Signal +:PROPERTIES: +:UNNUMBERED: t +:END: + +#+begin_src matlab +t = 0:args.Ts:args.Ts*(length(Rx) - 1); +#+end_src + +#+begin_src matlab +ref = zeros(length(Rx), 7); + +ref(:, 1) = t; +ref(:, 5) = Rx; +ref(:, 6) = Ry; +#+end_src + ** =getTransformationMatrixAcc= :PROPERTIES: :header-args:matlab+: :tangle matlab/src/getTransformationMatrixAcc.m @@ -6318,3 +10511,6 @@ Bb = Mb - [0; 0; Hbm]; J = [si', cross(Bb, si)']; #+end_src + +* Bibliography :ignore: +#+latex: \printbibliography