Stepper driver circuit - please help me understand it - Page 1
Forum section: electronics / projects

author: ttodorov
author_rank: Regular Contributor
timestamp: October 24, 2013, 09:42:00 pm
content: Hi folks,Below is a schematic of a stepper driver circuit I found on the Internet while browsing. Unfortunately I have only the gif file with the schematic, but no text explanations of the circuit (if any exist at all). I understand most of it just fine, but one thing eludes me. Why would the designer use a hex buffer to drive the base of the darlington transistor? Why not just use resistors to drive the darlingtons? Both the microcontroller and the 74x4050 IC are operating at 5V VCC and both can source or sink 20 mA of current. I looked at the datasheet of the 4050 chip and the only explanation I could come up on my own is, that as a high voltage tolerant part it would protect the MCU from said high voltage, if the transistor blows. But I am not too sure of that explanation, because higher current from the blown transistor will still damage the 4050 part...Any insight from the gurus?

author: Andreas
author_rank: Super Contributor
timestamp: October 27, 2013, 08:25:42 pm
content: I would not interpret too much in a buggy cirquit with missing base resistors.My guess: the TIP darlingtons where a ULN2003 in the "old" cirquit.and in the new cirquit there was some magic smoke due to missing base resistors.The CD4050 with its high resistance of around 300 Ohms will help in this case.With best regardsAndreas

author: homebrew
author_rank: Frequent Contributor
timestamp: October 27, 2013, 08:52:43 pm
content: Yeah, that's probably a quite bad design ... Just look at the 7805: No Capacitors, no protection diodes, no nothing!Just tell us what you want to do with it. The show design can only operate on unipolar stepper motors, btw. That way we could help you a lot more.Cheers,Pete

author: ttodorov
author_rank: Regular Contributor
timestamp: October 28, 2013, 02:12:20 am
content: Thank you all for your answers!Yes, the missing caps on the linear regulator are quite obvious even to a novice like me. I found this circuit while looking for unipolar stepper driver schematics. I am trying to design my own and tried to find something I could use as base to extend and solve my own requirements. I have had some success breadboarding an XMEGA to use as a driver by way of their hires extension and the pwm pattern generation, so I want to expand that to 3 axes while accepting any unipolar stepper up to 35V and several amps per winding. (I found several different models of uni-polar steppers and bought some cheaply, so that's why I am going with this type.)My own design uses N-channel logic-level MOSFETs (D-PACK) able to handle 5A drain-source current. I have also included the biasing resistors in my schematic. The purpose of this whole post is to figure out the reason for the use of the 4050 IC in the design above. My interested in the answer is because the atmel part in my own circuit is working off 3V3 power rail, while the motor might be 12 or 24 or 32 volts. My guess is that isolation is a good thing...What I am wondering is whether the 4050 part is enough. When I started thinking on how to do it, I thought that optocouplers are the way to go. As I started looking into parts at Mouser, I was presented with different types and I don't quite know if I should go with high speed or transistor based optos. Then I saw this and thought maybe optos are overkill and there is a cheaper way to do it?Below is the driver part of my circuit, without any isolation. Any thoughts?Thanks,Todor

author: Andreas
author_rank: Super Contributor
timestamp: October 28, 2013, 05:30:29 am
content: Hello,The 2 K resistors are usually enough isolation.But- they make the switching of the FETs slow.on high PWM freqencies they might be too slow.on the other side: you will have low EMI.- Why do you use the 10 K resistors as voltage divider?so you will get only around 2.5V out of your 3.3(+/- tolerance) logic.If you need something that overrides the pull up resistors during resetthe 10k resistor could be placed on the other side of the 2K resistor.with best regardsAndreas

author: poorchava
author_rank: Super Contributor
timestamp: October 28, 2013, 07:56:07 am
content: Unless that's an FDD drive stepper, you need to have some form of current control. Actually steppers should be driven in current mode, not voltage mode. Read up on a chopper drive method to see what's this all about.

author: ttodorov
author_rank: Regular Contributor
timestamp: October 29, 2013, 02:59:53 am
content: Thanks for the replies. I am looking into your suggestions.So I read up on current-driving chopping method with steppers and since I would like to have microstepping, it means I will have to either use a microstepping-capable IC, or cobble together my own solution with comparators and DACs. If I go the DAC route, the cost gets quickly out of hand, because the XMEGA part (or 32-bit chips like PICs or even ARM Cortex chips) have 2 DACs at most. Since I would need a single DAC per winding - or a 4-channel DAC for a single one of my uni-polar steppers, the cost for a 3-axis driver is soon becoming prohibitive. Disregarding the value of learning by going your own way, it would be cheaper to buy an available driver, than have the enjoyment of completing your own design. Dedicated uni-polar stepper driver ICs cost at least US $8.00+/piece, so that 3-axis solution is expensive as well. But bipolar stepper drivers are cheap, less than $2.00/piece. The problem is that my motors are uni-polar. Yes, I've read that uni-polar steppers can be driven as bi-polar, if the middle (common) lead is not used and the others are connected for bi-polar drive (on a 6-lead motor). My guess is that the calculations would need to be adjusted because the current rating will remain the same, but the resistance per winding would double (doesn't that also mean that the motor will get hotter compared to driving it in uni-polar mode?).So my question is this: If a UNI-polar stepper is driven as BI-polar, is microstepping still possible? Since both A and /A (as well as both B and /B) would be energized at the same time when treated as a whole winding, does microstepping still work? Would somebody who has tested that in a real world application weigh in, please!Then again somebody might suggest I go out and get some 4-wire bi-polar steppers and be done with it.... But I have about 30 uni-polar steppers (some barnd new, others salvaged from other equipment) that are jsut laying around, begging to be used...Dave, if you are by chance reading this post, maybe it is time you dedicate an episode to stepper motors and driver circuits. Yes, you have some makerbot videos out, but the driving part is very thin :-) Maybe with the increased use of 3D prineters and CNC homebrew and more professional designs the topic would be worth pursuing.Thanks for your help,Todor

