From the software perspective, there are only two bits to control per phase. One bit indicates whether a phase is active or not, while the other bit controls the polarity of current. As a result, we can write the following table for a full cycle, using half-stepping:
| Phase 1 Enable | Phase 1 Polarity | Phase 2 Enable | Phase 2 Polarity |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 |
In this table, a value of 1 for ``Enable'' means the phase is switched on. A value of 1 for ``Polarity'' means one way, a value of 0 means the other way.
As a program generates these steps patterns in this sequence, the motor rotates in one direction. To rotate in the opposite direction, one only needs to reverse the order of these steps. To make the motor spin faster, generate these steps more frequently, to make the motor spin slower, generate these steps less frequently.
At first glance, a stepper motor is difficult to control. However, due to the precise stepping nature, stepper motors are actually the easiest to control for open-loop control. Open-loop means there is no feedback utilized in the control code.
Copyright © 2006-02-15 by Tak Auyeung