Overview

We will learn everything we need to know about using an Arduino to operate stepper motors in this lesson. We’ll go over how to use an M415B  and a TMC2208 stepper driver to control a NEMA17 stepper motor.

Numerous devices like 3D printers, CNC machines, robots, automation machines, and others that require position control use this set of stepper motors and drivers.

Description

An easy-to-use professional stepper motor driver that can control a two-phase stepping motor is the TB6600 Arduino Stepper Motor Driver. It can emit a 5V digital pulse signal, therefore it works with Arduino and other microcontrollers that can.

The 9–42VDC power supply of the M415B /TB6600 Arduino stepper motor driver allows for a wide range of power inputs. And it has a peak output current of 4A, which is sufficient for the majority of stepper motors. The stepper driver allows for both direction and speed control.

With six DIP switches, you may adjust the output current and micro step. In total, there are 8 different types of current control (0.5A, 1A, 1.5A, 2A, 2.5A, 2.8A, 3.0A, 3.5A) and 7 different types of micro steps (1, 2 / A, 2 / B, 4, 8, 16, 32). likewise, all signal terminals.

M415B/TB6600 Stepper Motor Driver Controller 4A 9~42V TTL 16 Micro-Step CNC 1 Axis Upgraded Version of the 42/57/86 Stepper Motor segment increased to 32 segments, suitable for high subdivision applications. Suitable for step motor:57, 42, 86Type 4 phase 2 phase (4 line 6 line 8).

Features :

  1. H bridge bipolar constant current drive.
  2. The biggest 4.0 A Eight kinds of output current are optional.
  3. The biggest 32 To subdivide 6 kinds of subdivision modes selectable.
  4. Input signal high-speed photoelectric isolation.
  5. A total of standard single pulse interfaces.
  6. Offline retention function.
  7. The semi-enclosed casing can adapt to a more stringent environment.
  8. Provide energy-saving half-automatic current lock function.

Package Includes :

1 x TB6600 Stepper Motor Driver Controller 4A 9-42V TTL 16 Micro-Step

Specifications :

Input Supply Voltage (VDC)9 ~ 42
Supply Current (A)0 to 5
Max. Output Current (Amp)           3.3 to 24
Control Signal3.3 to 24
Max Power Output (W)160
Micro Step1, 2A, 2B, 8, 16, 32
Operating Temperature (C)-10 to 50
Length (mm)100
Width (mm)70
Height (mm)40
Weight (gm)150

NEMA17 Stepper Motor

A hybrid stepping motor called NEMA 17 has a 1.8° step angle (200 steps per revolution). With 1.2 A at 4 V for each phase, 3.2 kg-cm of holding torque is possible. Laser cutters, CNC equipment, and printers frequently use NEMA 17 stepper motors.

Use the M415B/TB6600 Driver to connect a NEMA17 stepper motor to an Arduino Uno, as demonstrated in the below image.

Using the M415B/TB6600 Driver, a NEMA17 Stepper Motor is connected to an Arduino Mega.

The complexity of wiring with boxed drivers is minimal.

The four motor cables should be connected in the following order: power supply, GND (-), and VCC (+), then the four motor wires. If in doubt, consult the datasheet for your motor.

Driver configuration for motors over 1 ampere

It will be based here on the table printed on the driver housing.

The number of steps per revolution is set using the first three dip switches. We will start with a figure of 800 steps for the time being. On-off-off for this motorist.

The following three are used to modify the driver’s current output intensity. Select a number that is either lower or equal to the power of your motor. Since our engine requires 4.2A, we opt for 3.5A (off-off-off).

Basic Stepper Motor Control Code

FinalCode:

const int ena = 2; //enable the driver
const int dir = 3; //determines the direction
const int pul = 4; //perform a step

boolean pulse = LOW; 
 
void setup()
{
pinMode(ena, OUTPUT);
pinMode(dir, OUTPUT);
pinMode(pul, OUTPUT);
digitalWrite(ena, HIGH); //
//digitalWrite(dir, LOW); // low CCW / high CW 
digitalWrite(pul, LOW); //falling edge
}
 
void loop()
{

  digitalWrite(dir,HIGH);// low CCW / high CW
  for(int x = 0; x <10000 ; x++)
  {
    pulse = !pulse; //invert the state of the variable
    digitalWrite(pul, pulse); //assigns the new state to the port 
    delayMicroseconds(150); 
    pulse = !pulse; //invert the state of the variable
    digitalWrite(pul, pulse); //assigns the new state to the port
    delayMicroseconds(150); 
  }
  delay(10); // One second delay 
  
  digitalWrite(dir,LOW); //low CCW / high CW
  for(int x = 0; x < 10000 ; x++) 
  {
    pulse = !pulse; //invert the state of the variable
    digitalWrite(pul, pulse); //assigns the new state to the port 
    delayMicroseconds(150); 
    pulse = !pulse; //invert the state of the variable
    digitalWrite(pul, pulse); //assigns the new state to the port
    delayMicroseconds(150); 
  }
  delay(10); 
}

Output images

By Devilal

Leave a Reply

Your email address will not be published. Required fields are marked *