author: poorchava
author_rank: Super Contributor
timestamp: October 29, 2013, 07:20:46 am
content: Quote from: ttodorov on October 29, 2013, 02:59:53 amYes, you can connect unipolar motor as bipolar and obviously microstepping will still work. And you are also right, that the resistance doubles and the current rating stays the same. The motor will run hotter, although it will also have more torque. The torque does not double, it something around 1.6x more IIRC due to imperfections in the motor itself. On the other hand most of the driver chips have some form of switchable torque control, which simply limits the current when motor is still to reduce power dissipation in the motor and the driver.Implementing a complete chopper drive out of discrete parts + MCU would make sense only if you're aiming at high power steppers (I'g guess >150W). Other than that there are fully integrated chips which can do that for you. Typical discrete stepper driver involves a dual H-bridge, wither P+N or with high-side N-mosfets, a high speed drivers for the bridge, fast current amplifier, ADC (or rather DAC+comparator) and logic (more like CPLD/FPGA than a microcontroller, and even if that - not an ATMega anyway).

author: paulie
author_rank: Frequent Contributor
timestamp: October 30, 2014, 03:27:04 pm
content: I came across this while browsing for color code on the cheap Ebay geared 5 wire steppers so thought I'd chime in in case of current interest.That original circuit is fine and don't need more caps or diodes or anything else. No magic smoke (personally I don't believe in magic). The 4050 is there to keep PIC from resetting due to motor noise. It is not needed with FETs. I was surprised to discover that with proper supply bypassing the even cheaper (25 cent) Ebay micro steppers can be driven directly off bits from typical AVR like Mega8. Not PICs though due to poor drive and noise sensitivity.However for small/medium motors boards with Alegro A4988 at a dollar and change have features impossible to match at similar cost. These days it makes little sense to use discrete circuits, bare drivers like ULN2003, or L298 type H-bridge. Even Sparkfun "Easyboard" with A3967, while quite popular, is an overpriced outdated joke.