Master's thesis - Multi-purpose system for measuring electrical power supplied by electric sockets
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
latex-masters-thesis/mainpart.tex

79 lines
7.5 KiB

\section{Realisation}
The manufactured client node has been inserted into the enclosure containing an European mains socket (female) on one side and an European mains plug (male) on the other side, forming a man-in-the-middle adaptor, that can be non-invasively put between wall socket and an appliance. The result can be observed in figure \ref{f:project_inside}.
\begin{figure}[ht!]
\centering
\includegraphics[width=.7\textwidth,angle=0]{project_inside}
\caption{The view into the client node's enclosure, before the final assembly, exposing top side of the board containing linear transformer T1 (green), mains connectors J1 and J2 (blue), a fuse holder for F1 (yellow-ish), a relay K1 (white) and an ESP-12E module}\label{f:project_inside}
\end{figure}
\begin{figure}[]
\centering
\includegraphics[width=.7\textwidth,angle=0]{project_inside}
\caption{The view onto a fully assembled client node}\label{f:project_outside}
\end{figure}
\subsection{Discovered problems}
After a few test runs performed on an assembled client node, the first problem became obvious: the node's application processor (contained inside of the ESP-12E module) starts erratically, when the node is plugged into socket. Investigations of the supply voltage under the oscilloscope shows no difference in voltage surges during the boot-up, either if the processor starts or not, suggesting a firmware problem too. The first 220ms of power line inspection can be seen in the figure \ref{f:oscilloscope}, showing a voltage fluctuations caused by current surges from the processor starting. However, this problem does not occur, when the processor is powered from external source via J3, but otherwise makes the node unreliable to use.
\begin{figure}[ht!]
\centering
\includegraphics[width=1\textwidth,angle=0]{oscilloscope}
\caption{The power line of the ESP-12E inspected during the boot-up by the oscilloscope - it looks the same either if the processors boots, or it doesn't, suggesting the possible occurence of the ESP8266 firmware problem}\label{f:oscilloscope}
\end{figure}
Ignoring the boot-up problem, the client node is sort of working as indented, apart from one huge problem with the MAX78615 \gls{ic}, that was not apparent during the design stage: the \gls{spi} protocol only allows for 6 bit long memory addressing, enabling only the first 64 words of the memory to be accessed, leaving the 104 words out of 186 completely inaccessible. As a result, from the required data, only RMS Voltage and RMS Current can be obtained. All the data depending on phase shift, namely real power, reactive power and power factor are not accessible.
The \gls{spi} limitation obviously cripples the node's functionality. The protocol was chosen, because the data-sheet for the MAX78615 suggested it as the only way to obtain the instantaneous measurements, as discussed back in the sub-chapter \ref{ss:schematic_pcb}. Although the instantaneous measurements are not required, there was no reason to not enable this feature in the design stage. The fact, that such a limitation exists was observed too late.
Requesting help from the technical support of the \gls{ic} manufacturer, the Maxim Integrated, did not help resolve or at least minimize the damage. They responded, that they are no longer supporting the part in question, because whole power measurement department was sold to another manufacturer based in China, Silergy Corp in March 2016.
There are multiple, rather cosmetic issues, that does not affect the functionality of the board, but are imposing small physical troubles. They include the following:
\begin{itemize}
\item The J3 header is wrong pitch (2mm instead of 2,54mm)
\item The mounting holes are too small diameter
\item The longer side of the board is 1mm wider than desired, it doesn't fit easily into the enclosure
\end{itemize}
\subsection{Data representation within the web interface}
Since there exists a possibility to read the RMS Current drawn by the appliance at measured RMS Voltage, at least the apparent power can be obtained by multiplying it, described in deeper detail back in a sub-chapter \ref{ss:ac_power}.
Having something to work with gives opportunity to continue the work, despite the fact that the desired real power will not be obtained. Client node makes statistical median of the measured current and voltage and every 10 seconds sends them to the could database, creating a data stream. The sample of the stream can be seen in the table \ref{t:cloud_samples}. The timestamp is in the internal format, allowing transformations to any other desired format easily.
\setlength{\tabcolsep}{.5em}
\begin{table}[ht!]
\centering
\caption{Sample of the data of the measurements stored in the cloud database, showing 10 successive samples}
\label{t:cloud_samples}
\begin{tabular}{|r|r|r|}
\hline
\multicolumn{1}{|c|}{\textbf{current}} & \multicolumn{1}{c|}{\textbf{voltage}} & \multicolumn{1}{c|}{\textbf{timestamp}} \\ \hline
1.0821 & 237.1633 & 2016-04-19T16:26:53.834Z \\ \hline
1.2323 & 237.0149 & 2016-04-19T16:26:41.787Z \\ \hline
1.0335 & 234.3102 & 2016-04-19T16:26:31.168Z \\ \hline
1.6476 & 233.5277 & 2016-04-19T16:26:19.157Z \\ \hline
1.0879 & 235.6132 & 2016-04-19T16:26:08.485Z \\ \hline
1.2149 & 238.0802 & 2016-04-19T16:25:57.706Z \\ \hline
1.1474 & 237.1673 & 2016-04-19T16:25:45.881Z \\ \hline
0.9841 & 238.3774 & 2016-04-19T16:25:35.115Z \\ \hline
0.9922 & 238.8315 & 2016-04-19T16:25:23.355Z \\ \hline
0.9598 & 236.3844 & 2016-04-19T16:25:12.715Z \\ \hline
\end{tabular}
\end{table}
The data from the could data stream are then visualised on the server node via plotting library, provided by GoogleAPIs. The web interface can be accessed via \texttt{http://vameter.ddns.net}, a \gls{ddns} redirect service provided by \texttt{http://no-ip.com}. It traslates the \gls{dns} to the \gls{ip} of the server node on the local network. If there were multiple client nodes, and the \gls{ip} of the server node should change, this way all of them would be updated. The illustrative results can be seen in the figure \ref{f:plot_preview}. The mentioned apparent power is obtained by multiplying current and voltage, as has been already stated, so these values are not stored or displayed explicitly.
\begin{figure}[ht!]
\centering
\includegraphics[width=1\textwidth,angle=0]{plot_preview}
\caption{The preview of the visualised data from the data stream displaying 14 hours of data; it can be seen when the appliance was in standby mode (red) or the periodical fluctuations of the mains voltage (blue)}\label{f:plot_preview}
\end{figure}
The web interface also contains a button for shutting the appliance on or off (by controlling the electromechanical relay K1). It consists of simple ON/OFF button that changes its value accordingly to the relay's state. It also uses the mentioned \gls{ddns} service to contact the server node.