#+TITLE: Flexible Joint - Test Bench
:DRAWER:
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas

#+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP:   ../index.html

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
#+HTML_HEAD: <script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>

#+BIND: org-latex-image-default-option "scale=1"
#+BIND: org-latex-image-default-width ""

#+LaTeX_CLASS: scrreprt
#+LaTeX_CLASS_OPTIONS: [a4paper, 10pt, DIV=12, parskip=full]
#+LaTeX_HEADER_EXTRA: \input{preamble.tex}

#+PROPERTY: header-args:matlab  :session *MATLAB*
#+PROPERTY: header-args:matlab+ :comments org
#+PROPERTY: header-args:matlab+ :exports both
#+PROPERTY: header-args:matlab+ :results none
#+PROPERTY: header-args:matlab+ :eval no-export
#+PROPERTY: header-args:matlab+ :noweb yes
#+PROPERTY: header-args:matlab+ :mkdirp yes
#+PROPERTY: header-args:matlab+ :output-dir figs

#+PROPERTY: header-args:latex  :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/tikz/org/}{config.tex}")
#+PROPERTY: header-args:latex+ :imagemagick t :fit yes
#+PROPERTY: header-args:latex+ :iminoptions -scale 100% -density 150
#+PROPERTY: header-args:latex+ :imoutoptions -quality 100
#+PROPERTY: header-args:latex+ :results file raw replace
#+PROPERTY: header-args:latex+ :buffer no
#+PROPERTY: header-args:latex+ :tangle no
#+PROPERTY: header-args:latex+ :eval no-export
#+PROPERTY: header-args:latex+ :exports results
#+PROPERTY: header-args:latex+ :mkdirp yes
#+PROPERTY: header-args:latex+ :output-dir figs
#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png")
:END:

* Finite Element 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)
<<matlab-dir>>
#+end_src

#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src

** Parameters
#+begin_src matlab
ka = 94e6; % Axial Stiffness [N/m]
ks = 13e6; % Shear Stiffness [N/m]
kb = 5;    % Bending Stiffness [Nm/rad]
kt = 260;  % Torsional Stiffness [Nm/rad]
#+end_src

#+begin_src matlab
Fa = 469;    % Axial Force before yield [N]
Fs = 242;    % Shear Force before yield [N]
Fb = 0.118;  % Bending Force before yield [Nm]
Ft = 1.508; % Torsional Force before yield [Nm]
#+end_src

#+begin_src matlab
Xa = Fa/ka; % Axial Stroke before yield [m]
Xs = Fs/ks; % Shear Stroke before yield [m]
Xb = Fb/kb; % Bending Stroke before yield [rad]
Xt = Ft/kt; % Torsional Stroke before yield [rad]
#+end_src

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable([1e-6*ka, Fa, 1e6*Xa; 1e-6*ks, Fs, 1e6*Xs], {'Axial', 'Shear'}, {'Stiffness [N/um]', 'Max Force [N]', 'Stroke [um]'}, ' %.0f ');
#+end_src

#+RESULTS:
|       | Stiffness [N/um] | Max Force [N] | Stroke [um] |
|-------+------------------+---------------+-------------|
| Axial |               94 |           469 |           5 |
| Shear |               13 |           242 |          19 |

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable([kb, 1e3*Fb, 1e3*Xb; kt, 1e3*Ft, 1e3*Xt], {'Bending', 'Torsional'}, {'Stiffness [Nm/rad]', 'Max Torque [Nmm]', 'Stroke [mrad]'}, ' %.0f ');
#+end_src

#+RESULTS:
|           | Stiffness [Nm/rad] | Max Torque [Nmm] | Stroke [mrad] |
|-----------+--------------------+------------------+---------------|
| Bending   |                  5 |              118 |            24 |
| Torsional |                260 |             1508 |             6 |

* Measurement Setup

As shown in Figure [[fig:flexible_joint_test_bench_axis]], the x-axis is aligned with both the force axis and the measurement axis.

#+name: fig:flexible_joint_test_bench_axis
#+caption: Test bench geometry and axis
[[file:figs/flexible_joint_test_bench_axis.png]]

* Shear
** Setup

