From c1488c2eb92b70999b8b93b641aaf8db9287201a Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Sat, 26 Mar 2022 21:25:48 +0000
Subject: [PATCH] Documenting firmware

---
 /dev/null                                                                    |   33 ----------------
 documentation/project_progress.tex                                           |   83 +++++++++++++++++++++++++++++++++++++++++
 documentation/depth_camera/Whitepaper_Multiple_Camera_Configuration_v1.2.pdf |    0 
 documentation/figures/case_drawing.png                                       |    0 
 documentation/esp32/esp32_datasheet_en.pdf                                   |    0 
 documentation/figures/pinout.png                                             |    0 
 documentation/figures/connector.png                                          |    0 
 documentation/figures/REARmechanical.png                                     |    0 
 documentation/figures/esppinout.png                                          |    0 
 9 files changed, 83 insertions(+), 33 deletions(-)

diff --git a/documentation/depth_camera/.project_progress.tex.swp b/documentation/depth_camera/.project_progress.tex.swp
deleted file mode 100644
index 4ac22fa..0000000
--- a/documentation/depth_camera/.project_progress.tex.swp
+++ /dev/null
Binary files differ
diff --git a/documentation/depth_camera/Whitepaper_Multiple_Camera_Configuration_v1.2.pdf b/documentation/depth_camera/Whitepaper_Multiple_Camera_Configuration_v1.2.pdf
new file mode 100644
index 0000000..26b5327
--- /dev/null
+++ b/documentation/depth_camera/Whitepaper_Multiple_Camera_Configuration_v1.2.pdf
Binary files differ
diff --git a/documentation/depth_camera/project_progress.aux b/documentation/depth_camera/project_progress.aux
deleted file mode 100644
index ae42185..0000000
--- a/documentation/depth_camera/project_progress.aux
+++ /dev/null
@@ -1,10 +0,0 @@
-\relax 
-\citation{productFamilyDatasheet}
-\citation{productFamilyDatasheet}
-\@writefile{toc}{\contentsline {section}{\numberline {1}Camera}{1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}Model and make}{1}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Mechanical specifications}{1}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Rear of the Intel RealSense Depth Camera D455. All units in millimeters. Taken from \cite  {productFamilyDatasheet}.}}{1}\protected@file@percent }
-\newlabel{fig:rearmechanical}{{1}{1}}
-\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Drawing of the case done in FreeCAD 0.19.}}{2}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Extension connector pinout}{2}\protected@file@percent }
diff --git a/documentation/depth_camera/project_progress.log b/documentation/depth_camera/project_progress.log
deleted file mode 100644
index e4f36a0..0000000
--- a/documentation/depth_camera/project_progress.log
+++ /dev/null
@@ -1,141 +0,0 @@
-This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2020.5.19)  26 MAR 2022 21:27
-entering extended mode
- restricted \write18 enabled.
- %&-line parsing enabled.
-**project_progress.tex
-(./project_progress.tex
-LaTeX2e <2020-02-02> patch level 2
-L3 programming layer <2020-02-14>
-(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
-Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
-(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
-File: size12.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
-)
-\c@part=\count167
-\c@section=\count168
-\c@subsection=\count169
-\c@subsubsection=\count170
-\c@paragraph=\count171
-\c@subparagraph=\count172
-\c@figure=\count173
-\c@table=\count174
-\abovecaptionskip=\skip47
-\belowcaptionskip=\skip48
-\bibindent=\dimen134
-)
-(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
-Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)
-
-(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
-Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
-\KV@toks@=\toks14
-)
-(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
-Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)
-
-(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
-Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
-)
-(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
-File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
-)
-Package graphics Info: Driver file: pdftex.def on input line 105.
-
-(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
-File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
-))
-\Gin@req@height=\dimen135
-\Gin@req@width=\dimen136
-)
-(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
-File: l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode
-\l__kernel_color_stack_int=\count175
-\l__pdf_internal_box=\box45
-)
-(./project_progress.aux)
-\openout1 = `project_progress.aux'.
-
-LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
-LaTeX Font Info:    ... okay on input line 3.
-
-(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
-[Loading MPS to PDF converter (version 2006.09.02).]
-\scratchcounter=\count176
-\scratchdimen=\dimen137
-\scratchbox=\box46
-\nofMPsegments=\count177
-\nofMParguments=\count178
-\everyMPshowfont=\toks15
-\MPscratchCnt=\count179
-\MPscratchDim=\dimen138
-\MPnumerator=\count180
-\makeMPintoPDFobject=\count181
-\everyMPtoPDFconversion=\toks16
-) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
-Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
-Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
-85.
-
-(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
-File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
-e
-))
-<figures/REARmechanical.png, id=1, 439.6425pt x 728.7225pt>
-File: figures/REARmechanical.png Graphic file (type png)
-<use figures/REARmechanical.png>
-Package pdftex.def Info: figures/REARmechanical.png  used on input line 14.
-(pdftex.def)             Requested size: 439.64142pt x 728.72072pt.
-
-
-LaTeX Warning: Citation `productFamilyDatasheet' on page 1 undefined on input l
-ine 16.
-
-
-LaTeX Warning: Citation `productFamilyDatasheet' on page 1 undefined on input l
-ine 16.
-
-<figures/case_drawing.png, id=3, 1038.88126pt x 507.8975pt>
-File: figures/case_drawing.png Graphic file (type png)
-<use figures/case_drawing.png>
-Package pdftex.def Info: figures/case_drawing.png  used on input line 23.
-(pdftex.def)             Requested size: 234.00238pt x 114.396pt.
-[1
-
-{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./figures/REARmechanical.p
-ng>] [2 <./figures/case_drawing.png>] (./project_progress.aux)
-
-LaTeX Warning: There were undefined references.
-
-
-LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
-
- ) 
-Here is how much of TeX's memory you used:
- 1152 strings out of 482527
- 17154 string characters out of 5948378
- 246255 words of memory out of 5000000
- 16253 multiletter control sequences out of 15000+600000
- 534154 words of font info for 30 fonts, out of 8000000 for 9000
- 395 hyphenation exceptions out of 8191
- 30i,7n,29p,527b,258s stack positions out of 5000i,500n,10000p,200000b,80000s
-</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></us
-r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb>
-Output written on project_progress.pdf (2 pages, 136467 bytes).
-PDF statistics:
- 24 PDF objects out of 1000 (max. 8388607)
- 13 compressed objects within 1 object stream
- 0 named destinations out of 1000 (max. 500000)
- 11 words of extra memory for PDF output out of 10000 (max. 10000000)
-
diff --git a/documentation/depth_camera/project_progress.pdf b/documentation/depth_camera/project_progress.pdf
deleted file mode 100644
index 278bbb3..0000000
--- a/documentation/depth_camera/project_progress.pdf
+++ /dev/null
Binary files differ
diff --git a/documentation/depth_camera/project_progress.tex b/documentation/depth_camera/project_progress.tex
deleted file mode 100644
index 6e4458e..0000000
--- a/documentation/depth_camera/project_progress.tex
+++ /dev/null
@@ -1,33 +0,0 @@
-\documentclass[12pt]{article}
-\usepackage{graphicx}
-\begin{document}
-\section{Camera}
-\subsection{Model and make}
-
-Intel Realsense D455
-
-\subsection{Mechanical specifications}
-At the rear of the camera there are two M4 holes for mounting additional modules to the camera. The mechanical drawing is not that clear about the hole size, since there is also a mention of M3 at the same drawing. The part of the mechanical drawing regarding the back of the camera is presented in figure \ref{fig:rearmechanical}.
-
-\begin{figure}[bth]
-	\begin{center}
-\includegraphics[angle=-90, origin=c, width=0.6\linewidth]{figures/REARmechanical.png}
-	\end{center}
-	\caption{Rear of the Intel RealSense Depth Camera D455. All units in millimeters. Taken from \cite{productFamilyDatasheet}.}\label{fig:rearmechanical}
-\end{figure}
-
-The case was drawn with open source 3d cad software FreeCAD version 0.19. The size of the case is approx 2 mm larger as camera back side in both dimensions and is 12 mm thick, allowing enough space for mounting the ESP32 board and nRF24l01 module. The holes for synchronization cables from camera and output sinchronization are of diameter 3 mm. They are positioned in such a way, that they do not pose any mechanical problems for assembly. Improvement would be to put connectors to the case. Which ones?
-
-\begin{figure}
-	\begin{center}
-		\includegraphics[width=0.6\linewidth]{figures/case_drawing.png}
-	\end{center}
-	\caption{Drawing of the case done in FreeCAD 0.19.}
-\end{figure}
-
-
-\subsection{Extension connector pinout}
-
-
-\end{document}
-
diff --git a/documentation/esp32/esp32_datasheet_en.pdf b/documentation/esp32/esp32_datasheet_en.pdf
new file mode 100644
index 0000000..457470b
--- /dev/null
+++ b/documentation/esp32/esp32_datasheet_en.pdf
Binary files differ
diff --git a/documentation/depth_camera/figures/REARmechanical.png b/documentation/figures/REARmechanical.png
similarity index 100%
rename from documentation/depth_camera/figures/REARmechanical.png
rename to documentation/figures/REARmechanical.png
Binary files differ
diff --git a/documentation/depth_camera/figures/case_drawing.png b/documentation/figures/case_drawing.png
similarity index 100%
rename from documentation/depth_camera/figures/case_drawing.png
rename to documentation/figures/case_drawing.png
Binary files differ
diff --git a/documentation/figures/connector.png b/documentation/figures/connector.png
new file mode 100644
index 0000000..b806c5b
--- /dev/null
+++ b/documentation/figures/connector.png
Binary files differ
diff --git a/documentation/figures/esppinout.png b/documentation/figures/esppinout.png
new file mode 100644
index 0000000..f039277
--- /dev/null
+++ b/documentation/figures/esppinout.png
Binary files differ
diff --git a/documentation/figures/pinout.png b/documentation/figures/pinout.png
new file mode 100644
index 0000000..3113016
--- /dev/null
+++ b/documentation/figures/pinout.png
Binary files differ
diff --git a/documentation/project_progress.tex b/documentation/project_progress.tex
new file mode 100644
index 0000000..4227987
--- /dev/null
+++ b/documentation/project_progress.tex
@@ -0,0 +1,83 @@
+\documentclass[12pt]{article}
+\usepackage{graphicx}
+\begin{document}
+\section{Camera}
+\subsection{Model and make}
+
+Intel Realsense D455
+
+\subsection{Mechanical specifications}
+At the rear of the camera there are two M4 holes for mounting additional modules to the camera. The mechanical drawing is not that clear about the hole size, since there is also a mention of M3 at the same drawing. The part of the mechanical drawing regarding the back of the camera is presented in figure \ref{fig:rearmechanical}.
+
+\begin{figure}[bth]
+	\begin{center}
+\includegraphics[angle=-90, origin=c, width=0.6\linewidth]{figures/REARmechanical.png}
+	\end{center}
+	\caption{Rear of the Intel RealSense Depth Camera D455. All units in millimeters. Taken from \cite{productFamilyDatasheet}.}\label{fig:rearmechanical}
+\end{figure}
+
+The case was drawn with open source 3d cad software FreeCAD version 0.19. The size of the case is approx 2 mm larger as camera back side in both dimensions and is 12 mm thick, allowing enough space for mounting the ESP32 board and nRF24l01 module. The holes for synchronization cables from camera and output sinchronization are of diameter 3 mm. They are positioned in such a way, that they do not pose any mechanical problems for assembly. Improvement would be to put connectors to the case. Which ones?
+
+\begin{figure}
+	\begin{center}
+		\includegraphics[width=0.6\linewidth]{figures/case_drawing.png}
+	\end{center}
+	\caption{Drawing of the case done in FreeCAD 0.19.}
+\end{figure}
+
+
+\subsection{Extension connector pinout}
+
+For multicamera synchronization, the external senzor connector is placed at the top side wall of the camera. The 9 pin JST connector with manufacturer part number SM09B-SRSS TB(LF)(SN) with 1 mm pitch is used and is show in figure \ref{fig:connector}.
+
+
+\begin{figure}[htb]
+	\begin{center}
+		\includegraphics[width=0.4\linewidth]{figures/connector.png}
+	\end{center}
+	\caption{Connector for sync signal. Taken from \cite{productFamilyDatasheet}. }\label{fig:connector}
+\end{figure}
+
+
+The connector has pinout shown in the data table. According to the \cite{productFamilyDatasheet}, pins 5 and 9 shoud be used for synchronization. From the pinout, pin number 8 could be used to power up electronics. However, no data about electrical characteristics of power supply is given (max current?).
+ 
+
+
+\begin{figure}[htb]
+	\begin{center}
+		\includegraphics[width=0.7\linewidth]{figures/pinout.png}
+	\end{center}
+	\caption{Connector pinout. Taken from \cite{productFamilyDatasheet}.}\label{fig:pinout}
+\end{figure}
+
+
+For multi-camera case, one camera could be initialized as master and the rest configured as slave. Alternatively an external signal generator can also be used as the master trigger with all cameras set to slave mode. When applying an external sync pulse, the HW SYNC input requires a 100 microsecond positive pulse at the nominal camera frame rate, 33.33 ms for a 30Hz frame rate for example. Inputs are high impedance, 1.8V CMOS voltage levels.
+
+However, it is important to make sure to use a high resolution signal generator. The frequency of the signal generator needs to exactly match the sensor frame rate. For example, if the sensor is set up as 30 fps, the real frame rate may be 30.015 fps. You may need to use an oscilloscope to measure the real frame and configure the signal generator to the same frequency.
+
+For this reason, it may be better to just use one additional camera as master sync signal generator. \cite{whitesheet}
+
+\section{ESP32 controller}
+
+
+\begin{figure}[htb]
+	\begin{center}
+		\includegraphics[width=\linewidth]{figures/esppinout.png}
+	\end{center}
+	\caption{ESP32 pinout.}\label{fig:esppinout}
+\end{figure}
+
+
+\section{Firmware}
+
+\subsection{Energy conservation}
+
+WiFi.mode(WIFI\_OFF);
+btStop();
+
+\subsection{Input trigger and interrupt}
+
+https://lastminuteengineers.com/handling-esp32-gpio-interrupts-tutorial/
+
+\end{document}
+

--
Gitblit v1.9.3