0

SMA7029M Unipolar stepper driver
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

SMA7029M Unipolar stepper driver

by keithg on Sat Feb 28, 2009 1:48 pm

SMA7029M appears on a number of salvaged boards from photo copy machines. I am not sure where to start connecting with Arduino and can't find a tutorial. Would you please take a look at the data sheet?

http://www.allegromicro.com/en/Products ... /97024.pdf

Is SMA7029M compatible with Arduino? My motors are high voltage/current unipolar stepper motors. Thanks.
keithg
 
Posts: 82
Joined: Thu Oct 30, 2008 8:30 pm

Re: SMA7029M Unipolar stepper driver

by adafruit on Mon Mar 02, 2009 11:05 pm

everthing is 'arduino compatible' the question is whether you want to put in the work
im going assume you dont want to do any of the work so the answer is, no, there are no existing libraries

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: SMA7029M Unipolar stepper driver

by keithg on Tue Mar 03, 2009 9:14 pm

I am a 62 year old elementary art teacher trying to open a window to our students' future with limited electronics knowledge. Between computer games and testing madness, our kids are given little or no opportunity to realize their innate curiosity. Unfortunately, they only learn as fast as I do which is painfully slow. The project must be complete the end of May. Time is a problem.

As for work, I have been struggling with the project every evening and weekends since Sept. I confess ignorance but not laziness. The advise I have been given here has helped and I appreciate it. From your perspective, it may appear I am just looking for a quick fix to a problem I could solve myself but that view assumes I have experience.

Would a few details about the project avoid the suspicion that I am looking for an undeserved handout?
keithg
 
Posts: 82
Joined: Thu Oct 30, 2008 8:30 pm

Re: SMA7029M Unipolar stepper driver

by adafruit on Wed Mar 04, 2009 12:22 am

dont worry, i dont think you're looking for a handout, i just have to answer 50 posts a day and i have to do it fast! ;)
the arduino library encompases many chips but not that one. its probably not very common & its just very difficult to start interfacing with chips without an existing library.
so i suggest:
you can look at the arduino.cc page for how to control stepper motors, a single L293d costs very little and can control small steppers
for young people, hobby servos, about $5-$10 are even better and are trivial to get going

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: SMA7029M Unipolar stepper driver

by Ran Talbott on Thu Mar 05, 2009 11:10 pm

I took a look at the datasheet, and it appears to be downright trivial to write code that will drive the SMA7029M in simple "full step" mode. I think this will do it for you:

Code: Select all | TOGGLE FULL SIZE
// Change these lines to select the desired pins
#define MOTOR_1_PIN_A 9
#define MOTOR_1_PIN_B 10

const int Pin_A_seq[4] = { HIGH, HIGH, LOW, LOW } ;
const int Pin_B_seq[4] = { LOW, HIGH, HIGH, LOW } ;
byte Motor_1_index = 0;

void setup()
{

   pinMode(MOTOR_1_PIN_A, OUTPUT);
   pinMode(MOTOR_1_PIN_B, OUTPUT);
   digitalWrite(MOTOR_1_PIN_A, HIGH);
   digitalWrite(MOTOR_1_PIN_B, LOW);
}

void loop()
{
   /*
    * Insert code here that will call motor_1_left and motor_1_right
    * to spin the motor as desired
    */

}

   // The "& 3" in the motor movement routines constrains the
   // value of Motor_1_index to a range of 0 through 3,  wrapping
   // it correctly when it goes out of range.
void motor_1_left()
{
   Motor_1_index = (Motor_1_index - 1) & 3;
   digitalWrite(MOTOR_1_PIN_A, Pin_A_seq[Motor_1_index]);
   digitalWrite(MOTOR_1_PIN_B, Pin_B_seq[Motor_1_index]);
}

void motor_1_right()
{
   Motor_1_index = (Motor_1_index + 1) & 3;
   digitalWrite(MOTOR_1_PIN_A, Pin_A_seq[Motor_1_index]);
   digitalWrite(MOTOR_1_PIN_B, Pin_B_seq[Motor_1_index]);
}



The hardest part is probably going to be figuring out which wire on the motor goes to which phase. I would encourage you to make up cables with a standard connector (like one of the nylon connectors sold at Radio Schlock, but purchased form a source with better prices), rather than using screw terminals like the motor shield does: you'll probably find yourself moving the electronics among various projects, and you'll want to minimize the amount of effort needed to do so, and the number of opportunities for error.

If you want to drive more than one motor, just duplicate the code with "motor_1_xxxx" in it, and change the "_1_" to "_2_" (you'll need to change the pin assignments for the second motor, of course). The sequence tables can be used for both motors.

Ran
Ran Talbott
 
Posts: 57
Joined: Thu Feb 19, 2009 1:32 pm

Re: SMA7029M Unipolar stepper driver

by keithg on Sun Mar 22, 2009 4:29 pm

Sorry for not responding sooner. Thanks for the code.
keithg
 
Posts: 82
Joined: Thu Oct 30, 2008 8:30 pm

Please be positive and constructive with your questions and comments.