Samo Penic
2022-03-27 b08ee12060d3cfa52b00e1710b3cc49a8f4ab820
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
\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}
 
 
\subsection{Connecting nRF24l01+}
 
For fast communication Nordic Semiconductor chip nRF24l01+ is used. It operates on 2.4 GHz frequency band, supports multiple channels, raw communication with possibilities of ACK/NoACK. The delay of wirelessly transporting the trigger should be minimal with pair of nRF24 where one is designated as transmitter and one as receiver. There is possibility of full duplex communication. No protocol is defined yet, so we have multiple possibilities on implementation.
 
As an advenced feature of the receiving end, there is a posibility to measure round trip of data transfer, therefore, the receiver can calculate the delay caused by the transmission and compensate for it, if the receiver does not need to trigger the event. As an example, this could be implemented when accelerometer is read and should be synchronized with camera frame capture. The receiver can measure acceleration beforehand in short intervals and put it into cyclic buffer. When the trigger is received and knowing the trigger transmission delay and accelerometer reading frequency, we can look up the value for acceleration at the exact time the camera published the event at the transmitter side. With this, we have possibility to minimize trigger delay.
 
nRF24l01 modules are used, where everyting regarding radio is implemented. Module has SPI and power supply pins on its connector. Image of module with its pinout is presented in figure \ref{fig:nrfpinout}.
 
\begin{figure}[htb]
    \begin{center}
        \begin{minipage}{0.45\linewidth}
        \includegraphics[width=0.9\linewidth]{figures/nrf_pinout.png}
        \end{minipage}
        \begin{minipage}{0.45\linewidth}
        \includegraphics[width=0.9\linewidth]{figures/nrf_electrical.png}
 
        \end{minipage}
    \end{center}
    \caption{nRF24l01 module pinout and its electrical characteristics. \cite{nrfInterfacing}}\label{fig:nrfpinout}
\end{figure}
 
 
 
Connection to ESP32 module is as presented in the following table:
 
\begin{tabular}{l | l | l}
nRF pin & ESP32 pin & comment \\ \hline
    1 & GND & Power and signal ground \\
    2 & 3.3V & Power supply \\
    3 & 22 & CE (Chip enable) \\
    4 & 21 & CSN \\
    5 & 18 & SCK \\
    6 & 23 & MOSI \\
    7 & 19 & MISO \\ \hline
\end{tabular}
 
 
 
\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}