The applied force as well as the measured displacement are aligned with the flexible joint's center (Figure [[fig:flexible_joint_test_bench_axis]]).

#+name: fig:flex_joint_bench_shear
#+caption: Schematic of the test bench to measure the shear stiffness
[[file:figs/flex_joint_bench_shear.png]]

Ideally, only shear is induced by the force.

If the force is not exactly aligned with the rotation point of the flexible joint:
- in the y-direction: some parasitic *torsional* motion will be induced
- in the z-direction: some parasitic *bending* motion will be induced

We wish here to estimate how precise the force vector should be aligned with the flexible point in order for the motion measured is mainly due to shear effects and not torsional and bending effects.

** Effect of Shear
The shear effect is simply:
\begin{equation}
  X_s = \frac{F}{k_s}
\end{equation}

** Effect of Bending

If the flexible joint is not perfectly positioned as shown in Figure [[fig:flex_joint_bench_pos_error]] (offset along the z-axis), the applied force will induce a bending motion in addition to the shear motion.

#+name: fig:flex_joint_bench_pos_error
#+caption: Considering a position error $\epsilon_z$ of the measurement and force application point with respect ot the flexible joint center (Side View)
[[file:figs/flex_joint_bench_pos_error.png]]

Let's estimate this effect.

The effect of the vertical position error $\epsilon_z$ is the apparition of a "bending" torque:
\begin{equation}
  M_b = \epsilon_z \cdot F
\end{equation}

This torque will induce a bending motion $\theta_y$ of the flexible joint:
\begin{equation}
  \theta_y = \frac{M_b}{k_b} = \frac{\epsilon_z \cdot F}{k_b}
\end{equation}

This rotation will induce an error $\epsilon_{\theta_y}$ on the measured displacement:
\begin{equation}
  \epsilon_{\theta_y} = \tan(\theta_y) \epsilon_z - L\left( 1 - \frac{1}{\cos(\theta_y)} \right)
\end{equation}

Supposing $\theta_y$ small:
\begin{equation}
  \epsilon_{\theta_y} \approx \frac{\epsilon_z^2 \cdot F}{k_b} \left( 1 + \frac{L}{2} \frac{F}{k_b} \right)
\end{equation}


And this error to be very small compared to the measured motion due to shear:
\begin{equation}
  \epsilon_{\theta_y} \ll X_s
\end{equation}

Which is equivalent to:
\begin{equation}
  \epsilon_z \ll \sqrt{\frac{k_b}{k_s} \frac{1}{1 + \frac{L}{2} \frac{F}{k_b}}}
\end{equation}

For realistic values, this is almost equivalent to:
\begin{equation}
  \epsilon_z \ll \sqrt{\frac{k_b}{k_s}}
\end{equation}

Numerically:
#+begin_src matlab
L = 5e-2; % [m]
F = 20;   % [N]

epsilon_z_max = sqrt(kb/ks/(1 + L/2*F/kb)); % [m]
#+end_src

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable(1e6*[1e-1*epsilon_z_max, 1e-2*epsilon_z_max, 1e-3*epsilon_z_max], {'$\epsilon_z\,[\mu m]$'}, {'10% error', '1% error', '0.1% error'}, ' %.1f ');
#+end_src

#+RESULTS:
|                       | 10% error | 1% error | 0.1% error |
|-----------------------+-----------+----------+------------|
| $\epsilon_z\,[\mu m]$ |      59.1 |      5.9 |        0.6 |

** Effect of Torsion
If the flexible joint is not perfectly positioned as shown in Figure [[fig:flex_joint_bench_pos_error_bis]] (offset along the y-axis), the applied force will induce a torsional motion in addition to the shear motion.

#+name: fig:flex_joint_bench_pos_error_bis
#+caption: Considering a position error $\epsilon_y$ of the measurement and force application point with respect ot the flexible joint center (top view)
[[file:figs/flex_joint_bench_pos_error_bis.png]]

Let's estimate this effect.

The effect of the horizontal position error $\epsilon_y$ is the apparition of a "torsional" torque:
\begin{equation}
  M_t = \epsilon_y \cdot F
\end{equation}

This torque will induce a torsional motion $\theta_z$ of the flexible joint:
\begin{equation}
  \theta_z = \frac{M_t}{k_t} = \frac{\epsilon_y \cdot F}{k_t}
