Shop OBEX P1 Docs P2 Docs Learn Events
How do I power a 12V unipolar stepper with a Prop? — Parallax Forums

How do I power a 12V unipolar stepper with a Prop?

I thought a unipolar stepper was easy: hook it up to a BJT and drive the base with your uC pin. If the voltage is still too much, use a darlington pair. If that's still not enough, hook a couple darlington pairs in parallel. Either I got something wrong, or underestimated how big 12V is. I have a ULN2803 and a Howard Industries 1-19-4200 (12V, 75 ohm, 160 mA, unipolar) stepper. Each pin of the Propeller is (directly) plugged into a pair of pins on the ULN2803 (P16 -> P1 & P5, P17 -> P2 & 6, etc) and each wire of the of the stepper is plugged into a pair of pins to match. The ULN2803's ground is connected to ground, and VCC to 3.3V. I then connected the common lead of the stepper to 5V and I can move the stepper very slowly. Great... now I've proven that my wiring and software is good. Time to step it up! I tried going straight to 12 V and that was not such a good idea. The 5V regulator got really hot and I might have burned a prop chip. I swapped it with a spare and now all seems good again (I can drive the stepper again with 5V), but that leaves me a bit confused. It's been way too long since my EE classes in college, so I don't remember how to do the math on this. Do I need something bigger than a ULN2803 to drive this stepper?

