TB6600 stepper driver

The boxed TB6600 driver for NEMA 17 and NEMA 23 steppers: opto-isolated PUL, DIR and ENA, 9 V to 42 V, up to 4 A.

Aliases: TB6600, TB6600HG, TB6600 4A, CNC stepper driver. Inside is Toshiba's TB6600HG chopper driver behind three optocouplers, with six DIP switches for the microsteps and the current.

Pins

Pin What it does
PUL+, PUL- The step input. Each time its optocoupler lights, the motor takes one step (or one microstep).
DIR+, DIR- Direction: lit is one way, dark the other.
ENA+, ENA- Lit takes the driver offline: the outputs let go and the shaft turns freely. Leave it unwired and the driver runs.
A+, A- One coil of the motor.
B+, B- The other coil.
VCC, GND The motor supply, 9 V to 42 V. It need not share the Arduino's ground: the inputs are isolated.

Wiring it to an Arduino

Each input pair is the LED of an optocoupler, anode on +, cathode on -, so a signal is a current through two pins. Wire it one of two ways:

  • Common cathode (the usual Arduino way): PUL-, DIR- and ENA- to the Arduino's GND, and pins to PUL+, DIR+ and ENA+. A pin driven high lights its LED.
  • Common anode: PUL+, DIR+ and ENA+ to the Arduino's 5V, and pins to the - side. A pin driven low lights its LED, so everything reads backwards.

An input lights at 2.5 V or more across its pair and goes dark at 1.5 V or less, so a 3.3 V board drives it too. Those two levels are an assumption; the manuals give 5 V signals (with a 1 kΩ series resistor for 12 V and 2 kΩ for 24 V) and 8 to 15 mA through each LED.

#include <TB6600.h>

TB6600 stepper(200, 3, 2, 4);   // steps a turn, DIR, PUL, ENA

void setup() {
  stepper.setEnableActiveState(LOW);  // common cathode: ENA high is offline
  stepper.begin(60, 8);               // 60 rpm, 1/8 as the switches are set
  stepper.enable();
}

void loop() {
  stepper.rotate(360);
  delay(500);
  stepper.rotate(-360);
  delay(500);
}

The DIP switches

microstep is S1 S2 S3, as the table on the case prints it:

S1 S2 S3 microstep Pulses a turn (1.8° motor)
ON ON OFF 1 200
ON OFF ON 2A 400
OFF ON ON 2B 400
ON OFF OFF 4 800
OFF ON OFF 8 1600
OFF OFF ON 16 3200
OFF OFF OFF 32 6400

current is S4 S5 S6: 0.5, 1.0, 1.5, 2.0, 2.5, 2.8, 3.0 or 3.5 A, with peaks of 0.7, 1.2, 1.7, 2.2, 2.7, 2.9, 3.2 and 4.0 A. The driver holds each coil at the peak times the sine or cosine of the step; a winding that would need more than the supply gets the supply. 1.5 A (1.7 A peak) suits a NEMA 17 rated 1.7 A.

What is not simulated

The load the optocoupler LEDs put on the board's pins, the minimum pulse widths and the 5 µs that DIR should lead PUL by, the chopper's ripple, coil inductance, heat and the thermal and over-current shutdowns, and the standstill current reduction some boards wire in. 2A and 2B are both plain half steps here; on the chip they differ in the current at the single-coil positions.