Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions data/algorithms/algorithm1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$$
\begin{array}{ll}
\textbf{Algorithm 1 } \text{Statics of the continuum legs} \\
\hline
1:\ \text{Initialize } \mathbf{q}^0 \\
2:\ \text{Define a tolerance } \epsilon \\
3:\ i \leftarrow 0 \\
4:\ \textbf{while } \|\mathbf{q}^i - \mathbf{q}^{i-1}\| > \epsilon \textbf{ do} \\
5:\ \quad \text{Find the residual:} \\
\quad\quad \mathbf{F}(\mathbf{q}^{i-1}) + \mathbf{Mg} + \mathbf{F}_{ext} = \mathbf{b} & (3)\\
6:\ \quad \text{Approximate } \mathbf{F}(\mathbf{q}^i) \text{ by a linearization around } \mathbf{q}^{i-1}\text{:} \\
\quad\quad \mathbf{F}(\mathbf{q}^i) \approx \mathbf{F}(\mathbf{q}^{i-1}) + \underbrace{\dfrac{\partial \mathbf{F}(\mathbf{q}^{i-1})}{\partial \mathbf{q}}}_{-\mathbf{A}} d\mathbf{q} & (4)\\
7:\ \quad \text{Solve the following system:} \\
\quad\quad \mathbf{A}\, d\mathbf{q} = \mathbf{b} & (5)\\
8:\ \quad \text{Update } \mathbf{q}^i \text{ (with } 0 < \alpha < 1\text{):} \\
\quad\quad \mathbf{q}^i = \mathbf{q}^{i-1} + \alpha\, d\mathbf{q} & (6)\\
9:\ \quad i \leftarrow i + 1 \\
10:\ \textbf{end while} \\
11:\ \textbf{Convergence reached: } \mathbf{q}^i \\
\hline
\end{array}
$$
{width=65%, .center}
31 changes: 31 additions & 0 deletions data/algorithms/algorithm2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$$
\begin{array}{ll}
\textbf{Algorithm 2 } \text{Kinematics of the parallel continuum robot computation } f(\textcolor{red}{\mathbf{u}_a}) = \textcolor{green}{\mathbf{y}_e} \\[0.5em]
\hline \\[-0.5em]
1:\ \text{Initialize } \mathbf{q}^0 = [\mathbf{q}_1^0;\ \mathbf{q}_2^0;\ \mathbf{q}_3^0;\ \mathbf{q}_4^0] \\
2:\ \text{Step 2 and 3 of Algorithm 1} \\
3:\ \textbf{while } \|\mathbf{q}^i - \mathbf{q}^{i-1}\| > \epsilon \textbf{ do} \\
4:\ \quad \text{Find the residual:} \\[0.5em]
\qquad \left\{
\begin{array}{l}
\mathbf{F}_1(\mathbf{q}_1^{i-1}) + \mathbf{M}_1\mathbf{g} + \mathbf{F}_{ext} = \mathbf{b}_1 \\
\vdots \\
\mathbf{F}_4(\mathbf{q}_4^{i-1}) + \mathbf{M}_4\mathbf{g} + \mathbf{F}_{ext} = \mathbf{b}_4
\end{array}
\right. & (14) \\[1em]
5:\ \quad \text{Compute } \mathbf{A}_1(\mathbf{q}_1^{i-1}),\ \ldots,\ \mathbf{A}_4(\mathbf{q}_4^{i-1}) \text{ by linearizing } \mathbf{F}_j\ (j \in [1,4]) \\
\quad\ \quad \text{and use the coupling method to obtain } \mathbf{A} \text{ and } \mathbf{b}. \text{ Then solve:} \\[0.5em]
\qquad \left\{
\begin{array}{l}
\mathbf{A}\, d\mathbf{q} = \mathbf{b} + \mathbf{H}_\mathrm{a}^T \boldsymbol{\lambda}_\mathrm{a} \\
\text{subject to}\\
\boldsymbol{\delta}_\mathrm{a}(\mathbf{q}^{i-1}) + \mathbf{H}_\mathrm{a}\, d\mathbf{q} = \textcolor{red}{\mathbf{u}_a}
\end{array}
\right. & (15) \\[1em]
6:\ \quad \text{Step 8 and 9 of Algorithm 1} \\
7:\ \textbf{end while} \\
8:\ \textbf{return: } \textcolor{green}{\mathbf{y}_e} = \boldsymbol{\delta}_\mathrm{e}(\mathbf{q}^{i-1}) + \mathbf{H}_\mathrm{e}\, d\mathbf{q}\\
\hline
\end{array}
$$
{width=55%, .center}
17 changes: 17 additions & 0 deletions data/algorithms/algorithm3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$$
\begin{array}{ll}
\textbf{Algorithm 3 } \text{Inverse Kinematics obtained by optimization } \textcolor{red}{\mathbf{u}_a} = f^{-1}(\textcolor{green}{\mathbf{y}_e}) \\
\hline
1:\ \text{Initialize } \mathbf{q}^0 = [\mathbf{q}_1^0; \mathbf{q}_2^0] \\
2:\ \text{Step 2 and 3 of Algorithm 1} \\
3:\ \textbf{while } \|\mathbf{q}^i - \mathbf{q}^{i-1}\| > \epsilon \textbf{ do} \\
4:\ \quad \text{Find the residual (like Algorithme 2):} \\
\quad\quad \mathbf{F}(\mathbf{q}^{i-1}) + \mathbf{Mg} + \mathbf{F}_{ext} = \mathbf{b} & (19)\\
5:\ \quad \text{Compute } \mathbf{A} \text{ and } \mathbf{b} \text{ and solve} \\
\quad\quad \left\{ \begin{array}{l} \mathbf{A}\,d\mathbf{q} = \mathbf{b} + \mathbf{H}_a^T \boldsymbol{\lambda}_a \\ \text{subject to} \\ \displaystyle\min_{\boldsymbol{\lambda}_a} \tfrac{1}{2}(\boldsymbol{\delta}_e(\mathbf{q}_{i-1}) + \mathbf{H}_e d\mathbf{q}) - \textcolor{green}{\mathbf{y}_e})^2 \end{array} \right. & (20) \\
6:\ \quad \text{Step 8 and 9 of Algorithm 1} \\
7:\ \textbf{end while} \\
8:\ \textbf{return: } \textcolor{red}{\mathbf{u}_a} = \boldsymbol{\delta}_a(\mathbf{q}^{i-1}) + \mathbf{H}_a\,d\mathbf{q} \\
\hline
\end{array}
$$
Binary file removed data/images/lab1-algorithm1.png
Binary file not shown.
Binary file removed data/images/lab2-algorithm2.png
Binary file not shown.
Binary file removed data/images/lab2-algorithm3.png
Binary file not shown.
11 changes: 10 additions & 1 deletion labs/lab_inversekinematics/sections/2_kinematics.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ Lagrange multiplier $\boldsymbol{\lambda}_{\mathrm{a}}$. Furthermore, the motor
$\boldsymbol{\delta}_{\mathrm{a}}$, is a function of the robot's position $\mathbf{q}$
(which is a concatenation of the leg positions: $\mathbf{q}_1, ..., \mathbf{q}_4$).

![](assets/data/images/lab2-algorithm2.png){width=65%, .center}

#include(assets/data/algorithms/algorithm2.md)

::: spoiler Algorithm 1: Statics of the continuum legs

#include(assets/data/algorithms/algorithm1.md)

:::

<br/>

To compute Equation 15 (in the algorithm above), it is more efficient to proceed with an indirect solution.
We will decompose the movement at each time step by separating the contributions from the force $\mathbf{b}$, which is
Expand Down
10 changes: 9 additions & 1 deletion labs/lab_inversekinematics/sections/3_inversekinematics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ There are several challenges in solving this inverse problem:

To handle these challenges, we typically employ QP optimization techniques.

![](assets/data/images/lab2-algorithm3.png){width=65%, .center}
#include(assets/data/algorithms/algorithm3.md){width=65%, .center}

::: spoiler Algorithm 1: Statics of the continuum legs

#include(assets/data/algorithms/algorithm1.md)

:::

<br/>

With the indirect solving, the optimization presented in equation 20 (in the algorithm above) can be rewriten:

Expand Down
2 changes: 1 addition & 1 deletion labs/lab_models/sections/1_staticanalysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $$

In practice $\mathbf{F}(\mathbf{q})$ being non-linear, the computation of the equilibrium position is obtained by iterative resolution (see algorithm 1 below).

![](assets/data/images/lab1-algorithm1.png){width=65%, .center}
#include(assets/data/algorithms/algorithm1.md)

To model the various legs and their deformations, we propose three types of modeling of these internal forces:

Expand Down
26 changes: 1 addition & 25 deletions labs/labsConfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@
{
"labs": [
{
"name": "introduction"
},
{
"name": "lab_models"
},
{
"name": "lab_inversekinematics"
},
{
"name": "project_pickandplace"
},
{
"name": "lab_design"
},
{
"name": "lab_closedloop"
},
{
"name": "sandbox"
}
]
}
{"labs":[{"name":"introduction"},{"name":"lab_models"},{"name":"lab_inversekinematics"},{"name":"project_pickandplace"},{"name":"lab_design"},{"name":"lab_closedloop"},{"name":"sandbox"},{"name":"Practical1"},{"name":"lab_optimization_firstorder","path":"https://github.com/SofaComplianceRobotics/Emio.lab_optimization_firstorder/archive/refs/heads/main.zip"},{"name":"lab_AI"}]}
Loading