Building GRBL for CoreXY
- Source:
I pulled grbl
from this location
on the web.
- Electronics: I used the Arduino
shield from Nayda Peek. The current limit resistors are
now 2.5k, allowing for a motor current of about .7A. With higher
currents, the motor drivers get really hot. To determine
component locations, open the eagle files and look.
- Algorithm: In order to move in X or Y,
both motors must move. A single motor will move the carriage on
a diagonal. Ilan talks about the algorithm here.
- Modified code: GRBL creates a queue of
blocks as an interrupt routine executes them (spinning the
motors). The CoreXY mods are inserted into planner.c where the number of steps in x, y and
z are calculated. The transform then recalculates the needed
movement for each motor, and modifies the block.
- I/O
Mapping: The motor drivers are connected to portB instead of portD.
- Calibration: GRBL holds configuration
settings in EPROM, so the system can be tuned by typing commands
at the g-code prompt. To print current values, type "$" To set
parameter 1 to 100 type: $1=100
The internal settings I ended up
using for the corexy with Dave's motors are as follows:
Grbl 0.7d
'$' to
dump current settings
$0 =
26.737 (steps/mm x)
$1 =
26.737 (steps/mm y)
$2 =
157.480 (steps/mm z)
$3 = 30
(microseconds step pulse)
$4 =
300.000 (mm/min default feed rate)
$5 =
300.000 (mm/min default seek rate)
$6 = 0.100
(mm/arc segment)
$7 = 0
(step port invert mask. binary = 0)
$8 =
20.000 (acceleration in mm/sec^2)
$9 = 0.050
(cornering junction deviation in mm)
'$x=value'
to set parameter or just '$' to dump current settings
ok These values seem
reasonable, but may not be perfect.
- Operation: David Mellis has a processing script
to download g-code to the board. Under Linux (Ubuntu based v12
distro) the RXTX serial port driver seems to lock up at times. I
replaced it with
per the directions on the MTM page, but I still get some
lockups.
Code Discussed in this Section:
Source
Hex
For future (post class) updates to this project and
related projects, see my website: www.ozydesign.com/makemachinesclass