Previous posts on the CNC machine:
I’ve done a bit more tuning on the CNC machine, and it’s running better than ever. First, I discovered a bit of useful data regarding stepper motor torque and micro-stepping. micro steps allow you to get greater precision from your stepper. Steppers are fed pulses from the controller board, where each pulse moves the motor a fixed increment. In my case, the steppers I use take 200 steps per revolution. If you needed greater precision than that, you can use micro-steps to send pulses that move the motor a fraction of a step at a time. For example, if I used 8x microsteps on my motors that are normally 200 pulses per revolution, they would jump to 1600 pulses per revolution. The micro steps can get you extra precision, but as this data shows the cost in torque can be quite high. I hadn’t realized that when I first setup my control board.
To get the most out of my little SparkFun steppers, I need all the torque I can get. The EasyDrivers are set by default to use 8x micro steps, but that can be disabled by jumping a couple pins to ground (as explained on the EasyDriver site). I don’t need the extra precision of micro-steps from my rig, since the motors turn 14-20 threaded rod to drive the CNC along an axis. 14-20 rod is 20 revolutions per inch, or 0.787 revolutions per mm. So each pulse is only moving the rig 1/157th of a millimeter. That’s enough precision for me! So, I did a bit of soldering and set each of the three motor controllers to use full resolution steps – and I’m now operating at 100% torque. Well, as much as these little motors can push anyway.
Next, I upgraded GRBL to the latest ‘beta’ version to take advantage of the max speed settings they added. These little SparkFun steppers stall at speeds over ~225mm/min so I need to keep them capped at about 190mm/min. With the current stable version of GRBL (0.8c), I was encountering issues where the motion planner would occasionally use higher speeds than those present in the gcode being processed. If I was cutting something using gcode settings of 200mm/min, GRBL would occasionally create runs that topped over 300mm/min and stall the motors. This usually occurred on axis-aligned paths. Crazy, and a pain in the ass to debug! But, after experimenting with the beta version of 0.9a, and capping it’s max speed, the same gcode is now working as expected. Go figure!
These little steppers still need a lot of wind up time before getting to top speed. In the GRBL settings, I have to keep the acceleration limits very low to maintain accuracy. When I bring them higher, the cutting path loses all accuracy and I end up just cutting gibberish. If you are working with the same SparkFun stepper motors and EasyDriver boards, here’s the GRBL settings I arrived at today after a bunch of tuning. Keep in mind this is also for 14-20 threaded rod, so your settings may differ.
$0=157.480 (x, step/mm)
$1=157.480 (y, step/mm)
$2=157.480 (z, step/mm)
$3=190.000 (x v_max, mm/min)
$4=190.000 (y v_max, mm/min)
$5=190.000 (z v_max, mm/min)
$6=1.000 (x accel, mm/sec^2)
$7=1.000 (y accel, mm/sec^2)
$8=1.000 (z accel, mm/sec^2)
$9=30 (step pulse, usec)
$10=190.000 (default feed, mm/min)
$11=0 (step port invert mask, int:11000000)
$12=25 (step idle delay, msec)
$13=0.050 (junction deviation, mm)
$14=0.005 (arc tolerance, mm)
$15=3 (n-decimals, int)
$16=0 (report inches, bool)
$17=1 (auto start, bool)
$18=0 (invert step enable, bool)
$19=0 (hard limits, bool)
$20=0 (homing cycle, bool)
$21=0 (homing dir invert mask, int:00000000)
$22=25.000 (homing feed, mm/min)
$23=190.000 (homing seek, mm/min)
$24=100 (homing debounce, msec)
$25=10.000 (homing pull-off, mm)
I hope that saves you some time. Killed my whole afternoon!
But they payoff was worth it. I cut some gears out of 1/4″ birch as a precision test, and they turned out perfect. Here’s a shot of the gear drawing in SketchUp, and the CNC in action cutting out the gear assembly shown at the top of this post.
It turns smooth as silk. Very encouraging for some of the projects I have planned. 🙂
UPDATE 3/28/2013: I totally forgot to mention the speed gain achieved by removing microsteps. In the initial build, the axis travel was limited to 50mm per minute to maintain torque. With the new setup, I’m now running at 190mm per minute. Still slower than most CNCs of this size, but good enough for my homebrew work.