Hi there, I am working on a Stepper motor rig to pull a camera dolly weight being about 7lbs on a 45 degree incline at times along a 3' track, so I need lots of holding torque - very slow speeds, and with manual control using a Potentiometer.
Here is my hardware list - which all works using my sketch and breadboard.
Arduino UNO
Pololu a4983 with voltage regulator - Goal is to power this with a 9v off the shelf battery - USB for now.
Stepper Motor: Unipolar/Bipolar, 200 Steps/Rev, 42x48mm, 4V, 1200mA - powered seperately from the UNO with a 12V 3.6amp lead acid battery
Potentiomenter
Here is my current sketch, as you can see I have been experimenting with POT code, but an stopping as I am starting to hear the Motor squeal and get very hot - never did get the POT to work btw.
I would love some suggestions on this please, very new with it all and suprised I have gotten as far as I have so far.
#define stepPin 7
#define dirPin 6
#define enablePin 5
///#define potPin A0 // set pullup on analog pin 0
//pot
///int analogPin = 0; // potentiometer wiper (middle terminal) connected to analog pin 0
// outside leads to ground and +5V
///int val = 0; // variable to store the value read
// end pot
void setup()
{
Serial.begin(9600);
Serial.println("Starting stepper exerciser.");
// We set the enable pin to be an output
pinMode(enablePin, OUTPUT);
// then we set it HIGH so that the board is disabled until we
// get into a known state.
digitalWrite(enablePin, HIGH);
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
}
//Have the execution of the for-loop be based conditionally on some external event
unsigned char takeSteps = 1; // global variable
void loop()
{
// POT
/// val = analogRead(analogPin); // read the input pin
///Serial.println(val); // debug value
// end pot
int j;
digitalWrite(dirPin, HIGH); // set step direction
if (takeSteps)
{
digitalWrite(enablePin, LOW); // enable driver
delay(2);
takeSteps = 0;
for(j=0; j<=50; j++)
{
digitalWrite(stepPin, LOW);
delay(2);
digitalWrite(stepPin, HIGH);
delay(100);
}
digitalWrite(enablePin, LOW); // HIGH = current LOW = No current - disable driver - this is basically a stop delivering current command
}
}