From a89e0331bb472662dc5ee156df00fe1e7d770417 Mon Sep 17 00:00:00 2001
From: Thomas Lambert <t.lambert@uliege.be>
Date: Tue, 4 Oct 2022 19:33:27 +0200
Subject: [PATCH] feat(esc): add ESC base report

---
 esc/esc_programming.tex | 255 ++++++++++++++++++++++++++++++++++++++++
 esc/latexmkrc           |  26 ++++
 style/definitions.sty   |  44 +++++++
 3 files changed, 325 insertions(+)
 create mode 100644 esc/esc_programming.tex
 create mode 100644 esc/latexmkrc
 create mode 100644 style/definitions.sty

diff --git a/esc/esc_programming.tex b/esc/esc_programming.tex
new file mode 100644
index 0000000..f37b7d8
--- /dev/null
+++ b/esc/esc_programming.tex
@@ -0,0 +1,255 @@
+% -----------------------------------------------------------------------------
+% This report details the ESC setting and telemetry procedures.
+%
+% Author: Thomas Lambert <t.lambert@uliege.be>
+% ULiege - Aeroelasticity and Experimental Aerodynamics
+% https://gitlab.uliege.be/thlamb/MechaRaptor-docs
+%
+% License: CC-BY-SA-4.0
+% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
+% International License (https://creativecommons.org/licenses/by-sa/4.0/)
+% ------------------------------------------------------------------------------
+
+\documentclass[
+  paper=A4,               % paper size
+  twoside=false,          % oneside or twoside printing
+  openright,              % chapter headings on right side
+  parskip=half,           % spacing value / method for paragraphs
+  chapterprefix=true,     % prefix for chapter marks
+  11pt,                   % font size
+  headings=large,         % size of headings
+  bibliography=totoc,     % include bib in toc
+  listof=totoc,           % include listof entries in toc
+  titlepage=false,        % own page for each title page
+  captions=tableabove,    % display table captions above the float env
+  chapterprefix=false,    % do not display a prefix for chapters
+  appendixprefix=false,   % do not display a prefix for appendix chapter
+  draft                   % currently in draft mode
+]{scrarticle}
+
+% ==============================================================================
+%                                PACKAGES
+% ==============================================================================
+\usepackage{booktabs}  % Better looking tables
+\usepackage[inline, marginclue]{fixme} % For fixme messages in text
+\fxsetup{theme=color}
+
+% My custom packages (see ../style/)
+\usepackage{definitions}
+
+% ==============================================================================
+%                                METADATA
+% ==============================================================================
+
+\title{ESC Setting and Telemetry}
+\subtitle{MechaRaptor}
+\author{Thomas Lambert}
+
+
+% ==============================================================================
+%                             BEGIN DOCUMENT
+% ==============================================================================
+\begin{document}
+\maketitle
+
+\listoffixmes
+
+\section{Introduction}
+The present document lists all the general settings programmed in the Engine
+Speed Controller (ESC) \jetispin. These settings must be configured using the
+\jetibox. The values selected for each setting ensure the proper operation of
+the motor and provide the best reliability during the operation of the
+\MR.
+
+Normally the ESC settings should only be modified at the very beginning of the
+\MR design usage and should stay the same during all the experiments. This
+report is just a way to trace everything should we start all over again or
+re-use the ESC in a separate project.
+
+\section{Safety precautions}
+\danger The \jetibox automatically switches in Telemetry mode if it detects any
+input from the throttle. This means that \textbf{the engine will start as in
+regular conditions even when connected to the \jetibox, if the Arduino send
+any signal}.
+
+Connecting and using the \jetibox requires the operator to stand in direct
+vicinity of the motor. It is therefore of paramount importance to ensure that
+\begin{itemize}
+  \item \textbf{the motor axis is not linked to any moving element}
+(gearbox, wings), or
+\item \textbf{the motor cannot be turned on inadvertently},
+by disconnecting the signal output from the Arduino.
+\end{itemize}
+Ideally both precautions should be followed in the same time.
+
+Please refer to the complete \MR Safety Assessment Report for further details.
+
+
+\section{Telemetry}
+The \jetibox can be used as a telemetry system during normal operation of the
+motor. While this should not be used when the model is in the wind
+tunnel\footnote{Not really needed/useful and not enough space to put the
+\jetibox inside the fuselage.}, the telemetry could provide valuable insight
+during the first programming steps of the ESC.
+
+\subsection{Safety procedure}
+The telemetry can be used in live on the operating motor to check all its
+parameters. \textbf{This is the most dangerous way of operation} as it requires
+both the motor to be running and the operator to stand close to the system. To
+ensure maximal safety, this should be reserved for analysing the motor in
+isolation on a test bench, not integrated in the \MR.
+
+\begin{enumerate}
+  \item Unmount the motor from the \MR and secure it to a test rig (a vice);
+  \item Ensure the surroundings are clear of any loose object that may come
+    in contact with the motor or its shaft;
+  \item Ensure that the operator stands as far as possible from the motor and is
+    not aligned with the motor lateral direction.
+\end{enumerate}
+
+
+\subsection{Telemetry procedure}
+To begin a test run using the \jetibox for telemetry:
+
+\fxwarning{Need review}
+
+\begin{enumerate}
+  \item Ensure the safety precautions are all conducted.
+  \item Connect the \jetibox to the ESC.
+  \item Turn on the power supply.
+  \item Turn on the Arduino.
+  \item Operate the motor as usual.
+\end{enumerate}
+
+\fxnote{Is there also a specific procedure for after-run analysis?}
+
+\section{ESC settings modifications}
+This section concerns the modifications of the ESC settings using the \jetibox.
+
+\subsection{Safety precautions}
+
+Modifying ESC settings can either be done separately on a test bench
+(preferably) or in place with everything mounted in the \MR.
+
+\danger As explained before, if any input is measured on the signal pin from the
+Arduino, the \jetibox will fall back in telemetry mode and the engine will
+start.
+
+\begin{enumerate}
+  \item \textbf{Disconnect the signal pin from the Arduino} completely to avoid
+    any possible start of the motor;
+  \item If possible, \textbf{disconnect the motor from the gearbox or unmount
+    the wings} as an extra safety measure.
+\end{enumerate}
+
+\subsection{Setting procedure}
+
+\fxfatal{Write proper setting procedure}
+\begin{enumerate}
+  \item Connect
+  \item Connect
+  \item Turn on the power supply
+  \item Navigate the menus using the arrows on the \jetibox\footnote{The diagram
+      for the \jetibox menus is attached in appendix to ease navigation during
+    the settings.}
+\end{enumerate}
+
+Once everything is properly set, disconnect the power supply, the \jetibox, and
+the Arduino from the ESC.
+
+
+\subsection{List of settings}
+The \jetispin allows two mode of programming: automatic or manual. The automatic
+settings are presets from the manufacturer designed for different types of
+applications. The manual settings allow a more granular control of the ESC
+operation.
+
+\subsubsection{Auto Set}
+In automatic setting, the only parameter to set is the operating mode. As the
+\MR is supposed to flap at a constant frequency under varying loads, the
+\fxwarning*{Are we sure?}{most suitable operating mode is \textbf{HELI
+Const.RPM}}.
+
+This mode will ensure that the motor keeps the rotating speed imposed by the
+controller (Arduino) no matter the load it is subjected to.
+
+\textit{The automatic mode should only be employed for preliminary testing and
+validation of the prototype, not for the aerodynamic test campaign in the Wing
+Tunnel. In that case, the more precise manual mode should be preferred}.
+
+\subsubsection{Manual Set}
+In manual mode, individual settings can be tweaked. The following table
+describes all the values that should be set for the proper operation of the
+engines in the \MR.
+
+\textit{The setting procedure will be conducted following the diagram provided
+by \textsc{JETI}. As some settings are not part of the flowchart used for
+\MR, they will be left out (e.g., number of battery cells, etc.).}
+
+\fxfatal{Complete table}
+
+\begin{table}[ht]
+  \caption{Values for the manual settings}
+  \label{tab:manualsettings}
+  \begin{center}
+    \begin{tabular}{@{} p{0.22\linewidth}  p{0.2\linewidth}  p{0.55\linewidth}
+      @{}}
+      \toprule
+      \textbf{Setting} & \textbf{Value} & \textbf{Description} \\
+      \midrule
+      \textbf{Temperature protection} &  &  \\
+      \hline
+      \textbf{Brake} &  &  \\
+      \hline
+      \textbf{Operation Mode} & Hell Normal & Could be Hell Auto or Hell
+      canst.RPM \\
+      \hline
+      \textbf{Motor pole No.} &  &  \\
+      \hline
+      \textbf{Gear} &  &  \\
+      \hline
+      \textbf{Set Max. Rotor RPM} &  &  \\
+      \hline
+      \textbf{Set Min. Rotor RPM} &  &  \\
+      \hline
+      \textbf{Sensitivity} &  &  \\
+      \hline
+      \textbf{Autorotation} &  &  \\
+      \hline
+      \textbf{Autorotation Acceleration} &  &  \\
+      \hline
+      \textbf{Timing Auto 0$^\circ$-30$^\circ$} &  &  \\
+      \hline
+      \textbf{Frequency} &  &  \\
+      \hline
+      \textbf{Acceleration} &  &  \\
+      \hline
+      \textbf{Accumulator Type} & Direct Voltage & DC power supply \\
+      \hline
+      \textbf{Off Voltage Set} &  & \\
+      \hline
+      \textbf{Cut off} &  & \\
+      \hline
+      \textbf{Initial point auto} &  & \\
+      \hline
+      \textbf{End Point} &  & \\
+      \hline
+      \textbf{Auto inc. End point ON from...} &  & \\
+      \hline
+      \textbf{Throttle curve} &  & \\
+      \hline
+      \textbf{Rotation} &  & \\
+      \hline
+      \textbf{Start-up Power} &  & \\
+      \hline
+      \textbf{Timing Monitor} &  & \\
+      \hline
+      \textbf{Setting thru R/C} &  & \\
+      \bottomrule
+    \end{tabular}
+  \end{center}
+\end{table}
+
+
+
+\end{document}
diff --git a/esc/latexmkrc b/esc/latexmkrc
new file mode 100644
index 0000000..75190fd
--- /dev/null
+++ b/esc/latexmkrc
@@ -0,0 +1,26 @@
+# LaTeXmk compiler configuration file
+# https://mirror.koddos.net/CTAN/support/latexmk/latexmk.pdf
+
+# Set master documents
+@default_files = ('esc_programming.tex');
+
+# Set paths for packages, figures and bibliography
+ensure_path('TEXINPUTS', '../style//','../figures//');
+# Set path for bibliography style
+ensure_path('BSTINPUTS', '../style/');
+
+# Set compiler option (same option for all compilers)
+set_tex_cmds('-synctex=1 -interaction=nonstopmode -file-line-error %O %S');
+$pdf_mode = 4;  # 1: use pdflatex, 4: use lualatex, 5 use xelatex
+
+# Delete bbl files without checking if bib is available (dangerous when bib files are not available)
+$bibtex_use = 2;
+
+# Extra extensions to clean
+$clean_ext = 'synctex.gz synctex.gz(busy) run.xml tex.bak bbl bcf fdb_latexmk run tdo %R-blx.bib lox nlg nlo nls';
+
+# Make nomenclature
+add_cus_dep("nlo", "nls", 0, "nlo2nls");
+sub nlo2nls {
+    system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg");
+}
diff --git a/style/definitions.sty b/style/definitions.sty
new file mode 100644
index 0000000..9d1bff6
--- /dev/null
+++ b/style/definitions.sty
@@ -0,0 +1,44 @@
+% ------------------------------------------------------------------------------
+% Custom definitions and commands to simplify the writing of the reports and
+% and ensure coherence in the style employed.
+%
+% Author: Thomas Lambert <t.lambert@uliege.be>
+% ULiege - Aeroelasticity and Experimental Aerodynamics
+% License: CC-BY-SA-4.0
+% https://gitlab.uliege.be/thlamb/MechaRaptor-docs
+% ------------------------------------------------------------------------------
+
+% Packages required
+% ***********************************************
+\RequirePackage{xspace}
+\RequirePackage{fontawesome5}
+\RequirePackage{xcolor}
+
+
+% --- Better colors ------------------------------------------------------------
+\definecolor{myRed}{RGB}{230,45,49}
+\definecolor{myGreen}{RGB}{40,155,56}
+\definecolor{myOrange}{RGB}{248,170,0}
+
+
+% --- Brands, software and generic names ---------------------------------------
+\newcommand\jetispin{\textsc{Jeti Spin Pro 75 Opto}\xspace}
+\newcommand\jetibox{\textsc{JetiBox}\xspace}
+\newcommand\MR{\textsf{MechaRaptor}\xspace}
+
+
+% --- URLs ---------------------------------------------------------------------
+
+% --- Shortcuts ----------------------------------------------------------------
+
+\newcommand{\latin}[1]{\textit{#1}}
+\newcommand{\ie}{\latin{i.e.},\xspace}
+\newcommand{\eg}{\latin{e.g.},\xspace}
+\newcommand{\etal}{\latin{et~al.}\xspace}
+
+
+% --- Pictograms ---------------------------------------------------------------
+\newcommand{\danger}{\textcolor{myOrange}{\faExclamationTriangle}\xspace}
+\newcommand{\fire}{\textcolor{myRed}{\faFire}\xspace}
+\newcommand{\bolt}{\textcolor{myRed}{\faBolt}\xspace}
+\newcommand{\injury}{\textcolor{myRed}{\faUserInjured}\xspace}
-- 
GitLab