TB6600 Stepper Motor driver Tester

Use Serial Monitor to test TB6600 Stepper Motor Driver and stepper motor

Feb 26, 2018

93789 views

50 respects

Components and supplies

1

Arduino Mega 2560

1

NEMA 17 Stepper Motor

1

TB6600 Stepper Motor Driver

Project description

Code

TB6600

arduino

test code for CNC Single Axis 4A TB6600 Stepper Motor Driver Controller

TB6600

arduino

test code for CNC Single Axis 4A TB6600 Stepper Motor Driver Controller

Downloadable files

wire up like this

wire up like this

Comments

Only logged in users can leave comments

AC8ZX

2 days ago

Every time I type in -mx- all i get is bad command, I have tried everything to get it to work, no luck. I changed board ,driver, motors. Thanks, Bob

haradhonharu

2 years ago

Hello ashley, There are 2 sketches, one with 161 lines other is with 228 lines, which one is correct or both will work individualy ? thanks for your time.

Anonymous user

2 years ago

hello to see first if I explain myself I have already almost mounted the cnc just need to connect tb6600 with arduino and the problem is the axis Y that are 2 engines when the system does not work, however, if it is an individual . How does it work? How does it work? https://postimg.cc/w12QwP8f https://postimg.cc/F1ZPWDtB

Anonymous user

2 years ago

Creo que hablas Español, por las fotos que has colgado, ya que están comentadas en Español. Los dos motores del eje Y van a trabajar en simultàneo? Es decir, ambos van a realizar el mismo trabajo?

Anonymous user

2 years ago

Thanks for this clear tutorial. I am concerned that my TB6600 driver shows 0 volts across the A+A- terminals but 24V across the B+B- terminals with nothing else connected except the 24V power supply. Since the Nema23 motor coils have a resistance of 1 ohm I am nervous to connect it. Should I be worried? Thanks.

Anonymous user

2 years ago

Nice project, When is start with the first command xon i received the message NX=0 other commands have also no result. What can be wrong?

ashleyblack

2 years ago

the only way i can get it to do that for me is type in x0n and not xon a zero instead of a o. type commands in lower case text.

ashleyblack

2 years ago

Typing a lower case x with anything after it will give you NX=0

raminmki

2 years ago

hi i want control the step motor with tb6600 driver and want program arduino to run step motor in 3 cycle for 30 second.wich one arduino model is better for my work and help me to write the program

ashleyblack

2 years ago

I can help you sorry for slow response.

Anonymous user

2 years ago

I'm trying to troubleshoot this project. I have Arduino 1.8.9 IDE, 23HS22-2804S-PG15 Stepper, TB6600 Motor Driver, and Arduino Mega2560. I have 12.5 vDC running to the TB6600. The TB6600 is connected to the Arduino using the same pins as the provided diagram. I uploaded the sketch to the Arduino. Everything looks good. Nothing happens when I type commands into the Arduino software.

ashleyblack

2 years ago

do you get the help text come up when you press the rest? type commands in lower case text. make sure your on 115200 baud.

Anonymous user

2 years ago

Great work here guys! Question, had anyone tried to run this circuit from Maxuino commands, through the stepper firmata? I am using this motor nema 23 here: https://joy-it.net/en/products/NEMA23-03 with the same TB6600 driver, but I can't yet get it to move. Would appreciate any suggestions! thank you!

Anonymous user

2 years ago

Seems like a great set up and code very complete. I have it all wired up but cannot get the serial monitor to accept commands. Baud checked tried at a couple rates, tried on 3 nano boards and one uno. not getting the error message either. if I type: "hello" enter or type: "xon" send or any available commands nothing happens.

Anonymous user

2 years ago

Got it. Had to select "new line" in the drop down menu in the serial monitor. I really like this code thank you! Using to test a 4th axis before plugging into the machine.

Anonymous user

2 years ago

Hi Ashley, first thanks for your helpful post. I have a question. I´m working with this TB6600 and one stepper motor. I need send to my motor more than 66.000 steps. Always in the same direction. My commands are of 600 steps. After pass the 66.000 steps my motor go back to zero position by itself. It´s possible avoid this..? I can´t reduce the number of steps. My motor must move a roll film from the beginning till the end. Thanks in advance mate. J.

