Stepper Motor Control

The purpose of this document is to introduce and show how to implement stepper motors. A common dc motor is hard to control for precise motion. Steppermotors can give you the precision required. Unfortunately they are not as easy to use as regular dc motors. Stepper motors are driven by pulses of electricity. Each pulse turns the shaft of the motor a fraction of a turn. These motors are inherently 'digital' devices so they are well suited for digital systems.

There are various types of stepper motors but we will focus on four phase motors. It is really two motors sandwiched together. Each motor has two windings. With four windings in total there are eight wires. On some motors the common wires have been ganged together so there may only be five or six wires instead of eight.

Information on stepper motors was found in "The Robot Builder's Bonanza" by Gordon McComb and the October 1998 issue of Nuts & Volts magazine.

We are using a couple of stepper motors to move a small robot. We are using two modules to control movement. A navigation module controls the position and sends command signals to a motor control module. The motor control module accepts the commands, turn left, turn right, move forward, move reverse, and converts that to the correct actuation sequence. We are using the full - step actuation technique explained in the following discussion.

The motor control module is

motorcontrol1.vhd

Basic Actuation (Full - Step wave drive)

Usually the common wires are connected to the positive power supply. The four windings are then powered in turn for a short amount of time by grounding it. For proper operation the windings must be energized in a wave sequence illustrated in Figure 1. To reverse the direction of the motor just reverse the sequence.

 

Figure 1. Full - Step (wave drive)

 

Better Actuation Technique (Full - Step)

A much better approach is to power two windings at once. This sequence is shown in Figure 2. This sequence increases driving power and provides greater precision in the rotation of the shaft.

 

 

Figure 2. Full - Step

 

 Alternate Actuation Technique (Half - Step)

If you require more precision you can use the half - step sequence shown in Figure 3.

 

Figure 3. Half - Step

 

Controlling a Stepper Motor

There are custom stepper motor chips available. You can also build your own from a couple of easily available TTL chips. A circuit is shown in Figure 4. The steering logic is provided from four exclusive OR gates. The actuation of the steps is done by two J-K flip-flops. The outputs of the flip-flops control the phasing of the motor.

Figure 4

Power transistors or MOSFETS must be used in order to drive the motors. A good general npn transistor is the TIP31. It can handle up to 1 amp. Be sure to heat sink though! The 2N3055 is great for motors that require up to 10 amps. The driver circuit is shown in Figure 5. Make sure you bias the transistors so that the flip-flops do not overheat. We found that adding LED’s to the output of the flip-flops made for a useful visual indication of the stepping sequence. It is a good idea to use protection diodes to protect the circuitry from potentially destructive overvoltages due to static charge accumulation and the inductive load of the motors.

Figure 5

More on Steppers

Stepper motors can be expensive. Surplus motors can be found at Princess Auto. The only trouble is that they often don’t come with wiring diagrams. If the motor has eight wires it is fairly easy to decode using an ohmmeter. If the motor has five or six wires it requires a little more patience.

 Authors:

Phillip Jacobsen

Shane Pilsworth