Hi,
thanks for the links.
I found a thread in the google group that pointed me to the problem:
https://groups.google.com/g/accelstepper/c/DObiJe74L9k/m/8nT11PfWAAAJFor some reason the max speed defaults to 1 step per second, which is why I got the same ticking motion no matter which value the speed had.
So these lines have to be included in setup() before setting the speed:
- Code: Select all | TOGGLE FULL SIZE
Wire.setClock(400000L); //to allow for speeds up to 1000 steps/second
Astepper1.setMaxSpeed(1000.0f);
I suggest you update the example included with motorshield library to reflect this.
I have a few related comments regarding controlling speed of a stepper motor using the motorshield v2.3
1.
I originally tried to change the speed in the StepperTest.ino example using
- Code: Select all | TOGGLE FULL SIZE
myMotor->setSpeed(10); // 10 rpm
There seems to be no relation between the number given to SetSpeed and RPM as is claimed in the comment of the code. In fact there seems to be no correspondence between the the value of SetSpeed and the actual speed of the stepper motor.
2.
back to the Accel_Constantspeed example, which now works with the modification mentioned above.
If I change the stepmode from SINGLE to INTERLEAVE or MICROSTEP this affects the speed obviously.
I found in Adafruit_MotorShield.h that MICROSTEP defaults to 16 (can also be set to 8).
If I understood the code in Adafruit_MotorShield.cpp correctly INTERLEAVE halves the speed?
It would be nice if this was included in the comments for the stepperTest.ino code.