Bi-polar stepper motor 2-wire vs 4-wire control with H-Bridge? Arduino UNO R3 - Page 1
Forum section: electronics / beginners

author: geratheg
author_rank: Regular Contributor
timestamp: April 21, 2015, 04:03:08 am
content: I want to control a Bi-Polar stepper motor using an H-Bridge and an Arduino UNO Rev3 as the controller. I have two questions:1. I would like to know if there is any advantage to using 4-wire control over 2-wire control with the Arduino Uno Rev3?Here is the tutorial I'm following:https://itp.nyu.edu/physcomp/lessons/dc-motors/stepper-motors/They mention using an L293D H-Bridge, but I will be using an SN754410 H-Bridge since I read that it is a pin-to-pin replacement for the L293D and I need to drive about 660mA of current.I'm assuming it will work as a pin-to-pin replacement with the 4-wire control setup.2. Is the SN754410 also a pin-to-pin replacement with the 2-wire control setup?

author: PSR B1257
author_rank: Frequent Contributor
timestamp: April 21, 2015, 06:55:44 am
content: QuoteLess circuit to build since the inverting of the other channels is done in software.QuoteSeems so. But you should better go for a L298.The L293 and SN754410 are only DIL package which makes it difficult to attach to a heatsink.You can buy L298 on the otherhand already on a little breakout board including heatsink, skrew terminals, bypass capacitors, clamping diodes and what not.

author: geratheg
author_rank: Regular Contributor
timestamp: April 21, 2015, 07:46:22 am
content: Thanks for the response.Besides reduced hardware, is there any performance difference?Will it affect how much current the motor will use if I use the 2-wire control version? For example, where the pins of the H-Bridge are connected to the controller, is it simply On or Off state? Or does it matter how much voltage and/or current is applied to those pins?The only problem I have is the stepper motors are rated at 0.33A per phase, and it's a 2-phase motor, so I'm expecting up to 0.66A = 660mA of continuous current. The L293D is rated for 600mA of continuous current and 1.2A max current.The SN754410 can take up to 1A of continuous current.I already have both of the H-Bridges and would prefer to use them instead of obtaining one assembled on a breakout board.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: April 21, 2015, 08:11:34 am
content: QuoteNo.QuoteOf course. The higher the voltage, the higher the motor current.These motors are often driven with current control at relatively high voltages. The high supply voltage ensures a dynamic response of the motor and the current control limits the motor current to its nominal value.But the simple driver you got (as well as the L298) have no current limiting.Therefor:QuoteWhat's the coil resistance?You have to choose the supply voltage appropriate to meet this current.

author: geratheg
author_rank: Regular Contributor
timestamp: April 21, 2015, 03:12:24 pm
content: The coil resistance is 32.6 ohms. Looks like the current at 12V will be 0.37A.I'll be using this motor:https://www.sparkfun.com/products/9238

author: PSR B1257
author_rank: Frequent Contributor
timestamp: April 21, 2015, 04:22:50 pm
content: QuoteNot quite. There is a voltagedrop of about 1V towards Vcc and GND within the driver, therefore you get about 10V at the motorcoil.That's should be fine. Especially if the motor is not or just slightly loaded.

author: geratheg
author_rank: Regular Contributor
timestamp: April 21, 2015, 08:53:39 pm
content: Quote from: PSR B1257 on April 21, 2015, 04:22:50 pmSo there is a total voltage drop of 2V?On page 6 of this documenthttp://www.farnell.com/datasheets/120417.pdf, I found an application schematic for the SN754410 and it looks like external diodes are used. I also attached the picture of it.In addition, I see a 10k resistor from 5V (which I don't think is necessary according to the wiring from the link in the original post).Since I'm new to electronics, I understand how a flyback diode works for simple inductive devices like relays.However, this seems more involved because if I'm seeing this correctly, I'm seeing the Anodes connected to ground and the Cathodes connected to 24V, which doesn't make sense to me. I don't see the reason those Anodes are connected to ground since current is completely blocked in that direction, thus those diodes might as well be eliminated?My understanding is that a flyback diode would short any back EMF.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: April 22, 2015, 07:00:53 am
content: QuoteThat's a so called pull up resistor, which keeps the ENABLE-input from foating. But you have the option to short the ENABLE-input to GND (and therefore disable the output driver), without shorting the supply.QuoteOf course they block the current in this direction, otherwise they would short out the supply voltage.QuoteNO!QuoteYes, that's what they do.

author: geratheg
author_rank: Regular Contributor
timestamp: April 22, 2015, 09:10:21 pm
content: Thanks for the reply.Can the resistor be removed and the wires directly going to +5V without the resistor? (Since in the link in the original post, 3 pins went directly to 5V on the L293D driver without a resistor). Otherwise I'm just going to include the resistor as in the schematic.While I am going to add diodes as shown in the schematic because that is the correct way, I'm also trying to understand what goes on and why that design of diodes works.I attached an image of my basic understanding of diodes, which can be seen on the top of the image. When there is back EMF the coil is shorted from one end to the opposite end.On the bottom, the diodes for one of the stepper motor coils are shown. I hope someone can explain how the coil is shorted when there is back EMF.I don't see any open path from one coil to the other coil through the diodes. I also see that the diodes completely block current to ground, and I'm assuming ground will always have the lowest voltage, thus the diodes and the wiring to ground can be eliminated as shown on the image to the right, since no current will ever flow there. If I'm wrong, please help me out.Thanks!