Stufin
Home Quick Cart Profile

TB6560 Stepper Motor Driver

Buy Now

Supply Voltage

10V to 35V

Output Current

up to 3.5A per phase

Microstepping Resolution

32 microsteps per full step

Input Signal Frequency

up to 500 kHz

Operating Temperature

-20C to 85C

Package

QFN48 or PDIP24

Applications

The TB6560 Stepper Motor Driver is suitable for a wide range of applications, including

CNC machines and 3D printers

Robotics and automation systems

Medical devices and equipment

Industrial automation and control systems

DIY projects and prototypes

Pin Configuration

  • TB6560 Stepper Motor Driver Documentation
  • Pinout Explanation
  • The TB6560 Stepper Motor Driver has a total of 16 pins, which can be divided into three categories: Power Supply, Control Signals, and Motor Outputs. Here's a detailed explanation of each pin:
  • Power Supply Pins
  • VIN (Pin 1): Input voltage pin. Connect to a power source with a voltage range of 7V to 15V.
  • GND (Pin 2): Ground pin. Connect to the negative terminal of the power source or a common ground point.
  • Control Signals Pins
  • ENA (Pin 3): Enable pin. Active low, connects to a digital output from a microcontroller or a logic circuit. When ENA is low, the driver is enabled.
  • DIR (Pin 4): Direction pin. Connects to a digital output from a microcontroller or a logic circuit. DIR high sets the motor direction to clockwise, while DIR low sets it to counterclockwise.
  • PUL (Pin 5): Pulse pin. Connects to a digital output from a microcontroller or a logic circuit. PUL is used to generate the step signal for the motor.
  • CLK (Pin 6): Clock pin. Connects to a digital output from a microcontroller or a logic circuit. CLK is used to synchronize the motor steps with an external clock signal.
  • Motor Outputs Pins
  • A+ (Pin 7): Motor output pin for coil A (positive).
  • A- (Pin 8): Motor output pin for coil A (negative).
  • B+ (Pin 9): Motor output pin for coil B (positive).
  • B- (Pin 10): Motor output pin for coil B (negative).
  • C+ (Pin 11): Motor output pin for coil C (positive).
  • C- (Pin 12): Motor output pin for coil C (negative).
  • D+ (Pin 13): Motor output pin for coil D (positive).
  • D- (Pin 14): Motor output pin for coil D (negative).
  • Additional Pins
  • RST (Pin 15): Reset pin. Active low, connects to a digital output from a microcontroller or a logic circuit. When RST is low, the driver is reset.
  • SLEEP (Pin 16): Sleep pin. Active low, connects to a digital output from a microcontroller or a logic circuit. When SLEEP is low, the driver enters sleep mode.
  • Connection Structure
  • Here's a general connection structure for the TB6560 Stepper Motor Driver:
  • Connect VIN to a power source (7V to 15V) and GND to a common ground point.
  • Connect ENA, DIR, PUL, and CLK to digital outputs from a microcontroller or a logic circuit.
  • Connect the motor coils (A+, A-, B+, B-, C+, C-, D+, D-) to the corresponding motor terminals.
  • Optionally, connect RST and SLEEP to digital outputs from a microcontroller or a logic circuit.
  • Important Notes
  • Make sure to check the motor specifications and adjust the driver's current limit and step mode accordingly.
  • Use a suitable heat sink for the driver to prevent overheating.
  • Always follow proper electrical safety practices when working with the TB6560 Stepper Motor Driver.

Code Examples

