5. Electronics production¶
updated (4/2/2021) added group work comment, additional description about issues and challenges.
Group Assignment¶
As mentioned in previous assignments, I am completing the group work on my own here at Haystack Fab Lab. That may or may not help those reading this and evaluating my work.
PCB Production Workflow¶
Machine | ShopBot Desktop 24 |
---|---|
Machine | Bantam Tools Desktop PCB Milling Machine |
I originally was intending to use the Bantam Mill for PCB production, but I realized that the spindle belt pulleys were busted and had to order some new replacements. So, instead, I took it upon myself to learn how to use the ShopBot Desktop to mill PCBs.
CAM: Generating Toolpaths¶
Software: VCarve Pro
ShopBot uses VCarve Pro as the primary supported CAM software to generate toolpaths. To get started, I imported the line test PNG file that Neil shared during lecture.
Since the file is a bitmap graphic, you can use VCarve’s trace bitmap tool to convert the image into vector paths that are then used to program the toolpaths. The image below shows the output from the trace bitmap tool.
Pocket Toolpath: Milling Traces¶
To mill the traces of a potential circuit board, you need to use the Pocket Toolpath program. Once you have your vector paths, selected, you simply click on the Pocket Toolpath icon and input the desired parameters.
Toolpath | Settings |
---|---|
Type | |
Start Depth | 0.0 mm |
End Depth | 0.15 |
Tool | 1/64” |
Cut Direction | Climb |
Cut Pattern | Offset |
Pocket Toolpath: Tool Settings¶
In order to use the Shopbot Desktop to mill the circuit boards, I need to create some new custom tools in VCarve’s tool database. To create a new tool, you need to specificy the tool’s diameter, desired spindle speed, cut speed, plunge speed, and pass depth.
Tool | Settings |
---|---|
Type | Endmill |
Diameter | 0.015625” |
Pass Depth | 0.015625” |
Step Over | 40% |
Spindle Speed | 15,000 RPM |
Feed Rate | 6.35 mm/sec |
Plunge Rate | 6.35 mm/sec |
I used some settings that I gathered from the Fab Modules’s PCB milling toolpath settings.
Profile Toolpath: Cut Out¶
To cut the PCB from the FR1 stock, you need to create a second toolpath that cuts along the profile of the board. In this case, we have a simple rectangle shape that surrounds the traces. The settings are similar except for the total cut depth is set to 1.7mm, which is the thickness of the FR1 stock. The settings I used are shown in the image below.
Preview Toolpaths¶
A nice feature of all CAM programs is to preview your toolpaths. This allows you to catch mistakes before they occur in the machining process. The toolpath preview is shown below.
Milling the Circuit board¶
To prepare milling the PCB, I attached the FR1 stock to the ShopBot’s bed using double-sided tape. I then cleaned the copper stock with alcohol.
Fortunately, we had an ER20 collet on hand to hold a tool with an 1/8” shank diameter so I was able to use the 1/64” end mill with the ShopBot Desktop. I loaded the tool into the spindle + collet and then homed the machine using the control software.
Milling the circuit board begins!
It took about 10 minutes to mill the traces. I vacuumed the board and it looked nice and clean. Success!
I swapped out tools, loaded a 1/32” endmill to cut the board out and then homed the Z-axis again to the top of the copper plate. I then ran the next toolpath from my VCarve file and cut the board out. This went much quicker, about 20-30 seconds in total.
The final line test board came out pretty good. The thin lines towards .001” got messed up, but that is to be expected with a 1/64” tool. I was impressed that the ShopBot did as good of a job as it did with this.
Files¶
LineTest.crv LineTest_MillTraces.sbp LineTest_CutOut.sbp
In-Circuit Programmer (ISP)¶
I am most likely going to be using the ATtiny44 for my projects down the road, so I am going to fabricate and produce an ISP (AVR) using the hello.ISP.44 design. Using the design rules above, I used the ShopBot Desktop and VCarve Pro to program the cutting program. Again, I just imported the PNG into VCarve and then traced the bitmap, which creates vector paths. This process seems to work well.
Milling¶
The milling process went smooth, it took about 15 minutes to fabricate the board. I used the same toolpath settings from earlier and that seemed to work well.
Stuffing & Soldering¶
I setup an electronics workbench at my home, note the Dr. Suess-looking fume extractor.
My strategy for surface mount electronics is to add a small amount of solder to the pads prior to stuffing the component, at least for the small passive components. This does not work out so well for the USB connector and IC.
After the solder has been added to the pad, I place the component on top, heat up the pad until the solder reflows around the component’s lead. This process works well.
There was one trace that shorted with another trace, which was a result of the milling process. I didn’t catch this mistake earlier in VCarve during the preview. I also need to install the solder jumpers for programming, which will then be removed after I load the firmware.
Flashing Firmware¶
CrossPack AVR Development Tool
brew install make
Navigate to firmware directory and run the following compiling code.
Fab-iMac-05:fabISP_mac.0.8.2_firmware fablab$ make clean
rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.elf *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
Fab-iMac-05:fabISP_mac.0.8.2_firmware fablab$ make hex
avr-gcc -Wall -Os -DF_CPU=20000000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -mmcu=attiny44 -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o
make: avr-gcc: Bad CPU type in executable
make: *** [Makefile:132: usbdrv/usbdrv.o] Error 127
Searched for solutions, and found this reference on solving the problem. Another reference from a previious Fab Academy student who ran into similar issues. Both of these students’ documentation helped me figure this out.
brew tap osx-cross/avr && brew install avr-gcc
xcode-select --install
Re-run the original brew install code to get the package.
Re make clean and hex commands work this time.
make fuse
This produced another error. BAD CPU TYPE. Then I realized I needed to install AVRDUDE package on my mac computer.
brew install avrdude
make program
Success!
Challenges & Issues¶
I ran into a couple of issues with this assignment. Mostly, I had planned to use the Bantam mill instead of the Shopbot Desktop for milling circuit boards. VCarve (ShopBot) is not the greatest CAM software for generating circuit board toolpaths, the preview is difficult to verify traces will come out unconnected and properly. I could have properly used Fab Mods to generate the SBP gcode files but I choose to try something different. This worked out okay in the end and was great to learn a new workflow for milling circuit boards.
The other issue I ran into was getting the software toolchain established and working properly. I had to install a lot of packages on my macOS system to get the code to compile and for AVRDUDE to flash the program onto the board properly. This was not surprising as it usually takes a couple of tries to get everything working properly. To my surprise, and documented in the electronics design week, the board was milling and stuffed properly and worked perfectly once I figured out the software toolchain.
Files¶
hello.ISP.traces.png hello.ISP.crv