Help with TB6600 and stepper motor

I hope this is the right forum. I’m a total newbie at this, so excuse me if I miss something obvious.

I’m attempting to make a basic slide mechanism for an anamorphic lens that goes in front of my projector. To do this, I have purchased the following:

  • Arduino Uno R3
  • Meanwell 24V 6A PSU (LRS-150-24)
  • TB6600 stepper motor driver (Link)
  • Slide mechanism with motor (Link)

I spent some time with the Arduino kit I ordered doing some basic things, like making LEDs turn on/off based on inputs, reading the serial output, etc. I even got it to react based on an IR input.

I just received my motor driver, however, and am currently attempting to get the motor to move. Unfortunately, absolutely nothing is happening. Everything appears to be wired correctly (I even corrected for the swapped A/B pins on these drivers), but running the code does nothing but make a green LED on the motor driver blink. I’ve also confirmed that the PSU is indeed supplying the correct 24V.

I’m honestly at my wit’s end with this.

Here’s example code I’m running

// defines pins numbers
const int stepPin = 3;
const int dirPin = 2;
const int enPin = 1;
void setup() {

// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);

pinMode(enPin,OUTPUT);
digitalWrite(enPin,LOW);

}
void loop() {

digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
// Makes 200 pulses for making one full cycle rotation
for(int x = 0; x < 800; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500); a
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // One second delay

digitalWrite(dirPin,LOW); //Changes the rotations direction
// Makes 400 pulses for making two full cycle rotation
for(int x = 0; x < 800; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000);

}

Does the stepper make any noise?

 digitalWrite(stepPin,HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);

That results in a step every millisecond or a 1KHz step rate. The stepper may not be able to accelerate to 1000 steps per second from a dead stop and will just stall. Try that with longer delays (delay(200) for instance).

Can you show the wiring between the Uno and the driver?

digitalWrite(enPin,LOW);

Did you try:

digitalWrite(enPin,HIGH);

?

const int enPin = 1;

On UNO / Nano, pin 1 is a serial comm pin try another (pin 4 ?).

Test the motor with the examples from this Simple Stepper Code.

With some stepper drivers you have to set the enable pin to make them work - but I'm not sure whether it should be set HIGH or LOW.

...R
Stepper Motor Basics

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

groundFungus:
Does the stepper make any noise?

Yes. When I first apply power I can get a thunk noise, then a bit of a buzz.

groundFungus:

 digitalWrite(stepPin,HIGH);

delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);



That results in a step every millisecond or a 1KHz step rate. The stepper may not be able to accelerate to 1000 steps per second from a dead stop and will just stall. Try that with longer delays (delay(200) for instance).

I tried 200 and 500. No change.

groundFungus:
Can you show the wiring between the Uno and the driver?

Attached below.

JCA34F:
Did you try:

digitalWrite(enPin,HIGH);

?On UNO / Nano, pin 1 is a serial comm pin try another (pin 4 ?).

Tried high. No change. Moved pins. No change.

JCA34F:
Did you try:

digitalWrite(enPin,HIGH);

?On UNO / Nano, pin 1 is a serial comm pin try another (pin 4 ?).

Robin2:
Test the motor with the examples from this Simple Stepper Code.

With some stepper drivers you have to set the enable pin to make them work - but I’m not sure whether it should be set HIGH or LOW.

…R
Stepper Motor Basics

Tried the code. No change.

Maybe the microswitches on the side need to change? I currently have it set to 3.0A and 1 microstep, 200 pulses/rev.

Hi,
Sorry a picture of your wiring is not enough to help with a solution.
Picture of a hand drawn circuit in jpg, png?
Ops pics.

Tom... :slight_smile:

I was able to get it working!

I think the dip switches may have been slightly off. I reset them and then moved them back for the 200 pulse/rev position, and I also added the code to set the enable pin to high. I now have full motor control and can continue my project.

Thanks for the help!