Updated TB6600 stepper driver config?

Hello all, first post after searching for answers regarding my issue with either this driver or my whole setup altogether. I’ve tried numerous sketches, from youtube clips to examples on sites like dfrobot.com but I can’t get my stepper to turn…

here’s what I have:

-Arduino Uno with latest IDE and GRBL installed (also tried older grbl)

both are 1.8 degrees, 4 wire bi-polar steppers.

Tried wiring common anode, common cathode, tried wiring and sketch according to this instructables page, tried this and this and some other youtube clips and I’m going crazy. Tried switching the steppers wiring just to see if that would make a difference but all I could hear is a very faint buzz which becomes louder the lower you configure microstep dipswitch setting.

I did also open up the driver and I could see something very disturbing…motor wiring on the printed circuitboard doesn’t correspond to the labels on the unit. But I did try switching over the motor wires in all possible configurations, to no avail

I hope someone can walk me through this setup. I can confirm that my drivers and Nema 17 steppers DID work somewhere beginning this year and I haven’t touched them since.
I just received my Nema 23 units and thought to try them out but disappointing results up to now.

I will try inserting some pictures and code I used, but it was all copy-paste from the sites and videos I checked…

Turn everything off and then disconnect all except 1 motor.

Connect that motor in the way that seems to you to be most appropriate. If it does not work then make a simple pencil drawing showing exactly how the motor is connected and post a photo of the drawing.

If you are confident that you can load GRBL onto your Arduino (some people seem to have problems) then you could try the first program in this Simple Stepper Code. Just make sure that you use the correct I/O pins for your stepper driver.

My example code does not set the enable pin on the stepper driver and you may need to add a line of code in setup() to do that.

...R

Thanks for the quick reply. I'm only testing 1 motor at the time. At first I connected all 3 Nema 23 as x-y-z with the 36V power but nothing happened, just some light buzzing. I didn't power them for long, just briefly and I wasn't on the highest amp rating of the driver so I don't think my stepper or driver has been toasted.

I used this instructable to begin with.
It was the first one I ever tried and worked back in january or so. Now it doesn't.....

I will post pics and/or drawing of my setup

Instructables have a very low standing on this Forum - many of them have serious errors.

...R

Robin2:
Instructables have a very low standing on this Forum - many of them have serious errors.

…R

Really??? danggg.

Ok I tried your simple stepper code, same thing. The DIR+ and PUL+ should be connected to pins 9 and 8 and the “-” all to GND right? Cuz the code brings PUL HIGH and then LOW to give the “pulses”
I can see the Arduino works cuz it’s led is blinking everytime the commands are sent

Image from Reply #4 so we don't have to download it. See this Simple Image Posting Guide

...R

Sorry to be brutal, but we have all seen flashing LEDs and they are not worth putting in a picture.

Make the drawing that I mentioned in Reply #1 showing how everything is connected when using my stepper code.

Also post the code that YOU have uploaded to your Arduino.

...R

