Circuit Corner - Issue 2

Welcome to another installment of Circuit Corner. This time, the circuits have a common theme: they are drawn from my robotics collection. These circuits, together, can form a simple stepper motor controller. I will likely cover more advanced topics in motor control in a later article.

H-Bridge

The H-Bridge circuit.
An H-Bridge is a classic circuit, most commonly used for controlling devices like motors that require current to flow in either direction, rather than just being turned on or off.

The design I present is not especially unique. It is simply a pair of totem poles, each composed of an NPN common emitter amplifier and an NPN common collector amplifier. The fact that it only uses NPN transistors should help, especially when dealing with power transistors, since PNP power transistors can be a little more difficult and/or expensive to come by.

I deliberately avoid setting component types, because this circuit is so easily adaptable to many situations. You can use almost anything for the transistors, a BC548 for small circuits (pager motors or the like), a 2N2222 for mid-power circuits (like small, 5V stepper motors), or even 2N3055 for high-power citcuits (10A at up to 50V can move some very large motors). The diodes can be 1N4148's for small circuits, but something like a 1N4001 should be used for heavy inductive loads like large motors. If the load is not inductive, then the circuit will function without the diodes. In fact, for small circuits, the diodes can likely be omitted, but you run the risk of burning out the transistors.

To apply current to the load, X1 and X2 should be engaged with opposite polarities (one VCC, one ground). To stop current to the load, the polarities should match (both to ground, for example).

There are a few things to watch for. The use of common collector amplifiers imposes some constraints on the incoming voltage. If the voltage is above transistor cutoff but much below VCC, then the output voltage will sag and the upper transistor pair will dissipate power. This is something to watch when powering from TTL, which has a nominal output voltage of about 3.5V. There are several strategies to combat this. You could replace the TTL driver with a CMOS one, which will provide better voltage levels. You could place a transistor buffer amplifier before X1 and X2. The second strategy is also useful if VCC of the devices being powered is different from the logic-level supply, or when using large, low-gain power transistors such as the 2N3055.

Quadrature Clock Generator

The basic quadrature clock generator.

Basic Circuit

An H-Bridge is fine when controlling simple DC motors, but what about when you are driving stepper motors? Steppers require a stepping sequence which may not seem especially obvious at first. Instead of just being able to say "go forward" or "go backwards", you have to generate a quadrature stepping sequence.

The good news is that quadrature clock generation is a relatively easy thing to accomplish using two D flip-flops, such as the kind found in the 7474. If you are driving the H-Bridge above, the pin-compatible CMOS 74C74 is a better choice, since it has a higher output level for the same logic supply, and allows a logic supply up to 15V. This means that you could use a 12V logic supply to directly drive the H-Bridge for a 12V motor, but you would of course need to either run all your logic on 12V or use level translators on the input of the 12V logic.

The basic circuit will generate a quadrature clock using nothing but a 7474 or compatible, but this will only allow a stepper motor to spin in one direction. A standard quadrature clock is not enough for stepper control by itself.

The quadrature clock generator adapted for stepper motor control.

Stepper Motor Sequence Generator

Adapting the quadrature clock generator to step sequence generation is no harder than adding a couple XOR gates, like the kind in a 7486 (or CMOS equivalent 74C86), to invert the next sequence step depending on the specified direction.

Using this circuit is simple. Set the direction line in the direction you wish the stepper motor to move. The motor will move one full step on the next rising edge on step.

A two-coil motor can be controlled using two H-Bridges and this circuit. A four-coil motor can be controlled using this circuit and four unipolar transistor drivers.

This circuit only does basic two coil excitation full stepping. It can be adapted for one coil excitation by adding four two-input AND gates, such as the 7408/74C08, to the four output lines, and using their outputs as the coil excitation signals. This circuit cannot generate a half-stepping sequence.