week 5: electronics production


assignment for the week

1. Characterize the specifications of your PCB production process
2. Make an in-circuit programmer by milling the PCB (/make a PCB by milling) (program it, so that you can use it to program your board in Electronics Design week, and in other weeks)
3. Optionally, trying other processes (of making PCBs)



learning outcomes

1. Describe the process of milling, stuffing, programming, and de-bugging
2. Demonstrate correct workflows and identify areas for improvement, if required



have i

1. Shown how I made and programmed the board
2. Explained any problems and how I fixed those
3. Included a 'hero shot' of my board



characterizing the specifications of our PCB production process and PCB production

This week I will be using a pre-designed circuit to mill a circuit board, I will not be designing one. Hence, I will leave out that portion of the PCB production workflow. This week, the workflow will be from the point when you have 2 image files, one for traces and pads and another for outline, and you input those, one at a time, in to fabmodules.org and generate toolpaths for milling. In the Electronics Design week, I will re-draw another pre-designed circuit in Autodesk EAGLE and that is where I will talk about CAD for drawing and/or designing circuits, exporting those circuits as image (.png) files, and further processing those images in an image editing program (optional). I will then integrate steps from this week to present the complete PCB production workflow.
Machining or milling PCBs, as explained by Neil, is a multi-step process as follows: To machine a board (Figure 5.0 A), you first have to attach it to the bed (Figure 5.0 B), and that is done in a surprisingly crude way (at least on these little precision milling machines). We use 2-sided tape (Figure 5.0 C), and the reason we do that is if you clamp the board, it bows a little bit, and the flexing and the tension can break the tool. By using a tape, we hold it from below, and that keeps the board nice and flat, and keeps it relaxed. Mounting a bare board on to the sacrificial layer of the milling machine is called fixturing (Figure 5.0 D). Here, let me grab an example ... so here is an example of the boards you will be making, and you can see the fine features and the traces that you will be cutting out. So the board has to be nice and flat to make those fine features that we need. An important precaution while fixturing is to avoid any air bubbles between the tape and the board, and between the tape and the underlay. I started out with a single-sided blank FR-1 board, 4 in * 6 in (Figure 5.0 A). Technically, these are bare single-sided copper-clad laminates in paper phenolic material. Under your board, there is an underlay (Figure 5.0 E), there is a sacrificial material, and that is so that when you cut through your board, you don't cut in to the machine, you cut in to that sacrificial material. Those materials have a lifetime. Once the sacrificial gets old, it doesn't hold down your board very well, and you need to replace it. So depending on how busy your lab is, maybe once a month you put in a new sacrificial layer. When you do that everything needs to be clean and smooth so that the layer lays flat, and so if you have an old sacrificial layer on a dirty machine, your board will move around, and again that will break the tool, and your board will not have a good finish. If you have a fresh sacrificial layer on a clean machine, everything will be smooth (orientation), and it will cut nicely. Then, you need to set the tool right on top of your board. We are only going to cut a few thousandths of an inch deep, and so zeroing (Figure 5.0 F) is where you set the machine (actually the end mill) right on top of your stock/board. All the steps I am describing are shown in this nice series of videos from Charles Fracchia (Neil's student). The way we zero it is you lower the tool to the surface, it helps to tap it a little bit just to make sure its in good contact, and then you tighten the set screw. And we have to get that very close to within a few thousandths of an inch. Now, one thing that can go wrong is if you don't hold the tool while you tighten it, it can move a little bit. So you hold it with one hand and tighten it. Another thing that can go wrong is when you lower the tool, if you drop it, it can actually shatter. These are hard but brittle so you lower it gently. Then the set screw, this is a common beginner mistake, there is a set screw in the collet that holds the tool. I have got a spare one here. This is the part of the machine that holds the tool (referring to the collet) and there is a little tiny screw that goes in to hold it. You do not tighten it as hard as you can. If you do that you actually strip the threads (of the set screw). It is just snug. You tighten it up snug, you don't tighten it so hard you are stripping the threads. If you have an old collet that has been over tightened the set screw does not hold very well, the tool wobbles, and again that will break the tool. Then when the tool is brand new, it is so sharp you get very fine shavings. After a little bit, it gets slightly dull and curves, and it actually machines more smoothly, and then when it gets very old, it doesn't machine nicely anymore, it just sort of smooshes the copper around and you get rough edges. That is a sign you need a new tool. I have come on people in fab labs who are actually trying to machine with a broken tool, and they say its not working well, and there tool is broken, it actually doesn't have the end of the tool there. And so you should look at your tool and make sure its in good condition, and be aware that it has a lifetime. To cut traces on the board (removing copper from the board), and perimeter of the board (basically, cutting through the copper and substrate layers on these bare boards), I used 2 different kinds of end mills (Figure 5.0 G): a v-bit (tip size, angle, equivalent to a 1/64 in end mill) for cutting traces, and a 1/32 in end mill for cutting perimeter of the board. Once you machine your board, there will be fine shavings left behind, and so you need to deburr it, and the way I like to do that ... this is a stainless steel rule that has a very straight sharp edge, and so when I am done machining I just use this, I pull it across, and it removes all the fine burrs, you can use a fine abrasive too. And then the last step is you clean the board. There are oils on your fingers that over time will begin to actually tarnish and then etch the board, and then there is the fine shavings. Oils from fingers also create problems during soldering components to the board. And so, you wash the board in soap and water before you assemble the circuit. So, those are all the steps you are going to go through to make your board by machining. And I want everybody to machine a board. I want you to learn this milling process because you can do it on a $ 1000 machine, the waste is just a little bit of dust, its easy to clean up, and its a very quick turn process.
PCB fabrication/production by milling is one of several ways to produce PCBs. My laboratory has a monoFab SRM-20 compact desktop milling machine (basically a miniature CNC mill, Figure 5.1), and that is what I used to produce PCBs for myself. The mill is computer-controlled through a program called VPanel for SRM-20 (Figure 5.2). It is used to output toolpaths (cutting data) to the mill. The toolpaths were created at fabmodules.org. Here are the steps:


roland-monofab-srm-20-desktop-milling-machine.jpg

Figure 5.1: Roland's monoFab SRM-20 Compact Desktop Milling Machine

5_2__vpanel_srm20_en.png

Figure 5.2: VPanel for SRM-20

Generating a toolpath to cut traces and pads on a bare board:
Google Chrome > fabmodules.org > click on input format dropdown menu > select image (.png) > this opens Finder > navigate to locate fts_mini_traces.png (Finder > Downloads > FabAcademy2018 > week 5 electronics production, Figure 5.3) > select file > Open > this opens the image in the browser, also reveals its specifications (input specifications, Figure 5.4), and also the output format dropdown menu > select Roland mill (.rml) > this reveals output specifications (Figure 5.5), and also the process dropdown menu > select PCB traces (1/64) > this reveals process specifications (Figure 5.6). The most important specifications/parameters, important for PCB production by milling, and some discussion about the same is as follows:


5_3__fts_mini_traces.png

Figure 5.3: to be filled

5_4__input-specifications.png

Figure 5.4: to be filled

Machine: Fab modules has 4 options, meaning you can output toolpath in 4 different ways. SRM-20 was selected here.
Speed (mm/s): This refers to the linear speed, basically the feed rate (how fast the tool progresses). The feed-rate of a router to the workpiece (or vice-versa, if used in a router table) is very important to the longevity of the tool and the overall quality of cut. This had a default setting of 4 mm/s once the process was selected. An optimum feed rate is important. Always keep the tool moving: allowing the tool to "dwell" in the cut will cause burning and reduce tool life immensely.

5_5__output-specifications.png

Figure 5.5: to be filled

Direction (of cutting): Climb machining was used for a good finish.
Cut depth (mm): How deep each succeeding pass goes. As a rule of thumb, you go down roughly the diameter of your tool. This setting determines how deep each individual cutting pass will be. You can make this smaller (for a finer cut) or bigger (for a rougher cut), depending on your model. The finer the cut, the longer it will take to mill the model. A cut depth of .12 mm was used.
Tool diameter/Cutting diameter (mm): The largest cutting diameter of your tool (in mm). A cutting diameter of .4 mm was used (at .12 mm from the tip of the v-bit, the end mill has a diameter of .4 mm).
Number of offsets/Offsets: It is the number of passes the end mill goes around the circuit trace to remove the material. This was set to a value of 4. If you use -1 as the offset, the mill removes all the material except for the traces.
Offset overlap (%): This was set to 40%. This is the extent to which each successive pass overlaps the immediately preceding pass (for efficient removal of material).

5_6__process-specifications.png

Figure 5.6: to be filled

Once the above parameters are set to their desired values, click on "calculate" toolpath. It takes a few seconds to calculate the toolpath for milling traces. If it takes any longer than that, there is a problem with the .png input file. If you look at the calculated toolpath image, you will see 4 thin lines running parallel to each-other, and around the traces. Why 4? This depends on the value of the number of offsets. An offset of 4 means the router will mill around the traces 4 times, each time cutting deeper than the immediately preceding pass (something that is controlled by the cut depth setting). Another important thing to note at this point is that you should look at your image file with traces and pads, and the toolpath image side by side (Figure 5.7). This juxtaposition is very helpful in several ways: (1) check if the toolpath image has traces and pads in the same places as in the input image; (2) check clearances (pad-pad, pad-trace, trace-trace) to make sure traces and/or pads have not merged (or shorted). If these conditions are violated, do not proceed to milling. Instead, go back to the board view (.brd) in EAGLE to adjust clearances, re-route some connections, and go forward from there (meaning a new .png file, recalculate the toolpath). When satisfied, "save" the calculated toolpath as a .rml output file for the SRM-20.

5_7__fts_mini_traces_Traces vs Toolpath

Figure 5.7: to be filled

Plug and switch on the SRM-20, and on the computer connected to it, fire VPanel for SRM-20. Install the 1/64 in end mill in the router for milling traces and pads. Before milling, there are 2 different origins you need to set: first, origin of the mill, and second, origin of the bare FR1 board.
Origin of the mill: VPanel for SRM-20 > Move > To Origin > click on the X/Y button > click on the Z button. The router will start moving, and will stop at the mill's origin.
Origin of the bare FR1 board: The origin (0,0) of the file created in fab modules is in the bottom left corner of the mill. This step sets the origin for the output (.rml) file on the actual physical board. VPanel for SRM-20 > Move the router in the XY plane by clicking on the +/-X and +/-Y arrows until the end mill is on top of the desired position/location on the board (typically, a few millimeters inside from the edge of the board). As you do this, notice the changing values in the X and Y fields to the left of the arrows. Also, be careful not to bump the end mill in to anything as you move the router around. Else, you will break the end mill. > Set Origin Point > Click on the X/Y button > This changes the values in the X and Y fields to 0 and 0, respectively. With a fine-tip marker, draw a small cross on the board right below the tip of the end mill. This will serve as a reference when cutting the outline later on.> Using the -Z arrow move the end mill down slowly until it is about 2-4 mm (max 5 mm, if needed) above the board. > Using an Allen wrench (or hex key), loosen the collet screw holding the end mill in place, and let the end mill gently land on the board. > Slightly press down on the board (about .5 mm). > Tighten the collet screw to secure the end mill in the collet. > Back to VPanel for SRM-20. > Set Origin Point > Click on the Z button > This changes the value in the Z field to 0. Origin of the bare board is now set.
Further, in VPanel for SRM-20, click on Cut > This opens a new window titled "Cut" > Click on Delete All if there is/are any file/s listed under Output File List > Click on Add > This takes you to Finder > Navigate, and locate your output (.rml) file for traces (fts_mini_traces.rml) > select file > Open > Back to the window titled "Cut" > Click on Output > The spindle will start turning, and milling will start momentarily.
Do not remove the board from the mill when done.
Generating a toolpath to cut an outline around a printed circuit:
Google Chrome > fabmodules.org > click on input format dropdown menu > select image (.png) > this opens Finder > navigate to locate fts_mini_outline.png (Finder > Downloads > FabAcademy2018 > week 5 electronics production, Figure 5.8) > select file > Open > This opens the image in the browser, also reveals its specifications (input specifications, Figure 5.9), and also the output format dropdown menu. These input specifications of the outline image file must match those of the traces and pads image (Figure 5.4 above) exactly. > select Roland mill (.rml) > this reveals output specifications, and also the process dropdown menu > select PCB outline (1/32) > this reveals process specifications. The most important specifications/parameters, important for PCB production by milling, and some discussion about the same is as follows:

5_8__fts_mini_outline.png

Figure 5.8: to be filled

5_9__input-specifications_fts-mini-outline.png

Figure 5.9: to be filled

Machine: Fab modules has 4 options, meaning you can output toolpath in 4 different ways. SRM-20 was selected here.
Speed (mm/s): This had a default setting of 4 mm/s once the process was selected.
Direction (of cutting): Climb machining was used for a good finish.
Cut depth (mm): A cut depth of .6 mm was used.
Stock thickness (mm): This refers to the thickness of the bare FR1 boards used. Our boards are 1.7 mm thick.
Tool diameter/Cutting diameter (mm): A cutting diameter of 2 mm was used.
Number of offsets/Offsets: This was set to a value of 1.
Offset overlap (%): This was set to 50%.
Once the above parameters are set to their desired values, click on "calculate" toolpath. It takes a few seconds to calculate the toolpath for cutting the outline. If it takes any longer than that, there is a problem with the .png input file. If you look at the calculated toolpath image, you will see 1 thin line running to make a perimeter around the entire circuit. Why 1? This depends on the value of the number of offsets. An offset of 1 means the router will cut only once. Another important thing to note at this point is that you should look at your image file with outline, and the toolpath image side by side (Figure 5.10). They should look the same, except for the thickness of the outline. When satisfied, "save" the calculated toolpath as a .rml output file for the SRM-20.

5_10__fts_mini_outline_Outline vs Toolpath

Figure 5.10: to be filled

Before cutting the outline (or after traces and pads are milled), you need to change the end mill to the bigger 1/32 in end mill to cut an outline/perimeter around the traces to separate the PCB from the rest of the board. Using +/-X and +/-Y arrows, position the router (actually the tip of the end mill) directly on top of the cross marked after setting the X and Y to origin right before milling traces and pads, but do not set X/Y to 0,0 again (if you do that, you will not be able to match the last origin you set before milling traces and pads). The mill remembers the X and Y origin of the bare board from the previous step. Only the Z needs to be zeroed this time. Follow the exact same procedure as last time. Finally, in VPanel for SRM-20, click on Cut > This opens a new window titled "Cut" > Click on Delete All if there is/are any file/s listed under Output File List > Click on Add > This takes you to Finder > Navigate, and locate your output (.rml) file for outline (fts_mini_outline.rml) > select file > Open > Back to the window titled "Cut" > Click on Output > The spindle will start turning, and milling will start momentarily.
You should have your PCB now (Figure 5.11). Use a spatula to pry it out/separate from the sacrificial material. Finally, vacuum away metal and plastic shavings in the mill, and return all tools (Allen wrench, both end mills, double-sided tape, and spatula) to the drawer.
No other process of PCB production, other than machining or milling, was tried this week.

Figure 5.11: Oops! Forgot to take a picture of the unstuffed board.



stuffing the PCB / assembling the PCB by manual soldering

The next step in the PCB production workflow is stuffing/assembling the board with components. This was done manually, one component at a time, by soldering. The process is as follows: Apply excess flux to the area on the PCB where components are to be soldered > With solder in one hand and soldering iron in the other, melt some solder and apply a blob on each pad > With a tweezer, place a component on its pads, re-heat the solder blob, and gently push the component onto to the pads so that it lays flat. The order of soldering should be from complex (e.g. ATtiny45) to simple components (so you have the most access while soldering the difficult components), and from the center of the board to the outside. Another important thing while soldering is that the solder surface should always be smooth and shiny. Also, be careful not to apply too much heat in one spot for too long as it may damage components. Uniform heating is the key.
Components and other items required are as follows:
1x ATtiny45
2x 1 k-ohm resistors (102)
2x 499 ohm resistors (4990)
2x 49.9 ohm resistors (49R9)
2x 3.3 V Zener diodes
1x red LED
1x green LED
1x 100 nF capacitor
1x 2x3 pin header
flux
solder
soldering iron
tweezers
magnifying lens
Solder components in the exact manner as they are shown in the reference picture (Figure 5.12a) below:

5_12a__fts_mini__stuffed board.jpg

5_12b__board I stuffed.jpg

Figure 5.12a (top): Stuffed board used as a reference to stuff the board I milled.^ Figure 5.12b (bottom): to be filled

For ATtiny45, Zener diodes, and LEDs, you have to consider the orientation or polarity of the components while soldering the same on to your PCB.
1. ATtiny45 comes marked with a dot next to pin 1.
2. Our Zener diodes have a black line running around it close to its cathode.
3. Polarity of the LEDs ???
Finally, use solder to create a bridge on the jumper (J1) near the ISP header thereby temporarily connecting VCC to the Vprog pin on the ISP header so that the header can be used to program the ATtiny45. The programmee board supplies voltage on this pin and the programmer detects it. Once it is programmed, this bridge will be removed to turn the board into a programmer (rather than a programmee).^

programming the board^

Downloaded and installed avrdude (the programming software) on Mac OS (source: http://macappstore.org/avrdude/, date of download: mmddyyyy): Install the program as follows:
1. Press Command+Space and type Terminal and press the return key.
2. In Terminal, run: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null and press the return key. If the screen prompts you to enter a password, please enter your Mac's user password to continue (when you type the password, it won't be displayed on screen, but the system will accept it) and press the return key. Wait for the command to finish.
3. Run: brew install avrdude. This completes installation of avrdude on the computer.
Downloaded and installed CrossPack AVR (development tool for AVR microcontrollers, source: https://www.obdev.at/products/crosspack/download.html, date of download: 4.6.2018) and XCode (for Make, source: Mac App Store, date of download: mmddyyyy).
Downloaded and unzipped (extracted) the firmware: Downloaded the firmware source code (source: http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/index.html, date of download: 4.6.2018) and extracted the zipped file (fts_firmware_bdm_v1.zip). cd into the source code directory through the terminal of the computer: cd sawhneyashish > cd Downloads > cd fts_firmware_bdm_v1.
Run make. This will build a hex file that will be programmed onto the ATtiny45 on the board. If the command completes successfully, a file called fts_firmware.hex will be created in the source code directory. If, however, the command does not complete successfully, something is wrong with your toolchain installation. Consult the error messages for information that will help debug those errors.
Updated the file called Makefile for the type of programmer I used to program my board. The Makefile, by default, assumes that you are going to use a programmer in the usbtiny family (e.g. another FabISP board). If you are using a different programmer, first find out what avrdude (the programming software) calls it and accordingly update the Makefile. For the small translucent blue programmer, change usbtiny to avrisp2.
Edit the Makefile using a text editor intended for programmers. I used TextEdit on Mac OS, just make sure to save as a plain text and not RTF (and make sure no ".txt" gets added to the filename). Generally speaking, whatever you use to edit your HTML code is probably an okay choice.
Near the top of the file, find the line that says:
PROGRAMMER ?= usbtiny
and change usbtiny to avrisp2.
In the absence of USB ports on my MacBook Pro, I had to power my board indirectly through an Arduino board as follows: the Arduino board was connected to another computer through a USB port > this powered the Arduino board > I then connected the positive and negative (or, ground) terminals on my board to VCC (providing 5 V of DC power) and GND (ground) terminals on the Arduino board through red and black jumper wires, respectively > this powered my board as the red LED on the board lit up > I then connected my board through its 6 pin header to the avrisp2 programmer making sure pin 1 on the board is connected to the slot in the plastic connector on the programmer cable that is marked pin 1 (there should be a small arrow, dot, or manufacturer's name marking the corner with pin 1). This is important as there are two different orientations in which you can make this connection; it is imporatant to get pin 1 in the right place. Pin 1 is marked in the board diagram with a dot (Figure 5.13) and has the MISO signal connected to it. Note that there's no enforced standard for which direction the cable comes out of the connector, so look for the pin 1 marker. Figure 5.14 below shows all these connections I just described.

5_13.png

Figure 5.13: to be filled

5_14__showing all connections.jpg

Figure 5.14: to be filled

Having completed the connections, run make flash. This will erase, and program the microcontroller's (on my board) flash memory with the contents of the .hex file created earlier. You should see several progress bars while avrdude erases, and programs the board's microcontroller.
Until now, everything went well, and the board is programmed successfully. It can now be used as a programmer to program other boards.

problems faced and de-bugging

1. Setting the origin of the mill
2. Absence of USB ports on my MacBook Pro
3. Programmed board did not show up as a USB on my computer

^source: http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/index.html