7
votes

I am building a system with the Arduino Uno, a power shield (REf to model) and a bipolar stepper motor.

I cannot initiate the motor using the stepper library from Arduino. I instantiate my stepper with

Stepper myStepper(motorSteps, motorPin1,motorPin2m motorPin3,motorPin4);

And keep on with the example code provided with the Arduino.

When I launch the code on the Arduino, the motor emits some sounds, but it does not turn.

How can determine the right motor pins to use? On the power shield, which mode is to be used, PWM or PLL?

7

7 Answers

6
votes

As you suggest, the adafruit motor shield should fit the arduino stepper library, as it uses a L293D to drive the motor. It can drive 2 stepper with an current of 0.6A (good for most of little stepper you can find in printers, floppy/CD/DVD reader...).

Be careful, they seem to use their own library for this shield, you can find it here :

http://www.ladyada.net/make/mshield/download.html

And to know how to connect your stepper, look here :

http://www.ladyada.net/make/mshield/use.html

Sorry to answer your comment this way, but I don't have enough reputation to comment... so please, +1 my answer if you think it's a good answer :)

4
votes

It's normal that the arduino sketch doesn't work. It drives the motor like this:

  • PIN1 : coil 1, forward current
  • PIN2 : coil 1, backward current
  • PIN3 : coil 2, forward current
  • PIN4 : coil 2, backward current

Your shield drives the stepper this way:

  • PIN1 : current forward/backward
  • PIN2 : current intensity with PWM
  • PIN3 : current intensity with PWM
  • PIN4 : current forward/backward

Not a good idea to drive a stepper motor, as you don't even need PWM to drive a stepper. It's to drive a DC motor. You may write your own sketch to drive a stepper with that shield, but you should find a shield that fit the arduino to drive a stepper. Look for something like "UL2003 stepper module", it costs few dollars.

Edit: I've got one of those modules and it works like a charm. Be careful about the power you need. Maybe you need something like a L298N module. I've got few of them too and they work fine.

2
votes

If the motor emits some sound, this is good news. At least you have contact with it. Since it is just a sound but no movement, there might be three things laying underneath of this behavior;

  1. Wrong pin connections of the motor
  2. Insufficient current feeding from the motor driver.
  3. Step counts determined by the code using PWM might be too less or too high as per the motor can handle.

I can offer this URL link to determine motor pin-outs;

How Can I Determine My Stepper Motor Wiring Without the Stepper Motor Pinout

1
votes

In stepper motor how many wires you have? 4 or 6.

Your connection is faulty. That's why it makes such sound.

Test with multimeter. you find two wires give high resistance. other two give half from that. Connect the first two with motor driver out1 and second two with out2.

You didn't mention which motor driver you are using. Try with L298 motor driver shield.

1
votes

I think the problem you are having is related to the kind of shield you are attempting to use. The power shield that you linked is designed for DC motors and you are attempting to use a stepper motor (see this website for an explanation of the difference).

I would recommend trying another shield (like the Sparkfun EasyDriver) that supports the use of a stepper motor.

1
votes

The problem seems to be wrong connected motor pins. Are you sure, you connect true windings to motor? Measure the motor pins with ohmmeter. There should be two windings which have pins A1-A2 and B1-B2. Between these pins you should see some resistance value. Then be sure you connect to shield with right order.

1
votes

In mi projects I use a bipolar motor (a nema17), and you can drive it easy with a A4988 pololu (or drv8825, more powerfull, and more expensive). Those drivers has an H bridge inside, and allows you to control the motor by a simple:

while(1){
   digitalWrite(PIN_STEP, HIGH);
   delay(1000);
   digitalWrite(PIN_STEP, LOW);
   delay(1000);
//1RPM = 100 microsecond delay for a 1.8 degree angle motor (200 steps per 
  turn)
  }