I've made a clock for the pantomime (5 months to go) with the 12:1 gearing so the hands work and I will connect a stepper to the minutes hand spindle. So I need it to turn at 1/60 rpm normally but it has to speed up on an analogue pin / potentiometer to run at, say, 10 rpm.
Back to normal speed at midnight would be great (could make a contact / sensor from the hands).
Can't find any examples that do both so tips / suggested code would be a great help.
Can't promise the glass slipper will fit you though..
I'm using a NEMA 17 1.8 degree stepper motor and L298N driver
Or the AccelStepper library, which ramps speed up and down so is more likely to actually work. [ although for 10rpm that's probably not an issue ]
For very low speeds it may be more accurate to send step pulses by hand, the speed
resolution of each library may be less than is required for an accurate 1/60 rpm
Thanks for suggestions - I don't know how to look inside a library, I thought you just loaded them. Still a lot to learn but useful tips I'm sure. Thanks, Ralph
clockface:
Thanks for suggestions - I don't know how to look inside a library, I thought you just loaded them. Still a lot to learn but useful tips I'm sure. Thanks, Ralph
Arduino ecosystem is open source, you have it all on your machine waiting to be examined!
The documentation is inside, mainly in AccelStepper.h, some in AccelStepper.cpp
The documentation in the source is guaranteed to match the version you are using, external
documentation may not be. Learning to read code is a good way to learn (if its well written
of course!)
With a 200 step / rev motor, you will need 1 pulse every 18 seconds (18000 millis) for 1/60 RPM and 1 pulse every 30 millis for 10 RPM.
You will probably need a real time clock module for the 1/60 RPM since the Arduino oscillator may be off by several seconds per hour.
edgemoron:
You will probably need a real time clock module for the 1/60 RPM since the Arduino oscillator may be off by several seconds per hour.
If this is just for an artistic piece in a play it should be possible to fudge the interval between steps to get sufficient accuracy for a few hours without needing an RTC.