Hey Folks !
I need to do the following:
- Button A is pressed. Motor accelerate FWD to full speed. Button is released, motor decelerate.
- Button B is pressed. Motor accelerate REV to full speed. Button is released, motor decelerate.
Yes, I know, I could have used a DC motor, but we bought that big NEMA34 Stepper motor, the driver that matches and a power supply. I'm stuck with the choice that was made. I would like to go up to 500 RPM.
According to the specs, (5 amp, 11 mH, fed at 48 Vdc) the the speed is 2.2 Rev / sec. (roughly 130 RPM)
In my first sketch, I use the "Stepper.run()" method, therefore my stepper follow an acceleration curve. The fastest speed I could achieve is 350 RPM, which is way better than the theoretical max speed.
My problem is that at some speeds, the motor make some weird noise, something like if a pulse or 2 went missing.. It does maintain a fairly stable speed. It also follows a nice accel/decel ramp.
My second sketch, uses the "RunSpeed()" method. When I want to start it, since it does not follow any acceleration curve, I must lower the speed below 50%, otherwise it won't start turning: I'm guessing the pulse train is so fast that it can't "beat" the inertia. Once started, I can increase the speed up to 600 RPM !
It does run smooth at any speed.......
Is the a way to combine both behaviour: being able to run up to 5-600 RPM, run smooth following an Accel/Decel curve ?
StepperMotor_RunSpeed_Method.ino (732 Bytes)
StepperMotor_Run_Method.ino (767 Bytes)