Determining bi-polar stepper wiring sequence

Yup, I got my Uno, my L293D Driver and my 12V, 1.7A bi-polar stepper hooked up and it shutters. Tried 3 different wiring set-ups using L293D with TIP120 transistors, different wiring without the transistors and the results are the same. a few shutters this way, then a few shutters the other way, maybe a bit of clicking with no movement, etc....

Reading the posts and feeling confident of my wiring and the proven sketches I used, I feel the problem is the wiring sequence (and/or polarity) to the stepper motor coils.

Does someone know a simple method of starting with two wires and hooking them up, confirming they are correct, and then the other two. I am terrified to try with without guidance for fear of damaging stuff.

I know the L293D says...
Pin 3 -> 1Y
Pin 6 -> 2Y
Pin 11-> 3Y
Pin 14->4Y

My stepper has a standard 4-pin connector with coil 1A, coil 1B, coil 2A, coil 2B

So, my default wiring has been...

1Y -> 1A
2Y ->1B
3Y ->2A
4Y ->2B

Other than that, I have been using wiring/code form the Arduino Stepper library (and other sources).
Tired to use my Pololu A4988 and nothing happened (but I might of blew that up earlier)

My external power supply is a regulated supply at 12V with 17A available (stepper only needs 1.7A). So lots of current available.
And yes, the L293D is hot to the touch. Actually, too hot to touch.

Biolar stepper two.docx (78.6 KB)

Bipolar stepper one.docx (25.6 KB)

datasheet-fit0278_1.pdf (84.1 KB)

You're flying blind. If you put leds on all the motor driver input signals (2 enables and 4 Direction pins) with 220 ohm resistors to ground , you can see the status of all the signals that determine what the stepper should be doing without even connecting it..
Read the datasheet for the L293 . Put leds on all the input signals. Run a sketch and change the speed to very slow. You should be able to see the phase sequences . Imagine the four leds connected to the driver inputs as DCBA binary and look at the pattern,, with
the binary weighting in the order 8421 so
0001 =1,
0010 =2
0100 =4
1000 = 8
0110 =6,
0011 = 3
etc etc.

The stepper motor sequences for full step , half, quarter etc are readily available online but they can be found on pages 4 and 5
of the L297 Datasheet (see attached).

If you can see the led pattern is correct then just measure the resistance of the windings. If the motor is stuttering then there is an impedance mismatch between the power supply and the motor. Either the voltage is too high or the current is too low, or both.
You need to verify the pattern cycles correctly with no motor connected first, then look at the winding resistance. The winding current I = Voltage V/ Resistance R => I = V/R ====> = 12V /R
If the motor is rated for 1.7 A total , then each winding draws half of that or 0.850 A (850 mA)

Let I = 0.850 A then
R = V/0.850 A =14. 11 ohms./per winding

My guess is that your problem is your power supply is overrated for your motor and because it is not an adjustable supply you
have no control of the current. All things being equal it should work just fine even with that supply but we don't know yet if your code is working because, as I said, you are flying blind. When you can tell us the sketch is cycling the driver input lines correctly then we can talk about the motor. Until then there is nothing to talk about (If you had a scope you would have already verified the signals were correct and reported such so we can rule that out. Report back when you can tell us it is cycling correctly.

In the future you can spare yourself a lot of grief by simply investing in a $100 variable dc (0 to 30V , 3A ) bench lab supply at Fry's electronics or a similar store. One that has adjustable voltage and current so you can limit the current when necessary. It will pay for itself in no time.

L297.pdf (168 KB)

If you use a proper stepper motor driver board such as a Pololu DRV8825 you would have none of this confusion. It will also allow you to power the motor with 20v or 30v for better high speed torque. An L293 is aa poor choice for driving a stepper motor.

The amps rating for stepper motors (1.7A in this case) is usually per-coil.

...R

The amps rating for stepper motors (1.7A in this case) is usually per-coil.

This explains the symtoms described. You are overloading the driver

The L293D is designed to
provide bidirectional drive currents of up to
600-mA at voltages from 4.5 V to 36 V.

You will not be able to drive that motor with that chip. You need to replace it with an L298 driver or one like Robin recommended that can handle the rating of the motor.

Hey, thanks for the prompt feedback.

:stuck_out_tongue_closed_eyes: LED's! Stupid brain, why didn't I think of that.
I will get on that pattern checking in the next few hours.
Oh, and you are correct Robin, it's 1.7A per phase.

Ok, a little more reading and I have determined that I plowed ahead and never did enough reading.
My apologies, but thanks for steering me back on course.

The L293 is not the driver I should be using as it is rated for 1.2A per phase and my stepper is 1.7A per phase.
Secondly, I did not control the current into the circuit as my motor power supply is a brute at 17A.

I heading out to locate a L298 at my local supplier.
I'll keep ya posted on my findings.

Oh crap, it's snowing! In September....really???

Things to look for when shopping for an L298 driver.
There a zillion flavors of this driver , all different.
Look for the following features:
1-Separate GROUND for Motor supply . (there should be a total of TWO GROUND PINS, NOT ONE) . Not all drivers have this.
2-ENABLE pins (two)
3- BE FORWARNED ! The 5V pin on these drivers is an OUTPUT , NOT an INPUT ! There is an onboard 5V regulator. This pin is to supply 5V to logic circuitry so you can everything off one supply connected to the driver. CHECK IT WITH A METER to confirm !
4-Separate set of pins for INPUTS ONLY. (All the logic inputs including the ground on one header) . Not all drivers have this.

