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);
}
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.
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.
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
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..
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 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..