Individual assignment: Make and test an embedded microcontroller board#
This week we had to take the board we designed in week 6 (Pi Pico W with 3 LEDs and 220 ohm resistors) and actually prepare it for milling on the Roland SRM-20. the workflow is basically KiCad design rules check, export gerbers, convert to PNGs, then generate toolpaths in mods. sounds straightforward but I ended up doing it twice because of a footprint issue
Part 1: Design and toolpath preparation#
Design rules check (attempt 1)#
First thing was setting up the board design rules in KiCad’s PCB editor. went to Board Setup > Design Rules and configured the constraints for our milling setup. minimum clearance 0.6mm, track width 0.4mm, connection width 0.4mm, annular width 0.6mm, via diameter 2mm, copper to hole clearance 0.6mm, copper to edge clearance 0.6mm

Ran the DRC and got hit with 88 violations right away. most of them were annular width errors, the board setup constraints wanted minimum 0.6mm but actual was 0.3mm on the PTH pads. basically the through-hole pads on the Pico header footprint were too small for the rules I set

So I went back and adjusted the rules. dropped the minimum annular width to 0.3mm and bumped the hole to hole clearance to 2mm. also set the uVia diameter and hole to 0.8mm

Exporting gerber files#
Next step was exporting the gerber files from KiCad. went to File > Plot, selected Gerber format, made sure F.Cu (front copper) and Edge.Cuts layers were included. checked the options for drill/place file origin and cross-out DNP

Plot ran clean, generated the F_Cu.gbr and Edge_Cuts.gbr files with zero errors and warnings

Then generated the drill files separately. used Excellon format with PTH and NPTH in single file, absolute origin, millimeters, decimal format

Converting gerbers to PNGs#
Used gerber2png.fablabkerala.in to convert the gerber files into PNG images that modsproject can read. uploaded the three files (F_Cu gerber, Edge_Cuts gerber, and the drill file) and the board showed up in the preview. 52.5 x 55mm board

The Quick Setup dropdown lets you generate specific layers. you need Top Trace, Top Drill and Top Cut for single side milling

Selected Top Trace with B/W mode to get a clean black and white trace image for the mill. this is what the SRM-20 will actually cut around

Generated all three PNGs. the outline and drill images show up in the preview panel on the right, ready to download

Generating toolpaths in modsproject#
Opened modsproject.org and loaded the traces PNG. the read png module shows the image at 999.998 dpi, 2131 x 2229 px which is 54.128 x 56.617mm. matches our board dimensions

Configured the mill raster 2D module. tool diameter 0.4mm (that’s the end mill we have), cut depth 0.1mm, max depth 0.1mm, offset number 4 which means it’ll make 4 passes around each trace, offset stepover 0.5, climb milling direction, forward path order with sort distance enabled

The 3D preview shows what the milled board will look like. copper on FR1 substrate with the traces carved out. you can orbit around it and check that everything looks right

The Roland SRM-20 output module shows the machine settings. speed 4mm/s, jog height 5mm, estimated milling time about 9 minutes 43 seconds

Also loaded the drills PNG into a separate pipeline. same process, different image

The footprint problem#
At this point we realized something was wrong. I had used the through-hole header version of the Pi Pico footprint in my schematic. the THT footprint has two rows of through-hole pins that you solder headers into. but for PCB milling on a single-sided board, you want the SMD version where the Pico sits directly on surface mount pads. with the header version you’d have to mirror/invert the Pico which doesnt really work for what we need
So I went back to the schematic and swapped the footprint to Module_RaspberryPi_PicoW_Combined which has both THT and SMD pads. rewired everything
Redo: updated schematic#
Here’s the updated schematic with the combined footprint. 3 LEDs (D1, D2, D3) with 220 ohm resistors (R1, R2, R3) connected to GP10, GP11 and GP12 pins. GND rail at the bottom, 3V3 power on the right with PWR_FLAGs

Cleaned up the power flags placement. moved PWR_FLAG for GND to the left side near the LED ground connections

Ran the Electrical Rules Check and got zero violations this time. clean schematic

Redo: PCB layout#
Opened the PCB editor and it had both the old THT footprint and the new combined one sitting there. needed to clean that up

Used Tools > Update PCB from Schematic to sync the changes. the dialog shows it reconnecting nets to the new footprint pins

Had two M1 footprints stacked on top of each other. right-clicked to select between them and deleted the old THT one

After removing the old footprint and rerouting, got the board laid out with the SMD pads. LEDs and resistors on the left, Pico combined footprint on the right

First DRC run on the new layout had some errors. items shorting two nets and front solder mask aperture bridges between different nets. the SMD pads were too close together

Fixed the routing and pad spacing. DRC now shows only silkscreen clipped by board edge warnings which are fine, no actual errors

Redo: gerber export and PNG generation#
Exported the gerbers again and loaded them into gerber2png. you can see the finder window with all the generated files on the right

Generated the Top Trace in B/W. the SMD version looks quite different from the THT one, the pads are elongated rectangles instead of circles with holes

Generated the drill and outline PNGs too

Redo: mods toolpath generation#
Loaded the new trace PNGs into modsproject. same mill raster 2D settings as before, 0.4mm tool, 0.1mm cut depth, 4 offsets

3D preview of the final SMD board toolpath. you can see the rectangular SMD pads on the right side where the Pico will sit, and the LED/resistor pads on the left. ready to mill

Takeaways from design phase#
Biggest lesson this week was checking the footprint type early. I burned a good chunk of time going through the whole gerber/mods pipeline before realizing the THT header footprint wasn’t going to work for single-sided milling. the SMD combined footprint is what you want when the Pico sits flat on the board. also learned that the design rules in KiCad need to be tuned to match what your mill can actually do, the defaults are way too tight for the SRM-20 with a 0.4mm end mill.
Part 2: Milling the board#
With the toolpath files ready from modsproject, time to actually cut this thing on the Roland SRM-20.
The machine#
The Roland Monofab SRM-20 desktop mill at Enterprise FabLab. compact little machine, lives in the CNC room between shelves of parts and an oscilloscope

Inventory label says its a high-resolution milling machine. model Monofab SRM-20, code EFL0030, section Victor, CNC Room

Material and setup#
Started with a blank single-sided copper clad FR1 board. this is the stock material, copper layer on top of a phenolic substrate

First thing was hoovering out the machine bed. there was dust from previous jobs in there, you want a clean flat surface so the board sits level

Securing the board#
Applied double-sided tape to the back of the copper board. you need it held down firmly because the mill will push on it, and any movement ruins your traces

Board stuck down on the machine bed, taped nice and flat. no bubbles or lifted corners

Finding the right bits#
Dug through the tooling drawer to find the right end mills. lot of different bits in there, various sizes and types

Found the carbide end milling cutters we need. 0.4mm for the traces (D0.4D450L*2F HRC60) and 0.8mm for the outline cut. both 2-flute carbide

Setting up in VPanel#
The SRM-20 is controlled through Roland’s VPanel software. opened it up and you get the coordinate display with X/Y/Z position, movement arrows, speed controls, and the origin buttons

Setting the X/Y origin#
Need to jog the machine to where you want the cut to start. used the X/Y arrows in VPanel to move the spindle to the bottom-left corner of where the board should be milled. the “X/Y” button under “To Origin” is what sets your home position

Moved the end mill over the copper board to the starting position. you can see it hovering above the surface

VPanel now shows X=20.00, Y=23.67, Z=-1.00. using x100 cursor step for coarse positioning first then fine tuning with x10

Setting the Z origin#
This is the critical part. you need the end mill tip to just barely touch the copper surface. lowered the spindle close to the board

To get the Z right, you loosen the collet with an allen key so the bit drops down under gravity until it rests on the copper surface. then tighten it back up. this way you know the tip is exactly at the surface level

VPanel asks to confirm setting the Z origin. hit Yes

Origin is now set. X=20.00, Y=23.67, Z=0.00. thats our reference point for the whole cut

After hitting “X/Y” and “Z” origin buttons, the machine resets the display to X=0.00, Y=0.00, Z=3.00 (it lifts the Z up 3mm for safety)

Loading the toolpath and cutting#
Close-up through the cover of the 0.4mm end mill bit, ready to go

Spindle spinning at 7797 rpm. on and ready

Opened the file dialog in VPanel to load the toolpath. navigated to Downloads where modsproject saved the .rml file

The Cut dialog shows the output file loaded - traces_top_layer_0.png.rml. hit Output to start the cut

First cut result#
Milling in progress. you can see the copper dust building up as the end mill carves out the traces. the machine just goes back and forth methodically

First cut done. can see the traces starting to appear under all the copper dust. looks like it worked but hard to tell with all the debris

Hoovered the board to see the result properly

The depth problem#
After cleaning off the dust, could see the traces clearly but one side wasnt cut deep enough. the Pico pad area on the right looked barely scratched, copper not fully removed between the traces

Measured the board thickness with digital calipers to understand what we’re working with. 1.68mm

Second pass - deeper cut#
Lowered the Z axis to cut deeper and ran the same trace toolpath again. you can see way more dust this time, its actually cutting through the copper properly now

After hoovering the second pass. traces look much cleaner now, copper properly removed between pads on both sides

Close-up of the spindle collet holding the 0.4mm end mill

Side view showing the end mill over the milled board. you can see the traces are properly carved now

Cutting the outline#
Now need to cut the board outline to separate it from the stock. adjusted the Z in VPanel, showing Z=2.10

Reset to Z=3.00 after setting the new origin for the outline cut

End mill positioned at the board edge, ready for the outline pass

VPanel showing Z=4.00 with x100 cursor step. deeper Z for cutting through the full board thickness

Loaded the outline toolpath in the Cut dialog - outline_top_layer_1.png.rml. hit Output

Outline cut done. massive amount of FR1 dust everywhere, the machine cut right through the full board thickness. you can see the rectangular outline carved around the PCB

Removing the board#
Used a scraper to pry the cut board off the double-sided tape. careful not to bend it

The finished board#
Here it is. the finished milled PCB held up. LED and resistor pads on the left with the routing traces, and the two rows of Pico SMD pads on the right. traces are clean, copper properly removed

Test fit with the Pi Pico sitting on the board. pads line up nicely with the SMD footprint

TODO#
- solder the SMD components onto the board (Pico W, LEDs, 220 ohm resistors) - thats the next step for later this week
- test continuity and verify the circuit works
- program the Pico W and blink some LEDs