I am posting here as I have an interest in cnc and cnc uses stepper motors though quite a bit more powerful than I have. I have a stepper motor question and I am very new to stepper motors. I bought two small stepper motors to experiment with Pololu - Stepper Motor: Bipolar, 200 Steps/Rev, 28x32mm, 3.8V, 670mA and a easy driver stepper controller from SparkFun that are hooked up to an Arduino with an external supply set to 24v. I modified a program I found, but I am disappointed in the results I am getting. The stepper works, but it is jerky and very slow, sometimes slower than others. Is this normal for stepper motors or do I have something wrong.
Code:/* Stepper Test - Test a single Stepper Motor http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/?ALLSTEPS */ // for duemilanove atmega328 arduino board + easydriver stepper controller // dan@marginallyclever.com 2010-06-15 #define DIR1_PIN (11) #define STEP1_PIN (11) //#define DELAY (1600/10) #define BAUD (9600) void setup() { Serial.begin(BAUD); pinMode(DIR1_PIN,OUTPUT); pinMode(STEP1_PIN,OUTPUT); } void loop() { int i=0; digitalWrite(DIR1_PIN, LOW); // Set the direction. delayMicroseconds(100); Serial.println(">>"); for (i = 0; i<=3400; i++) // Iterate for 4000 microsteps. { digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the digitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step. delayMicroseconds(700); // This delay time is close to top speed for this //j+=1; } // particular motor. Any faster the motor stalls. }![]()


LinkBack URL
About LinkBacks





