Hi I am trying to rotate my stepper motor below 1 RPM.
The intent is to use it for tracking the sun for a solar cooking project I am working on.
The motor I am using is 28BYJ-48. It comes with a lot of starter Arduino kits.
It's a 5 volt stepper motor with a 1 to 64 gear ratio.
For the solar tracking I have have taken into account
24 hours of rotation of the earth in 360 degrees.
I've calculated this out to be 15 degrees/hr -->.25 degrees/min-->.004167 degrees/sec
Or .25 degrees/min/360 degrees = .000694 RPM
In my code below I've input the number of steps the motor must take to complete one revolution.
I've been able to successfully use the code with 1 RPM, but anything below that doesn't rotate.
Is there a reason why? Are steppers not good enough for this type of motion?
Thanks! Any input is appreciated.
//28BYJ-48 Stepper Motor
//Half-step mode: 8 step control signal sequence (recommended) 5.625 degrees per step / 64 steps per one revolution of the internal motor shaft
//Arduino Stepper Library runs in 4 step control signal sequence 11.25 degrees per step / 32 steps per one revolution of the internal motor shaft
//Gear reduction ratio: 1 to 63.68395
// Steps per one revolution (internal motor shaft) * Gear reduction ratio = Actual number of steps per revolution = 64 * 63.68395 = 4075.7728 in 8 step control signal sequence
// Steps per one revolution (internal motor shaft) * Gear reduction ratio = Actual number of steps per revolution = 32 * 63.68395 = 2037.8864 in 4 step control signal sequence
//stepper library
#include <Stepper.h>
//ms stands for motor steps
//#define is used to assign a name for a constant value i.e. in this case ms stands for actual number of steps per revolution
#define ms 2037.8864
//mip stands for motor input pin
//output pins 8,9,10,11 on Arduino UNO R3 attach to input pins 1,2,3,4 respectively on stepper motor driver ULN2003A
int mip1 = 8;
int mip2 = 9;
int mip3 = 10;
int mip4 = 11;
//command tells the Arduino stepper library which pins are connected to motor controller
//first parameter in parenthesis is number of actual steps that occur per revolution
Stepper stepper(ms, mip1, mip2, mip3, mip4);
void setup()
{
//outputs Arduino UNO R3 pin outputs into stepper motor inputs
pinMode(mip1, OUTPUT);
pinMode(mip2, OUTPUT);
pinMode(mip3, OUTPUT);
pinMode(mip4, OUTPUT);
//stepper motor value in parenthesis is in RPM
stepper.setSpeed(.000694);
}
//repeats commands written below
void loop()
{
//number of steps the motor takes to complete one revolution
stepper.step(ms);
}