Saturday, March 28, 2020

PCB Mill

PCB Mill Kit
My latest toy is a small PCB Mill, a CNC 3018 Pro, there are many available from Ali Express for the enormous sum of 285 Dirhams or so, which is about 70 Euro.  I thought that even if it didn't work at all, it would not be a big loss.

Assembled CNC 3018 Kit

It will help if you have a little previous workshop experience, but these machines are so simple and relatively slow moving, that any radio-geek can safely experiment.

Carving With a V-bit in a Puddle of Oil

Of course I can have boards made in China by Dirty PCBs, but what is the fun in that?

The problem with making PCB antennas, is that you need to experiment to change the design 1 mm this way or that, to tune it just so and just such and having to wait 2 weeks for each experiment doesn't work.  A few hours playing with a router is more practical.

It turned out to be a pretty nice little kit, made from aluminium and 1/4 inch Bakelite (paper reinforced phenol formaldehyde).  This Prehistoric Olde Fashioned Thermoset Composite is actually pretty good - very strong and stiff.  Assembling the kit was not difficult, but it requires some patience and one has to look ahead to see which nuts need to be slotted into the aluminium pieces for future use, before you bolt them together.  It is also a good idea to put a tiny drop of Locktite on the tips of all bolts, so they don't come undone under vibration (use a wooden tooth pick to apply a very small amount).

Many people don't understand how Loctite/Spring Washers work and why they are very important.  A bolt and nut is normally under tension, with the screw thread pressing together on one side only.  Under vibration, the screw can bounce and become momentarily completely loose, not touching either side of the thread.  Under this floating condition, the bolt can turn very easily.  This effect is used by an Impact Driver.  While the bolt can then turn left or right, Murphy's Law says that it will always turn left (Righty tighty, lefty loosy) and after a while you have little nuts and bolts rolling on the floor.  Purple Loctite 222 is a weak rubber glue that prevents the bolt from turning easily, but it is not so strong that you can never get it apart again.

Use calipers and a triangle to square the machine up as well as you can and once assembled, add a little bit of grease to the slides and worm screws so it will slide smoothly.

Note the anti-backlash springs on the worm screws.  These keep the system locked to one side of the screw thread.  If you stress the machine, then the spring may move and you may get backlash.  You can observe that as a visible jump on the tool tip when it exits a cut into already cut space.  Obviously if you see that, the results will be quite horrible - so slow down - get a mug of coffee and relax.

The step motors are small and there are no end stop switches.  When the mechanism hits the end, the motor magnetic fields will simply slip, which will make a clucking noise.  Don't worry about it - you don't need to add switches.  There is no mechanical wear when a step motor magnetic field slips.

I found only two problems:
a. Two of the three stepper motors rotated the wrong way.
b. The DC barrel plug of the PSU was the wrong size and didn't fit into the socket on the board.

The X and Z axis stepper direction can be reversed using the included GRBL Control software, but I could not find an old enough computer that it would run on (It requires an ancient niche OS called Windows, which was very popular in the previous century), so I cut and reversed the step motor Red/Blue wire pairs instead (reverse only one coil on each motor, else you are back to where you started from).

I could not find a bigger barrel plug in my Junque Bochs and one cannot easily replace the power socket without damaging the board, since it connects to the ground plane (which conducts the heat of a soldering iron away).  I could take the board to my work factory and ask a technician to replace it using an infrared rework machine, but thanks to the Corona virus hullabaloo, I'm stuck at home.  I therefore soldered a pair of wires to the underside of the controller board and fitted an inline socket instead - gut enuff.

Machine Controller
The next problem with these toys is finding usable software to control it with.  I expected this to be a hassle, since I mostly work on a MacBook.  My PCB design software of choice is KiCAD on a Fedora Linux virtual machine.  Hooking Linux via the Mac host USB port to the CNC machine would be very painful and I don't want my Mac to sit in the dust next to the mill - MacBook keyboards do not like dirt.

BTW, the CNC 3018 machine is small enough that one can put a large transparent plastic tote over it to contain the dust and debris.  You don't have to make a special box - just buy one at Carrefour or Ace HW.

I sidestepped the software issues, by ordering a model that includes a little offline controller.  This controller accepts a SD card, so that one can load it with a GRBL file, adjust it to the 0, 0, 0 position manually by rotating the lead screws (Rotate the lead screws when the power is off - best to use white grease or you will get black fingers) and let it go without any further ado.  The only problem then is converting a PCB Gerber file into a CNC GRBL file, which can be done with FlatCAM on Linux.

If you want to be seriously fancy, then you could run GRBL-Web on a Raspberry Pi and access the little CNC machine over your home LAN/WiFi :

Note that the first time you try it out, it is best to machine something soft, like balsa wood or construction foam, so that if the feed rates are wrong, the machine will not undergo a rapid unplanned disassembly.  I also plan to bolt the whole machine to a sheet of ply wood (Use rubber studs/grommets to prevent noise amplification) to keep it rigid - as soon as the virus scare is over and I can actually find a shop with ply wood.

2D PCB Antenna Carving
Now, I need to fire up KiCAD and design a little antenna to carve out.  That was rather easier said than done.

On Linux, one of the ways to convert a PCB into an outline and Gcode is a program called Flatcam.  This program does exactly what is written on the tin and it wants to have a Gerber PCB layer stack as input.  It can import a SVG file, but then it can be difficult to modify anything, so be sure that the graphic is correct. (Flatcam has an editor function, but it doesn't seem to work and I cannot get the editor to do anything beyond showing a little dot on the screen!).

Flatcam works well, but the UI is a bit confusing to the uninitiated.  In general, first get the red tracks generated, then generate the Gcode.  That sounds tremendously obvious, but it means that you may have to select and do things from the bottom up.  When you try to run Flatcam, you will understand.

Note that for a PCB antenna, you don't need to do isolation milling - simply remove all the non-copper with an end mill and the antenna will be left behind!

The size of the end mill depends on the smallest gap that it has to get through - simple as that - but with a 1/32nd inch or 0.8 mm, you can mill tracks, drill holes and cut out the board - one tool that conquers all.

I can make a Gerber file with KiCAD PCB editor, but while it has very useful footprint wizards, it doesn't have a nice drawing function that can be used for complex shaped small antenna footprints.

I then tried Inkscape and made a neat drawing - then I went on a crazy tour of different CAD programs and file formats, only to come back to Inkscape and the SVG file format.

The trick is that the KiCAD footprint editor can import an outline onto the Front Silkscreen layer.  It then needs some manual editing of the footprint in the library to move it to the Front Copper layer.  

In short: With KiCAD PcbNew, make a new footprint library and a new footprint.  Draw and save a SVG antenna with Inkscape.  Import the SVG file into the PcbNew footprint editor and save the footprint in the new library.  Open the footprint file with a text editor and replace all instances of F.Silk with F.Cu and save it.  Confirm using PcbNew that it is OK by clicking the layers on the right on/off.

Now you can place the footprint on a PCB and carry on as usual, by following this most excellent guide at Inventables

BTW, even with a simple little low cost engraver, you still need to use expensive bits.  The HS sample bits that you get with this toy are only good for experiments in soft wood/plastic - they are not sharp enough to cut copper properly at a fast speed.  Get 1/8th inch shank, Tungsten Carbide 0.8 mm end mills, and 30 Degree V bits for isolation milling (  

Since you cannot easily compensate for board warping and uneven surfaces, you need to cut a little deeper, without making the cuts wider.  Also, don't bother cutting the boards out with a small mill - a jigsaw is much more efficient, but you will need a good 1/8th inch end mill bit to cut out a level work surface and a 1/16th or 1/32nd to mill an antenna.  Cutting a surface with a needle nose V bit, will take longer than the Corona virus quarantine period.

With a larger CNC Mill and larger boards, you could probe the surface and compensate in the Gcode to handle the warping of the board ( - you can then save an hour of cutting time, with an hour of probing.  With a small board, the warping is less, so simply cut a little deeper and move slower.

Note that the Gcode is a text file.  You can modify it with a programmer's editor, if you want to change the cutting depth without having to rerun Flatcam for example.  You can also concatenate two or more files so they will run in succession with no further ado, if you don't need to do a tool change in between.  So you can do the copper, board cut-out and hole drilling all with the same 0.8 mm end cutter consecutively, unattended.

Flatcam Parameters
This is a small machine, with small motors, for making small PCBs.  If you stress it, you won't get good results, so take it slow.  The bigger the PCB, the more the warp, so keep them small.

For RF circuits the track width determines the impedance.  For these use a 15 degree needle tip, so that the cutting depth doesn't change the track width significantly - OR - use a 1/32" end mill and take it slow.

Boards are always slightly uneven and warped and the machine is not 100% true and steady.  A cutting depth of 5% to 15% of the thickness of a 1.5 mm board should work, but if you cut deep, the stress on the tool tip is very large, so slow down, else it will go blunt/break, or wander around and chip the copper.  Put several drops of machine oil on the board to lubricate the cutter.  This keeps the bit cool and sharp and also captures the swarfs and dust, so you can just wipe the mess off with an oil rag.  The oil prevents getting itch powder all over your shop.

Levelling Pocket - Made With an 8 mm End Mill

Eventually, I bolted a heavy 1/2 inch board to the aluminium table and slowly (20 mm/min) machined a very good polished 80 x 110 x 0.2 mm pocket, using an 8 mm end mill from my Dremel kit.  Next, I drilled 6 lead holes so that I can secure a 70 x 100 mm PCB blank with 6 small wood screws and washers.  That yields repeatable results.  I sealed the wood with Ye Gut Olde 3 in 1 Machine Oil.

The important point is that this is not a precision machine.  If you stress it, the results will be worse.  If you don't stress it, then it should last a long time.  For Euro 70, it has certainly exceeded my expectations.

Carbide 3D
The manufacturers of the Shapeoko Milling machine provides a free, online PCB Gerber to CNC outline Gcode converter.  Similar to Flatcam, you upload a Gerber file, select the tool and there you are:

Bits and Bites
Engraving V Bits are very strong and can cut very fast (200 to 300 mm/min), but the result is bound to be rough.  This is due to the nature of the bit.  If you need a clean cut, use a Fluted End Mill.  If you want a perfectly clean cut, use a Push Down Fluted End Mill. It has a left hand thread.  A push down bit seemingly goes the 'wrong' way and doesn't lift the copper layer, but then you have to cut more slowly (30 to 100 mm/min).

For cutting copper foil PCB, you need a very sharp bit.  Garden variety High Speed Steel bits are not quite sharp enough - they are OK for wood and plastic - but you should get tungsten carbide bits for PCBs.

The below little SMD board was cut with a new Steel V-bit.  No burrs, thanks to lots of 3 in 1 oil and taking it painfully slow at 20 mm/min.  Cutting in oil looks horrible, but it works. (The double cuts are due to the ground plane fill - I expected the middle left over copper to curl away, but it stayed perfectly and looks like 10 mil tracks.)

Freshly Cut - No Burrs

Cut in a puddle of oil.  Good olde 3 in 1 machine oil works wonders.  Spread it with a tooth pick.  It keeps the bits sharp and cold and prevents burrs.  It also prevents the dust from taking flight.  Wipe up with a rag and brush with a tooth brush and tooth paste under running water - yes, toothpaste works wonderful to clean an oily board!

V Bits need some high school trigonometry
V Milling bit: 0.1 mm tip, 15 degrees
  • Cutting depth: 0.15 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(15/2) x 0.15 = 0.139 mm
V Milling bit: 0.1 mm tip, 15 degrees
  • Cutting depth: 0.10 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(15/2) x 0.10 = 0.126 mm
V Milling bit: 0.1 mm tip, 15 degrees
  • Cutting depth: 0.05 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(15/2) x 0.05 = 0.113 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.20 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.20 =  0.207 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.15 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.15 = 0.180 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.10 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.10 = 0.154 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.05 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.05 = 0.127 mm

Default settings for Flatcam that will 'work' with any V tip:
Just remember 20, 20, 20!
  • Z = -0.20 mm
  • Travel Z = 2 mm
  • Tool diameter = 0.20 mm
  • Feed = 20 mm/min
  • Overlap: 0.15 to 0.25 (15 to 25 percent overlap)
  • Spindle Speed = 5000 (Any number will turn the motor on - no speed control)
  • Dwell Time = 1
The feed rate is related to the spindle RPMs and since this machine doesn't spin fast, you got to feed slow.

You need to cut fast enough that you get tiny little chips and not a cloud of itch powder, but not so fast that the tip wanders and cuts inaccurately.

Use 3 in 1 machine oil liberally and wipe your tools with an oil rag.  An oiled board lubricates the cutter and makes the dust stay on the board, so you don't get glass itch powder all over the shop and in your lungs.

Handy conversions:
1/64" = 0.397 mm; 1/32" = 0.794 mm; 1/16" = 1.59 mm; 1/8" = 3.175 mm; 1/4" = 6.35 mm
20 mil = 0.508 mm; 40 mil = 1.016 mm; 60 mil = 1.524 mm; 80 mil = 2.03 mm; 100 mil = 2.54 mm

Router tip tips:
  • Use a push down (left handed) end mill for a clean surface cut on a laminate.
  • Use a single flute straight cutter on plastics to avoid melting and fouling.

PCB Fixed with Screws and Bent Washers

  • A straight fluted end mill also gives good results, but 
  • a common right handed pull up end mill is as bad as a V bit.
  • Use a cutting fluid - a puddle of machine oil on the copper makes a huge difference.
BTW, regarding the PCB fixture - one can actually buy bent washers made of spring steel, but I just bent some mild steel washers with a crimping tool...

Table Levelling:
  • Bolt Masonite or other soft wood to the aluminium table and machine a level pocket in it 
  • Pocket depth: 0.5 to 1 mm deep
  • Size: A little bigger than your PCB blanks
  • Use a relatively big end mill to get a polished surface (6 to 8 mm)
  • Either use double sided tape, or screw the blank boards down, but screwing can warp them more.
  • Amazing Goop glue also works and it can be rubbed off with a thumb after you pulled the board up. In sheer desperation, I used it for the experiment below and was pleasantly surprized.
Where to get Masonite/Hard Board/Wood during the shutdowns: Buy a clip board, or a bread board at Lulu or Carrefour...

V-Bit Test:
Milling RF parts with a V bit is not recommended and the below picture shows why.

 Yagi Milled with a 30 Degree V Bit

The elements are not of a consistent width.  Cutting this test antenna took about 2 hours, at 200 mm/minute, which is really too fast for a V bit, if you were wondering, but it proved my mill is working as expected and can keep going for hours without burning out, or falling to pieces.  The quality would be much better with a 1/16th inch push down end mill at 20 to 30 mm/minute and will take the same time, since being wider, it will run a much shorter distance.

Yagi Done With 0.8 mm End Mill

Cutting the second Yagi took about 3 hours.  Liberal use of oil resulted in a clean cut with no burrs.  For the next ry, I'll increase the overlap to 20% to get rid of the little left over bits of foil.

See this for antenna details and measurement results:

One problem is that one has to lower the head until the tip of the mill bit just barely touches the copper - if you drive it down hard, then it will cut much deeper than intended.  A 1 thou contact point is very hard to see for someone my age, even with a magnifying glass.  So I soldered a LED and a 2k2 resistor to a 9V battery and two crocodile clips.

Contact Indicator

Cutting Fluid
I tried using propanol and 3 in 1 oil as as a cutting fluid: Propanol works and is less messy, but it evaporates too quickly.  Oil is more sticky and keeps the dust down perfectly.  Wiping it up with a piece of an old T-shirt is also no problem at all.  So my recommendation is to put 5 to 10 drops of oil on the board before you start and keep it wetted.

PCB Warp Compensation:
With this little machine, forget about warp compensation.  The machine is not accurate enough to worry about 0.05 mm differences.

For best results, keep the board feature size larger than 1 mm and cut 0.2 mm deep with a 2 flute (1/32") 0.8 mm or (1/64") 0.4 mm end mill, or a 30 degree V-bit at 10 to 20 mm/min.  The bigger the pads and tracks, the better - 1 mm tracks are good, 0.25 mm (10 mil) are not recommended.

If you want to try V bits for very fine isolation milling of SMD parts, the Autoleveller project is here:, but I like'em square and prefer end mills and big tracks.  Small tracks will be an exercise in frustration with this machine - it is simply not accurate enough.  You only need one bad track to ruin a board.

Manual Control
The little offline controller is also nice for drilling small holes and making straight cuts, without programming. A wee little drill press...

Bakelite (Pertinax, Formica, Melamine)
The >100 year old Paper Reinforced Phenol Formaldehyde plastic sheets have made a comeback recently - the modern composites are more stable than before.  Bakelite sheets are dimensionally stable, very strong and much easier to cut/file/mill/drill than aluminium, acrylic or fibreglass board.  It is very useful for making enclosures and panels with intricate cutouts for connectors and it doesn't foul or blunt your tools.

Bakelite is produced in 8' by 4' sheets just like plywood, which presents a large delivery problem. Here are two vendors in Germany for cut pieces of Paper Bakelite, FR2 PCB, Carbon, Aluminium, Lexan and more:

US vendors:

I list them here, since it is very difficult to find these type of composite sheet stock vendors.  Google doesn't help, it just turns up page after page of Chinese PCB manufacturers.

Further Information

So What is This Toy Good For?
It is good for single sided home PCBs with parts large enough that someone over 50 can actually see them unaided.  It really does make home brew circuits look much more professional and neat than strip board or blob board.

You can do SMD boards, but you have to keep the pads bigger than 1 mm on a side, such as 1206 or 1812 - the small 0603 (1.5 by 0.8 mm), with 0.5 mm tracks, is probably the lower limit - the bigger the better.

If you have to use a little SO8 package for example, buy a little break-out board for it from Sparkfun, so you can make bigger 1 mm tracks.  The secret sauce however, is cutting in a puddle of machine oil - clean the board with a tooth brush and toothpaste.  If there is enough oil, then there are no burrs.

I also had success with engraving plastic, using a V-bit with the same 20, 20, 20 settings and a puddle of propanol as lubricant.  Oil could make plastics craze.  Clamping a small sheet of acrylic down is difficult - it tends to crack - put something under the washers.

I have not had success with cutting plastic panels yet - it tends to melt - even with propanol.  I am waiting for better single flute end mill bits - hopefully that will work. The secret with plastic is that you need very sharp bits and move at a relatively fast rate.  Blunt bits cause friction and melts the plastic.  Once you found one that works, don't use your new found plastic cutting bit to cut anything else.

BTW, if you want to cut panels to make boxes, see this wizard:

Square Helical Antenna
Something I would like to try, is to make a quadrifilar antenna on 4 pieces of PCB - a square tube version of this one: starting with the box wizard above for the outlines.

La Voila!


No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.