\end{equation}

This rotation will induce an error $\epsilon_{\theta_z}$ on the measured displacement:
\begin{equation}
  \epsilon_{\theta_z} = \tan(\theta_z) \epsilon_y - L\left( 1 - \frac{1}{\cos(\theta_z)} \right)
\end{equation}

Supposing $\theta_z$ small:
\begin{equation}
  \epsilon_{\theta_z} \approx \frac{\epsilon_y^2 \cdot F}{k_t} \left( 1 + \frac{L}{2} \frac{F}{k_t} \right)
\end{equation}


We want this error to be very small compared to the measured motion due to shear:
\begin{equation}
  \epsilon_{\theta_z} \ll X_s
\end{equation}

Which is equivalent to:
\begin{equation}
  \epsilon_y \ll \sqrt{\frac{k_t}{k_s} \frac{1}{1 + \frac{L}{2} \frac{F}{k_t}}}
\end{equation}

For realistic values, this is almost equivalent to:
\begin{equation}
  \epsilon_y \ll \sqrt{\frac{k_t}{k_s}}
\end{equation}

Numerically:
#+begin_src matlab
L = 5e-2; % [m]
F = 20;   % [N]

epsilon_y_max = sqrt(kt/ks/(1 + L/2*F/kt)); % [m]
#+end_src

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable(1e6*[1e-1*epsilon_y_max, 1e-2*epsilon_y_max, 1e-3*epsilon_y_max], {'$\epsilon_y\,[\mu m]$'}, {'10% error', '1% error', '0.1% error'}, ' %.1f ');
#+end_src

#+RESULTS:
|                       | 10% error | 1% error | 0.1% error |
|-----------------------+-----------+----------+------------|
| $\epsilon_y\,[\mu m]$ |     446.8 |     44.7 |        4.5 |

* Axial
** Setup

#+name: fig:flex_test_bench_axial
#+caption: Schematic of the test bench to measure the Axial Stiffness
[[file:figs/flex_test_bench_axial.png]]

** Effect of Compression

The axial (compression) effect is simply:
\begin{equation}
  X_a = \frac{F}{k_a}
\end{equation}

** Effect of Bending
If the force is not exactly aligned with the rotation point of the flexible joint, some parasitic *bending* motion will be induced (Figure [[fig:flex_joint_bench_pos_error_axial]]).

#+name: fig:flex_joint_bench_pos_error_axial
#+caption: Error of position of the force vector and measurement point with respect to the flexible joint's center
[[file:figs/flex_joint_bench_pos_error_axial.png]]

We wish here to estimate how close to the rotation point the force vector should be aligned for the motion measured to be mainly due to shear effects and not bending effects.

Suppose there is a distance $\epsilon_z$ form the center of rotation, it will induce a torque equal to:
\begin{equation}
  M_b = \epsilon_z \cdot F
\end{equation}

Therefore, the rotation of the top part will be:
\begin{equation}
  X_b = \frac{M_b}{k_b} = \frac{\epsilon_z \cdot F}{k_b}
\end{equation}

And the induced measured displacement is:
\begin{equation}
  D_b = \tan(X_b) \epsilon_z - L\left( 1 - \frac{1}{\cos(X_b)} \right) \\
\end{equation}

Supposing $X_b$ small:
\begin{equation}
  D_b \approx \frac{\epsilon_z^2 \cdot F}{k_b} \left( 1 + \frac{L}{2} \frac{F}{k_b} \right)
\end{equation}

We want the induced displacement due to the bending much smaller than the induced displacement due to the compression:
\begin{equation}
  D_b \ll Xs
\end{equation}

Which is equivalent to (taking $\tan x \approx x$):
\begin{equation}
  \epsilon_z \ll \sqrt{\frac{k_b}{k_a} \frac{1}{1 + \frac{L}{2} \frac{F}{k_b}}}
\end{equation}

For realistic values, this is almost equivalent to:
\begin{equation}
  \epsilon_z \ll \sqrt{\frac{k_b}{k_a}}
\end{equation}

Note that an error in $z$ is chosen here, but the same results are obtained for errors in the $y$ direction.
What matters is the distance from the axis $F$ to the flexible joint's center.

