% !TEX root = master.tex

\subsection{Printed Circuit Board}
The finished schematic and subsequent board layout (which will be completed within the first few weeks of senior design two, or possibly over the winter break period) will need to be realized in the form of a printed circuit board. This board fabrication is a fairly expensive step in the procedure, as the intention for our group is to have board fabrication done entirely professionally. This is simply due to the fact that any mistake at this stage could be incredibly costly in terms of materials, and more importantly in terms of time consumption. Diagnosing problems with a board are typically incredibly time consuming procedures, and are unacceptable at such a late stage in the project. The plan for fabrication are detailed in this section.

\subsubsection{PCB Design}


As discussed in section 3, Eagle is the primary vehicle of design, and both the schematic and the board layout will be completed in this software. Once the board layout is complete, Eagle has a built in method to export a certain number of files, called GERBERs, which lay out certain specifications for board manufacturers in order for the fabrication of a printed circuit board. These files are in a human readable ASCII format, which simply lay out where a certain feature needs to be. We will use the RS-274X family of files for our project, which is considered the standard to describe any given PCB layer. The specific GERBER files that we plan on using are listed below:


\paragraph{Copper Top and Bottom (.cmp and .sol)}

These two files lay out the copper features for the board, otherwise known as the traces on the board. These layers correspond to the "top" and "bottom" layers in eagle, and are typically simply used for conductive paths or planes.


\paragraph{Top Soldermask and Bottom Soldermask (.stc and .sts)}

The soldermask on the top and bottom of the board is a thing layer of polymer applied to the exposed copper of traces on the board, in order to prevent both oxidation and to prevent unintentional shorts due to soldering. This is especially relevant in small pitch devices, such as our microprocessor and the bluetooth module. In both of these applications, the solder mask is incredibly important to be applied correctly. Typically there is no soldermask on the bottom of the board unless there are parts there, as is our case. The intention at this point is to keep all of the parts on one side of the board for simplicity.  

\paragraph{Top Silkscreen and Bottom Silkscreen (.plc and .pls)}
When the board is created in Eagle, it is important to have labels for each part so that when the bill of materials is created, each part can be linked to the board design. These references are typically called "reference designators", examples of such designators are "R1, R2, C1, C2" for two resistors and two capacitors. These will number off in order until every part on the board has been listed. These also exists so that any individual working on the board has a method with which to eliminate confusion if any parts need to be replaced or re-soldered. The soldermask itself is the ink located on the board, and is typically printed in a color very clearly different than the board color for readability A common convention in board design is white silkscreen on a green board, which is likely to be the design we use.


\paragraph{Drill Legend (.drd)}
The board will have various drills located throughout in order for various applications. The most common, and the likely applications in our use case, include mounting holes and vias. In order to physically mount the printed circuit board to the table. The vias are small features on the board (typically around .012 inches) that allow a copper trace to jump from the top of the board to the bottom of the board. This is a specific case, in general a board can have any number of layers, including internal layers for extremely complex boards, which our board is not one. However, in these arbitrarily complex boards, a via can connect any coper layer, whether it be a trace or a plane, to any other layer's trace or plane. This is useful simply because board design will typically grow complicated enough that traces will need to duck under each other, or connect to some ground plane on the back of the board. It is imperative that using vias not be overused however, because vias are less reliable than simply having a trace from one point to another, as they are more exposed to corrosion and other such issues. Please reference section 3, design, for a more detailed discussion on this topic.

\subsubsection{PCB Fabrication}

\paragraph{Contracting}Once the aforementioned GERBER files have been produced by Eagle, two separate foreign entities need to be contracted. In order to produce the final printed circuit board, a stencil will be created to properly distribute the solder paste onto the board, and the actual board itself will need to be created by an outside source as discussed above. The board itself will likely be outsourced to a company called Alberta Printed Circuits, or APC. We expect the price of this procedure to cost around \$100 or less. Preparing the board through such a professional channel will streamline this procedure, which is a major benefit towards using this method.

