Stepper Motor Does not turn but I can hear vibrations

Hi all. I recently had a set up for a NEMA 17 HS4401 that was controlled with a TB6600 driver. A few weeks ago everything was working as intended but our group decided to take everything apart and rebuild it and now it doesn't even work with the most basic code. What is more concerning is that the motor shaft can not be turned when plugged in, but when it is not plugged in I can rotate the shaft freely. I did not change any of the switch settings on the TB6600 (Used the 1.5-1.7 A for current setting and 200 steps for the steps setting). I checked all the wire connections with a multimeter and found no broken wires and I checked that the wires connecting the motor to the driver were paired correctly. I already tried reversing the polarity of one pair in desperation but that did not solve the problem. Any advice is greaty appreciated.

The following code used:

#define dirPin 7
#define stepPin 6
#define EnablePin 5
void setup() {
  // Declare pins as output:
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(EnablePin, OUTPUT);
  // Set the spinning direction CW/CCW:
  
  
  
}
void loop() {
  // These four lines result in 1 step:
  digitalWrite(EnablePin, LOW);
  digitalWrite(dirPin, HIGH);
  
  digitalWrite(stepPin, HIGH);
  delayMicroseconds(400);
  digitalWrite(stepPin, LOW);
  delayMicroseconds(400);
}

Image of the current setup:

Image of diagram (Note I forgot the draw the lines for the enable pins but I don't have my ipad at the moment):

Sources:
(TB6600 Datasheet: https://www.makerguides.com/wp-content/uploads/2019/10/TB6600-Manual.pdf )
(Nema 17 HS4401 Data Sheet 17HS4401S-Handson.pdf (134.3 KB))

Move the power leads feeding the breadboard to the othe end. Some breadboards have the power rails split so the opposite ends don't connect without jumpers in the middle.

You mean move them to the top?

Most likely, a (re)wiring mistake was made. Triple check all wiring and redo if necessary. Use your multimeter continuity checker to look for broken wires or connections.

Breadboards are intended for temporary experiments with low power logic circuitry and cannot tolerate motor currents. The conductive tracks tend to burn out.

Your project on Wokwi with scope attached ...

Shouldn't the dir signal look something like this?

Yes the dir pins are square waves

Not from the code you posted. Its just set HIGH.

Thats what I was doing for 6hrs yesterday XD but I will keep checking. We also switched off to a new breadboard too.

MB im wrong. From what I understand, the dir pin is just used to set the direction, but the stepPin is the one that gets turned off and on in order to get the motors to rotate

Also would the pins I use have any affect? Right now I think I have dirPin and StepPin on pwm pins on the arduino. Would that matter?

Well, it looks like you're using dir correctly for the TB6600.

No, because you're using digitalWrite().
The analogWrite() function enables the pwm mode.

1 Like

2 * 400 microseconds calculates to 375RPM.
I doub any motor can do that from stand-still.
Change 400 to 4000, and see what happens.
Then use proper stepper code with acceleration and deceleration.
Leo..

What do you mean by deceleration and acceleration? Could you provide an example or a source?

Did it work with 4000.

Exacly as it says. Stepper libraries ramp up/down motor speed slowly.
AccelStepper seem popular. The library can be installed via the library manager.
Tools>Manage Libraries>type accelstepper>install.
Examples can be found in the IDE after installing.
Leo..

Your breadboard layout does not match the schematic that you have given us.

You have got the ENA- and DIR- of the stepper motor driver connected to the negative of the motor supply, and not to the Arduino GND pin.

There is no need for the 12V supply to be connected to the breadboard.. Connecting it straight to the motor driver screw connections will be more reliable.

Hi,
The one thing missing from your schematic is the wiring colours from the stepper.
Have you got the wires in the correct combination?

Have you consulted the data/spec sheet of the stepper to confirm the wiring?

Do you have a DMM to deternime the wire pairs of the stepper?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Hi,
Just a quick draw of your schematic.

Tom... :grinning: :+1: :coffee: :australia:

Hi all. Connecting to the Arduino gnd solved the problem. However, I want to know why that matters? How come grounding everything to the power supply's ground doesn't achieve the same result?

The return path for the 12volt motor supply is motor supply supply ground.
The return path for Arduino 5volt DIR/PUL/ENA signals is Arduino ground.
Those two grounds can, but don't have to be shared.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.