\node[draw, circle, inner sep=0pt, minimum size=0.3cm, label=left:$a_6$] at (p6){};
\draw[fill, color=black] (p6) circle (0.04);
\end{tikzpicture}
#+end_src
#+name: fig:local_to_global_coordinates
#+caption: Schematic of the measured motions of a solid body
#+RESULTS:
[[file:figs/local_to_global_coordinates.png]]
The goal of this section is to see how to compute the acceleration/angular acceleration of the solid body from the accelerations $\vec{a}_i$ measured by the accelerometers.
The acceleration/angular acceleration of the solid body is defined as the vector ${}^O\vec{x}$:
As we want to measure 6dof, we suppose that we have 6 uniaxial acceleremoters (we could use more, but 6 is enough).
The measurement of the individual vectors is defined as the vector $\vec{a}$:
\begin{equation}
\vec{a} = \begin{bmatrix}
a_1 \\ a_2 \\ a_3 \\ a_4 \\ a_5 \\ a_6
\end{bmatrix}
\end{equation}
From the positions and orientations of the acceleremoters (defined in Section [[sec:accelerometer_pos]]), it is quite straightforward to compute the accelerations measured by the sensors from the acceleration/angular acceleration of the solid body (Section [[sec:transformation_motion_to_acc]]).
From this, we can easily build a transformation matrix $M$, such that:
\begin{equation}
\vec{a} = M \cdot {}^O\vec{x}
\end{equation}
If the matrix is invertible, we can just take the inverse in order to obtain the transformation matrix giving the 6dof acceleration of the solid body from the accelerometer measurements (Section [[sec:transformation_acc_to_motion]]):
\begin{equation}
{}^O\vec{x} = M^{-1} \cdot \vec{a}
\end{equation}
If it is not invertible, then it means that it is not possible to compute all 6dof of the solid body from the measurements.
The solution is then to change the location/orientation of some of the accelerometers.
** Transformation matrix from motion of the solid body to accelerometer measurements
<<sec:transformation_motion_to_acc>>
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:
If we now want to know the (scalar) acceleration $a_i$ of the point $p_i$ in the direction of the accelerometer direction $\hat{s}_i$, we can just project the 3d acceleration on $\hat{s}_i$:
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.
#+begin_important
The transformation from solid body acceleration ${}^O\vec{x}$ from sensor measured acceleration $\vec{a}$ is:
\begin{equation} \label{eq:M_matrix}
\vec{a} = \underbrace{\begin{bmatrix}
\hat{s}_1^T & \hat{s}_1^T \cdot P_{1,[\times]} \\
\vdots & \vdots \\
\hat{s}_6^T & \hat{s}_6^T \cdot P_{6,[\times]}
\end{bmatrix}}_{M} {}^O\vec{x}
\end{equation}
with $\hat{s}_i$ the unit vector representing the measured direction of the i'th accelerometer expressed in frame $\{O\}$ and $P_{i,[\times]}$ the skew-symmetric matrix representing the cross product of the position of the i'th accelerometer expressed in frame $\{O\}$.
#+end_important
Let's define such matrix using matlab:
#+begin_src 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;
end
#+end_src
The obtained matrix is shown in Table [[tab:effect_motion_on_meas]].
#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
** Compute the transformation matrix from accelerometer measurement to motion of the solid body
<<sec:transformation_acc_to_motion>>
In order to compute the motion of the solid body ${}^O\vec{x}$ with respect to frame $\{O\}$ from the accelerometer measurements $\vec{a}$, we have to inverse the transformation matrix $M$.
\begin{equation}
{}^O\vec{x} = M^{-1} \vec{a}
\end{equation}
We therefore need the determinant of $M$ to be non zero:
#+begin_src matlab :results value replace :exports both :tangle no
det(M)
#+end_src
The obtained inverse of the matrix is shown in Table [[tab:compute_motion_from_meas]].
#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
Parameters for sub-components of the simscape model are defined below.
*** Springs
<<sec:simscape_springs>>
The 4 springs supporting the suspended optical table are modelled with "bushing joints" having stiffness and damping in the x-y-z directions:
#+begin_src matlab
spring.kx = 1e4; % X- Stiffness [N/m]
spring.cx = 1e1; % X- Damping [N/(m/s)]
spring.ky = 1e4; % Y- Stiffness [N/m]
spring.cy = 1e1; % Y- Damping [N/(m/s)]
spring.kz = 1e4; % Z- Stiffness [N/m]
spring.cz = 1e1; % Z- Damping [N/(m/s)]
spring.z0 = 32e-3; % Equilibrium z-length [m]
#+end_src
*** Inertial Shaker (IS20)
<<sec:simscape_inertial_shaker>>
The inertial shaker is defined as two solid bodies:
- the "housing" that is fixed to the element that we want to excite
- the "inertial mass" that is suspended inside the housing
The inertial mass is guided inside the housing and an actuator (coil and magnet) can be used to apply a force between the inertial mass and the support.
The "reacting" force on the support is then used as an excitation.
- an "inertial mass" suspended inside the housing by springs and guided in the measured direction
The relative motion between the housing and the inertial mass gives a measurement of the acceleration of the measured body (up to the suspension mode of the inertial mass).
Here are defined the parameters for the triaxial accelerometer:
#+begin_src matlab
acc_3d.m = 0.005; % Inertial mass [kg]
acc_3d.m_tot = 0.025; % Total mass [m]
acc_3d.w0 = 2*pi*20e3; % Resonance frequency [rad/s]
acc_3d.kx = acc_3d.m*acc_3d.w0^2; % Spring constant [N/m]
acc_3d.ky = acc_3d.m*acc_3d.w0^2; % Spring constant [N/m]
acc_3d.kz = acc_3d.m*acc_3d.w0^2; % Spring constant [N/m]
acc_3d.cx = 1e2; % Damping [N/(m/s)]
acc_3d.cy = 1e2; % Damping [N/(m/s)]
acc_3d.cz = 1e2; % Damping [N/(m/s)]
#+end_src
DC gain between support acceleration and inertial mass displacement is $-m/k$:
#+begin_src matlab
acc_3d.g_x = 1/(-acc_3d.m/acc_3d.kx); % [m/s^2/m]
acc_3d.g_y = 1/(-acc_3d.m/acc_3d.ky); % [m/s^2/m]
acc_3d.g_z = 1/(-acc_3d.m/acc_3d.kz); % [m/s^2/m]
#+end_src
We also define the sensitivity in order to have the outputs in volts.
#+begin_src matlab
acc_3d.gV_x = 0.102; % [V/(m/s^2)]
acc_3d.gV_y = 0.102; % [V/(m/s^2)]
acc_3d.gV_z = 0.102; % [V/(m/s^2)]
#+end_src
The problem with using such model for accelerometers is that this adds states to the identified models (2x3 states for each triaxial accelerometer).
These states represents the dynamics of the suspended inertial mass.
In the frequency band of interest (few Hz up to ~1 kHz), the dynamics of the inertial mass can be ignore (its resonance is way above 1kHz).
Therefore, we might as well use idealized "transform sensors" blocks as they will give the same result up to ~20kHz while allowing to reduce the number of identified states.
The accelerometer model can be chosen by setting the =type= property:
#+begin_src matlab
acc_3d.type = 2; % 1: inertial mass, 2: perfect
#+end_src
** Identification
<<sec:simscape_parameters>>
*** Number of states
Let's first use perfect 3d accelerometers:
#+begin_src matlab
acc_3d.type = 2; % 1: inertial mass, 2: perfect
#+end_src
And identify the dynamics from the shaker force to the measured accelerations: