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

KiCad Board Setup showing design rules - minimum clearance 0.6mm, track width 0.4mm, annular width 0.6mm, via diameter 2mm

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

Design Rules Checker showing 88 violations, mostly annular width errors on PTH pads where actual 0.3mm was less than the required 0.6mm

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

Board Setup with adjusted design rules - annular width reduced to 0.3mm, hole to hole clearance set to 2mm

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

KiCad Plot dialog with Gerber format selected, F.Cu and Edge.Cuts layers checked, general options configured

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

Plot output messages showing successful generation of F_Cu.gbr and Edge_Cuts.gbr gerber files with 0 errors

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

Generate Drill Files dialog with Excellon format, PTH and NPTH in single file, absolute origin in millimeters

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

Gerber2PNG with the PCB loaded showing the board layout in original colors, dimensions 52.5 x 55mm

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

Gerber2PNG Quick Setup dropdown showing options: Generate All, Generate for Carvera, Top Trace, Top Drill, Top Cut

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

Gerber2PNG showing Top Trace in B/W mode - black background with white traces showing the PCB routing

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

Gerber2PNG with Top Cut selected, preview panel showing generated outline_top_layer and drills_top_layer PNGs

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

modsproject read png module with traces_top_layer_0.png loaded, showing 999.998 dpi, 2131x2229px, 54x56mm

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

modsproject mill raster 2D settings - tool diameter 0.4mm, cut depth 0.1mm, offset number 4, climb direction

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

modsproject 3D toolpath preview showing the PCB traces on copper/FR1 stock from an angled view

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

modsproject Roland SRM-20 milling machine module - speed 4mm/s, jog height 5mm, estimated time 00:09:43

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

modsproject read png module with drills_top_layer_1.png loaded, showing drill hole positions

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

Updated KiCad schematic with Module_RaspberryPi_PicoW_Combined footprint, 3 LEDs with resistors on GP10-GP12

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

Schematic with PWR_FLAG repositioned to left side near GND connections for cleaner layout

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

Electrical Rules Checker showing 0 violations on the updated 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

PCB Editor showing both the old THT Pico footprint and new Combined footprint with ratsnest lines

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

Update PCB from Schematic dialog showing net reconnections and field updates for the new footprint

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

PCB Editor context menu showing two Footprint M1 options, selecting between the Combined and THT versions

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

PCB layout with SMD footprint routed - LEDs and resistors on left, Pico combined footprint on right with traces

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

DRC showing errors - nets shorting and solder mask aperture bridges between pads on the combined footprint

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

DRC clean - only silkscreen clipped by board edge warnings, 0 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

Gerber2PNG with the updated SMD board loaded, Finder showing gerber 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

Gerber2PNG Top Trace B/W for SMD layout showing elongated rectangular pads instead of round through-holes

Generated the drill and outline PNGs too

Gerber2PNG showing Top Drill view with generated drill and outline PNGs in the preview panel

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

modsproject mill raster 2D with SMD trace image - same settings, tool 0.4mm, depth 0.1mm, 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

modsproject 3D preview of SMD board showing rectangular Pico pads and LED routing on copper/FR1

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

Roland SRM-20 desktop mill with lid open, copper board visible on the bed

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

Enterprise FabLab inventory label on the SRM-20 showing model info and location

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

Blank copper clad FR1 board on the machine bed

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

Vacuuming the SRM-20 bed with a DeWalt hoover to clear previous milling dust

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

Applying double-sided tape strips to the back of the copper board with a craft knife

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

Copper board secured with double-sided tape on the SRM-20 bed, ready for milling

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

Drawer of assorted end mill bits and PCB milling tools

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

Two carbide end mill cutter packages - 0.4mm and 0.8mm diameter, 2-flute HRC60

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

VPanel for SRM-20 software showing coordinate system, movement controls, speed and spindle settings

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

Close-up of VPanel Move section showing X/Y origin button and cursor step options

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

End mill positioned above the copper board at the desired X/Y origin point

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

VPanel coordinates X=20.00 Y=23.67 Z=-1.00 with x100 cursor step selected

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

End mill lowered close to the copper board surface for Z-axis zeroing

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

Using an allen key to loosen the collet, letting the end mill drop to the copper surface for Z zeroing

VPanel asks to confirm setting the Z origin. hit Yes

VPanel dialog asking to confirm changing Z origin settings in User Coordinate System

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

VPanel showing origin set with X=20.00 Y=23.67 Z=0.00

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)

VPanel after origin set showing X=0.00 Y=0.00 Z=3.00 with x100 step

Loading the toolpath and cutting#

Close-up through the cover of the 0.4mm end mill bit, ready to go

Close-up of the end mill bit through the SRM-20 cover

Spindle spinning at 7797 rpm. on and ready

VPanel showing spindle ON at 7797 rpm

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

Windows file dialog browsing Downloads folder for the toolpath .rml file

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

VPanel Cut dialog with traces toolpath file loaded, ready to output

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

SRM-20 milling in progress, copper dust accumulating on the board as traces are carved

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

Milled board close-up showing traces under copper dust after first cut

Hoovered the board to see the result properly

Vacuuming the milled board to clear copper dust and inspect the traces

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

Milled board after hoovering - traces visible but right side pads not cut deep enough

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

Digital calipers measuring the copper board thickness at 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

Second milling pass in progress with deeper Z setting, more copper dust visible

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

Board after second pass and cleaning - traces cleanly cut on both sides

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

Close-up of SRM-20 spindle collet with end mill bit

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

Side view of end mill positioned over the milled board with visible traces

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

VPanel showing Z=2.10mm for outline cut setup

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

VPanel showing Z=3.00mm ready for outline cut

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

End mill at board edge ready for outline cut, traces visible on the board

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

VPanel showing Z=4.00mm with x100 step for outline cut depth

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

VPanel Cut dialog with outline_top_layer_1.png.rml loaded for the outline cut

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

Outline cut complete - board separated from stock, covered in FR1 dust

Removing the board#

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

Using a scraper to pry the finished PCB off the double-sided tape on the machine bed

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

Finished milled PCB held in hand showing clean traces, LED pads on left and Pico SMD pads on right

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

Pi Pico placed on the milled board for test fitment, pads aligned with 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