This is your code I used but without LED (don't have any at hand right now)

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 250; // milliseconds - or try 1000 for slower steps


void setup() {

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
 
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    // delayMicroseconds(pulseWidthMicros); // probably not needed
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
}

void loop() {
}

and here my drawing

Also tried following setup with grbl loaded onto my arduino...still nothing

The way I read that, the ENA+, DIR+ and STEP+ should be connected to +5V and the - terminals pulled LOW by an output pin to activate. You would have to invert the Arduino switching logic but thats not a big deal.

JCA34F:
The way I read that, the ENA+, DIR+ and STEP+ should be connected to +5V and the - terminals pulled LOW by an output pin to activate. You would have to invert the Arduino switching logic but thats not a big deal.

tried that too (tried both ways, common anode AND common kathode)

JCA34F:
The way I read that, the ENA+, DIR+ and STEP+ should be connected to +5V and the - terminals pulled LOW

Either way will do.

...R

dogla:
Also tried following setup with grbl loaded onto my arduino...still nothing

This is what I call the scattergun approach to debugging - change something, anything, change two things for good measure. It never works.

Stick with the simple code and the wiring diagram that you have with it. Add some code in setup() to set the enable pin nd see if that helps. In other words make one single change at a time.

Also, I don't see where you have described what happens when you run my simple program. I see a mention of "same thing" in Reply #4, but I don't know what that means.

Have you checked with your multimeter to be sure you know which pairs of wires from the motor belong to each coil? One coil should go to the A connections on the driver and the other coil to the B connections.

Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.

...R

Robin2:
This is what I call the scattergun approach to debugging - change something, anything, change two things for good measure. It never works.

I actually first tested with grbl after I got my steppers. Followed youtube clips and instructables to the dot (which did work for them) and when I saw it didn't work for me I searched many sites looking for sketches which also worked for others and tried a few.

Robin2:
Stick with the simple code and the wiring diagram that you have with it. Add some code in setup() to set the enable pin nd see if that helps. In other words make one single change at a time.

I assumed your code is one that actually works so I didn't bother adding any additional code

Robin2:
Also, I don't see where you have described what happens when you run my simple program. I see a mention of "same thing" in Reply #4, but I don't know what that means.

Arduino led just blinks, stepper doesn't move at all but I hear a faint whine from the stepper like it's trying to. It does get power cuz I can't turn it by hand whenever I put power to the driver. I'm using the 19V laptop adapter for now (don't wanna throw 36Volts at it and risk frying it if I screw it up). When I tested the nema 23 steppers at first with grbl I did hook up my 36V power for a few seconds just to see if anything works.

Robin2:
Have you checked with your multimeter to be sure you know which pairs of wires from the motor belong to each coil? One coil should go to the A connections on the driver and the other coil to the B connections.

Yes, Red-Blue is a pair and Black-Green is a pair (on my motor)

Robin2:
Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.

I know, I put a switch in between the driver + and power + so I can turn it off whenever I have to do something on the driver. Last thing I want is to order other drivers (I'm in South America so we don't have this kind of stuff here in my country, I buy all my items either from USA or from China)

I'm not good yet at programming, but I'm learning as I encounter these issues and read trough few sites about Arduino programming

I really appreciate the time you take to help out others like me. I'm building a large format ( 1200x900mm) 3-axis cnc machine which will have my Nema 23 steppers. I did get the steppers with a breakout board but my old pc died and my laptop doesn't have parallel port. That's why I reverted to Arduino for the time being so I can finish building my machine and afterwards probably get a used tower with parallel port to drive my machine (with Mach3)

dogla:

Stick with the simple code and the wiring diagram that you have with it. Add some code in setup() to set the enable pin nd see if that helps. In other words make one single change at a time.

I assumed your code is one that actually works so I didn't bother adding any additional code

I'm not sure how to interpret that. Have you tried adding code to set the enable pin?

The A4988 driver that I have does not require the enable pin to be asserted but your driver might require it. I'm not sure whether it should be HIGH or LOW.

I actually first tested with grbl after I got my steppers. Followed youtube clips and instructables to the dot (which did work for them) and when I saw it didn't work for me I searched many sites looking for sketches which also worked for others and tried a few.

I understand that, but your Reply #7 leads me to think you tried the second set of wiring and the other program when my program did not work - which is why I made my comment about being methodical.

...R

I also have DRV8825 drivers which I bought off Amazon

I first bought The A4988 drivers with shield but then I bought the DRV8825 because of the higher amperage rating.

I might give those a try with my Nema 17 stepper when I get home next week just to rule out driver issue.
Meanwhile I will try adding the ENABLE code in your sketch to see if that does anything.

Thanx for all the help, I’ll post back whenever I get around testing that out.

EDIT:

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing

byte enablePin = 10;
byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 250; // milliseconds - or try 1000 for slower steps


void setup() {

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(enablePin, OUTPUT);
  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
 
  digitalWrite(enablePin, HIGH);
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    // delayMicroseconds(pulseWidthMicros); // probably not needed
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
}

void loop() {
}

added enablePin, tried with HIGH, then with LOW, then switch to common cathode…
can’t get them to talk…

dogla:
added enablePin, tried with HIGH, then with LOW, then switch to common cathode...
can't get them to talk....

Without having your hardware on my own bench I can't think of anything else.

Maybe the driver is faulty.

...R

I tried all 4 drivers before, I'll try again with your code when I get back home.

yaaay finally got my steppers moving…All there was to it was change 1 parameter in the code…

this code worked for me, I only had to change the millisbetweenSteps from 250 to 1 then it started moving. Don’t even need the enable pin on my driver.
With number of steps and my stepper dipswitch settings I could change the number of revolutions the motor made. I had mine on 6400 so I put 6400 steps in the code to make 1 full turn…saweet!!!

Thanx for all the input.

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing

byte enablePin = 10;
byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 6400;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 1; // milliseconds - or try 1000 for slower steps


void setup() {

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(enablePin, OUTPUT);
  
 
  digitalWrite(enablePin, HIGH); //isn't really needed for my driver
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    // delayMicroseconds(pulseWidthMicros); // probably not needed
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
}

void loop() {
}

dogla:
this code worked for me, I only had to change the millisbetweenSteps from 250 to 1 then it started moving.

I'm glad it is working for you. However if it works with a value of 1 then it must also work with a value of 250 - except 250 times slower.

...R

Robin2:
I'm glad it is working for you. However if it works with a value of 1 then it must also work with a value of 250 - except 250 times slower.

...R

Yea it probably did but I couldn't see it turning and was afraid to keep the power on it....afraid something could get fried