This is as close as we come to a digital motor. Unlike a DC motor which spins continuously when power is applied to it, stepper motors only rotate a specific number of degrees (one step) when it receives a pulse of electricity. The more the motor is pulsed, the further the robot will travel. If care is taken, the microcontroller should be able to send out X number of pulses and cause the robot to travel a distance Y. The advantage over DC motors is that there is no need for feedback from the wheels to determine speed and distance traveled.
Unipolar Steppers
A Six Wire Unipolar Stepper
Unipolar stepper motors have a rotating permanent magnet surrounded by four windings. Very often, pairs of windings will share a common connection point as in the diagram above. These motors have 6 wires. Sometimes, the two common connection points are tied together in which case the motor would have 5 wires.
The common connection points are attached to the positive side of the power supply. The free ends of the windings are then grounded in a specific sequence so as to cause the shaft to rotate. There are three different sequences which produce three different results.
(A) “Full Step” or “Wave Drive”
In the full step sequence, only one winding is on at any given moment. To rotate the shaft the wires would be grounded in the following order:
| Step No. | Grounded |
|---|---|
|
1 |
A
|
|
2
|
C
|
|
3
|
B
|
|
4
|
D
|
(The sequence is then repeated so in step number 5 connection A is grounded once again.)
To make the motor spin in the opposite direction, the windings would be grounded in reverse order:
| Step No. | Grounded |
|---|---|
|
1 |
D
|
|
2
|
B
|
|
3
|
C
|
|
4
|
A
|
(B) “Two – Phase Drive”
Here, two windings are energized at one time. In this case the rotor does not line up with any one winding but aligns itself between the two windings being energized. The sequence would be:
| Step No. | Grounded |
|---|---|
|
1 |
A and C
|
|
2
|
C and B
|
|
3
|
B and D
|
|
4
|
D and A
|
Since two windings are being energized, the magnetic pull is stronger and the result is more torque from the motor, roughly 1.5 times the torque achieved with wave drive. But the cost is high: twice the current is being consumed by the motor.
(C) “Half – Step”
When more precision is needed, the motor can be operated in half-step mode. This is a combination of the drive methods described above. The sequence would be:
| Step No. | Grounded |
|---|---|
|
1 |
A
|
|
2
|
A and C
|
|
3
|
C
|
|
4
|
C and B
|
|
5
|
B
|
|
6
|
B and D
|
|
7
|
D
|
|
8
|
D and A
|
This results in twice as many steps. If a motor rotates 3.6 degrees per step in full step mode, it would only rotate 1.8 degrees per step in half step mode. The disadvantage is that the torque is not constant.
Bipolar Steppers
A Four Wire Bipolar Stepper
Bipolar stepper motors only have two windings instead of the unipolar’s four. Because there are less windings, bipolar motors are cheaper to produce. The windings can also be made with thicker wire which can carry more current and produce more torque. The down-side is that the control circuit is more complicated. During operation, the polarity in the windings must be reversed so two H-bridges must be used with each bipolar motor. See the section on DC motors to learn about H-bridges.
Each of the driving sequences described for the unipolar motor is also available with the bipolar motor.
(A) “Full Step” or “Wave Drive”
As with the unipolar motor, only one winding is on at any given moment. To rotate the shaft the windings would be energized in the following order:
| Step No. | Energized |
|---|---|
|
1 |
A+ B-
|
|
2
|
C+ D-
|
|
3
|
B+ A-
|
|
4
|
D+ C-
|
(“A+ B-” means that A is connected to the positive side of the power supply and B is connected to the negative side of the power supply.)
(B) “Two – Phase Drive”
To increase the torque, two windings are energized at one time. The sequence would be:
| Step No. | Energized |
|---|---|
|
1 |
(A+ B-) and (C+ D-)
|
|
2
|
(B+ A-) and (C+ D-)
|
|
3
|
(B+ A-) and (D+ C-)
|
|
4
|
(A+ B-) and (D+ C-)
|
Again, twice the current is being consumed by the motor.
(C) “Half – Step”
To double the number of steps the sequence would be:
| Step No. | Energized |
|---|---|
|
1 |
A+ B-
|
|
2
|
(A+ B-) and (C+ D-)
|
|
3
|
C+ D-
|
|
4
|
(C+ D-) and (B+ A-)
|
|
5
|
B+ A-
|
|
6
|
(B+ A-) and (D+ C-)
|
|
7
|
D+ C-
|
|
8
|
(D+ C-) and (A+ B-)
|
Driving Steppers
To drive a unipolar motor directly from the microcontroller would require four output lines. Each of these lines would turn on a transistor which would ground its corresponding winding. To drive a bipolar motor, the microcontroller would need eight output lines to operate 2 H-bridges.
Since driving the motors directly requires many output lines and because the controller could be better used for such things as solving the maze, most mice use integrated circuits which are designed to control steppers. With these IC’s the microcontroller needs only two control lines. One line controls whether the motor spins clockwise or counter-clockwise. The second line steps the motor. An example of this type of chip is Allegro’s UCN5804B, which we used in Dexter. Not only does the 5804 provide the sequence logic, it also has the power transistors built in so that it can drive unipolar stepper motors (up to 35 V / 1.5 A) directly. All this in a 16 pin DIP package.
To increase the torque at higher speeds, stepper motors are driven at several times their voltage rating. A designer might use 5 volt steppers in his mouse and then run them at 12 or 14 volts. To avoid destroying the motors, the current through the windings is monitored and power is cut off when the current reaches a critical level. When it falls back down, the power is reapplied. This technique is known as “chopper drive” and it allows the mouse to increase its top speed. SGS-Thomson produces the L297 and L298 which can be used to drive unipolar and bipolar motors using the chopper drive technique. The L298 contains 2 H-bridges capable of supplying up to 2 A per winding at up to 40 V. The L297 provides the sequence logic and can monitor the current through the windings via the L298.
Acceleration and Speed Control
Stepper motors have the greatest torque at slower speeds and less torque as the motor speeds up. If the motors are started at full speed they will not move the mouse at all, the motors will simply “twitch” and the rotor will not rotate to the next position. In order to move the mouse, the motors must be accelerated to top speed. Likewise, in order to stop the mouse, the motors must be slowed down. A graph of the stepper’s speed would look like this:
When controlling stepper motors, the speed is adjusted by varying the delay between the pulses. The strength and duration of the pulses are constant:
Summary
Because stepper motors can be driven without the need for feedback from the output shafts, it is easier for the first time mouse builder to use steppers rather than DC motors. The use of integrated circuits which take care of the sequence logic and power stages make the task of constructing the circuit and controlling the motors relatively easy.
