For those of us not familiar with the driver, can you explain the parameters and expected result of the 4 functions used? That would help us help you without a lot of research on our part.
In other words, are the speed variables rpm, or steps?
This is steps per second ( It's AccelStepper - doesn't have to do with the driver ). But with an AVR ( Mega/UNO/Nano ... ) you will never reach that speed - even without any prints in loop.
When I comment it printing it is better. Accelerating and than just stops and scrimming. He stops at approx 4 turns per second as I can see. I wrote up 4rpm sorry. I am using full step config. Using mega2560.
If you use the run() method ( with acceleration/deceleration ) the max speed that is reached after acceleration is determined by setMaxSpeed. With this setSpeed() should not be used at all, because it is used by run() internally to set the speed during acceleration.
Ah, so max speed is the target speed, which you may or may not hit depending on the distance you move. I assume it’s units are steps/sec.
So if your target is 10000steps/sec, and the motor is 200steps/rev, then revs/sec should be 10000/200 or 50revs/sec or 3000 rpm. So is your motor capable of running 3000rpm?
You might want to try some smaller max speed to see if you’re trying to run it too fast.
Well, steppers are not high speed motors. Did you set the coil current according to your motor specs?
And what about your power source? To achive high speeds, the voltage should be as high as possible for your driver.
I looked at the HW controller spec… How have you got the mode dip switches set? You could be at 1/16’th step, which could explain your slow speed. Your expected revs/sec is 50, but if the dip switches are set to 1/16’th, you’d be running about 3revs/sec!
I imagine the driver set speed function should match the dip switch settings.