# EDN Access -- 02.17.94 Motor-drive algorithm saves space and cycle

-February 17, 1994

Design Ideas:February 17, 1994

## Motor-drive algorithm saves space and cycles

Jose A P Machado da Silva,
University of Porto, Porto, Portugal

# Listing 1—Stepper motor drive subroutines

The algorithm embodied in the second subroutine in Listing 1 generates the excitation sequence for most permanent-magnet and hybrid stepper motors. This subroutine is smaller than subroutines that spring from other algorithms.

To understand the algorithm, first consider that stepper motors have two stator coils, A and B, each having a center tap. Phase notation (A,A,B, and B) shows the direction of the current flow. That is, AA=102 symbolizes that current flows through half-coil A and that half-coil A is off.

To get the maximum torque from a stepper motor, you must drive two phases at a time. Using the binary notation developed in the preceding paragraph, the 4-phase drive sequence for all four half coils is 01012, 01102, 10102, 10012 or 5HEX, 6HEX, AHEX, 9HEX.