Tangle Matlab files without comments
This commit is contained in:
parent
73de5c5adc
commit
1199f9fb7a
@ -21,19 +21,6 @@ colors = colororder;
|
||||
%% Frequency Vector [Hz]
|
||||
freqs = logspace(0, 3, 1000);
|
||||
|
||||
% Range validity of the approximate inverse kinematics
|
||||
|
||||
% The accuracy of the Jacobian-based forward kinematics solution was estimated by a simple analysis.
|
||||
% For a series of platform positions, the exact strut lengths are computed using the analytical inverse kinematics equation eqref:eq:nhexa_inverse_kinematics.
|
||||
% These strut lengths are then used with the Jacobian to estimate the platform pose eqref:eq:nhexa_forward_kinematics_approximate, from which the error between the estimated and true poses can be calculated, both in terms of position $\epsilon_D$ and orientation $\epsilon_R$.
|
||||
|
||||
% For motion strokes from $1\,\mu m$ to $10\,mm$, the errors are estimated for all direction of motion, and the worst case errors are shown in Figure ref:fig:nhexa_forward_kinematics_approximate_errors.
|
||||
% The results demonstrate that for displacements up to approximately $1\,\%$ of the hexapod's size (which corresponds to $100\,\mu m$ as the size of the Stewart platform is here $\approx 100\,mm$), the Jacobian approximation provides excellent accuracy.
|
||||
|
||||
% Since the maximum required stroke of the nano-hexapod ($\approx 100\,\mu m$) is three orders of magnitude smaller than its overall size ($\approx 100\,mm$), the Jacobian matrix can be considered constant throughout the workspace.
|
||||
% It can be computed once at the rest position and used for both forward and inverse kinematics with high accuracy.
|
||||
|
||||
|
||||
%% Estimate the errors associated with approximate forward kinematics using the Jacobian matrix
|
||||
stewart = initializeSimplifiedNanoHexapod('H', 100e-3);
|
||||
|
||||
|
@ -21,53 +21,6 @@ colors = colororder;
|
||||
%% Frequency Vector [Hz]
|
||||
freqs = logspace(0, 3, 1000);
|
||||
|
||||
% Validation of the multi-body model
|
||||
% <<ssec:nhexa_model_validation>>
|
||||
|
||||
% The developed multi-body model of the Stewart platform is represented schematically in Figure ref:fig:nhexa_stewart_model_input_outputs, highlighting the key inputs and outputs: actuator forces $\bm{f}$, force sensor measurements $\bm{f}_n$, and relative displacement measurements $\bm{\mathcal{L}}$.
|
||||
% The frames $\{F\}$ and $\{M\}$ serve as interfaces for integration with other elements in the multi-body system.
|
||||
% A three-dimensional visualization of the model is presented in Figure ref:fig:nhexa_simscape_screenshot.
|
||||
|
||||
% #+attr_latex: :options [b]{0.6\linewidth}
|
||||
% #+begin_minipage
|
||||
% #+name: fig:nhexa_stewart_model_input_outputs
|
||||
% #+caption: Nano-Hexapod plant with inputs and outputs. Frames $\{F\}$ and $\{M\}$ can be connected to other elements in the multi-body models.
|
||||
% #+attr_latex: :scale 1 :float nil
|
||||
% [[file:figs/nhexa_stewart_model_input_outputs.png]]
|
||||
% #+end_minipage
|
||||
% \hfill
|
||||
% #+attr_latex: :options [b]{0.35\linewidth}
|
||||
% #+begin_minipage
|
||||
% #+name: fig:nhexa_simscape_screenshot
|
||||
% #+caption: 3D representation of the multi-body model
|
||||
% #+attr_latex: :width 0.90\linewidth :float nil
|
||||
% [[file:figs/nhexa_simscape_screenshot.jpg]]
|
||||
% #+end_minipage
|
||||
|
||||
% The validation of the multi-body model was performed using the simplest Stewart platform configuration, enabling direct comparison with the analytical transfer functions derived in Section ref:ssec:nhexa_stewart_platform_dynamics.
|
||||
% This configuration consists of massless universal joints at the base, massless spherical joints at the top platform, and massless struts with stiffness $k_a = 1\,\text{N}/\mu\text{m}$ and damping $c_a = 10\,\text{N}/({\text{m}/\text{s}})$.
|
||||
% The geometric parameters remain as specified in Table ref:tab:nhexa_actuator_parameters.
|
||||
|
||||
% While the moving platform itself is considered massless, a $10\,\text{kg}$ cylindrical payload is mounted on top with a radius of $r = 110\,mm$ and a height $h = 300\,mm$.
|
||||
|
||||
% For the analytical model, the stiffness, damping, and mass matrices are defined in eqref:eq:nhexa_analytical_matrices.
|
||||
|
||||
% \begin{subequations}\label{eq:nhexa_analytical_matrices}
|
||||
% \begin{align}
|
||||
% \bm{\mathcal{K}} &= \text{diag}(k_a,\ k_a,\ k_a,\ k_a,\ k_a,\ k_a) \\
|
||||
% \bm{\mathcal{C}} &= \text{diag}(c_a,\ c_a,\ c_a,\ c_a,\ c_a,\ c_a) \\
|
||||
% \bm{M} &= \text{diag}\left(m,\ m,\ m,\ \frac{1}{12}m(3r^2 + h^2),\ \frac{1}{12}m(3r^2 + h^2),\ \frac{1}{2}mr^2\right)
|
||||
% \end{align}
|
||||
% \end{subequations}
|
||||
|
||||
% The transfer functions from the actuator forces to the strut displacements are computed using these matrices according to equation eqref:eq:nhexa_transfer_function_struts.
|
||||
% These analytical transfer functions are then compared with those extracted from the multi-body model.
|
||||
% The developed multi-body model yields a state-space representation with 12 states, corresponding to the six degrees of freedom of the moving platform.
|
||||
|
||||
% Figure ref:fig:nhexa_comp_multi_body_analytical presents a comparison between the analytical and multi-body transfer functions, specifically showing the response from the first actuator force to all six strut displacements.
|
||||
% The close agreement between both approaches across the frequency spectrum validates the multi-body model's accuracy in capturing the system's dynamic behavior.
|
||||
|
||||
|
||||
%% Plant using Analytical Equations
|
||||
% Stewart platform definition
|
||||
k = 1e6; % Actuator stiffness [N/m]
|
||||
@ -154,28 +107,6 @@ yticks([-180, -90, 0, 90, 180]);
|
||||
linkaxes([ax1,ax2],'x');
|
||||
xlim([freqs(1), freqs(end)]);
|
||||
|
||||
% Nano Hexapod Dynamics
|
||||
% <<ssec:nhexa_model_dynamics>>
|
||||
|
||||
% Following the validation of the multi-body model, a detailed analysis of the nano-hexapod dynamics was performed.
|
||||
% The model parameters were set according to the specifications outlined in Section ref:ssec:nhexa_model_def, with a payload mass of $10\,kg$.
|
||||
% The transfer functions from actuator forces $\bm{f}$ to both strut displacements $\bm{\mathcal{L}}$ and force measurements $\bm{f}_n$ were derived from the multi-body model.
|
||||
|
||||
% The transfer functions relating actuator forces to strut displacements are presented in Figure ref:fig:nhexa_multi_body_plant_dL.
|
||||
% Due to the system's symmetrical design and identical strut configurations, all diagonal terms (transfer functions from force $f_i$ to displacement $l_i$ of the same strut) exhibit identical behavior.
|
||||
% While the system has six degrees of freedom, only four distinct resonance frequencies were observed in the frequency response.
|
||||
% This reduction from six to four observable modes is attributed to the system's symmetry, where two pairs of resonances occur at identical frequencies.
|
||||
|
||||
% The system's behavior can be characterized in three frequency regions.
|
||||
% At low frequencies, well below the first resonance, the plant demonstrates good decoupling between actuators, with the response dominated by the strut stiffness: $\bm{G}(j\omega) \xrightarrow[\omega \to 0]{} \bm{\mathcal{K}}^{-1}$.
|
||||
% In the mid-frequency range, the system exhibits coupled dynamics through its resonant modes, reflecting the complex interactions between the platform's degrees of freedom.
|
||||
% At high frequencies, above the highest resonance, the response is governed by the payload's inertia mapped to the strut coordinates: $\bm{G}(j\omega) \xrightarrow[\omega \to \infty]{} \bm{J} \bm{M}^{-T} \bm{J}^T \frac{-1}{\omega^2}$
|
||||
|
||||
% The force sensor transfer functions, shown in Figure ref:fig:nhexa_multi_body_plant_fm, display characteristics typical of collocated actuator-sensor pairs.
|
||||
% Each actuator's transfer function to its associated force sensor exhibits alternating complex conjugate poles and zeros.
|
||||
% The inclusion of parallel stiffness introduces an additional complex conjugate zero at low frequency, which was previously observed in the three-degree-of-freedom rotating model.
|
||||
|
||||
|
||||
%% Multi-Body model of the Nano-Hexapod
|
||||
% Initialize 1DoF
|
||||
initializeSimplifiedNanoHexapod('flex_type_F', '2dof', 'flex_type_M', '3dof', 'actuator_type', '1dof');
|
||||
|
@ -21,22 +21,6 @@ colors = colororder;
|
||||
%% Frequency Vector [Hz]
|
||||
freqs = logspace(0, 3, 1000);
|
||||
|
||||
% Control in Cartesian Space
|
||||
|
||||
% Alternatively, control can be implemented directly in Cartesian space, as illustrated in Figure ref:fig:nhexa_control_cartesian.
|
||||
% Here, the controller processes Cartesian errors $\bm{\epsilon}_{\mathcal{X}}$ to generate forces and torques $\bm{\mathcal{F}}$, which are then mapped to actuator forces using the transpose of the inverse Jacobian matrix eqref:eq:nhexa_jacobian_forces.
|
||||
|
||||
% The plant behavior in Cartesian space, illustrated in Figure ref:fig:nhexa_plant_frame_cartesian, reveals interesting characteristics.
|
||||
% Some degrees of freedom, particularly the vertical translation and rotation about the vertical axis, exhibit simpler second-order dynamics.
|
||||
% A key advantage of this approach is that the control performance can be tuned individually for each direction.
|
||||
% This is particularly valuable when performance requirements differ between degrees of freedom - for instance, when higher positioning accuracy is required vertically than horizontally, or when certain rotational degrees of freedom can tolerate larger errors than others.
|
||||
|
||||
% However, significant coupling exists between certain degrees of freedom, particularly between rotations and translations (e.g., $\epsilon_{R_x}/\mathcal{F}_y$ or $\epsilon_{D_y}/\bm\mathcal{M}_x$).
|
||||
|
||||
% For the conceptual validation of the nano-hexapod, control in the strut space was selected due to its simpler implementation and the beneficial decoupling properties observed at low frequencies.
|
||||
% More sophisticated control strategies will be explored during the detailed design phase.
|
||||
|
||||
|
||||
%% Identify plant from actuator forces to external metrology
|
||||
stewart = initializeSimplifiedNanoHexapod();
|
||||
initializeSample('type', 'cylindrical', 'm', 10, 'H', 300e-3);
|
||||
@ -149,35 +133,6 @@ yticks([-180, -90, 0, 90, 180]);
|
||||
linkaxes([ax1,ax2],'x');
|
||||
xlim([freqs(1), freqs(end)]);
|
||||
|
||||
|
||||
|
||||
% #+name: fig:nhexa_decentralized_iff_schematic
|
||||
% #+caption: Schematic of the implemented decentralized IFF controller. The damped plant has a new inputs $\bm{f}^{\prime}$
|
||||
% #+RESULTS:
|
||||
% [[file:figs/nhexa_decentralized_iff_schematic.png]]
|
||||
|
||||
|
||||
% \begin{equation}\label{eq:nhexa_kiff}
|
||||
% \bm{K}_{\text{IFF}}(s) = g \cdot \begin{bmatrix}
|
||||
% K_{\text{IFF}}(s) & & 0 \\
|
||||
% & \ddots & \\
|
||||
% 0 & & K_{\text{IFF}}(s)
|
||||
% \end{bmatrix}, \quad K_{\text{IFF}}(s) = \frac{1}{s}
|
||||
% \end{equation}
|
||||
|
||||
|
||||
% In this section, the stiffness in parallel with the force sensor was omitted since the Stewart platform is not subjected to rotation.
|
||||
% The effect of this parallel stiffness is examined in the next section when the platform is integrated into the complete NASS.
|
||||
|
||||
% Root Locus analysis, shown in Figure ref:fig:nhexa_decentralized_iff_root_locus, reveals the evolution of the closed-loop poles as the controller gain $g$ varies from $0$ to $\infty$.
|
||||
% A key characteristic of force feedback control with collocated sensor-actuator pairs is observed: all closed-loop poles are bounded to the left-half plane, indicating guaranteed stability [[cite:&preumont08_trans_zeros_struc_contr_with]].
|
||||
% This property is particularly valuable because the coupling is very large around resonance frequencies, enabling control of modes that would be difficult to include within the bandwidth using position feedback alone.
|
||||
|
||||
% The bode plot of an individual loop gain (i.e. the loop gain of $K_{\text{IFF}}(s) \cdot \frac{f_{ni}}{f_i}(s)$), presented in Figure ref:fig:nhexa_decentralized_iff_loop_gain, exhibits the typical characteristics of integral force feedback of having a phase bounded between $-90^o$ and $+90^o$.
|
||||
% The loop-gain is high around the resonance frequencies, indicating that the decentralized IFF provides significant control authority over these modes.
|
||||
% This high gain, combined with the bounded phase, enables effective damping of the resonant modes while maintaining stability.
|
||||
|
||||
|
||||
%% Identify the IFF Plant
|
||||
stewart = initializeSimplifiedNanoHexapod('actuator_kp', 0); % Ignoring parallel stiffness for now
|
||||
initializeSample('type', 'cylindrical', 'm', 10, 'H', 300e-3);
|
||||
@ -258,19 +213,6 @@ ylim([-180, 180])
|
||||
linkaxes([ax1,ax2],'x');
|
||||
xlim([1, 1e3]);
|
||||
|
||||
|
||||
|
||||
% #+name: fig:nhexa_hac_iff_schematic
|
||||
% #+caption: HAC-IFF control architecture with the High Authority Controller being implemented in the frame of the struts
|
||||
% #+RESULTS:
|
||||
% [[file:figs/nhexa_hac_iff_schematic.png]]
|
||||
|
||||
% The effect of decentralized IFF on the plant dynamics can be observed by comparing two sets of transfer functions.
|
||||
% Figure ref:fig:nhexa_decentralized_hac_iff_plant_undamped shows the original transfer functions from actuator forces $\bm{f}$ to strut errors $\bm{\epsilon}_{\mathcal{L}}$, which are characterized by pronounced resonant peaks.
|
||||
% When the decentralized IFF is implemented, the transfer functions from modified inputs $\bm{f}^{\prime}$ to strut errors $\bm{\epsilon}_{\mathcal{L}}$ exhibit significantly attenuated resonances (Figure ref:fig:nhexa_decentralized_hac_iff_plant_damped).
|
||||
% This damping of structural resonances serves two purposes: it reduces vibrations near resonances and simplifies the design of the high authority controller by providing simpler plant dynamics.
|
||||
|
||||
|
||||
%% Identify the IFF Plant
|
||||
initializeController('type', 'iff');
|
||||
|
||||
@ -375,45 +317,6 @@ yticks([-180, -90, 0, 90, 180]);
|
||||
linkaxes([ax1,ax2],'x');
|
||||
xlim([freqs(1), freqs(end)]);
|
||||
|
||||
|
||||
|
||||
% #+name: fig:nhexa_decentralized_hac_iff_plant
|
||||
% #+caption: Plant in the frame of the strut for the High Authority Controller.
|
||||
% #+attr_latex: :options [htbp]
|
||||
% #+begin_figure
|
||||
% #+attr_latex: :caption \subcaption{\label{fig:nhexa_decentralized_hac_iff_plant_undamped}Undamped plant in the frame of the struts}
|
||||
% #+attr_latex: :options {0.48\textwidth}
|
||||
% #+begin_subfigure
|
||||
% #+attr_latex: :width 0.95\linewidth
|
||||
% [[file:figs/nhexa_decentralized_hac_iff_plant_undamped.png]]
|
||||
% #+end_subfigure
|
||||
% #+attr_latex: :caption \subcaption{\label{fig:nhexa_decentralized_hac_iff_plant_damped}Damped plant with Decentralized IFF}
|
||||
% #+attr_latex: :options {0.48\textwidth}
|
||||
% #+begin_subfigure
|
||||
% #+attr_latex: :width 0.95\linewidth
|
||||
% [[file:figs/nhexa_decentralized_hac_iff_plant_damped.png]]
|
||||
% #+end_subfigure
|
||||
% #+end_figure
|
||||
|
||||
% Based upon the damped plant dynamics shown in Figure ref:fig:nhexa_decentralized_hac_iff_plant_damped, a high authority controller was designed with the structure given in eqref:eq:nhexa_khac.
|
||||
% The controller combines three elements: an integrator providing high gain at low frequencies, a lead compensator improving stability margins, and a low-pass filter for robustness against unmodeled high-frequency dynamics.
|
||||
% The loop gain of an individual control channel is shown in Figure ref:fig:nhexa_decentralized_hac_iff_loop_gain.
|
||||
|
||||
% \begin{equation}\label{eq:nhexa_khac}
|
||||
% \bm{K}_{\text{HAC}}(s) = \begin{bmatrix}
|
||||
% K_{\text{HAC}}(s) & & 0 \\
|
||||
% & \ddots & \\
|
||||
% 0 & & K_{\text{HAC}}(s)
|
||||
% \end{bmatrix}, \quad K_{\text{HAC}}(s) = g_0 \cdot \underbrace{\frac{\omega_c}{s}}_{\text{int}} \cdot \underbrace{\frac{1}{\sqrt{\alpha}}\frac{1 + \frac{s}{\omega_c/\sqrt{\alpha}}}{1 + \frac{s}{\omega_c\sqrt{\alpha}}}}_{\text{lead}} \cdot \underbrace{\frac{1}{1 + \frac{s}{\omega_0}}}_{\text{LPF}}
|
||||
% \end{equation}
|
||||
|
||||
% The stability of the MIMO feedback loop is analyzed through the /characteristic loci/ method.
|
||||
% Such characteristic loci represent the eigenvalues of the loop gain matrix $\bm{G}(j\omega)\bm{K}(j\omega)$ plotted in the complex plane as the frequency varies from $0$ to $\infty$.
|
||||
% For MIMO systems, this method generalizes the classical Nyquist stability criterion: with the open-loop system being stable, the closed-loop system is stable if none of the characteristic loci encircle the -1 point [[cite:&skogestad07_multiv_feedb_contr]].
|
||||
% As shown in Figure ref:fig:nhexa_decentralized_hac_iff_root_locus, all loci remain to the right of the $-1$ point, validating the stability of the closed-loop system.
|
||||
% Additionally, the distance of the loci from the $-1$ point provides information about stability margins of the coupled system.
|
||||
|
||||
|
||||
%% High Authority Controller - Mid Stiffness Nano-Hexapod
|
||||
% Wanted crossover
|
||||
wc = 2*pi*20; % [rad/s]
|
||||
|
@ -22,7 +22,7 @@
|
||||
#+BIND: org-latex-bib-compiler "biber"
|
||||
|
||||
#+PROPERTY: header-args:matlab :session *MATLAB*
|
||||
#+PROPERTY: header-args:matlab+ :comments org
|
||||
#+PROPERTY: header-args:matlab+ :comments no
|
||||
#+PROPERTY: header-args:matlab+ :exports none
|
||||
#+PROPERTY: header-args:matlab+ :results none
|
||||
#+PROPERTY: header-args:matlab+ :eval no-export
|
||||
@ -3741,67 +3741,6 @@ if isfield(stewart.kinematics, 'C')
|
||||
end
|
||||
#+end_src
|
||||
|
||||
*** =generateCubicConfiguration=: Generate a Cubic Configuration
|
||||
#+begin_src matlab :tangle matlab/src/generateCubicConfiguration.m :comments none :mkdirp yes :eval no
|
||||
function [stewart] = generateCubicConfiguration(stewart, args)
|
||||
% generateCubicConfiguration - Generate a Cubic Configuration
|
||||
%
|
||||
% Syntax: [stewart] = generateCubicConfiguration(stewart, args)
|
||||
%
|
||||
% Inputs:
|
||||
% - stewart - A structure with the following fields
|
||||
% - geometry.H [1x1] - Total height of the platform [m]
|
||||
% - args - Can have the following fields:
|
||||
% - Hc [1x1] - Height of the "useful" part of the cube [m]
|
||||
% - FOc [1x1] - Height of the center of the cube with respect to {F} [m]
|
||||
% - FHa [1x1] - Height of the plane joining the points ai with respect to the frame {F} [m]
|
||||
% - MHb [1x1] - Height of the plane joining the points bi with respect to the frame {M} [m]
|
||||
%
|
||||
% Outputs:
|
||||
|
||||
% - stewart - updated Stewart structure with the added fields:
|
||||
% - platform_F.Fa [3x6] - Its i'th column is the position vector of joint ai with respect to {F}
|
||||
% - platform_M.Mb [3x6] - Its i'th column is the position vector of joint bi with respect to {M}
|
||||
|
||||
arguments
|
||||
stewart
|
||||
args.Hc (1,1) double {mustBeNumeric, mustBePositive} = 60e-3
|
||||
args.FOc (1,1) double {mustBeNumeric} = 50e-3
|
||||
args.FHa (1,1) double {mustBeNumeric, mustBeNonnegative} = 15e-3
|
||||
args.MHb (1,1) double {mustBeNumeric, mustBeNonnegative} = 15e-3
|
||||
end
|
||||
|
||||
assert(isfield(stewart.geometry, 'H'), 'stewart.geometry should have attribute H')
|
||||
H = stewart.geometry.H;
|
||||
|
||||
% We define the useful points of the cube with respect to the Cube's center.
|
||||
% ${}^{C}C$ are the 6 vertices of the cubes expressed in a frame {C} which is located at the center of the cube and aligned with {F} and {M}.
|
||||
|
||||
sx = [ 2; -1; -1];
|
||||
sy = [ 0; 1; -1];
|
||||
sz = [ 1; 1; 1];
|
||||
|
||||
R = [sx, sy, sz]./vecnorm([sx, sy, sz]);
|
||||
|
||||
L = args.Hc*sqrt(3);
|
||||
|
||||
Cc = R'*[[0;0;L],[L;0;L],[L;0;0],[L;L;0],[0;L;0],[0;L;L]] - [0;0;1.5*args.Hc];
|
||||
|
||||
CCf = [Cc(:,1), Cc(:,3), Cc(:,3), Cc(:,5), Cc(:,5), Cc(:,1)]; % CCf(:,i) corresponds to the bottom cube's vertice corresponding to the i'th leg
|
||||
CCm = [Cc(:,2), Cc(:,2), Cc(:,4), Cc(:,4), Cc(:,6), Cc(:,6)]; % CCm(:,i) corresponds to the top cube's vertice corresponding to the i'th leg
|
||||
|
||||
% We can compute the vector of each leg ${}^{C}\hat{\bm{s}}_{i}$ (unit vector from ${}^{C}C_{f}$ to ${}^{C}C_{m}$).
|
||||
|
||||
CSi = (CCm - CCf)./vecnorm(CCm - CCf);
|
||||
|
||||
% We now which to compute the position of the joints $a_{i}$ and $b_{i}$.
|
||||
Fa = CCf + [0; 0; args.FOc] + ((args.FHa-(args.FOc-args.Hc/2))./CSi(3,:)).*CSi;
|
||||
Mb = CCf + [0; 0; args.FOc-H] + ((H-args.MHb-(args.FOc-args.Hc/2))./CSi(3,:)).*CSi;
|
||||
|
||||
stewart.platform_F.Fa = Fa;
|
||||
stewart.platform_M.Mb = Mb;
|
||||
#+end_src
|
||||
|
||||
* Footnotes
|
||||
|
||||
[fn:nhexa_3]Such equation is called the /velocity loop closure/
|
||||
|
Loading…
x
Reference in New Issue
Block a user