Engineering notebook, outlining the design process of an autonomous robot competing in the 2016 TYESA/ASEE robot parade competition.
\documentclass[]{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{pgfmath}
\usepackage{amsmath}
\pagestyle{fancy}
\fancyhf{}
\newcommand*\mean[1]{\bar{#1}}
\def\dates{{"1/5/2016","1/8/2016","2/10/2016","2/13/2016","2/16/2016","2/27/2016","3/12/2016","3/16/2016","3/20/2016","3/28/2016","4/5/2016","4/13/2016","4/15/2016","4/20/2016","4/25/2016","4/28/2016"}}
\def\name{Jacob M. Kiggins}
\title{Engineering Notebook}
\date{01/25/2016 --- 05/26/2016}
\author{\name}
\begin{document}
\pagenumbering{gobble}
% FRONT COVER ///////////////////////////////////////
\begin{figure}
\includegraphics[width=\linewidth]{./img/cover.jpg}
\end{figure}
\maketitle
\newpage
% FRONT COVER ///////////////////////////////////////
%TABLE OF CONTENTS /////////////////////////////////
\tableofcontents
% GLOBAL FORMATTING ////////////////////////////////
\newpage
\pagenumbering{arabic}
\lhead{PAGE: \thepage}
\cfoot{}
\lfoot{SIGNATURE: \textit{\name}}
\setlength{\parindent}{0pt}
% NEW DAY //////////////////////////////////////////
\rfoot{DATE: \pgfmathparse{\dates[0]}\pgfmathresult}
% CONTENT //////////////////////////////////////////
\section{Problem Analysis}
\paragraph{Problem Statement}
In this year’s competition our team will design and build an autonomous robot that can deposit jewelry (rings) to one dozen boxes along the parade route on a specified track. Our team must design and build an autonomous robot(s) that can deposit one ring in each of the 12 boxes located along the “parade route” on the track. Our robot(s) will have a maximum time of 90 seconds in each of our four allotted trials. The robots must begin within an 8” X 12” X 10” high size limit but may expand to any size during a trial.
\subsection{Inital Reactions}
The track (Figure: \ref{fig:track}) has a particular topology which the sensor system and robot may take advantage of.
\begin{itemize}
\item The walls enclose the route
\item The black line follows near the boxes
\item Overall, the track is symmetrical
\item The boxes are all red
\item The boxes are all in corners
\end{itemize}
Navigation of the course would be much easier to do if the wooden walls did not impede travel. The start and size constraint "boxes" are large enough to accommodate multiple robots. Multiple robots will most likely have an advantage over a single robot. We will analyze this idea as we progress.
\begin{figure}[h!]
\includegraphics[width=\linewidth]{./img/track.png}
\caption{Parade Route Track Specs}
\label{fig:track}
\end{figure}
% CONTENT //////////////////////////////////////////
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[1]}\pgfmathresult}
% CONTENT //////////////////////////////////////////
\subsection{Rules and Scoring}
\paragraph{Allowable Energy Sources}
Any energy source is allowed as long as it is completely contained within the robot and does not create or emit any gaseous, liquid, or solid emissions. Energy sources must not present any safety hazards to participants or spectators.
\paragraph{Structure}
The robot must fit inside a box with vertical sides having inside dimensions of 8.0” X 12.0” and have a maximum height of 10.0”. The robot may expand to any size after the start of a trial.
\paragraph{Components}
Team members using materials which are commonly available to the general public must perform all fabrication. Use of commercially available vehicles, robots, or entire kits such as RC cars, Legos, K-nex, Fischer-Technics, Parallax or erector sets may not be used. The use of Lego Mindstorm microcontroller bricks are prohibited. Individual components from these cars, robots, or kits (except the Mindstrorm Brick) may be integrated into a team’s robot as long as the majority of the robot’s components are not from the same car, robot, or kit source. The cost of purchasing all components must not exceed \$400.
\paragraph{General Scoring and Rules}
\begin{itemize}
\item Five points will be awarded for each ring deposited in a box (one ring per box)
\item A twenty point bonus will be awarded for a robot that deposits a ring in each of six boxes and returns to the start/stop area
\item If a robot completes a perfect run in under ninety seconds, the remaining time will be added to that teams score.
\item The trial is ended if ninety seconds has passed or...
\item The robot stops moving and shows no signs of continuing or...
\item The robot deposits twelve rings and returns to the start/stop area
\item A robot must deposit exactly one ring in a box to receive credit for that box
\end{itemize}
There will be four trials and a exhibit poster session. A teams score will be the sum of their four trials and their poster session (maximum of 120 points)
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[2]}\pgfmathresult}
\subsection{Multiple Robot Analysis}
\paragraph{Assumptions}
This analysis assumes a robot that may navigate it's way around the track by following the lines and/or walls. There are also a few assumed values about robot maneuverability which are outlined in figure \ref{fig:rbt3a}
\begin{figure}[h!]
\includegraphics[width=\linewidth]{./img/three_bots.png}
\caption{Three Robot Analysis}
\label{fig:rbt3a}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=\linewidth]{./img/time_graph.png}
\caption{Multiple Robot Timing Graph}
\label{fig:mrtg}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[3]}\pgfmathresult}
\section{Game Strategy}
\paragraph{Overview}
Our basic strategy involves the use of a line sensor mounted on the bottom of a tank style drive robot. We will use the line to navigate the track and deposit rings from off the side of the robot. We will also integrate a distance sensor. This when coupled with our quadrature encoders should allow us accurate off-the-line navigation allowing us to deposit rings over the wall as well as make complex maneuvers.
\subsection{Mechanical}
\paragraph{Requirements}
\begin{itemize}
\item Quick assembly/dis-assembly
\item Short manufacture time
\item Highly durable under when subject to impact
\item Secure when assembled
\item Reliable ring drop mechanism with large margin of error in terms of robot location with respect to the box
\end{itemize}
\paragraph{Solution}
We will use a 3D printed chassis with pre-made mounting holes and a .25'' thickness. Our drive-train will consists of two Lego motors and an omni-wheel. Our chassis will be designed such that all drive-train components snap into place easily.
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[4]}\pgfmathresult}
\subsection{Electrical}
\paragraph{Requirements}
\begin{itemize}
\item Interface with a QTR-8 line sensor(Figure \ref{fig:qtr8ln})
\item Interface with a ZX IR distance sensor (Figure \ref{fig:zxd})
\item Circuitry to interface with quadrature encoders for off-the-line navagation
\item Interface with servo, used to drop rings
\end{itemize}
\begin{figure}[h!]
\includegraphics[width=3in]{./img/qtr8_iso.png}
\caption{QTR-8 sensor}
\label{fig:qtr8ln}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=3in]{./img/qtr8_bottom.png}
\caption{QTR-8 Bottom View}
\label{fig:qtr8bt}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=3in]{./img/zxd.png}
\caption{Sparkfun ZX distance sensor}
\label{fig:zxd}
\end{figure}
\newpage
\paragraph{Soultion}
We will design an engraved circuit board to route all connections around. Header pins will be extensively used. Components should be replaceable without de-soldering. High voltage rails will not be close to low voltage rails to minimize the likelihood of chip damage.
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[5]}\pgfmathresult}
\subsection{Programming}
\paragraph{Requirements}
\begin{itemize}
\item Program should be divided into two independent components
\begin{itemize}
\item Physical actions the robot can perform
\item Sensor feedback which can control the flow of these actions
\end{itemize}
\item No interrupts except those required for communications (I2C) and the quadrature encoders
\item The route should be mapped out with a series of “blocking” function calls
\item The program needs to be flexible to changes in physical configuration
\end{itemize}
\begin{figure}[h!]
\includegraphics[width=\linewidth]{./img/flow.png}
\caption{Basic program flow chart}
\label{fig:bfc}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[6]}\pgfmathresult}
\section{Encoder Navigation}
\begin{figure}[h!]
\includegraphics[width=\linewidth]{./img/nav.png}
\caption{Navigation Diagram}
\label{fig:nvdg1}
\end{figure}
\paragraph{Motivation}
Since this robot is driven with two independent wheels on either side of it's frame a certain theoretical model must be created to describe it's motion from available inputs. Of these available inputs the quadrature encoders on each wheel will be the most effective in determining movement. The characteristics we are most interested in are the change in distance and the change in heading. This model will be developed below
\paragraph{Let}
$W =$ wheel base in cm, $R_{left} = W + R_{right}$, $A$ be the start angle (usually zero) and $B$ be the ending angle, We also define $R = R_{right} + W/2$ \newline \newline
Let $T_{left}$ be the encoder tick count on the left wheel, $T_{right}$ be the encoder tick count on the right wheel, both since the position was last updated
\subsection{Radius Development}
\begin{equation} \label{eq:radius_dev}
\begin{split}
\frac{ R_{left} }{ R_{right} } = \frac{ T_{left} }{ T_{right} } = \frac{R + W/2}{R-W/2}\\\\
T_{left}R - T_{left}W/2 = T_{right}R + T_{right}W/2\\\\
R(T_{left} - T_{right}) = \frac{W}{2}(T_{left} + T_{right})
\end{split}
\end{equation}
\begin{equation} \label{eq:radius}
R = \frac{W}{2}*\frac{T_{left} + T_{right}}{T_{left} - T_{right}}
\end{equation}
\subsection{Angle Development}
\begin{equation}
\begin{split}
da & = B - A \\
& = \frac{S}{R} = \frac{T_{left} * CMPT}{R + W/2} = \frac{T_{right} * CMPT}{R - W/2} \\
& = \frac{T_{average}}{R}
\end{split}
\end{equation}
\paragraph{Where}
$CMPT$ is the centimeters per encoder tick ,and $S$ is arc length
\subsection{Conclusions}
\paragraph{With}
this mathematical model, given accurate encoder counting and minimal wheel slip, should provide reliable off-the-line navigation. Also, this model can provide feedback to the robot when it is moving in an arc-like path or simply rotating.
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[7]}\pgfmathresult}
\section{Prototyping}
\paragraph{Lego Robot}
Though the robot is mostly finished in solidworks (1st rev. at least) We need a test robot to move along the program development. To accomplish this we designed and built a lego version (\ref{fig:lego_bot}) of our robot which is almost dimensional-ly equivalent to the final bot.
\newline\newline
The main purpose of this robot is to interface with the encoders and show that they can be a reliable control point. We have also created a breadboard to prototype our circuit design. Throughout discussion we have considered the idea of resin-ing the breadboard to create a more permanent solution.
\paragraph{Cylinder Deposit System}
We have been able to 3D print our first iteration of the Cylinder deposit system (\ref{fig:cyldep}). It is designed to hold the rings in a stacked fashion and Our custom "Sploosher" arm will eject the rings left or right.
\begin{figure}
\includegraphics[width=\linewidth]{./img/cyl.png}
\caption{Cylinder Ring Deposit System}
\label{fig:cyldep}
\end{figure}
\begin{figure}[ht!]
\centering
\includegraphics[height=.95\textheight]{./img/lego_bot.jpg}
\caption{Lego Version of Robot}
\label{fig:lego_bot}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[8]}\pgfmathresult}
\subsection{Prototype Results}
\paragraph{The Good...}
The Lego motors have proved dependable and the overall drive system is solid. The QTR-8 sensor (\ref{fig:qtr8ln}) is very capable and the robot itself shields the sensor from ambient light. Our ring deposit system is very solid, though it shoots rings out the top occasionally. This is most likely due to the servo "Kicking" when the power is initially applied, this is of course an electrical problem.
\paragraph{The Bad...}
The encoder navigation is less reliable than we had hoped. Some possible causes are the inability for the Arduino Mega to keep up with the 720 ticks/s x 2 motors. Another is the small-angle-error which plagues the method we use to calculate the robot's "heading". The H-Bridge we are using does not have a break mode so there are a lot of sketchy time delays where the motors have opposite power applied.
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[9]}\pgfmathresult}
\subsection{Prototype conclusions}
\paragraph{Going Forward...}
We Are going switch to the teensy 3.2 micro-controller instead of an arduino mega. The teensy has a clock speed of 97MHz (as opposed to 16 MHz) and built in hardware quadrature encoder counters. This should give us a much more accuracy in all aspects of the robot. We also plan to switch to a polulu H-Bridge that is much smaller and has a break mode. To combat the navigation errors a software band-pass filter may be used on the heading, only allowing "reasonable" changes to occor on the heading.
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[10]}\pgfmathresult}
\section{Program Structure}
\subsection{Mapping the Route through the Track}
\paragraph{Motivation}
Due to differences in each team member's experience with programming. We developed a system in which every action or decision the robot makes can be reduced to a series of function calls. This above all else allows each member of the team to work on the program if nessisary. Also with this model the path we take around the track can be changed very quickly. This model can be seen in Figure \ref{fig:rino}.
\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{./img/route_ino}
\caption{Track Navigation}
\label{fig:rino}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[11]}\pgfmathresult}
\subsection{Separation of Actions and Sensor Feedback}
\paragraph{Motivation}
Throughout the process of developing this code it became exceedingly clear that flexibility was one of the most important features. We needed a system where adding a sensor and allowing its feedback to control the robot was as simple as writing a new method or two. We also needed it to be possible to add "Actions" to the robot with similar ease. The best way to do this it to separate the control structures completely. Actions need to be influenced by sensor feedback obviously, but the code should be such that if every sensor suddenly blew up the robot could still be commanded to move. Such an implimentaion is outlined in Figure \ref{fig:ind_sys_out}
\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{./img/prg_flow}
\caption{Independent System Outline}
\label{fig:ind_sys_out}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[12]}\pgfmathresult}
\section{3D Printing Components, and Assembling}
\paragraph{Overview}
With TYESA approaching we have sped up our progress on the mechanical side. The robot has had the addition of folding ramps on either side. Our chassis has been printed with all mounting holes "pre-drilled" and only the removal of support material is necessary. We have also perfected our snap together design. The entire robot comes together with nothing more than 3 Lego cross pieces and two hex screws.
\subsection{Manufacture Timing}
\paragraph{Different}
combinations of parts printing together have been tested and an optimal solution has been found. The part groupings are shown below.
\begin{enumerate}
\item Top and bottom chassis plates - 10 hours
\item Cylinder Assembly, Servo Mounts - 5 hours
\item Ramps and Sploosher - 5 hours
\end{enumerate}
In the end it takes a mere twenty hours to create our robot, start to finish, mechanically.
\subsection{Bill of Materials}
\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{./img/bill.png}
\caption{Cost analysis PER robot}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[13]}\pgfmathresult}
\subsection{Figures}
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\linewidth]{./img/full_bot.png}
\caption{Full Robot in CAD}
\end{figure}
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\linewidth]{./img/full_cyl.png}
\caption{Full Cylinder Deposit System}
\end{figure}
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\linewidth]{./img/motor.png}
\caption{Exploded view of Lego Motor}
\end{figure}
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\linewidth]{./img/omni.jpg}
\caption{Front Omni-Wheel}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[14]}\pgfmathresult}
\section{Electrical Specifications}
\paragraph{Overview}
During out discussion on the electrical system we have decided not to create a conventional wiring diagram. Instead we will use excel to create a pin map which will show how the teensy 3.2 (\ref{fig:teensy}) is connected to the rest of the components. The reason for this is we aren't sure whether our final board will end up on a solder proto-board or an engraved board. This type of specification gives us flexibility in final design. As you can see in Figure \ref{fig:elect_spec} Each set of pins is color coded to their connection with their connection to the teensy. The pins on the actual device being interfaced with are also listed as to create a full pin map.
\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{./img/teensy32.jpg}
\caption{Teensy 3.2 Microcontroller}
\label{fig:teensy}
\end{figure}
\begin{figure}[t!]
\centering
\includegraphics[width=\linewidth]{./img/wiring.png}
\caption{Pin Routing Specification Sheet}
\label{fig:elect_spec}
\end{figure}
% NEW DAY //////////////////////////////////////////
\clearpage
\rfoot{DATE: \pgfmathparse{\dates[15]}\pgfmathresult}
\section{Conclusion}
\paragraph{Throughout}
this design and development process we have all learned a lot. There are many small details in developing a robot such as this. Attention to those details can make the difference between a winning robot and a losing one. We have also gained better insight into the transition between a theoretical model and a working system. As well as which Theoretical models will actually work in the real world. This as well as experience gained from the TYESA competition has prepared us to tackle ASEE.
Also, we won TYESA
\subsection{Action Shot}
\begin{figure}[ht!]
\centering
\includegraphics[width=\linewidth]{./img/robo_action.jpg}
\caption{Robot Depositing Ring}
\end{figure}
\end{document}