drone-rigide/doc/compte_rendu/presentation.tex
2019-06-07 15:29:39 +02:00

360 lines
12 KiB
TeX

\documentclass[aspectratio=169]{beamer} \usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{minted}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{appendixnumberbeamer}
\definecolor{boxcolor}{HTML}{23373B}
\usetikzlibrary{shapes,arrows}
\tikzstyle{block} = [draw, fill=boxcolor!30, rectangle, minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, fill=boxcolor!30, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]
\usepackage{amsmath,amsmath,amsfonts,amssymb}
\usetheme{metropolis}
\setbeamertemplate{footline}[frame number]
\newcommand*\intervalleEntier[2]{\intervalle{\llbracket}{#1}{#2}{\rrbracket}}
\newcommand*\intervalle[4]{\left#1 #2 \, ; #3 \right#4}
\newcommand*\floor[1]{\left \lfloor{#1}\right \rfloor}
\title{\includegraphics[width=8cm]{LogoCS.png}\\Asservissement rigide de drones}
\author{Hugo \bsc{Levy--Falk} et Joanne \bsc{Steiner}}\institute{CentraleSupélec}
\date{Soutenance de projet}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Introduction}
\begin{frame}{Objectifs du projet}
Asservissement plus "rigide" d'un drone
\begin{itemize}
\item<2-> Stabilité
\item<3-> Rapidité
\end{itemize}
\end{frame}
\begin{frame}{Livrables}
\begin{itemize}
\item Une bibliothèque d'automatique;
\item Un exemple d'asservissement en simple boucle.
\end{itemize}
\end{frame}
\section{Utilisation de la bibliothèque}
\begin{frame}{Pourquoi ?}
\begin{itemize}
\item Faire de l'automatique avec ROS;
\item Utilisable dans des cas plus généraux que l'asservissement d'un drone.
\end{itemize}
\end{frame}
\begin{frame}{Fonctionnement}
\begin{itemize}
\item Script Python permettant de créer des n\oe uds;
\item Fichiers de configuration pour gérer les paramètres dynamiquement;
\item Fichiers launch pour relier les n\oe uds entre eux.
\end{itemize}
\begin{center}
\includegraphics[width=0.3\linewidth]{images/presentation/brique.jpg}
\end{center}
\end{frame}
\begin{frame}{Différents n\oe uds}
\begin{itemize}
\item On a les n\oe uds suivants :
\begin{itemize}
\item \mintinline{python}|ProportionalNode|;
\item \mintinline{python}|SaturateNode|;
\item \mintinline{python}|DerivativeNode|;
\item \mintinline{python}|DifferenciateNode|;
\item \mintinline{python}|SumNode|;
\item \mintinline{python}|InputNode|;
\item \mintinline{python}|RateNode|.
\end{itemize}
\item Calcul de la vitesse du n\oe ud \mintinline{python}|DerivativeNode| grâce à un filtre de \bsc{Savitzky-Golay}.
\end{itemize}
\end{frame}
\begin{frame}{Performances de \bsc{Savitzky-Golay}}
\begin{figure}
\centering
\includegraphics[height=0.7\textheight]{images/realisation/mesure_vitesse_big_quadra.eps}
\caption{Filtre de \bsc{Savitsky-Golay}}
\end{figure}
\end{frame}
\begin{frame}[fragile]{Utilisation du script}
\begin{minted}{bash}
python control_compute.py derivative
python control_compute.py proportional
python control_compute.py sum 3
...
\end{minted}
\end{frame}
\begin{frame}{Utilisation du script}
\includegraphics[width=\linewidth]{images/realisation/control_launch.png}
\end{frame}
\section{Interface avec le drone}
\begin{frame}{Rappels}
\begin{itemize}
\item Objectif : Asservir le drone;
\item Livrable : Une bibliothèque pour faire de l'automatique.
\end{itemize}
\end{frame}
\begin{frame}{Détection des cibles}
\begin{itemize}
\item Idée du script : Détecter les zones d'une couleur choisie;
\item Possibilité de modifier dynamiquement la couleur.
\end{itemize}
\end{frame}
\begin{frame}{Détection du bleu}
\begin{figure}
\centering
\includegraphics[height=0.7\textheight]{images/utilisation/targets.png}
\caption{Cibles bleues}
\end{figure}
\end{frame}
\begin{frame}{Détection du jaune}
\begin{figure}
\centering
\includegraphics[height=0.7\textheight]{images/utilisation/targets_yellow.png}
\caption{Cibles jaunes}
\end{figure}
\end{frame}
\begin{frame}{Interface avec le contrôleur}
\centering
\includegraphics[width=\linewidth]{images/presentation/schema_mesure.png}
\end{frame}
\begin{frame}{Simple boucle : Principe}
\centering
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
% We start by placing the blocks
\node [input, name=input] {};
\node [sum, right of=input, node distance=3cm] (sum) {};
\node [block, right of=sum] (controller) {$C(p)$};
\node [block, right of=controller,
node distance=3cm] (system) {Drone};
% We draw an edge between the controller and system block to
% calculate the coordinate u. We need it to place the measurement block.
\node [output, right of=system, node distance=5cm] (output) {};
\node [block, below of=system] (measure) {Mesure};
% Once the nodes are placed, connecting them is easy.
\draw [draw,->] (input) -- node[pos=0.99] {$+$} (sum);
\draw [->] (sum) -- node {$\epsilon$} (controller);
\draw [->] (controller) -- (system);
\draw [->] (system) -- node [name=y] {position }(output);
\draw [->] (y) |- (measure);
\draw [->] (measure) -| node[pos=0.99] {$-$}
node [near end] {mesure de la position} (sum);
\end{tikzpicture}
\end{frame}
\begin{frame}{Axes du drone}
\includegraphics[height=\textheight]{images/modelisation/drone_axes.png}
\end{frame}
\begin{frame}{Diagramme de bode selon l'axe z et l'angle z}
\begin{figure}[h!]
\centering
\includegraphics[width=0.5\linewidth]{images/modelisation/bode_z.eps}
\caption{Diagramme de Bode simplifié}
$C(p)=K_p+K_i/p + K_d p$
\end{figure}
\end{frame}
\begin{frame}{Diagramme de Bode selon les axes x et y}
\begin{figure}[h!]
\centering
\includegraphics[width=0.5\linewidth]{images/modelisation/bode_u.eps}
\caption{Diagramme de Bode simplifié}
$C(p)=K_p+K_d p$
\end{figure}
\end{frame}
\begin{frame}{Réglage de la simple boucle}
\begin{itemize}
\item Axe z et angle z : Méthode de \bsc{Ziegler-Nichols} en oscillations entretenues, puis ajustements;
\item Axe x et y : Méthode empirique car \bsc{Ziegler-Nichols} trop instable;
\item Amélioration éventuelle avec une double boucle
\end{itemize}
\end{frame}
\section{Conclusion}
\begin{frame}{Conclusion}
\begin{itemize}
\item Bibliothèque fonctionnelle;
\item Asservissement fonctionnelle extensible à d'autres applications;
\item Extension éventuelle à une double boucle.
\end{itemize}
\includegraphics[height=0.5\textheight]{images/presentation/marvin.jpg}
\end{frame}
\appendix
\begin{frame}{Diagramme UML}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{images/realisation/uml.png}
\caption{Diagramme UML}
\label{fig:uml}
\end{figure}
\end{frame}
\begin{frame}{Savitzky-Golay}
\begin{columns}[T]
\begin{column}{.48\textwidth}
$((x_i,y_i))_{i\in\intervalleEntier{1}{n}}$ les $n$ points de la fenêtre
Polynôme $a_0 + a_1 X + \dots + a_k X^k$
\begin{equation*}
\left \|
\begin{pmatrix}
y_1 \\
y_2 \\
\vdots \\
y_n
\end{pmatrix}
-
\begin{pmatrix}
1 & x_1 & x_1 ^2 & \cdots & x_1 ^ k \\
1 & x_2 & x_2 ^2 & \cdots & x_2 ^ k \\
\vdots & \vdots & \vdots & & \vdots \\
1 & x_n & x_n ^2 & \cdots & x_n ^ k
\end{pmatrix}
\cdot
\begin{pmatrix}
a_0 \\
a_1 \\
\vdots \\
a_k
\end{pmatrix}
\right \| ^2
\label{eq:moindrecarres_raw}
\end{equation*}
\end{column}
\begin{column}{.48\textwidth}
En supposant les $x_i$ centrés en 0 et espacés régulièrement d'un pas $h$, et $k$ impair,
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Savitsky-Golay}
\begin{eqnarray*}
L((y_k),(a_k)) &=&
\left \|
\underbrace{
\begin{pmatrix}
y_1 \\
y_2 \\
\vdots \\
y_n
\end{pmatrix}}_{=Y}
-
\underbrace{
\begin{pmatrix}
1 & -\floor{\frac{n}{2}} & \left(-\floor{\frac{n}{2}}\right) ^2 & \cdots & \left(-\floor{\frac{n}{2}}\right) ^ k \\
1 & \left(-\floor{\frac{n-1}{2}}\right) & \left(-\floor{\frac{n-1}{2}}\right) ^2 & \cdots & \left(-\floor{\frac{n-1}{2}}\right) ^ k \\
\vdots & \vdots & \vdots & \vdots & \vdots \\
1 & -1 & \left(-1\right) ^2 & \cdots & \left(-1\right) ^ k \\
1 & 0 & 0 & \cdots & 0 \\
1 & \left(1\right) & \left(1\right) ^2 & \cdots & \left(1\right) ^ k \\
\vdots & \vdots & \vdots & \vdots & \vdots \\
1 & \left(\floor{\frac{n-1}{2}}\right) & \left(\floor{\frac{n-1}{2}}\right) ^2 & \cdots & \left(\floor{\frac{n-1}{2}}\right) ^ k \\
1 & \left(\floor{\frac{n}{2}}\right) & \left(\floor{\frac{n}{2}}\right) ^2 & \cdots & \left(\floor{\frac{n}{2}}\right) ^ k
\end{pmatrix}}_{=M}
\cdot
\underbrace{
\begin{pmatrix}
a'_0 \\
a'_1 \\
\vdots \\
a'_k
\end{pmatrix}}_{=A}
\right \| ^2 \\
\label{eq:moindrecarres}
\end{eqnarray*}
\end{frame}
\begin{frame}{Savitsky-Golay}
\begin{eqnarray}
\frac{\partial L}{\partial (A)}(A) &=& -2 \cdot M^\intercal \cdot (Y - M \cdot A)\\
A &=& \underbrace{(M^\intercal\cdot M)^{-1} \cdot M^\intercal}_{=B} \cdot Y
\end{eqnarray}
Dérivée d'ordre $d$, on convolue le signal par le filtre RIF $[b_1, \dots b_n ]$, avec
\begin{equation}
\forall i \in \intervalleEntier{0}{n}, b_i = B_{d,n-i}
\end{equation}
\end{frame}
\begin{frame}{Méthode de \bsc{Ziegler-Nichols}}
\centering
\begin{tabular}{|c|c|}
\hline
Type de contrôle & Paramètres de réglage \\
\hline
P.I.D & $K_p=0.6 K_u$ $K_i=\frac{T_u}{2}$ $K_d=\frac{T_u}{8}$ \\
\hline
P.I.D peu de dépassement & $K_p=0.33 K_u$ $K_i=\frac{T_u}{2}$ $K_d=\frac{T_u}{3}$ \\
\hline
P.I.D aucun dépassement & $K_p=0.2 K_u$ $K_i=\frac{T_u}{2}$ $K_d=\frac{T_u}{3}$ \\
\hline
\end{tabular}
\end{frame}
\begin{frame}{Double boucle}
\begin{tikzpicture}[auto, node distance=2cm,>=latex',scale=0.7, every node/.style={scale=0.7}]
% We start by placing the blocks
\node [input, name=input] {};
\node [sum, right of=input, node distance=3cm] (sum) {};
\node [block, right of=sum] (controller) {$C_p(p)$};
\node [sum, right of=controller, node distance=3cm] (sum_speed) {};
\node [block, right of=sum_speed] (controller_speed) {$C_v(p)$};
\node [block, right of=controller_speed,
node distance=3cm] (system) {Drone};
\node [block, right of=system,
node distance=3cm] (integrate) {$\frac{1}{p}$};
\node [block, below of=controller_speed] (measurements_speed) {Mesure};
% We draw an edge between the controller and system block to
% calculate the coordinate u. We need it to place the measurement block.
\draw [->] (controller) -- node[pos=0.99] {$+$}
node [near end] {$u$} (sum_speed);
\node [output, right of=system, node distance=5cm] (output) {};
\node [block, below of=measurements_speed] (measurements) {Mesure};
% Once the nodes are placed, connecting them is easy.
\draw [draw,->] (input) -- node {position attendue +} (sum);
\draw [->] (sum) -- node {$\epsilon_p$} (controller);
\draw [->] (sum_speed) -- node {$\epsilon_v$} (controller_speed);
\draw [->] (controller_speed) -- node [name=x] {} (system);
\draw [->] (system) -- node [name=v] {} (integrate);
\draw [->] (measurements_speed) -| node[pos=0.99] {$-$}
node [near end] {mesure de la vitesse} (sum_speed);
\draw [->] (integrate) -- node [name=y] {position }(output);
\draw [->] (v) |- (measurements_speed);
\draw [->] (y) |- (measurements);
\draw [->] (measurements) -| node[pos=0.99] {$-$}
node [near end] {mesure de la position} (sum);
\end{tikzpicture}
\end{frame}
\end{document}