CNC 3018-Pro: GRBL Configuration

The CNC 3018-Pro router arrived with GRBL 1.1f installed on the Camtool V3.3 board and ran well enough, although it accelerated very slowly. After installing Home switches, figuring out the travel limits, and trying different speeds & accelerations, it runs much better:

3018 CNC - Endstop switches - overview
3018 CNC – Endstop switches – overview

Configuration values to remember for next time:

$1=100 turns off the stepper motor drivers after 100 ms of inactivity:

3018 X - 100ms timeout - 100mm-min 12V 500 ma-div
3018 X – 100ms timeout – 100mm-min 12V 500 ma-div

There’s no force worth mentioning on a diamond scribe when the motors stop, so there’s no reason to keep them energized, and the DRV8825 chips resume from the same microstep when re-enabled.

$3=5 reverses the X and Z motor rotation, so you can use the same type of cable on all three axes and have them move the way you’d expect.

$20=1 turns on Soft Limits, thereby producing an error when you (or the G-Code) tries to move beyond the machine’s limits, as defined by the $120 $121 $122 values relative to the Home switch positions.

$21=0 leaves Hard Limits off, because I didn’t see much point in switches on both ends of all the axes for this little bitty machine.

$22=1 enables the Home cycle, after which you must start each session by homing the machine.

$27=1.000 sets the Pull-off distance from all three Home positions, so the machine ends up at absolute XYZ = -1.000 mm relative to the switch trip points after homing. This depends on the mechanics of the limit switches, but seems OK with the MBI-style switches I used:

3018 CNC - X axis endstop - 1 mm pull-off
3018 CNC – X axis endstop – 1 mm pull-off

$100 $101 $102 = 1600 set the XYZ step/mm, which requires knowing the 3018-Pro uses two-start leadscrews with a 2 mm pitch = 4 mm lead:

3018 CNC - two-start leadscrew
3018 CNC – two-start leadscrew

The Camtool V3.3 board hardwires the DRV8825 stepper controllers into 32 microstep mode, so:

1600 step/mm = (200 full step/rev) × (32 microstep/full step) / (4 mm/rev)

$110 $111 $112 = 1100 set the maximum speed along the XYZ axes in mm/min. Note the hard upper limit set by the maximum microcontroller interrupt rate of about 40 k/s:

1500 mm/min = 25 mm/s = (40×10³ step/s) / (1600 step/mm)

I’ll have more to say about speed limits, stepper current, torque, and similar topics.

$120 $121 $122 = 3000 set the acceleration along the XYZ axes in mm/sec². These are two orders of magnitude higher than the default acceleration, which accounts for the as-received sluggish acceleration.

$130=299.000 $131=179.000 $132=44.000 set the XYZ travel limits relative to the Home switch trip points, which feed into the $20=1 Soft Limits. You could probably eke out another millimeter along each axis, but this is what I came up with.

With all those in place, the G54 coordinate system puts the XY origin dead in the middle of the platform and the Z origin a little bit below its upper travel limit. Set them thusly:

G10 L2 P1 X-147 Y-90.6 Z-1.5

The original and tweaked GRBL configuration settings as a GitHub Gist:

$0=10
$1=25
$2=0
$3=5
$4=0
$5=0
$6=0
$10=1
$11=0.010
$12=0.002
$13=0
$20=0
$21=0
$22=0
$23=0
$24=25.000
$25=500.000
$26=250
$27=1.000
$30=1000
$31=0
$32=0
$100=1600.000
$101=1600.000
$102=1600.000
$110=1000.000
$111=1000.000
$112=800.000
$120=30.000
$121=30.000
$122=30.000
$130=200.000
$131=200.000
$132=200.000
$0=10
$1=100
$2=0
$3=5
$4=0
$5=0
$6=0
$10=1
$11=0.010
$12=0.020
$13=0
$20=1
$21=0
$22=1
$23=0
$24=100.000
$25=1000.000
$26=25
$27=1.000
$30=1000
$31=0
$32=0
$100=1600.000
$101=1600.000
$102=1600.000
$110=1100.000
$111=1100.000
$112=1100.000
$120=3000.000
$121=3000.000
$122=3000.000
$130=299.000
$131=179.000
$132=44.000
ok
[G54:-147.000,-90.600,-1.500]
[G55:0.000,0.000,0.000]
[G56:0.000,0.000,0.000]
[G57:0.000,0.000,0.000]
[G58:0.000,0.000,0.000]
[G59:0.000,0.000,0.000]
[G28:0.000,0.000,0.000]
[G30:0.000,0.000,0.000]
[G92:0.000,0.000,0.000]
[TLO:0.000]
[PRB:0.000,0.000,0.000:0]
ok

The as-shipped configuration is mostly for reference, but ya never know when it might come in handy.

One thought on “CNC 3018-Pro: GRBL Configuration

Comments are closed.