This is my first time using an Arduino Uno. I have an Arduino Motor Shield R3 connected to a 12vdc 5a/h battery. I've been trying to run a basic stepper test but have had no luck. The shield A and B blinks and the stepper makes noise but it doesn't do any steps. The L298P also gets hot pretty fast.
Here is the stepper I'm using: 27:1 Planetary High Torque Nema 17 Stepper
Is this stepper too much for this configuration?
Electrical Specification:
- Manufacturer Part Number: 17HS19-1684S-PG27
- Motor Type: Bipolar Stepper
- Step Angle: 0.067 deg.
- Holding Torque: 3Nm
- Rated Current/phase: 1.68A
- Phase Resistance: 1.65ohms
- Inductance: 2.8mH+/-20%(1KHz)
I have the Black(A+), Green(A-) connected to A on the power block and Red(B+), Blue(B-) connected to B. I did not cut the Vin Connect.
I tried the code from this link but nothing happens:
http://forum.arduino.cc/index.php?topic=194077.0
Does anyone know what I'm doing wrong? I really want to learn this but I'm stuck.
I set my steps to 5373, RPM to 20, and test rotation to 1/8.
// Include the Stepper Library
#include <Stepper.h>
// Map our pins to constants to make things easier to keep track of
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;
// The amount of steps for a full revolution of your motor.
// 360 / stepAngle
const int STEPS = 5373; // 360 divided by 0.067
// Initialize the Stepper class
Stepper myStepper(STEPS, dirA, dirB);
void setup() {
// Set the RPM of the motor
myStepper.setSpeed(20);
// Turn on pulse width modulation
pinMode(pwmA, OUTPUT);
digitalWrite(pwmA, HIGH);
pinMode(pwmB, OUTPUT);
digitalWrite(pwmB, HIGH);
// Turn off the brakes
pinMode(brakeA, OUTPUT);
digitalWrite(brakeA, LOW);
pinMode(brakeB, OUTPUT);
digitalWrite(brakeB, LOW);
// Log some shit
Serial.begin(9600);
}
void loop() {
// Move the motor X amount of steps
myStepper.step(STEPS/8);
Serial.println(STEPS);
// Pause
delay(2000);
// Move the motor X amount of steps the other way
myStepper.step(-STEPS/8);
Serial.println(-STEPS);
// Pause
delay(2000);
}