Automatic commit of irc logs
[matches/MCTX3420.git] / reports / final / chapters / Design.tex
index 0294e0d..51f7206 100644 (file)
@@ -1,4 +1,4 @@
-\chapter{Design and Implementation}
+\chapter{Design and Implementation}\label{Design and Implementation}
 
 % BEGIN Sam's section
 
@@ -119,7 +119,7 @@ An alternative safety mechanism involves modification of the script that starts
 \end{figure}
 
 
-\section{Hardware Interfacing}\label{Hardware}
+\section{Hardware Interfacing}\label{Hardware Interfacing}
 
 Figure \ref{pinout.pdf} shows the pin out diagram of the BeagleBone Black. There are many contradictory pin out diagrams available on the internet; this figure was initially created by the software team after trial and error testing with an oscilloscope to determine the correct location of each pin. Port labels correspond with those marked on the BeagleBone PCB. The choice of pin allocations was made by the electrical team after discussion with software when it became apparent that some pins could not be controlled reliably.
 
@@ -155,7 +155,7 @@ Code to set actuator values is located in the \gitref{server}{actuators} subdire
 
 \subsubsection{Relay Controls}
 
-The electrical team employed three relays (model: ) for control over digital devices. The relays are switched using the GPIO outputs of the BeagleBone Black.
+The electrical team employed three relays for control over digital devices. The relays are switched using the GPIO outputs of the BeagleBone Black.
 
 \begin{itemize}
        \item Can select - Chooses which can can be pressurised (0 for strain, 1 for explode)
@@ -168,7 +168,7 @@ The use of a ``can select'' and ``can enable'' means that it is not a software p
 
 \subsubsection{PWM Outputs}
 
-A single PWM output is used to control a pressure regulator (model: ). The electrical team constructed an RC filter circuit which effectively averages the PWM signal to produce an almost constant analogue output. The period of the PWM is $2\text{kHz}$. This actuator has been calibrated, which allows the user to input the pressure value in kPa rather than having to control the PWM duty cycle correctly.
+A single PWM output is used to control a pressure regulator. The electrical team constructed an RC filter circuit which effectively averages the PWM signal to produce an almost constant analogue output. The period of the PWM is $2\text{kHz}$. This actuator has been calibrated, which allows the user to input the pressure value in kPa rather than having to control the PWM duty cycle correctly.
 
 
 \begin{figure}[H]
@@ -179,7 +179,7 @@ A single PWM output is used to control a pressure regulator (model: ). The elect
 \end{figure}
 
 
-\section{Authentication Mechanisms}\label{Authentication}
+\section{Authentication Mechanisms}\label{Authentication Mechanisms}
 
 The \funct{Login_Handler} function (\gitref{server}{login.c}) is called in the main thread when a HTTP request for authentication is received (see Section \ref{Communication}). This function checks the user's credentials and will give them access to the system if they are valid. Whilst we had originally planned to include only a single username and password, changing client requirements forced us to investigate many alternative authentication methods to cope with multiple users.
 
@@ -188,18 +188,18 @@ Several authentication methods are supported by the server; the method to use ca
   \item {\bf Unix style authentication}
 
 
-  Unix like operating systems store a plain text file (/etc/shadow) of usernames and encrypted passwords. To check a password is valid, it is encrypted and then compared to the stored encrypted password. The actual password is never stored anywhere. The /etc/shadow file must be maintained by shell commands run directly from the BeagleBone. Alternatively a web based system to upload a similar file may be created.
+  Unix like operating systems store a plain text file (/etc/shadow) of usernames and encrypted passwords\cite{shadow}. To check a password is valid, it is encrypted and then compared to the stored encrypted password. The actual password is never stored anywhere. The /etc/shadow file must be maintained by shell commands run directly from the BeagleBone. Alternatively a web based system to upload a similar file may be created.
 
   \item {\bf Lightweight Directory Access Protocol (LDAP)}
 
-  LDAP is a widely used data base for storing user information. A central server is required to maintain the LDAP database; programs running on the same network can query the server for authentication purposes.
+  LDAP\cite{ldap, ldap_man} is a widely used data base for storing user information. A central server is required to maintain the LDAP database; programs running on the same network can query the server for authentication purposes.
 
   The UWA user management system (Pheme) employs an LDAP server for storing user information and passwords. The software has been designed so that it can interface with an LDAP server configured similarly to the server on UWA's network. Unfortunately we were unable to gain permission to query this server. However an alternative server could be setup to provide this authentication mechanism for our system.
 
 
   \item {\bf MySQL Database}
 