Numerically:
#+begin_src matlab
L = 10e-2; % [m]
F = 50; % [N]
d_off_eq = sqrt(kb/ka/(1 + L/2*F/kb))
#+end_src

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable(1e6*[1e-1*d_off_eq, 1e-2*d_off_eq, 1e-3*d_off_eq; 1e-1*d_off_eq, 1e-2*d_off_eq, 1e-3*d_off_eq], {'$\epsilon_y\,[\mu m]$', '$\epsilon_z\,[\mu m]$'}, {'10% error', '1% error', '0.1% error'}, ' %.1f ');
#+end_src

#+RESULTS:
|                       | 10% error | 1% error | 0.1% error |
|-----------------------+-----------+----------+------------|
| $\epsilon_y\,[\mu m]$ |      18.8 |      1.9 |        0.2 |
| $\epsilon_z\,[\mu m]$ |      18.8 |      1.9 |        0.2 |

Same as for the shear measurement, it is very difficult to be that precise, and therefore rotations should also be measured and compensated for.

** Measured Displacement with realistic positioning errors

Suppose there is a positioning error of $\epsilon_z = 0.1\,mm$.

\begin{equation}
  X_b = \frac{\epsilon_z \cdot F}{k_b}
\end{equation}

#+begin_src matlab
Fmax = Fa;
Ez = 0.1e-3;
Xb_max = Ez*Fmax/kb;
#+end_src

#+begin_src matlab :exports results :results value replace
ans = sprintf('Xbmax = %.1f [mrad]', 1e3*Xb_max)
#+end_src

#+RESULTS:
: Xbmax = 9.4 [mrad]

Which is about half of the maximum stroke in bending.


The

\begin{equation}
  D_b = \tan(X_b) \epsilon_z - L\left( 1 - \frac{1}{\cos(X_b)} \right) \\
\end{equation}

* Bending Stiffness
** Setup
Let's say a force is applied on top of the flexible joint with a distance $H$ with the joint's center.

The displacement of the flexible joint is also measure at the same height $H$.


** Effect of Bending
The torque applied is:
\begin{equation}
  M_b = F \cdot H
\end{equation}

The flexible joint is experiencing a rotation $R_b$ due to the torque $M_b$:
\begin{equation}
  R_b = \frac{M_b}{k_b} = \frac{F \cdot H}{k_b}
\end{equation}

This rotation is then measured by the displacement sensor coaxial with the force actuator.
The measured displacement is:
\begin{equation}
  D_b \approx H \tan (R_b) \approx \frac{F \cdot H^2}{k_b}
\end{equation}

** Effect of Shear
The effect of Shear on the measured displacement is simply:
\begin{equation}
  D_s = \frac{F}{k_s}
\end{equation}

We would like to have this displacement much smaller than the displacement induced by the bending effects:
\begin{equation}
  D_b \gg D_s
\end{equation}

Which is equivalent as to have:
\begin{equation}
  H \gg \sqrt{\frac{k_b}{k_s}}
\end{equation}

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
data2orgtable(1e3*[1e1*sqrt(kb/ks), 1e2*sqrt(kb/ks), 1e3*sqrt(kb/ks)], {'D offset [mm]'}, {'10% error', '1% error', '0.1% error'}, ' %.0f ');
#+end_src

#+RESULTS:
|               | 10% error | 1% error | 0.1% error |
|---------------+-----------+----------+------------|
| D offset [mm] |         6 |       62 |        620 |

We should therefore apply a force at least 50mm higher than the joint's center for the shear effects to be negligible.

** Effect of Torsion

If the application force is not aligned with the vertical axis of the flexible joint, this will induce a torsion motion that will induce a measurement error.

Let's note the offset $x_{off}$:
\begin{equation}
  D_t \approx \frac{x_{off}^2 \cdot F}{k_t} \left( 1 + \frac{L}{2} \frac{F}{k_t} \right)
\end{equation}

And we would like to have:
\begin{equation}
  D_b \gg D_t
\end{equation}

Which is equivalent as to have:
\begin{equation}
  x_{off} \ll H \sqrt{\frac{k_t}{k_b}}