BE SURE YOU UNDERSTAND THE PIN LABELING ON THE DRIVER 1 DO NOT CONNECT YOUR +12V to your 5V LOGIC POWER PIN
YOU HAVE BEEN WARNED.

Haha...warning noted!

Regardless, local supplies do not carry it.
Looks like I'll be sitting idle for a few days while they arrive. I ordered more than one......just in case. :wink:

Oh well, on to some servo fun now....

Titanium69:
I heading out to locate a L298 at my local supplier.

Waste of time and money. Get a Pololu DRV8825 or maybe a Pololu A4988 (but its max current is lower) and save yourself a ton of trouble as well as poor performance.

...R

Do you need to be able to microstep ?

raschemmel:
Things to look for when shopping for an L298 driver.
. . .
3- BE FORWARNED ! The 5V pin on these drivers is an OUTPUT , NOT an INPUT ! There is an onboard 5V regulator. This pin is to supply 5V to logic circuitry so you can everything off one supply connected to the driver. CHECK IT WITH A METER to confirm !
. . .

The data sheets that I have seen refer to this as an input pin.

Don

L298_H_Bridge.pdf (597 KB)

Things to look for when shopping for an L298 driver.
There a zillion flavors of this driver , all different.

Not the chip. I said DRIVER. I meant a driver module , not chip. Nobody actually breadboards an L298 because it would melt the breadboard so they buy modules like this:
http://www.ebay.com/itm/like/331141029475?lpid=82

http://www.ebay.com/itm/L298N-Dual-H-Bridge-DC-stepper-Motor-Driver-Controller-module-Board-for-Arduino-/361042612663?_trksid=p2054897.l5659

Scroll down to the bottom of the page at the above link and look at the schematic. See the onboard 5V regulator ?
See it in the photos ?

From reply # 6

when shopping for an L298 driver

From reply # 11

Not the chip. I said DRIVER.

Since the L298 is a driver (it describes it as such in the introductory paragraph of the datasheet), and since it has a 5 Volt pin I assumed that you were talking about the L298 chip itself. Nothing in your reply really pointed out that you were referring to the circuitry that drives this DRIVER chip.

Scroll down to the bottom of the page at the above link and look at the schematic. See the onboard 5V regulator ?
See it in the photos ?

Sorry, my crystal ball was in the shop when I was reading reply #6. I wasn't aware that I would have to refer to a link that was going to be posted 36 hours later, in reply #11, in order to properly figure out what 5 volt pin you were talking about.

Don

Maybe you should get more experience with the topic before jumping to correct people.

Why is anyone discussing an L298 (in any form) for driving a stepper motor ????

...R

Okay, I see you folks have been busy chatting while I was gone.

So, my L298N "Module" showed up today.

I wired it all up to my stepper and used a short "demo" sketch.
Everything ran fine. Stepper was a little noisier than I would have expected.

Approx 12 secs went by and then there was a "pop" and a little cloud of smoke. It came from the area of the 7805.
But the stepper just kept going along peacefully and that heat sink was getting really hot.

So....what did we learn?

PUT A CURRENT LIMITING RESISTOR ON BEFORE YOU USE A 12 VOLT - 17 AMP POWER SUPPLY!!!!

Board is good, but that one won't be providing 5V for anyone.

L298N module.JPG

Titanium69:
PUT A CURRENT LIMITING RESISTOR ON

Where?

What was the 7805 doing?

...R

Remember this post ? (Reply#6)

BE SURE YOU UNDERSTAND THE PIN LABELING ON THE DRIVER 1 DO NOT CONNECT YOUR +12V to your 5V LOGIC POWER PIN
YOU HAVE BEEN WARNED.

Do you remember what I said about the 5V pin on the L298 being an OUTPUT (from the onboard 5V regulator) , not an INPUT ?

The damaged 7805 is not related to current. I don't think a resistor would have made any difference but without knowing why it popped it's hard to tell.

The damaged 7805 is not related to current. I don't think a resistor would have made any difference but without knowing why it popped it's hard to tell.

The reason the motor gets hot is because you DON'T have anything limiting phase current. I'm amazed you didn't POP the L298. Unless you know the winding resistance of your motor already, get an ohm meter and measure the resistance of one winding. Then do the math: I=E/R, where I is current and E is your voltage, 12V. That's how much current you are sending the motor. The other way to limit the current is by PWM. Since the motor winding is an inductor, if you switch the winding quickly enough the current doesn't have time to build up. Most Stepper Chips, such as Robin suggested, have this feature built in. Not to say you can't do it with the L298 but it's a tremendous amount of overhead for the Arduino. With the L298, you will need to sense the current (some boards have a jumper) across a resistor, monitor it with the A2D and adjust the PWM pulse to maintain a given voltage across the resistor. This is non-trivial engineering and has you re-inventing the wheel.

The only other way to limit the current is by placing a 6 ohm resistor in series with each lead of the motor. It should get you very close to the 1.7A rating of your motor. You should be able to find 6 ohms at 50 watts on ebay since this is a resistor used in cars when replacing incandescent bulbs with LED's.

rmetzner49:
The reason the motor gets hot is because you DON'T have anything limiting phase current.

That's why I have been recommending a proper stepper motor driver - but my suggestion has been ignored. =(

...R