Assignment #4
electronics production

The fourth Fab Academy assignment is electronics production.
We have to use a CNC milling machine to produce an ISP programmer.
The first thing to do is to mill some FR1 sheets to test the design rules of the circuit we’ll design.

1 – export the files for milling

After looking at work by previous Fab Academy students, I chose a PCB designed by Axel Cornu . The design improves on aspects of Brian’s FabISP and comes with a great introduction featuring Professor Farnsworth, which was enough to win me over! I downloaded the Eagle version from Axel’s page and opened it in KiCad. I exported the top copper layer and the Edge.Cuts outline as Gerber files for milling.

The circuit will be made of the following parts
1x – ATtiny45 microcontroller
1x – 100 nF capacitor
2x – 47 Ohm resistors
2x – 150 Ohm resistors
1x – 1.5 kΩ resistor
2x – 3,3 V Zener diodes
2x – LEDs
1x – 3x2 pin connector
Turning the geometry into a milling path

Assignment 4 documentation image: ass5 1

2 – generating milling paths and G-code

To generate the G-code I decided to use software called FlatCAM. FlatCAM is an open-source G-code generator designed by Juan Pablo Caram. It imports Gerber and SVG files and creates toolpaths around them. I started with the circuit traces. The software needs the tool diameter, 0.4 in my case, and the feed rate, for which I chose 30 mm per minute. There are three main steps:
1 – import the gerber file
2 – Create a toolpath around it
Turning the geometry into a milling path
After preparing the traces, I moved to the outline. However, FlatCAM’s “Board cut” function generated a rectangle around the Gerber geometry rather than following the PCB’s USB-shaped outline.

Assignment 4 documentation image: ass5 2 Assignment 4 documentation image: ass5 3 Assignment 4 documentation image: ass5 4

I had to find my way around it, so I did it by following this tutorial.
I returned to KiCad and created a fill on the bottom layer with the desired board shape. Back in FlatCAM, I treated this geometry like a trace, using a larger 0.8 mm bit and a 1.5 mm cutting depth. This produced a path around the outline I needed. I also added tabs manually in “Edit geometry” to keep the board in place.

Assignment 4 documentation image: ass5 5 Once this was done, I exported the two G-code files and moved to the machine.

3 – Milling the PCB

With the G-code ready, it was time to use the machine: a Stepcraft 2/600 Black Edition. This version has more precise stepper motors for work such as PCB milling. I used a Proxxon spindle, with its rotation speed adjusted manually using the knob on the spindle.

Assignment 4 documentation image: ass5 6

First, I milled a square on a polycarbonate sheet to make sure the working surface was parallel to the machine’s motion. I then attached the FR material using double-sided tape. In UCCNC, I positioned the tool at the lower-right corner of the material and clicked “Zero all”. Setting the Z origin required more care: I placed the spindle just above the surface, loosened the bit, lowered it gently until it touched the material, then secured it and set the Z origin.

Assignment 4 documentation image: ass5 7 Assignment 4 documentation image: ass5 8

The first attempts did not go well. In CAM, I had set the cut depth to 1.5 rather than 0.15, cutting a trace-shaped hole through the PCB. Surprisingly, the bit did not break. I corrected the G-code and tried again, but the bit was in poor condition and the cut was still bad. After replacing the bit, the traces finally milled well. I switched to a 0.8 mm bit for the outline, which worked on the first attempt. At last, I had my PCB!

Assignment 4 documentation image: ass5 19 Assignment 4 documentation image: ass5 9 Assignment 4 documentation image: ass5 10

4 – Solder on the PCB

I was super happy with my PCB milling session, and I finally moved to the soldering phase, where I could finally put all the components together and start to make my PCB work. I was very excited, but as soon as I touched the surface of the PCB with my soldering iron, the track charred immediately and my PCB was no longer usable… After this traumatic experience I just started to put tin on the other parts to get a little more used to the practice, but I think I made quite a mess. I’m going to make another board, and then I’ll try to solder the components avoiding direct contact between the iron and the PCB

Assignment 4 documentation image: ass5 11

5 – Solder on the PCB 2 – the copper battlefield

After milling another PCB, I was nervous about soldering it. I used the old board and other failed attempts to practise first.

Assignment 4 documentation image: ass5 12

I followed several tutorials for precise instructions. The one I recommend most is this one by the mighty Collin Cunningham. The tutorial is very well made, the only thing that I feel like adding to it is that since we are not putting solder mask on our PCBs we’ll need to be extra careful not to ruin our board (like I did before…), and the use of solder paste really helped a lot in the process. Besides this, I milled two more boards and placed almost all the parts on them, but as soon as I touched the pin connectors… ...BAM! The connectors went away, bringing a substantial part of the traces with them. This was truly frustrating, and it left me no choice but to throw away the board and start over again (what the hell...).

Assignment 4 documentation image: ass5 13

I did my best to keep my morale up and soldered everything again. Fortunately, this time it went well. Here is the result:

Assignment 4 documentation image: ass5 14 Assignment 4 documentation image: ass5 15

6 – flashing the ISP programmer

To flash the ISP programmer I used an Arduino, because I don’t have an already working ISP programmer. I used this tutorial to do it

Assignment 4 documentation image: ass5 16

Once the Arduino was set up, I edited the firmware’s Makefile to select its USB port and the ATtiny45 controller.

Assignment 4 documentation image: ass5 16

After that, I followed this tutorial. I opened the folder in my terminal and ran “make hex” to generate the HEX file, although the terminal reported “nothing to be done for hex”. Then I ran “make flash” to flash the ISP programmer.

Assignment 4 documentation image: ass5 17 Assignment 4 documentation image: ass5 18

Source files

Here are all the source files for the Electronics production assignment:
1 – KiCad file for the FabISP 45 Key
2 – GBR + SVG files for the FabISP 45 Key