\end{equation}

Let's take $H = 50/,mm$.

#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
H = 50e-3; % [m]
data2orgtable(1e3*[1e-1*H*sqrt(kt/kb), 1e-2*H*sqrt(kt/kb), 1e-3*H*sqrt(kt/kb)], {'X offset [mm]'}, {'10% error', '1% error', '0.1% error'}, ' %.1f ');
#+end_src

#+RESULTS:
|               | 10% error | 1% error | 0.1% error |
|---------------+-----------+----------+------------|
| X offset [mm] |      36.1 |      3.6 |        0.4 |

The effect of torsion should be negligible for a positioning accuracy of ~1mm.

** Full stroke measured displacement and applied force as a function of $H$

Applying a force with a large offset $H$ means the induced rotation (for constant force) will be larger.
This also means that the measured displacement $D_b$ will also be larger.
\begin{equation}
  D_b \approx H \tan (R_b)
\end{equation}

Note that we here suppose the force axis is co-linear with the measurement axis.

Let's compute:
- $D_b$ as a function of $H$
  \[ D_b \approx H \tan (R_b) \]
- the applied force $F_{\text{max}}$ to induce the maximum rotation
  \[ F_{\text{max}} \approx \frac{X_b \cdot k_b}{H} \]

#+begin_src matlab
H = linspace(0, 100e-3, 1000);

Db = H*tan(Xb);
Fmax = Xb*kb./H;
#+end_src

#+begin_src matlab
figure;
yyaxis left
plot(1e3*H, Fmax);
ylabel('Maximum Force [$N$]');
ylim([0, 100]);

yyaxis right
plot(1e3*H, 1e6*Db);
ylabel('Measurement Range [$\mu m$]');

xlabel('Offset $H$ [$mm$]');
#+end_src

** Conclusion

- Applied Force
- Measured Displacement
- Requirements in terms of positioning

* Torsion
** Distance to flex axis for torsion >> shear

** Force Location Precision for torsion >> bending

* Force Sensor

Requirements:
- Large enough measurement range
- Small enough measurement noise and errors

The largest applied force is foreseen to be around 500N.
The smallest (full range) force is foreseen to be around 2N.

If we want an accuracy of 1% (even for the small measurement range), the force sensor should be accurate down to ~0.02N and with a full range of 500N.
This corresponds to an accuracy of 0.004%.

If we limit ourselves to 100N of applied force, the required accuracy of 0.02N corresponds to 0.02% of accuracy which is more realistic.

Another solution would be to use 2 force sensors.

#+begin_src matlab
Fmax = 500; % [N]
Fmin = 2; % [N]
Fres = Fmin/100; % [N]

% Dynamic range
Fmax/Fres
#+end_src

| Model  | Range [N] | Accuracy | Error [N] | Price [eur] |
|--------+-----------+----------+-----------+-------------|
| [[https://www.hbm.com/en/3364/s2m-reliable-high-precision-s-type-force-load-cell/][S2M]]    |       100 |    0.02% |      0.02 |             |
| [[https://www.hbm.com/en/3364/s2m-reliable-high-precision-s-type-force-load-cell/][S2M]]    |       500 |    0.02% |       0.1 |             |
| [[https://www.althensensors.com/sensors/force-sensors/cylindrical-force-sensors/4510/alf241-axial-compensated-force-sensor/][ALF241]] |       100 |    0.05% |      0.05 |             |
| [[https://en.pm-instrumentation.com/1500-cellule-de-force-plate-125-a-1500-n-faible-sensibilite-aux-efforts-transverses#documents][PM1500]] |       500 |    0.05% |       0.5 |             |


https://www.hbm.com/en/2925/top-transfer-reference-force-transducer-maximum-precision/
- State of the art but big
https://www.burster.com//en/sensors/load-cells/high-precision-load-cells/p/detail/8527
- 500N range => 0.25N error



* Displacement Sensor
** Three displacement sensors to measure both rotations $\theta_y,\theta_z$ and translation $x$

#+name: fig:3_point_measurement
#+caption: Figure caption
[[file:figs/3_point_measurement.png]]

- Capacitive sensors or interferometers
- Choice of the position of the three sensors => will change rotation sensitivity and range
