5. Electronics production¶
This week’s assignment:
group assignment:
characterize the design rules for your PCB production process
individual assignment:
make an in-circuit programmer by milling the PCB,
program it, then optionally try other PCB processes
USB timing
Characterizing PCB Production¶
Our Lab has Bantam Tools’ Othermill CNC mills.
To refresh our knowledge with our CNC mill and characterize our mills, we based our testing on the work of a participant in last year’s Academy at our lab, Ms. Mary Fabian; we milled the line test provided on our assignment page. We got the PNG file for the traces here and the file for the profile here.
In order to convert the image files into files compatible with our CNC mills, we used Fab Modules. We simply selected PNG as our input type, uploaded the file, selected Othermill .nc file output, selected the bit we wanted to use (1/64 in for the traces and 1/32 in for the profile). Then, we clicked on Calculate, waited for the site to process the file, and then clicked Save and downloaded the new file.
Note: Make sure to select the correct bit size on Fab Modules. We accidentally chose 1/64 in for the outline and saved the file, but used the 1/32 in bit as intended for the outline; this ended up cutting into the traces, which is when we realized our mistake and got a new file from Fab Modules. Luckily, the site automatically inputs tool speed, etc., so we didn’t need to worry about those variables.
From there, we opened Bantam Tools’ eponymously-named free software and imported the .nc file we got from Fab Modules.
Once in Bantam, we selected our material (Single-sided FR1), measured the length, width, and thickness of the board with calipers and entered those into their respective fields.
Once the FR1 was measured, we applied very sticky double-sided Nitto tape to the mill bed to ensure that the PCB material would not fly off of the bed during the milling process.
Then, we carefully laid down the PCB material over the tape, lining up the bottom left corner with the same edge on the mill bed.
Note: Due to the bit going too deep on the traces, we realized that we needed to account for the double-sided Nitto tape that we used to secure the material to the mill bed; we measured the thickness of the tape and added it to the thickness of the board in Bantam.
Once we made sure the desired bit was installed (more on this below) and the file was set to mill in the desired location (we chose the lower left hand corner to start), we simply clicked “Start Milling” and watched as the machine milled away. Above, the views in Bantam Tools as the mill ran the outline and lines, showing the bit moving across the bed in real time.
In order to switch bits on the Othermill, it is easiest to begin in the software (note that this dialog will automatically appear if you have set files with different bits to mill together). In the upper right hand corner, we clicked Change next to the Tool listing. Then the tool head moved to an accessible location over the bed where we could loosen the head’s grip on the bit, lower the bit from the head, put in the new bit, and tighten the grip (see below for how to do this). Once done, we clicked Continue; the bit head moved over to an empty corner of the bed, asked us to confirm that the bed was empty in that spot, and then the mill lowered the bit until it came in contact with the bed so that it could home the Z-axis (so that the machine knew where the tool head was height-wise in relation to the mill bed).
Once the tool head was in a good spot to swap bits, we used two small wrenches that come with the Othermills. One wrench is used to secure the shaft above the collet from turning, and the second is used to loosen the collet itself. As the collet is loosened, it is necessary to hold the bit carefully to catch it before it hits the mill bed and breaks.’
A view of two bits, one is broken. Can you tell which one? Even a slight drop can easily break these tiny bits.
A look at our final products from the group assignment. The top is the first run, and the bottom is the second run.
Note: Neither of them is a perfect product; the first board’s defect on the bottom was a result of a bad removal from the mill bed, and the traces were run too deep. We corrected for both of these errors in the second run. Unfortunately, we learned afterward that the mill bed on the Othermill we used for this assignment is not level; we have since been using a different Othermill that has been resulting in far better runs.
Bantam Tools Line Test File (.btm format)
Thank you to Katie Chai and Maxine Tan for taking certain videos and images displayed above.
Making Our Programmers¶
Per the recommendation of Neil, the course professor, as well as those of past Academy graduates, we used Brian’s FabTinyISP tutorial to produce our in-circuit programmers. The author provides an excellent step-by-step instruction on each part of the production process.
Repeating much of the procedures outlined above, we converted the ISP board designs (available on the tutorial page) to be compatible with the Othermill and prepared for milling.
We ran a few test runs as a group to find the ideal settings, and then each of us produced our own PCBs to solder.
Since it was my first time surface-mount soldering, I used an SMT test board provided by one of my instructors to learn the basics. I used Nitto tape to secure the practice board to a granite tile. I soldered on a few resistors with the assistance of M.G. Chemicals’ No Clean Flux Paste, which comes in an easy to use syringe. I used this rosin flux for the rest of my soldering for this assignment because of its ease of use for me.
Once I was confident that I was ready to surface-mount solder, I gathered all of the necessary components. I used a clean sheet of paper and masking tape per the recommendation of my instructor. Note that I forgot the 2 x 49 Ohm resistors before I took this photo.
These time lapses show me soldering on the required components on to my first PCB.
Unfortunately, when I only had a couple of components left to solder on, I mis-soldered one of the LEDs. When I used solder braid to remove the solder in an attempt to adjust the LED’s placement, I tore one of the traces on the board; I later determined that I would not be able to fix this error. In the above picture, you can see the ruined trace through a microscope.
So, I grabbed a new set of components and started over on a new board.
Here is my second board with all components soldered on.
Then, all I had to do was use rubbing alcohol and a small brush to clean off the sticky rosin flux from my PCB.
After cleaning it, I used a small paint scraper to remove the PCB and the double-sided tape from my soldering tile, and then carefully removed the tape from the board. You’ll notice that I used a paper towel; I did so in order to prevent my skin’s oils from getting on the delicate PCB.
Bantam Tools FabTinyISP File (.btm format)
Programming Our Programmers¶
Before beginning to program my board, I used the continuity mode on a multimeter to make sure various parts of the board were properly connected per the schematics on the tutorial page. Once I was certain that my board was ready for programming, I used the following workflow that we developed in our Lab for doing so on a Windows PC. The workflow is as follows, with some grammatical corrections, notes, and addition of documentation/links from myself:
Charlotte Latin Software Setup for FabTinyISP
Dr. Adam Harris Tom Dubick Will Rudolph Maxine Tan
-
Install Atmel Studio 7 & Select 8-bit MCU upon install
-
Make sure Atmel Studio is installed in this path:
C:\Program Files (x86)\Atmel
-
Also you make sure you find the AVR toolchain here:
C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin
-
Download and install “make” for Windows to
C:\Program Files(x86)\GnuWin32
-
Download avrdude & unzip to
C:\Program Files (x86)\avrdude
and make sure that when you enter this path it hasavrdude.exe
and the associated files in it. -
Edit your environment variables on your Windows computer so it’ll show up when you type the commands into the command line:
Hit the Windows key and type “Edit the system environment variables” Click the button on that popup window called “Environment Variables” and a new window will pop up. Click on “Path” then click “edit” & a new window pops up listing file paths. Click “Add” and paste the following paths one by one:
C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin
C:\Program Files (x86)\GnuWin32\bin
C:\Program Files (x86)\avrdude
-
Click “ok” on all the windows to close them.
-
Then reboot the machine.
-
Once rebooted, hit the Windows key and type in “cmd” and open the Command Prompt We started using PowerShell after this version of the workflow was written, but all the commands are the same
-
Test each command we’ll need:
-
Type
make
and it should say:make: *** No targets specified and no makefile found. Stop.
In the video above, you can see that the response is different, which is because themake all
has already been executed -
Type
avr-gcc
and it should say:avr-gcc: fatal error: no input files compilation terminated.
I skipped this step for a reason I cannot recall -
Type
avrdude
and it should vomit a lot of stuff on the screen. -
If these don’t give you the responses I mentioned above, then you need to check the path to the make program and edit that PATH variable again…
-
Connect the two chips together be sure to check orientation of the programmer cable as well
-
Download the FabtinyISP firmware to Desktop, and unzip the folder
-
Open the firmware folder and copy the path from the address bar
-
Open the Command Line and type
cd
(include space after “cd”) & paste the file path for the FabTinyISP folder -
Then type
dir
and it tells you what is in the folder (verify that all of the firmware files are there) -
Then type
make all
and you should get positive results Again, I skip this step because the files had already been made at this point
-
Then type
make flash
to download the hex file to the board The video immediately above shows my eventual programming success, but the video above that shows errors, which I explain at the end of this workflow -
Then type
make fuses
to burn most of the fuses
- Then unplug the boards and plug your new FabtinyISP into windows and it should be visible in Device Manager seen as
libusb-win32 devices
…if not, then you need to debug it. It’s likely a hardware issue such as the zener diodes are backwards or something simple.
- Then connect back to the fully functioning programmer & type
make rstdisbl
success can be seen @ 2:31 in the video
-
Remove the J1 solder joint
-
Replug and try to reprogram the FabtinyISP (
make all
,make hex
,make fuses
) -
If all else fails, make another board
Reference: These instructions are tweaked from this site
Other notes: Press up/down buttons to use previous commands, without having to type it all out again
The above video shows the view of PowerShell when I successfully used my finished programmer to actually program a fresh programmer made by one of my coursemates, Will Knight, that hadn’t been programed yet.
Notes: I experienced 2 issues while trying to program this board and get the computer to recognize it afterwards. As seen in the first video in the workflow, I got an error message when I tried to execute make flash
, which should have put the appropriate hex files onto my programmer. After many minutes of careful examination, I finally discovered that one of the legs of the pin header was not fully soldered, which I quickly fixed, as shown in the above image. I didn’t encounter the second issue until I tried to verify that my board had properly programmed; my board did not appear in the Device Manager, and I was pretty concerned. After a long time of inspection without seeing anything wrong, one of my instructors, Mr. Rudolph, thought that perhaps my USB contacts were not high enough; I quickly added more solder, and sure enough, my board showed up in the Device Manager, as shown in the workflow above.