ashleyblack

2 years ago

What you need to do is change lines 6 and 7 from word X; word NX; to long X; long NX; so they will now do up to 2,147,483,647 steps. hope this helps Ashley

Anonymous user

2 years ago

Oh my god, you are right..!! How could I be so dummy, I thought the limitation was the stepper motor driver. Thanks so much Ashley

Anonymous user

2 years ago

This was very helpful in setting up my first stepper motor. Using the TB6600 as shown, the ENA-, DIR-, and PUL-, can be tied together and run to the ground terminal instead of thru separate I/O pins. Makes wiring much less cumbersome.

Anonymous user

2 years ago

I really like how this project works. I am trying to find a way to implement this into my own project. However I am very new to Arduino software, and cannot quite put a finger on how to do this.

Anonymous user

2 years ago

Can i send this serial commands from my python script, like steps speed etc

Anonymous user

2 years ago

I mean controlling the Y axes with a tb6600 module the problem may be that it loses speed alcontrolar 2 motors nema 23 ??

Anonymous user

2 years ago

I see complicated that the tb6600 can with the 2 nema 23 since it is 2.8A the nema the tb6600 only takes out 4A

Anonymous user

2 years ago

I see that it is a complicated issue may have to change the targeting controller

Anonymous user

2 years ago

May be you should change the TB6600 switches to improve the output A. If it does work with only one motor may be the problem is the TB6600 output power

Anonymous user

2 years ago

It’s not so complicated. Usually you must setup your TB6600 depending of the motor you will control. You must see how many amps is your motor, so if your motor is 1A you must set your TB6600 switches (S4-ON, S5-OFF, S5-ON). 1A output If you want control 2 motors with 1A , you should setup your TB6600 (S4-ON, S5-OFF, S6-OFF). 2A output. Use this link for locating the switches in your TB6600: https://imgs.inkfrog.com/pix/ebayimage2012/1A30004-5.jpg Use this link to see the TB6600 user manual. You will find the switches setup in the page 6. https://forum.arduino.cc/index.php?action=dlattach;topic=558523.0;attach=266385 You can find

Anonymous user

2 years ago

if both are going to perform the same job it is for CNC

Anonymous user

2 years ago

Then you could use the same cables from Arduino to control both step motor drivers. Assuming you are controlling only one motor. So, each TB6600 control one motor and Arduino control 3 motors (X, Z and both Y).

Anonymous user

2 years ago

Во-первых хочу сказать огромное спасибо за скетч. Во-вторых есть вопросы: У меня arduino 2560 mega, TB6600, шаговый двигатель 57HS56-3004 серии NEMA 23 1) Я не могу выставить минимальное время задержки шагов S, то есть, например при s100 двигатель не вращается, Почему? 2) При установке на драйвере частоты импульсов в 6400, двигатель так же не хочет работать, выставил так как у вас 2/А 400-работает. Почему так? 3) Мне приходится каждый раз перезапускать com4, чтобы двигатель работал корректно. Если этого не сделать, двигатель может вращаться в другую сторону(если включить ComDataOn), либо не вращаться вообще(рандом!), причем даже при включенном реверсе. Как это изменить?

jagajeeth

2 years ago

Which software does u use to design the circuit

ashleyblack

2 years ago

I used SketchUp to draw the circuit

Anonymous user

2 years ago

How to check tb6600 stepper motor driver whether it's working or not..?

Anonymous user

2 years ago

i need help i'm working on project which is control the stepper motor direction with two hall effect sensors by using L298N stepper driver. when the first hall sensor will activate stepper should rotate in a clockwise direction till 2nd hall sensor activate, if 2nd hall sensor activate then motor should rotate in a anticlockwise direction and also provide one stop/start button. please help it is a very important project for me...

ashleyblack

2 years ago

I not logged into this for some time. Did you succeed? or still want help?

bordajavier1

2 years ago