Comments

  • kwinnkwinn Posts: 8,697
    edited 2017-07-15 18:56
    You should not need anything bigger since the ULN2803 rating is 500mA for a single output and you are using 2 outputs per coil, so only 80mA per output.

    Odd that the 5V regulator is getting hot when the stepper is connected to 12V. Can you post a wiring diagram?
  • kwinnkwinn Posts: 8,697
    BTW the voltage on the ULN common pin should be the same as the voltage that is connected to the stepper motor.
  • Attached is my circuit. And thanks for the tip on the 5V VCC line. Changing that out allowed a higher RPM so it's definitely working better now. I'm a bit scared to try it on the 12V line again.

    1530 x 781 - 21K
  • frank freedmanfrank freedman Posts: 1,974
    edited 2017-07-15 20:24
    David,

    The initial description does not quite match the wiring diagram. The ULN2803 does not have (at least TI nomenclature) a VCC pin. They call it a common and it sources all the backswing diodes in the output stages. If your common voltage is less than the driving supply voltage, the diodes will become forward biased and conduct. As kwinn mentions it should be at the supply voltage of the driving source. I would guess that when you had 5V for the supply line, you were not (after coil resistance and forward biased diode drops) not pushing back on the 3.3 V regulator so hard (so the prop survived the first test), also, the 5V would have, due to the forward biasing of all the backswing diodes, caused a current flow into all the windings of the stepper inhibiting its movement when you stepped it. This may account for the increase in RPM capability that you had after incorporated kwinn's note resulting in current flow in ONLY the selected coils. Then when you took the drive voltage to +12 you were trying to drive about 12V back into the 3.3V supply through the now forward biased backswing diodes. So if you think the prop got fried, this would be my guess as to how. You drove the supply from the 3.3 to close to 12V into its output.

    That's my guess anyway, I have seen this circuit used many times in steppers in film processors, relays for x-ray control and a ton of others. As drawn, your diagram should work as expected as long as the common pin is at the same potential as the driving voltage of the stepper supply. The backswing diodes are there to protect the ULN driver stage from high reverse voltage pulses caused by the magnetic field collapsing when the driver is switched off. This is why you will see diodes on boards near relays or other magnetic devices. ULN just happens to incorporate them to make life easier. Other times, you may see a resistor in parallel with a capacitor for the same purpose (google snubber circuit).

    Go forth boldly............

    If ya cook one as shown with 12V, I'll owe ya a prop. Also, there are a lot of manuals on line for some medical imaging devices and the ones that actually still have schematics may have some good ideas you can uhm, "adopt"...
  • I see that your ground for the ULN is labeled AGND. The 12V return and DGND need to be connected to the AGND pin at the chip and nowhere else. This will prevent motor return currents from flowing through the logic ground, possibly offsetting parts of it due to ohmic losses.

    -Phil
  • I see that your ground for the ULN is labeled AGND. The 12V return and DGND need to be connected to the AGND pin at the chip and nowhere else. This will prevent motor return currents from flowing through the logic ground, possibly offsetting parts of it due to ohmic losses.

    -Phil

    Oh that's nothing. i was just trying to find a picture that more closely matched what I imagine to be the ground symbol :) Everything is on the same ground plane in this circuit.
  • Thank you all. You were correct (as I'm sure you knew :) ) and I just had to connect the VCC COM line to 12V, not 3.3V. This is great fun now!
  • DavidZemon wrote:
    Everything is on the same ground plane in this circuit.
    I'm glad that works for you, but it's not always a good idea to assume that a ground plane has a low enough impedance to accommodate high motor currents without disrupting logic circuits that are common to it. Typically, you will want to run a separate, heavy trace for the motor ground return from the driver, rather than relying upon a common ground plane.

    -Phil
  • DavidZemon wrote:
    Everything is on the same ground plane in this circuit.
    I'm glad that works for you, but it's not always a good idea to assume that a ground plane has a low enough impedance to accommodate high motor currents without disrupting logic circuits that are common to it. Typically, you will want to run a separate, heavy trace for the motor ground return from the driver, rather than relying upon a common ground plane.

    -Phil

    I'm aware of that on principle, but have no idea how to know when you've reached "high motor currents". Wish I knew an EE around me that was interested in building the electronics for this thing so I could concentrate on the software :P
  • Being naturally lazy, I tend to err on the side of caution in a case like yours. That way, I don't have to perform any messy calculations. :)

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-07-16 01:44
    When I read your first post and saw that you connected the Vcc of the ULN to 3.3V I cringed as I swear I could see smoke. But the point about the ground current of the motor only going through the ULN is just as important too. Easiest way to ensure that is to connect your supply ground right at that point but normally the power ground and logic ground and only connected together at the supply ground, not before. Don't rely on a ground plane unless you are careful to ensure current for the power ground does not flow through logic or end up raising the ground (voltage) level as there is resistance in any ground and ohms law still applies.
  • I don't see a need to double up the connections. Just use pins 1,2,3,4 to the prop, Pins 15,16,17,18 to the motor, Pin 9 to ground, and pin 10 to the motor power 5v. If you need more Ma use fet's to triggers transistors. I'll have to post my 18volt step driver using stamp2 and prop.
  • btw - you could have just as easily doubled them up using adjacent pairs too however Darlington's might have high gain but their Vce(sat) saturation voltage is always woefully high which is why the "800ma" current rating of the ULN is fake news. It is just as easy to use four common NPN transistors such 2N2222 and drive them with a few milliamps with anything from a 470 to 220R base resistor - no need for a "biasing" (not) resistor. The small SOT23 packs will handle this easily. You will require diodes though but even 1N4148s will do the trick to motor+.

    Once you start looking at using MOSFETs you may as well consider bipolar driver anyway.
  • The TI version states 500mA per, and that they can be ganged for higher output. No mention of thermal current hogging so from a parts and layout and cost, ULN seems a better way to go. For driving power FETs, I've seen articles suggesting the 555 timer. But at what point does it become more cost effective to go with dedicated stepper drivers?

  • This is a stepper driver schematic that I've used before. All you need is clock and high or low for direction.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-07-18 00:58
    The TI version states 500mA per, and that they can be ganged for higher output. No mention of thermal current hogging so from a parts and layout and cost, ULN seems a better way to go. For driving power FETs, I've seen articles suggesting the 555 timer. But at what point does it become more cost effective to go with dedicated stepper drivers?


    NO, the TI version states 500mA (single) and when you read the Absolute Maximum specs you see that 500ma is the "Peak" output current, not even the continuous current etc. These chips were designed to pulse solenoids briefly but they have become an easy way to interface to motors. I have been guilty of misusing them in this way in one early vending machine design, the TI ones would have a very high failure rate and I assumed at the time that they were faulty, which they weren't, I had simply misused them. Thankfully the Allegro version exceeded these specifications and I was able to use them, but I made sure I never got caught again. It is just as easy to use tiny little SOT23 digital transistors as drivers and they take up less space and can drive much heavier loads continually and all together.

    The advantage of the BJT over a MOSFET is that they can be driven very comfortably from 3.3V and they are cheap. I use dual MOSFET chips in SOIC8 when I want to drive much heavier loads but under 1A the BJTs have very low Vce(sat) and are easy to use.
  • Thank you for the correction Peter. Looks like many designs abuse this chip as well. I should have checked the data sheet more carefully. Goes to an earlier comment of yours in another thread. So, I guess I need to go back to read twice, fry none!
  • Wish I knew an EE around me that was interested in building the electronics for this thing so I could concentrate on the software

    The EFX-TEK HC-8+ controller has eight N-channel MOSFETs that you can drive a unipolar stepper with (I've got one sitting on my desk doing just that). In fact, I just wrote a driver for my friend John B who is upgrading another friend's project from a BS1 interpreter and ULN2803 (in the form of an EFX-TEK Prop-1 controller) to and HC-8+.

    I just finalized the driver today. It's attached in the event you might find something useful.
Sign In or Register to comment.