gpasse
gpasse

Reputation: 4489

Arduino stepper

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?

Upvotes: 7

Views: 2672

Answers (9)

SAMIRAN MULEY
SAMIRAN MULEY

Reputation: 1

Do you know that we can also run stepper motor on just analogWrite whether having a stepper driver or not , If u have a driver then just give some analogWrite 155 or something , because what it needa is just the pulse , providing analogWrite starts the commutation of motor , if u dont have stepper driver u can switch the levels of 4 wires of stepper using delay and digitalWrite , note that only one wire must be powered at a time If still the sound persist check for the wiring of stepper whether their is cut or what , or increase the current of stepper driver or increase the voltage of motor driver , In most cases this is the issue of current if code and wiring are right , Hope this helps you

Upvotes: 0

SAMIRAN MULEY
SAMIRAN MULEY

Reputation: 1

I recommend using the AccelStepper Library to control a stepper using arduino ide , I have use many libraries but this one stands out of crowd It has basic two function , it can control stepper either by speed or by position or number of steps. The main thing of this library is that no delay has been used in the code

Upvotes: 0

Alvaro Torijano
Alvaro Torijano

Reputation: 17

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)
  }

Upvotes: 1

user1176298
user1176298

Reputation:

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.

Upvotes: 4

Sener
Sener

Reputation: 335

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

Upvotes: 2

meakcey
meakcey

Reputation: 83

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.

Upvotes: 1

torrey1028
torrey1028

Reputation: 19

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.

Upvotes: 1

user3647272
user3647272

Reputation: 76

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.

Upvotes: 1

user1176298
user1176298

Reputation:

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 :)

Upvotes: 6

Related Questions