12.1.2 TPIC0108 Logic for Stepper Motors

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.


$\displaystyle \mathrm{A.IN1.oe}$ $\textstyle =$ $\displaystyle 1$ (12.3)
$\displaystyle \mathrm{A.IN1.ar}$ $\textstyle =$ $\displaystyle 0$ (12.4)
$\displaystyle \mathrm{A.IN1.ck}$ $\textstyle =$ $\displaystyle \mathrm{STEP}$ (12.5)
$\displaystyle \mathrm{A.IN1.d}$ $\textstyle =$ $\displaystyle \mathrm{DIR}\cdot % 0 1 0 1, forward
\overline{\mathrm{A.IN1}} \cdot
\mathrm{A.IN2}\cdot
\overline{\mathrm{B.IN1}} \cdot
\mathrm{B.IN2}+$ (12.6)
    $\displaystyle \overline{\mathrm{DIR}} \cdot % 0 1 1 0, backward
\overline{\mat...
...IN1}} \cdot
\mathrm{A.IN2}\cdot
\mathrm{B.IN1}\cdot
\overline{\mathrm{B.IN2}} +$ (12.7)
    $\displaystyle % 1 0 ? ?, either direction
\mathrm{A.IN1}\cdot
\overline{\mathrm{A.IN2}} \cdot +$ (12.8)
    $\displaystyle \mathrm{DIR}\cdot % 1 1 0 1 forward
\mathrm{A.IN1}\cdot
\mathrm{A.IN2}\cdot
\overline{\mathrm{B.IN1}} \cdot
\mathrm{B.IN2}+$ (12.9)
    $\displaystyle \overline{\mathrm{DIR}} \cdot % 1 1 1 0 backward
\mathrm{A.IN1}\cdot
\mathrm{A.IN2}\cdot
\mathrm{B.IN1}\cdot
\overline{\mathrm{B.IN2}}$ (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