1st test of repstrap reprap stepper motor

 

 

 

 

 

 

 

 

 

 

 

I have three small (tiny really) stepper motors in my “junk box”. I eventually want to build some cool CNC machines. RepRap, CNC router, CNC mill, CNC lathe. Okay, but to get there i need to learn more about this technology. Best way for me to learn is by doing through experimentation. I have to start small, so i will be attempting to build a repstrap “starter” machine. Today i used a sparkfun easy driver to drive a stepper. It was awesome. It was similar to the first tutorial, and the 2nd video mixed together.

here is the arduino sketch so far. (version 1)

////////////////////////////////////////////////////////
// Stepper Motor skecth for use with the EasyDriver 4.2
////////////////////////////////////////////////////////

// Original by Dan Thompson 2008
//
// Musical test version 1 by Andrew Barney
//
// Use this code at your own risk.
// For all the product details visit http://greta.dhs.org/EasyDriver/
// For the full tutorial visit http://danthompsonsblog.blogspot.com/
//

int dirpin = 3;
int steppin = 12;

void setup() {
Serial.begin(9600);

pinMode(dirpin, OUTPUT);
pinMode(steppin, OUTPUT);
}
void loop()
{

int i;

Serial.println(“>>”);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps.
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(200); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

Serial.println(“<<“);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

Serial.println(“<<“);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(400); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

Serial.println(“<<“);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(500); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

Serial.println(“<<“);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(600); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

Serial.println(“<<“);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(700); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

Serial.println(“<<“);
for (i = 0; i<4000; i++) // Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(steppin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(800); // This delay time is close to top speed for this
} // particular motor. Any faster the motor stalls.

delay(1000);

}

Advertisements

2 thoughts on “1st test of repstrap reprap stepper motor

  1. Thank you, I have just been searching for info approximately this subject for
    a while and yours is the greatest I’ve found out so far.
    But, what in regards to the conclusion? Are you certain about the source?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s