I am currently trying to use a microstepper motor driver (TB6600) with Arduino UNO. So far I got the motor to move, the problem is the microsteps. I'm using a stepper motor with 200 steps/rev. and the motor driver is set up to 32 microsteps/step, resulting in 6400 microsteps/rev.
With the attached code, the motor moves 16 microsteps, waits for 16 signals (it really doesn't move at all) and then moves another 16 microsteps. I want it to move continuously for one microstep every second without interruption for one revolution. My set up is currently to have PUL+, DIR+ and ENA+ all together on the 5V pin on the Arduino and PUL-, DIR-, and ENA- on pins 9, 10 and 11.
What seems to be another problem is the width of the steps. When the motor moves these 16 microsteps, it moves about 2 degrees, which would be the resolution of one normal step (360 degrees/200 steps/rev = 1.8 degrees/step). With a resolution of 32 microsteps/step it should only move about 1 degree (0.9 degrees) when taking 16 microsteps.
Does someone know where to start troubleshooting?
You forgot to post all the important information: links to the motor, motor power supply and driver, and exactly how you set the current limit on the driver (which is absolutely critical for proper microstep operation).
Why don't you have a normal FOR statement like this
for(z = 0; z < 6400; z++){
A step interval of 1000 millisecs is very long for microstepping. And there is no need for the step pulse to be so long. 10 microsecs should be plenty - like this
void loop() {
for(; z < 6400; z++){
digitalWrite(stepPin, HIGH);
delayMicroseconds(10);
digitalWrite(stepPin, LOW);
delay(1000);
}
}[/code]
In the first instance test the motor with the AccelStepper library, with modest settings for speed and acceleration.
If the progress is stuttering at low speed this could simply be you've connected the windings wrong.
Be careful never to disconnect or connect the windings to the TB6600 when it is powered, this usually
instantly destroys the chip. For this reason the connections to the windings must be rock solid too.