Grbl CNC USB to TB6560 Interface using Arduino

I’ve had a CNC mill for a few years now, and while many homemade CNC mills use EasyDriver or Pololu, mine came with a sturdy, generic TB6560 controller board. For those unfamiliar, boards like this are interfaced using an old fashioned LPT parallel port, which was initially an annoyance, but quickly became impractical and a hassle, having to use an old PC with VNC installed. The board has plenty of power to push the steppers around, far more than any of the smaller / cheaper solutions had to offer I think, so I wanted to try and teach this board a few new tricks, and let me interface with it using a more modern interface.

Being as USB was the ideal interface, and from previous searching around, Grbl seems like a great solution. Grbl is [ an open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino ]… perfect. The basics of the project are, Arduino has a USB interface, which acts like a serial port. It accepts GCODE from the computer, and Grbl translates this into pulses, used by stepper controllers, pushing around stepper motors, while providing feedback when any limit or control switches are hit.

I dug up all the information I could find on my particular TB6560 controller board, including schematic and documentation, but being as how these are mass produced in China with several minor changes between each clone, the documentation was both helpful and misleading at times. Eventually, I had it wired up to a Grbl flashed Arduino Duemilanove, with a ton of loose wires between the two. And after a lot of adjusting of Grbl settings, I was jogging around my CNC via serial terminal, yay!!

While all that is great, it was time to make this into a real, permanent install. First prototyped on breadboard, and then created in Eagle PCB, I have a working device I can leave attached to my mill. I opted to not deal with a FTDI Serial->USB interface, as I had my doubts in my mill being able to cut the SMD traces small enough to host the IC, plus already had a few USB->TTL adapters laying around. Being they only cost about $2.00 on eBay, I’m going to not worry about things beyond TTL.

Eagle schematic


I actually milled the PCB for this project on the mill using the “rats nest” wiring to my Arduino, just to prove out the design, and things went very smoothly. I used a V-carve bit, and coated the PCB with 3-in-1 oil to both prevent PCB dust, and to improve the quality of the cuts. It really does help. I designed the PCB to have a small switch panel to be cut off after milling, which has four helpful buttons: abort, start/resume, hold, and reset Arduino. They have matched headers, so the controller can be plugged in as a “wing”, or later I can add a length of wire and attach it more optimal. All of the buttons and limit switches are pulled up via resistor, even though Arduino apparently already does that internally. This guarantees that the switches won’t false trigger at any point. I added breakout for “spindle direction” and “spindle enable” along side the limit header, but they are just there for possible future upgrades.

Attached between my completely unmodified TB6560, and a USB->TTL adapter

Since building, I’ve paired my controller board up with a Raspberry Pi running GRBLweb. Pushing projects and jogging around the mill is a breeze compared to how it used to be.


Update Jan 10th, 2016:

Here are my GRBL settings:

$0=1280.000 (x, step/mm)
$1=1280.000 (y, step/mm)
$2=1280.000 (z, step/mm)
$3=60 (step pulse, usec)
$4=400.000 (default feed, mm/min)
$5=400.000 (default seek, mm/min)
$6=94 (step port invert mask, int:01011110)
$7=254 (step idle delay, msec)
$8=20.000 (acceleration, mm/sec^2)
$9=0.050 (junction deviation, mm)
$10=0.100 (arc, mm/segment)
$11=25 (n-arc correction, int)
$12=3 (n-decimals, int)
$13=0 (report inches, bool)
$14=1 (auto start, bool)
$15=1 (invert step enable, bool)
$16=1 (hard limits, bool)
$17=0 (homing cycle, bool)
$18=127 (homing dir invert mask, int:01111111)
$19=20.000 (homing feed, mm/min)
$20=20.000 (homing seek, mm/min)
$21=100 (homing debounce, msec)
$22=1.000 (homing pull-off, mm)