For stepper motors, we can use only two lines per motor for step and direction. This requires that the logic chip maintain its current state, and also to have an initial reset state.
The truth table of the stepper half-stepping state machine is as follows (coils A and B, each has its own IN1 and IN2 signals):
| A.IN1 | A.IN2 | B.IN1 | B.IN2 | comment |
| 0 | 1 | 1 | 1 | A forward, B off |
| 0 | 1 | 0 | 1 | A forward, B forward |
| 1 | 1 | 0 | 1 | A off, B forward |
| 1 | 0 | 0 | 1 | A backward, B forward |
| 1 | 0 | 1 | 1 | A backward, B off |
| 1 | 0 | 1 | 0 | A backward, B backward |
| 1 | 1 | 1 | 0 | A off, B backward |
| 0 | 1 | 1 | 0 | A forward, B backward |
Because we need to use a ``previous'' state to determine the ``next'' state, the programmable logic needs to be registered. Fortunately, the ATF750C device has a product clock for each macro cell. This means we can dedicate a clock (STEP) for each stepper motor.
Next, we need to express the next state as an equation of the current terms, as well as the clock and direction. ``ar'' is async. reset state, ``ck'' is the clock product term, ``oe'' is output enable and ``d'' is the D-latch input term. The following is the equation for coil A IN1.
| (12.3) | |||
| (12.4) | |||
| (12.5) | |||
| (12.6) | |||
| (12.7) | |||
| (12.8) | |||
| (12.9) | |||
| (12.10) |
The other output pins can be determined similarly. Using this technique, we only need two lines to control two stepper motors.
Copyright © 2006-02-15 by Tak Auyeung