noughty stepper

hi there!

i am looking for help interfacing a (bipolar) stepper motor.

the example on this page: http://www.tigoe.net/pcomp/code/category/arduinowiring/51 works just fine.

the arduino 0018 example at files/examples/stepper/MotorKnob does strange things with the same configuration (i changed the pins according to my wiring). the motor turns in one direction without me touching the pot at all -- than it changes direction after a while but never on the same position.

here you can see what i did: (the ic in the mddle is a L293DNE) http://arpro.posterous.com/finally-a-working-stepper-motor-driver-l293d

any ideas?

greetings
Roderic Schuchart

If the stepper works with Tom's example, but not with the MotorKnob example, then the problem would seem to be with the one piece of hardware that is different between the two setups.

I don't think it has anything to do with a naughty stepper motor or stepper motor driver.

I assumed the same and tried the pot with the AnalogInSerial example -- the pot works nice and cleen(10k pot).

PaulS has summed it up. Can you change the software so that the same wiring is used for both programs?

I drive a stepper with an L293D.
I don't bother with the complication of the "Biolar stepper two-wire circuit:" schematic.
I don't use transistors to invert the signals, I just use two extra control pins from the Arduino. I drive all the signals 'by hand'. That way I know precisely what is happening.

I have had a stepper jump around when the battery was getting low.

maybe you forgot to change the knob port from 0 to 2?

Also, when I drove a motor that was only rated for 3V from the 5V Arduino pin it caused the motor to jump around.

ted stockwell, unless it is a very low power stepper, it is best to avoid driving a motor directly from Arduino pins.

There are several issues:

  1. all the steppers I have used take much more current than an Arduino can safely supply, so the Arduino could be damaged
  2. When the voltage is changed (i.e. on to off), the motor acts as a generator and inductor, and so delivers an opposing voltage 'spike' to the pin, which pull the Arduino pin beyond ground or 5V, which could damage the Arduino

Also roderic schuchart says that an L293D is being used, and gives links to the circuits.

An L293D is a reasonable cost, relatively robust way to drive motors. So roderic schuchart isn't driving the motor directly from the Arduino.

HTH

gbulmer,

Sorry, I wasn't clear... I used a L293D and connected the 5V from the Arduino to the Vcc2 pin on the L293D.
The motor would change direction at random times and would not make complete revolutions.

I was using a small motor that I bought cheap at AllElectronics but had no datasheet. After googling I discovered that the motor was only rated for 3V. When I switched to the Arduino 3V feed the motor worked fine.

ted stockwell - Okay.

You have had more luck than me. Vcc1 of the L293D is only rated down to 4.5V, and I've had problem running below that.

gbulmer,

Wow, I did not notice that.
I have no idea why it works.
OTOH, I have no idea why it didn't work in the first place since I thought it was OK to use a slightly higher voltage when driving a stepper motor.

Did I mention I was new to electronics :-)?

I have no idea why it works.

Parts are often specified quite conservatively, and are often capable of much better performance, so I wouldn't worry about it.

Did I mention I was new to electronics :slight_smile:

Maybe you're a natural :wink: