Nema 23 stepper motor runs slow, bad wiring?

I have bought one of thease rails: Link

And connected it with a TB6600 and a Arduino Due.

The code im running is this:

AccelStepper stepper(1,3,9); // Driver, Stepper, Direction 
void setup()
{  
stepper.setMaxSpeed(30000);
stepper.moveTo(20000);
}
void loop()
{
    stepper.run();
}

With so large number i get the motor moving atleast, but it's not fast. It takes like 15 seconds to move 20cm.

My knowledge about stepper motors are limited, from what i read 4 wire motors are bipolar, i used a multimeter and there are resistance between red - blue and green - black wires on the stepper. I also tryed switching the red to a- and blue to a+ but nothing happend it still runs slow.

Any ideas?

Have you set the driver for full steps or microsteps?

Is the motor missing steps?

Have you set the correct current limit on the driver so it matches your motor?

I have no experience with a DUE. The demo code in the link below works on an Uno or Mega - but I don't see anything wrong with your test program unless the Due and Accelstepper don't like each other.

Does the DUE work on 3.3v? Is that compatible with your stepper driver?

...R
Stepper Motor Basics
Simple Stepper Code

Hi Robin,
Ive set the steps to 1. Is that correct? I also tryed so switch the current between 1-3A

I also tryed to connected everything to a arduino Uno with the same result.

How do you see if the motor is missing steps?

stepper.moveTo(20000) shouldnt that make the motor turn 200 times? It probably turning 20 Times or so..

//H

Have a look at the AccelStepper author's main page , where he explains the library and its limits.

It says that you can send a max. of 4000 steps/sec to a motor.
In your case you try to send 20,000 steps - that is way too much for this library!

I assume that the library gets in trouble and is heavily dealing with getting rid of the step-overflow.
If your motor needs 200 steps/revolution, then maxspeed = 4000 = 20rev/sec.

If this is too fast then, you can either reduce the steps/sec (maxspeed) or you use microstepping which makes the motor move smoother (at the cost of reduced torque).

Start with setting maxspeed to 2000 (at fullstep); this should move the motor 10 times/sec and after 10sec it should have reached your goal (stepper.moveTo(20000)).

If that is ok for you, you can try to set maxspeed to 4000 and set microsteps to 1/2 and should have the same result (destination reached after 10sec).

thrinker:
How do you see if the motor is missing steps?

Get it to move an exact number of revolutions and see if it does it.

...R