-        MySQL is a popular and free database system that is widely used in web applications. The ability to search for a user in a MySQL database and check their encrypted password was added late in the design as an alternative to LDAP. There are several existing online user management systems which interface with a MySQL database, and so it is feasible to employ one of these to maintain a list of users authorised to access the experiment. UserCake is recommended, as it is both minimalistic and open source, so can be modified to suit future requirements. We have already begun integration of the UserCake system into the project, however a great deal of work is still required.
+        MySQL\cite{mysql} is a popular and free database system that is widely used in web applications. The ability to search for a user in a MySQL database and check their encrypted password was added late in the design as an alternative to LDAP. There are several existing online user management systems which interface with a MySQL database, and so it is feasible to employ one of these to maintain a list of users authorised to access the experiment. UserCake\cite{UserCake} is recommended, as it is both minimalistic and open source, so can be modified to suit future requirements. We have already begun integration of the UserCake system into the project, however a great deal of work is still required.
 
 
   MySQL and other databases are vulnerable to many different security issues which we did not have sufficient time to fully explore. Care should be taken to ensure that all these issues are addressed before deploying the system.
@@ -210,7 +210,7 @@ Several authentication methods are supported by the server; the method to use ca
 % END Sam's section
 
 
-\section{Server/Client Communication}\label{Communications}
+\section{Server/Client Communication}\label{Server/Client Communication}
 
 % BEGIN Jeremy's section
 
@@ -357,7 +357,7 @@ AJAX requests are essentially web requests made in JavaScript that occur ``behin
 
 Whilst AJAX requests are possible with plain JavaScript, the use of the jQuery library (see Section \ref{jQuery}) greatly simplifies the way in which requests can be made and interpreted.
 
-\section{Alternative Communication Technologies}\label{Alternative Communication}
+\section{Alternative Communication Technologies}\label{Alternative Communication Technologies}
 
 This section attempts to explain the reasoning behind the communication method chosen. This choice was not trivial, as it had to allow for anyone to remotely control the experiment, while imposing as little requirements from the user as possible. These requirements can be summarised by:
 \begin{enumerate}
@@ -394,8 +394,8 @@ Initially, a system known as ``Common Gateway Interface'', or CGI was explored.
        \caption{Block Diagram of a request to a custom web server} 
        \label{custom_webserver.png}
 \end{figure}