Hi Ashley, Thanks for your help. I have a problem with the speed, the motor is too slow. I have a NEMA 34H59 motor and DM860T (STEPPERONLINE) Stepper controller also I have a DM542S (CLOUDRY) controller and I had almost the same results in both controllers using your program on Arduino mega board. I'm very appreciate if you help me out with this issue. Javier

ashleyblack

2 years ago

i have not used the DM860T or DM542S but it looks like they have very high pulse rate settings. So have you set DM542S to 400 off on on on / DM860T 400 on on on on If you have and its slow try a much faster speed setting like s100

Anonymous user

3 years ago

Can i send this serial commands from my python script, like steps speed etc

Anonymous user

3 years ago

How to check tb6600 stepper motor driver whether it's working or not..?

Anonymous user

3 years ago

Во-первых хочу сказать огромное спасибо за скетч. Во-вторых есть вопросы: У меня arduino 2560 mega, TB6600, шаговый двигатель 57HS56-3004 серии NEMA 23 1) Я не могу выставить минимальное время задержки шагов S, то есть, например при s100 двигатель не вращается, Почему? 2) При установке на драйвере частоты импульсов в 6400, двигатель так же не хочет работать, выставил так как у вас 2/А 400-работает. Почему так? 3) Мне приходится каждый раз перезапускать com4, чтобы двигатель работал корректно. Если этого не сделать, двигатель может вращаться в другую сторону(если включить ComDataOn), либо не вращаться вообще(рандом!), причем даже при включенном реверсе. Как это изменить?

Anonymous user

4 years ago

i need help i'm working on project which is control the stepper motor direction with two hall effect sensors by using L298N stepper driver. when the first hall sensor will activate stepper should rotate in a clockwise direction till 2nd hall sensor activate, if 2nd hall sensor activate then motor should rotate in a anticlockwise direction and also provide one stop/start button. please help it is a very important project for me...

ashleyblack

2 years ago

I not logged into this for some time. Did you succeed? or still want help?

jagajeeth

5 years ago

Which software does u use to design the circuit

ashleyblack

2 years ago

I used SketchUp to draw the circuit

sazash83

5 years ago

Great work here guys! Question, had anyone tried to run this circuit from Maxuino commands, through the stepper firmata? I am using this motor nema 23 here: https://joy-it.net/en/products/NEMA23-03 with the same TB6600 driver, but I can't yet get it to move. Would appreciate any suggestions! thank you!

Anonymous user

5 years ago

I really like how this project works. I am trying to find a way to implement this into my own project. However I am very new to Arduino software, and cannot quite put a finger on how to do this.

Anonymous user

5 years ago

Can a Nema 17 stepper motor turn 500 eggs setup in an automatic incubator?

Anonymous user

5 years ago

Thanks for this clear tutorial. I am concerned that my TB6600 driver shows 0 volts across the A+A- terminals but 24V across the B+B- terminals with nothing else connected except the 24V power supply. Since the Nema23 motor coils have a resistance of 1 ohm I am nervous to connect it. Should I be worried? Thanks.

T200T

5 years ago

Seems like a great set up and code very complete. I have it all wired up but cannot get the serial monitor to accept commands. Baud checked tried at a couple rates, tried on 3 nano boards and one uno. not getting the error message either. if I type: "hello" enter or type: "xon" send or any available commands nothing happens.

T200T

2 years ago

Got it. Had to select "new line" in the drop down menu in the serial monitor. I really like this code thank you! Using to test a 4th axis before plugging into the machine.

bordajavier1

5 years ago

Hi Ashley, Thanks for your help. I have a problem with the speed, the motor is too slow. I have a NEMA 34H59 motor and DM860T (STEPPERONLINE) Stepper controller also I have a DM542S (CLOUDRY) controller and I had almost the same results in both controllers using your program on Arduino mega board. I'm very appreciate if you help me out with this issue. Javier

ashleyblack

2 years ago

i have not used the DM860T or DM542S but it looks like they have very high pulse rate settings. So have you set DM542S to 400 off on on on / DM860T 400 on on on on If you have and its slow try a much faster speed setting like s100

Anonymous user

5 years ago

Nice project, When is start with the first command xon i received the message NX=0 other commands have also no result. What can be wrong?

ashleyblack