TB6560 Stepper Motor Driver Documentation
Overview
The TB6560 Stepper Motor Driver is a widely used driver IC for bipolar stepper motors. It's a high-performance driver that can handle high currents and voltages, making it suitable for various applications, including 3D printers, CNC machines, and robotics. This documentation provides an overview of the TB6560 Stepper Motor Driver, its pinout, and three code examples demonstrating its usage in different contexts.
Pinout
| Pin | Function |
| --- | --- |
| VCC | Power supply (5V to 24V) |
| GND | Ground |
| EN (Enable) | Enable input (active low) |
| CW (Clockwise) | Clockwise rotation input |
| CCW (Counterclockwise) | Counterclockwise rotation input |
| DIR (Direction) | Direction input (high = CW, low = CCW) |
| STEP | Step input (pulse input for stepping) |
| A1, A2, B1, B2 | Motor coil connections |
Code Examples
### Example 1: Basic Stepper Motor Control using Arduino
This example demonstrates how to control a stepper motor using an Arduino board and the TB6560 Stepper Motor Driver.
```cpp
const int dirPin = 2;  // Direction input
const int stepPin = 3;  // Step input
const int enPin = 4;  // Enable input
void setup() {
  pinMode(dirPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(enPin, OUTPUT);
  digitalWrite(enPin, LOW);  // Enable the driver
}
void loop() {
  // Rotate the motor clockwise for 100 steps
  digitalWrite(dirPin, HIGH);
  for (int i = 0; i < 100; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }
// Rotate the motor counterclockwise for 100 steps
  digitalWrite(dirPin, LOW);
  for (int i = 0; i < 100; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }
}
```
### Example 2: Microstepping Control using Raspberry Pi and Python
This example demonstrates how to control a stepper motor using microstepping and a Raspberry Pi with the TB6560 Stepper Motor Driver.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# Define GPIO pins for the driver
DIR_PIN = 17
STEP_PIN = 23
EN_PIN = 24
# Set up GPIO pins as outputs
GPIO.setup(DIR_PIN, GPIO.OUT)
GPIO.setup(STEP_PIN, GPIO.OUT)
GPIO.setup(EN_PIN, GPIO.OUT)
# Enable the driver
GPIO.output(EN_PIN, GPIO.LOW)
try:
    while True:
        # Set direction and step mode
        GPIO.output(DIR_PIN, GPIO.HIGH)  # Clockwise
        for i in range(100):
            GPIO.output(STEP_PIN, GPIO.HIGH)
            time.sleep(0.001)  # 1ms delay
            GPIO.output(STEP_PIN, GPIO.LOW)
            time.sleep(0.001)  # 1ms delay
GPIO.output(DIR_PIN, GPIO.LOW)  # Counterclockwise
        for i in range(100):
            GPIO.output(STEP_PIN, GPIO.HIGH)
            time.sleep(0.001)  # 1ms delay
            GPIO.output(STEP_PIN, GPIO.LOW)
            time.sleep(0.001)  # 1ms delay
except KeyboardInterrupt:
    # Clean up GPIO pins
    GPIO.cleanup()
```
### Example 3: Stepper Motor Control with Acceleration and Deceleration using ESP32 and MicroPython
This example demonstrates how to control a stepper motor with acceleration and deceleration using an ESP32 board and the TB6560 Stepper Motor Driver.
```python
import machine
import utime
# Define GPIO pins for the driver
dir_pin = machine.Pin(2, machine.Pin.OUT)
step_pin = machine.Pin(3, machine.Pin.OUT)
en_pin = machine.Pin(4, machine.Pin.OUT)
# Enable the driver
en_pin.value(0)
def accelerate(steps, acceleration):
    for i in range(steps):
        step_pin.value(1)
        utime.sleep_us(1000 - (i  acceleration))
        step_pin.value(0)
        utime.sleep_us(1000 - (i  acceleration))
def decelerate(steps, deceleration):
    for i in range(steps, 0, -1):
        step_pin.value(1)
        utime.sleep_us(1000 - (i  deceleration))
        step_pin.value(0)
        utime.sleep_us(1000 - (i  deceleration))
try:
    while True:
        # Rotate the motor clockwise with acceleration and deceleration
        dir_pin.value(1)
        accelerate(100, 10)
        utime.sleep(0.5)
        decelerate(100, 10)
# Rotate the motor counterclockwise with acceleration and deceleration
        dir_pin.value(0)
        accelerate(100, 10)
        utime.sleep(0.5)
        decelerate(100, 10)
except KeyboardInterrupt:
    # Clean up GPIO pins
    dir_pin.value(0)
    step_pin.value(0)
    en_pin.value(1)
```
These code examples demonstrate the basic usage of the TB6560 Stepper Motor Driver in various contexts. You can modify and extend these examples to suit your specific application requirements.