-\r
-Another system considered was to build a custom web server (Figure \ref{custom_webserver.png} that used threading, integrating both the control and web components. This option was primarily discarded because it was inflexible to supporting extended services like PHP and TLS encryption. See \href{https://github.com/szmoore/MCTX3420/issues/6}{Issue 6} on GitHub for more information.\r
+
+Another system considered was to build a custom web server (Figure \ref{custom_webserver.png} that used threading, integrating both the control and web components. This option was primarily discarded because it was inflexible to supporting extended services like PHP and TLS encryption. See \href{https://github.com/szmoore/MCTX3420/issues/6}{Issue 6} on GitHub for more information.
 
 \begin{figure}[H]
        \centering
@@ -416,7 +416,7 @@ In comparison, FastCGI (Figure \ref{fastcgi.png}) can be seen as the ``best of b
        \item Consider using X-Accel-Redirect along with UserCake (Section \ref{Authentication}) to make a finer-grained access control system to information such as the system logs
 \end{enumerate}
 
-\section{Server Configuration}
+\section{BeagleBone Configuration}\label{BeagleBone Configuration}
 
 \subsection{Operating system}
 The Beaglebone has been configured to use the Ubuntu operating system. The original operating system was Angstrom, which was unsuitable because it lacked a number of software packages required. Detailed instructions on how to install this operating system exist on the project wiki\cite{mctx3420_wiki}.
@@ -529,7 +529,7 @@ To increase the accuracy in finding the edge, I considered the Canny Edge theore
        \label{canny_edges_noise.png}
 \end{figure}
 
-After the Sensors Team relayed that they were now attaching something to the can in order to measure the change position, I decided to simply stick with the Canny Edge algorithm and implement something similar to what I had in my previous testing.  The figures in appendix A shows the progression of the image through the algorithm.  Figure 2A shows the original image, whereas 2B shows the blurred (with a BLUR value of 5) gray scale image.  Whereas figure 2C shows the image after going through the Canny Edge algorithm with a low threshold of 35.   Figures 3A and 3B both have the same input image, however different input values.  It can be seen how tweaking the values can remove outliers, as figure 3B is skewed to the right due to the outliers.  From figure 4 it can be seen that despite there being no points in the edge in the top half of the image, the edge has still been accurately determined.  
+After the Sensors Team relayed that they were now attaching something to the can in order to measure the change position, I decided to simply stick with the Canny Edge algorithm and implement something similar to what I had in my previous testing.  The images in Figure \ref{canny_demo} shows the progression of the image through the algorithm.  Figure \ref{canny_demo} A shows the original image, whereas \ref{canny_demo}B shows the blurred (with a BLUR value of 5) gray scale image.  Whereas figure \ref{canny_demo}C shows the image after going through the Canny Edge algorithm with a low threshold of 35.   Figures \ref{canny_demo}D and \ref{canny_demo}E both have the same input image, however different input values.  It can be seen how tweaking the values can remove outliers, as figure \ref{canny_demo}E is skewed to the right due to the outliers.  From figure \ref{canny_demo}F it can be seen that despite there being no points in the edge in the top half of the image, the edge has still been accurately determined.  
 
 The testing done shows that given a rough edge with few outliers an edge can be determined, however there is an obvious degree of inaccuracy the greater the variance of the edge. The best solution to this however does not lie in software.  If an edge was used that was straight even at that magnification with a good contrast then the results would be much more accurate (i.e. the accuracy of the dilatometer is currently more dependent on the object used than the software). 
 
@@ -547,8 +547,6 @@ Earlier in the semester we were informed by the Sensors Team that instead of a d
        \item The algorithm can be improved to try and neglect outliers in the edge image; however this is not as necessary if the original object used gives a sufficiently smooth and straight edge.
 \end{itemize}
 
-% END Callum's section
-
 \subsection{Results}
 
 Figure \ref{image_in_api.png} shows an image obtained from one of two dilatometers used in the system setup with collaboration between all teams. The image is of a white Lego tile attached to the can. This image was successfully streamed using the server software, and results of the dilatometer readings were monitored using the same software. Unfortunately we were unable to maintain a constant value for a stationary can, indicating that the algorithm needs further development. Due to a leak in the can seal we were unable to pressurize the can sufficiently to see a noticeable change in the edge position.
@@ -560,8 +558,27 @@ Figure \ref{image_in_api.png} shows an image obtained from one of two dilatomete
        \label{image_in_api.png}
 \end{figure}
 
+\begin{figure}[H]
+       \centering
+
+       \begin{tabular}{cc}
+               \includegraphics[width=0.4\textwidth]{figures/dilatometer_test.jpg} A &
+               \includegraphics[width=0.4\textwidth]{figures/dilatometer_test.jpg} B  \\
+               \includegraphics[width=0.4\textwidth]{figures/dila_blur7thresh36.png} C &
+               \includegraphics[width=0.4\textwidth]{figures/dila_blur5thresh30.png} D \\
+               \includegraphics[width=0.4\textwidth]{figures/dila_blur9thresh35.png} E &
+               \includegraphics[width=0.4\textwidth]{figures/dila_blur9thresh35_2.png} F
+       \end{tabular}
+       \caption{Canny Edge Algorithm in Action}
+       \label{canny_demo}
+\end{figure}
+
+% END Callum's section
+
+
+
 
-\section{Human Computer Interaction and the Graphical User Interface}
+\section{Human Computer Interaction and the Graphical User Interface}\label{Human Computer Interaction and the Graphical User Interface}
 
 % BEGIN James' section
 \subsection{Design Considerations}
@@ -632,7 +649,7 @@ Once a design document was completed a Master Template was created.  Firstly a d
 
 % BEGIN Rowan's section
 
-\section{GUI Design Process}
+\section{GUI Design Process}\label{GUI Design Process}
 
 \subsection{Creation}
 

UCC git Repository :: git.ucc.asn.au