2 years ago

Typing a lower case x with anything after it will give you NX=0

ashleyblack

2 years ago

the only way i can get it to do that for me is type in x0n and not xon a zero instead of a o. type commands in lower case text.

Anonymous user

5 years ago

I'm trying to troubleshoot this project. I have Arduino 1.8.9 IDE, 23HS22-2804S-PG15 Stepper, TB6600 Motor Driver, and Arduino Mega2560. I have 12.5 vDC running to the TB6600. The TB6600 is connected to the Arduino using the same pins as the provided diagram. I uploaded the sketch to the Arduino. Everything looks good. Nothing happens when I type commands into the Arduino software.

ashleyblack

2 years ago

do you get the help text come up when you press the rest? type commands in lower case text. make sure your on 115200 baud.

raminmki

5 years ago

hi i want control the step motor with tb6600 driver and want program arduino to run step motor in 3 cycle for 30 second.wich one arduino model is better for my work and help me to write the program

ashleyblack

2 years ago

I can help you sorry for slow response.

Anonymous user

6 years ago

I mean controlling the Y axes with a tb6600 module the problem may be that it loses speed alcontrolar 2 motors nema 23 ??

Anonymous user

2 years ago

May be you should change the TB6600 switches to improve the output A. If it does work with only one motor may be the problem is the TB6600 output power

Anonymous user

2 years ago

It’s not so complicated. Usually you must setup your TB6600 depending of the motor you will control. You must see how many amps is your motor, so if your motor is 1A you must set your TB6600 switches (S4-ON, S5-OFF, S5-ON). 1A output If you want control 2 motors with 1A , you should setup your TB6600 (S4-ON, S5-OFF, S6-OFF). 2A output. Use this link for locating the switches in your TB6600: https://imgs.inkfrog.com/pix/ebayimage2012/1A30004-5.jpg Use this link to see the TB6600 user manual. You will find the switches setup in the page 6. https://forum.arduino.cc/index.php?action=dlattach;topic=558523.0;attach=266385 You can find

Anonymous user

2 years ago

I see that it is a complicated issue may have to change the targeting controller

Anonymous user

2 years ago

I see complicated that the tb6600 can with the 2 nema 23 since it is 2.8A the nema the tb6600 only takes out 4A

Anonymous user

6 years ago

if both are going to perform the same job it is for CNC

Anonymous user

2 years ago

Then you could use the same cables from Arduino to control both step motor drivers. Assuming you are controlling only one motor. So, each TB6600 control one motor and Arduino control 3 motors (X, Z and both Y).

Anonymous user

6 years ago

hello to see first if I explain myself I have already almost mounted the cnc just need to connect tb6600 with arduino and the problem is the axis Y that are 2 engines when the system does not work, however, if it is an individual . How does it work? How does it work? https://postimg.cc/w12QwP8f https://postimg.cc/F1ZPWDtB

Anonymous user

2 years ago

Creo que hablas Español, por las fotos que has colgado, ya que están comentadas en Español. Los dos motores del eje Y van a trabajar en simultàneo? Es decir, ambos van a realizar el mismo trabajo?

Anonymous user

6 years ago

Hi Ashley, first thanks for your helpful post. I have a question. I´m working with this TB6600 and one stepper motor. I need send to my motor more than 66.000 steps. Always in the same direction. My commands are of 600 steps. After pass the 66.000 steps my motor go back to zero position by itself. It´s possible avoid this..? I can´t reduce the number of steps. My motor must move a roll film from the beginning till the end. Thanks in advance mate. J.

Anonymous user

2 years ago

Oh my god, you are right..!! How could I be so dummy, I thought the limitation was the stepper motor driver. Thanks so much Ashley

ashleyblack

2 years ago

What you need to do is change lines 6 and 7 from word X; word NX; to long X; long NX; so they will now do up to 2,147,483,647 steps. hope this helps Ashley

dlwheelock

6 years ago

This was very helpful in setting up my first stepper motor. Using the TB6600 as shown, the ENA-, DIR-, and PUL-, can be tied together and run to the ground terminal instead of thru separate I/O pins. Makes wiring much less cumbersome.