Pages: [1]   Go Down
Author Topic: Slowing speed with Easydriver v4.3  (Read 1753 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just starting to play around with steppers in the attempts to have a very slow rpm motor.  I've been working through an Easydriver v4.3.  After some research and helpful code and tips via posts and blogs I've had enough success in having something move, but I haven't worked out the end result which is this:

A speed of 0.2 rpm or about 1rph.  I'm using a 200step, 330ma, 12v bipolar stepper via Uno Arduino.

My attempts often end up in stalling or 2 steps forward 1 step back results.
Would adjusting the mircosteps help (ie full step to 1/8 step or visa versa)
Is there a sample of code using the setSpeed(rpm) or step(200) that could work?
Any advice on acheiving such a slow speed?
I've done the route of gearhead dc motors and would prefer an alternative.

thanks
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 20
Posts: 1318
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1 rph = 2.25 seconds per step if microstepping at 1/8

so set MS1 and MS2 high (the default as it happens)

Code:
while (true)
{
  digitalWrite(step_pin, HIGH);
  delayMicroseconds(10);
  digitalWrite(step_pin, LOW);
  delay(2250)
}

and Bob = Mother's brother!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

0
Offline Offline
Newbie
*
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

mmcp42,

thanks for this:

Quote
while (true)
{
  digitalWrite(step_pin, HIGH);
  delayMicroseconds(10);
  digitalWrite(step_pin, LOW);
  delay(2250)
}

it tried it out. works better than I had but it still creates an issue with the motor occasionally stepping backward.

here's something else I have going which is working to some extent but still runs issue with the occasional backward step as well.  It's also quite jerky.  Here is:

Code:

////////////////////////////////////////////////////////
// Stepper Motor skecth for use with the EasyDriver 3.1 ///////////////////////
/////////////////////////////////
// Dan Thompson 2008 //
// modified by Robert Hengeveld 2011 //
// Inpired by the code and chat on this thread.
// http://forum.sparkfun.com/viewtopic.php?t=10378&highlight=easydriver //
// 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;

digitalWrite(dirpin, LOW); // Set the direction.
delay(100);

Serial.println(">>");

for (i = 0; i<20; i++) // Iterate for 20 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); //
} // particular motor. Any faster the motor stalls. (could maybe go faster - decrease the Microseconds between steps)

digitalWrite(dirpin, HIGH); // Change direction.
delay(1000);

} // end of loop

I've been looking into the option of coding in 'setSpeed(rpm)' or 'step(200)' but haven't found the right sample code or tutorial.  I've also consider having it switching the 'sleep' or 'enable' high and low in order to slow things down while conserving some energy at the same time?
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 20
Posts: 1318
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

suspect you need to look at:

a) is your power supply reliable
b) make sure you set MS1, MS2, Enable, Sleep, Direction either HIGH or LOW; don't let them float

When I first set up my stepper motors they were all over the place
Seems the EasyDriver can pick up noise (motors are quite good at making noise) and changing direction while I wasn't looking!

PS setting enable HIGH stops the main circuitry and reduces power a very lot
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

0
Offline Offline
Newbie
*
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've run through these suggestions.  Thanks.  It doesn't seem to solve the issues.

defaults are enable, MS1, MS2 = LOW, sleep = HIGH.
I've tried them with different combinations of pulled to GND and 5v+.  In the end I've left MS1, MS2, and enable GNDed and Sleep to 5v which mirrors the defaults.

power supply is fine.

everything works at higher speeds.  I just run into issues when trying to slow it down.

Logged

Pages: [1]   Go Up
Jump to: