Added more documentation

This commit is contained in:
2021-11-11 09:04:28 +01:00
parent 53d198a064
commit 1ccd1e8c63
6 changed files with 105 additions and 3 deletions
+2 -1
View File
@@ -173,4 +173,5 @@
\newacronym{pla}{PLA}{Polylactic Acid, a thermoplastic polyester}
\newacronym{pc}{PC}{Personal Computer}
\newacronym{tbd}{TBD}{To Be Determined}
\newacronym{mpi}{MPI}{Message Passing Interface}
\newacronym{mpi}{MPI}{Message Passing Interface}
\newacronym{dut}{DUT}{Device Under Test}
+1 -1
View File
@@ -165,7 +165,7 @@ More details on the execution thread is provided in Section \ref{sec:csv_exec}.
\myparagraph{Magnetometer Calibration Mode Class \code{CalibrateMagnetometer}}
This class constructs magnetometer calibration interface.
It is placed in the application's main area, its layout is shown in Figure TODO.
It is placed in the application's main area, its layout is shown in Figure \ref{fig:magcalibrationpure}.
This class creates and manages a separate execution thread defined in \code{calibration.py} to preform the calibration without blocking the \gls{ui}.
Hardware control is acquired upon creation of the thread, or an exception is returned otherwise.
More details on the calibration thread is provided in Section \ref{sec:calibration_processes}.
+102 -1
View File
@@ -284,6 +284,61 @@ The \gls{ui} layout is shown in Figure \ref{fig:csvmodepure}, its main elements
\item Monitor execution in console, status display and on devices
\end{enumerate}
\subsubsection*{Ambient Field and Coil Constant Calibration}
\label{sec:ambient_field_calibration}
The application offers calibration tools to determine the exact ambient field with the intention of cancelling it, as well for measuring the test bench's coil constants.
These are both integrated into one application view, depicted in Figure \ref{fig:ambientcalibrationpure}.
All the calibration tools require access to the complete Helmholtz cage hardware, as well as a magnetometer.
These must be connected before starting the test.
For these tests, where the magnetometer itself is not the \gls{dut}, it is recommended to use the IRS's FGM3D reference magnetometer.
Further, an adapter script (\code{fgm3d\_adapter.py}) already exists for this sensor.
For more details on writing adapter scripts and connecting magnetometers, please refer to Section \ref{sec:tcp_api}.
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{media/ambient_calibration_pure}
\caption{Ambient field and coil constant calibration view.}
\label{fig:ambientcalibrationpure}
\end{figure}
After setting up the magnetometer, operation is simple: Click on the buttons to ``Calibrate Ambient Field'' or ``Calibrate Coil Constants''.
This will cause the calibration procedure to start.
The current status will be shown in the progress bar underneath.
After completing, the results of the calibration procedure will be saved into the data fields on the right hand side of Figure \ref{fig:ambientcalibrationpure}.
At this point, the buttons underneath the respective will become available.
These two calibrations are primarily used to determine important application config parameters, namely the ambient field and coil constant as their names imply.
To automatically apply the newly measured values, click ``Save and apply''.
The ``Copy to clipboard'' will put the results table as shown in the \gls{ui} into the system clipboard, from which it can be pasted into software such as Microsoft Excel and LibreOffice Calc.
If semi-raw experiment data is required to verify the program functioning or to apply custom algorithms, it can be exported with the ``Export raw CSV'' button.
\vspace{5mm}
\textbf{Ambient Field Calibration Method}
This calibration uses a P-controller (implemented as PI-controller with $I=0$) to attempt to reach zero as a set point for the magnetometer.
Updates are preformed approximately every half second by default and the calibration executes for 45 seconds.
The procedure consistently achieves zero offsets below \SI{10}{\nano\tesla}.
The ambient field exported by this calibration has been processed by multiplying the current that was required with the current coil constants, thus it is strongly recommended to first preform the coil constant calibration if both are to be executed.
\vspace{5mm}
\textbf{Coil Constant Calibration Method}
The coil consant calibration uses a linear distribution of currents in each axis individually to collect coil consant data.
Each setpoint is held for 3 seconds before being measured, and by default 8 points distributed across \SI{-3}{\ampere} to \SI{3}{\ampere}.
To calculate the individual setpoints corresponding to each setpoint, first the field magnitude compared to the inital conditions is calculated, second the sign is estimated and reapplied, third the field is divided by the applied current.
The final result is the average of all constants.
In addition to the primary coil constant measurement, the maximum setpoints are also sampled once for each axis to calculate the angles between the coils.
This is simply done by calculating the angle between the measured vectors.
To understand the calibration methods in all detail, it is recommended to look at the \code{calibration.py} source file.
\subsubsection*{Magnetometer Calibration}
\label{sec:magnetometer_calibration}
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{media/magnetometer_calibration_pure}
\caption{Magnetometer calibration view.}
\label{fig:magcalibrationpure}
\end{figure}
\subsubsection*{Data Logging Configuration Page}\label{sec:logging_guide}
The application has the ability to log test bench data to a \gls{csv} file.
The data is temporarily stored internally and must be saved to an external file by user request.
@@ -472,4 +527,50 @@ Figure \ref{fig:settingspure} shows a screenshot of the \gls{ui} layout with the
\subsection{TCP Remote Control}
\label{sec:tcp_api}
TODO.
The Helmholtz Control Software offers a TCP automation interface that is opened upon application start-up.
To find out which port is being listened on, look for the corresponding information in the application console, but typically, it will be port 6677.
The commands that are accepted by the TCP interface are documented in Table \ref{tab:tcp_comamnds} and also in the \code{socket\_control.py} source file.
All field commands will implicitly preform the usual safety checks to ensure safe operation.
The commands that are shown must all be terminated with a single {\textbackslash}n (newline) char.
Commands may be split across multiple packets if desired.
Important Note: Before useful commands can be sent, \code{declare\_api\_version} must be called.
The \code{tools} folder in the application git repository contains an example implementation (\code{fgm3d\_adapter.py}) of a magnetometer interface using the TCP socket.
%\small
\begin{longtable}{lp{8.5cm}}
\caption{TCP Remote Control Commands}\\
\hline
\textbf{Command} & \textbf{Description}\\ \hline
\code{set\_raw\_field} [X] [Y] [Z] & Returns: 0 or 1 for success.
Accepts decimal point formatted floats, with or without scientific notation. The float() cast must understand it.
The field units are Tesla.
This causes an additional field of the given strength to be generated, without regard for the pre-existing geomagnetic/external fields. \\ \hline
\code{set\_compensated\_field} [X] [Y] [Z] & Returns: 0 or 1 for success.
Accepts decimal point formatted floats, with or without scientific notation. The float() cast must understand it.
The field units are Tesla.
This causes a field of exactly the given magnitude to be generated by compensating external factors such as the
geomagnetic field. \\ \hline
\code{set\_coil\_currents} [X] [Y] [Z] & Returns: 0 or 1 for success.
Accepts decimal point formatted floats, with or without scientific notation. The float() cast must understand it.
The field units are Ampere.
This establishes the requested current in the individual coils. \\ \hline
\code{magnetometer\_field} [X] [Y] [Z] & Returns: 1.
Accepts decimal point formatted floats, with or without scientific notation. The float() cast must understand it.
The field units are Tesla.
Sets the state of a virtual magnetometer object which mirrors a physical sensor by means of
this command. \\ \hline
\code{get\_api\_version} & Returns: a string uniquely identifying each API version.
This function can be called before \code{declare\_api\_version}. \\ \hline
\code{declare\_api\_version} [version] & Returns: 0 or 1.
Declare the API version the client application was programmed for.
It must be compatible with the current API version. This prevents unexpected behavior by forcing programmers to specify which API they are expecting.
This function must be called before sending HW commands. \\ \hline
\label{tab:tcp_comamnds}
\end{longtable}
%\normalsize
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB