I recently converted my mf-70 to cnc control, and I’ve decided to write about it because it’s surprisingly easy, and makes an awesome tool. Seen above is the completed mill, next to a SOIC-20 breakout board I milled with it.
I’m going to divide this post into:
1) Mechanics: Basically just coupling stepper motors to the axes. Also, replacing the spindle motor with a brushless motor (optional).
2) Electronics: usb->rs232->gcode->stepper commands (Basically reprap electronics).
3) Software: PCB layout -> gcode.
1) I decided to use NEMA23 steppers to control the 3 axes, since I had some lying around. They have a LOT of torque, and are small enough to fit easily. Initially, I used some 3d printed couplers (http://www.thingiverse.com/thing:9622) to attach the motors to the threaded rods. They had a fair bit of slop, but the real aim was to manage to cnc mill some proper oldham couplers:
Oldham couplings have the really nice property that they tolerate axial misalignment quite happily – in my case I’m using 32mm steel rod for the coupling, and they tolerate 5-10mm misalignment well. Milling instructions are in the previous post on this blog.
Annoyingly, I managed to burn out my spindle motor within hours of use (I was milling steel at much too fast a feedrate so the motor stalled). I was initially panicked, but then realised I had a spare brushless motor than might just do the job. I ended up using a TURNIGY plush 25Amp ESC with a TURNIGY 2217 860kv 22A outrunner, and coupling to the spindle with a small 3d printed part I made (http://www.thingiverse.com/thing:115759). The motor was loosely secured with cable ties. I needed some control that would output servo commands to control the ESC, so I used the schematic at: 556 Based Servo Exerciser . The fan sitting on top is to cool down the motor (the motors can overheat, since they’re really made to be coupled to a propeller in an rc model).
2) I had a bunch of spare parts lying around from previous 3d printer projects, so I mushed some together to get some free electronics:
I use marlin firmware (https://github.com/ErikZalm/Marlin), and the stepper drivers are easy to attach (step/dir/enable). You can use any stepper drivers and electronics that work with Marlin/grbl/whatever. The drivers get pretty hot, so they’re housed in a wooden box with fans at each end.
3) I use eagle with pcb2gcode to generate the gcode. You just need to generate the board layout with eagle, then use the CAM processor with (http://www.sparkfun.com/tutorial/BeginningEmbedded/9-EaglePCBs/sfe-gerb274x.cam)
Then, you just need a pcb2gcode millproject file (for arcane reasons, pcb2gcode expects a file called milproject in the current directory). I use:
# this is an example config file for pcb2gcode. # place this in the same directory as your gerber files to save typing metric=1 # You may want to uncomment and change those in local project file front=untitled.GTL #back=diode_tester-B_Cu.gbl #drill=diode_tester.drl # parameters for isolation routing / engraving / etching zwork=10 zsafe=12 zchange=15 mill-feed=100 mill-speed=30000 drill-front=1 # drilling parameters zdrill=-2 drill-feed=300 drill-speed=20000 # generate voronoi regions offset=100 dpi=1000
You’ll need the metric version of pcb2gcode at: https://github.com/festlv/pcb2gcode-metric
Then you just need to modify millproject to contain the exact file that you want to be milled, then you can just run ./pcb2gcode in the directory containing millproject and your gerber files, which will give you a .ngc file. You can then push this to the mill with something like pronterface (https://github.com/kliment/Printrun).
In order to get everything lined up correctly, I use the following steps:
I tell the FW that the axes locations are at some arbitrary large number (G92 X100; G92 Y100; G92 Z100)
I use pronterface to jog the axes until x and y are where I want 0,0 to be.
I tell the FW that it is at 0,0 (G92 X0; G92 Y0)
I move the Z axes down until the tip is touching the copper (I will in future automate this with a probe).
I then tell the FW that the Z axis is at 10mm + cut depth (say for example G92 Z10.2)
I hit start.