I took apart an old flatbed scanner and kept the mechanical parts in place (timing belt, smooth rod, pulleys, and stepper motor) - I want to control it using my Arduino, but am having some difficulty.
The stepper motor is a small, 4-wire bipolar motor. I purchased an L293D IC and slapped it onto a breadboard, then wired it up (enable pins to +5V, VCC1 = 5V, VCC2 = 12V). I connected the 1A, 2A, 3A and 4A pins to pins A0, A1, A2 and A3 respectively on my Arduino.
I thought I had identified the phase pairs correctly with my multimeter (pairs result in a resistance of ~330 ohms, non-pairs result in nothing or infinite). However, when I connected the stepper motor wires to the L293D and uploaded a simple sketch (using AccelStepper), the motor will not budge. In fact, sometimes the motor and chip both get too hot to touch after a few seconds in some configurations. The source code is extremely simple, it seems silly to share, but if you want it just ask.
I've swapped wires within pairs to see if I could get it to at least move in one direction, and also swapped wires between phases (I hope I'm using the right terms). But no matter how I move the wires around, the thing just keeps ticking and chirping, but not moving. It makes me think that either a) the wiring is wrong or b) the motor is not getting enough current. Since the L293D is capable of up to 2A per phase, and I'm using an ATX power supply, I didn't think that current was a problem.
Any ideas on what to do to troubleshoot this? I purchased the scanner used, so there may be a chance that the motor itself is bad - how can I go about testing that?
If it is getting hot rapidly, you need a heat sink on the 293, and you are probably running too high a voltage, resulting in too high a current. When they get hot fast that is a bad sign. Also - double check your wiring that you don't have something connected backwards.
Does the 293 want active high or active low inputs? use some 1K resistors to pull them to the off state.
Got a picture of your setup - close enough that some detail can be seen?
What is a good source for suitable heatsinks? I'm not sure where to look for one.
Here's the odd thing - when turn off my ATX power supply, and plug my Arduino in via USB (FTDI Friend), the stepper motor now works perfectly. When I remove the USB connection and turn on my ATX power supply, the motor makes a ticking noise, then doesn't do anything.
With my multimeter, I've found that motor is receiving 3.9V via USB, while the ATX supply gives 4.6V. Could that difference of 0.7V really be the difference between the motor working and not working? I didn't think that the USB connection would be capable of providing enough power for the motor, but it seems to be!
By the way, the L293 wants active highs for the enable pins, so I should be good there
And here's a picture: http://imgur.com/Wd6t8 (L293 is on the left, ULN2003 for a unipolar motor is on the right, just ignore it).
kf2qd:
If it is getting hot rapidly, you need a heat sink on the 293, and you are probably running too high a voltage, resulting in too high a current. When they get hot fast that is a bad sign. Also - double check your wiring that you don't have something connected backwards.
Does the 293 want active high or active low inputs? use some 1K resistors to pull them to the off state.
Got a picture of your setup - close enough that some detail can be seen?
If the windings are 330 ohms and the supply is 12V then getting hot means a short! 330 ohms only carries 36mA.
I am suspicious of the 330 ohm figure though, that's high for a motor winding - perhaps its a 24V motor?
Test the motor by connecting 12V across each winding in turn in each polarity - it should be nudged by a step or two each time and exhibit holding torque.
I may have mis-read my multimeter - I set it to the "2000 ohm" setting, and it read "033". That may mean 33ohms, instead.
Like I said in the original post, the steppers are from a flatbed scanner - very small. They are roughly the same size as this: http://www.sparkfun.com/products/10551
I've now confirmed that both motors work, and are wired up correctly, but I'm having trouble with delivering the correct amount of voltage to each. When I connect my programming interface (FTDI Friend), I measure 3.9V going to the L293, and the motor works perfectly.
When I remove my programming interface and plug in my ATX power supply, I measure 4.6V going to the L293, and the motor will not turn. The funny thing that my OTHER stepper motor (unipolar motor connected to a ULN2003) DOES work at this voltage.
How can I drive two motors with two different voltages? Or is it simpler than that?