\paragraph{Stenciling} The stencil is also a relatively simple procedure, however this is a majority of the cost for the project in the long term. The total price of a professionally created stencil is around \$220. The stencil simply is a thin metal sheet, which has various small apertures for the solder paste to run through in another step in the manufacturing of the board, discussed later in this section. The thin sheet is framed in a thick metal box, which is used to stabilize the entire structure once fixed in the solder distribution machine. The total cost is typically material cost in this application, though keeping the tolerances of the apertures is also a cost consideration, as with our microprocessor and bluetooth modules that have small pitch, the cost for keeping the apertures tight to tolerance goes up. These two steps, stencil and printed circuit board manufacturing, are both performed off site by professional companies. Once these steps have been completed, the results of these steps will be brought to the company that Ryan Mulvaney works for, called I-Con. This company has allowed the use of their solder paste distribution machine, their pick and place machine, and their oven. The three stages will be discussed briefly below.

\paragraph{Solder Pasting} The Solder paste distribution machine basically takes the stencil produced by the stencil entity, locks it into a fixed position over the printed circuit board produced by the other company, and proceeds to apply solder paste in a wiping motion across the stencil. The machine takes two passes in order to ensure that the paste was applied properly to the board. This is the board manufacturing step that is least likely to have any failure as it is simply placing solder paste on a board.

\paragraph{Pick and Place Machine}The second section is the pick and place machine. This machine is the most complicated of the production line that we will use, and as such has the highest likelihood of failure. This machine is connected directly to the previous machine, and the time delay between solder paste distribution and part placement is very short. This is to prevent the solder paste from hardening on its own, as the alcohol inside the paste evaporates In order to operate the machine, a .CSV must be produced from the information generated by eagle. The .csv will be produced from the generated bill of materials, because this excel file has the x and y coordinates of the parts on the board. It also has the rotational information of the parts. When the program is written to populate the board via the pick and place machine, the nozzles that actually pick the parts need to know exactly how far along to move (the x and y coordinates), and how far to rotate (rotation), both of which are gathered from the .csv. 

The parts themselves are typically sourced from a reel, which is then prepared and placed into the machine on several feeders. Once all of the information is produced and loaded into the machines computer, and the feeders have been populated properly, the machine can begin the production process. The machine has 4 nozzles, which are connected to a vacuum device. These use suction to pick up any part provided by the feeders, which move the parts forward as they are placed. The suction of the nozzle picks up the part, then rotates to whatever rotation provided by the .csv, then the next nozzle moves to the next part and picks up the part. After 4 parts are placed, the nozzles place the 4 parts from left to right in their place on the board. In order to properly place the new set of parts without the potential for knocking other parts that are already placed on the board, parts are typically programmed to be placed in order of shortest to largest. This also limits the potential of the nozzles clipping parts as the nozzles move about the board. 

\paragraph{Baking}The last step is the oven, which also follows immediately after the previous machine in order to prevent any problems with solder paste hardening. If the paste is not cooked at a proper heat before allowing it to settle, issues can arise with proper seating or conductivity. The oven is very long, and the parts simply ride a dolly down the oven to be heated. The oven is not heated exactly the same throughout. As the graph below shows in order for typical solder paste (sn63pb37, discussed in section 1.4) to be properly reflowed, a standard for temperature must be met as the board moves through the oven.

\begin{center}
	\includegraphics[width=0.7\linewidth]{img/Kester-Reflow-Profile}
\end{center}

As you can see, the board must not be too hot for too long, and typically keeps a temperature of mid 100 degrees Celsius throughout the heating procedure until the very end of the process. Our production line does not have a cooling procedure, and the boards are simply allowed to air cool as they come out of the oven. This is, for our uses, a perfectly acceptable way of cooling the boards after heating. However, if this were for any robust application such as medical or aerospace, it may be required for a refrigeration step after the heating to ensure proper seating and conductivity. 

After the circuit board has completed the air cooling cycle, the board is complete at this time. The board has been populated and soldered, and assuming there are no errors in any part of the procedure after visual and some electrical inspection (some continuity testing can be done here with any multimeter), the board should be prepared to be plugged into the mains power from the wall on the input side, and the LED matrix on the output side. The full testing procedure that is expected to be implemented can be found in the next section, section 5.

