Free Print Subscription Printer-friendly version Email to a Friend

Implement a stepper-motor driver in a CPLD

( 01 May 2007 )
Stephan Roche, Santa Rosa, CA

Based on the Motorola (now Freescale) heavily used but obsolete SAA1042 stepper-motor-driver IC, this Design Idea describes a CPLD (complex-programmable-logic-device)-based implementation of a stepper-motor driver that can also replace the driver in SAA1027- or UCN5804B-based designs. The design uses only six macrocells of a Xilinx XC9536 CPLD and thus can implement multiple stepper-motor drivers in one small-capacity CPLD. The CPLD stepper-motor driver requires clock, direction, step-size, and reset inputs. The clock input accepts logic-level pulses and goes active on the pulse's positive edge.
The direction, or CW/CCW (clockwise/counterclockwise), input determines the motor's rotational direction. Depending on the motor's electrical connections, holding this input at 0V normally produces CW rotation, and a logic-1 input produces CCW rotation. The step-size—that is, full- or half-step—input determines the motor's angular rotation for each clock pulse. Holding this input low commands the motor to execute a full step for each applied clock pulse, and a high input produces a half-step. A high level on the reset input puts the motor in a previously defined state and commands the CPLD to ignore any incoming clock pulses.
The CPLD's outputs comprise A and A_n and B and B_n phases, each of which controls one of the motor's two coils through external power drivers IC2 and IC3, which operate at the motor's nominal voltage (Figure 1). A pair of Schottky diodes at each driver's output protects the drivers' outputs during inductive-voltage transients induced by reversing the windings' currents. Using MOSFET drivers with internal diodes, such as Microchip's TC4424A dual driver, may eliminate the requirement for external diodes.
The CPLD's program comprises an eight-state Moore finite-state machine that corresponds to the motor's eight half-step states. Table 1 shows the driver's outputs for each machine state. In full-step state mode, the state machine executes only Step 0, Step 2, Step 4, and Step 6. At each clock pulse's rising edge, the machine state changes from Step(n) to Step(n+1) if CW/CCW is high or from Step(n) to Step(n–1) if CW/CCW is low. You can download a generic VHDL implementation of the stepper-motor-driver firmware. Although written for an XC9536 CPLD, the code is also suitable for any CPLD or FPGA target device.

Caption

Figure 1 Emulating a dedicated stepper-motor controller, a programmable-logic device, IC1, applies stepper-motor signals to motor drivers IC2 and IC3.
Click here for Table:

Table 1

 
Free Print Subscription Printer-friendly version Email to a Friend
Article Rating 
Average Rate: No rating yet
 
Poor Quite Good Good Very Good Excellent
 
 
Related Content 
 
WEBCASTS
 
KNOWLEDGE CENTER
Fairchild Semiconductor :
 
Panasonic Key Devices Guide 2008:
 
 
Highest Rated  
Feedback Loop  
ADS BY GOOGLE 
 
 
 
ADVERTISEMENT
Press Release 
 
TECHNOLOGY NEWS
 
RESOURCE CENTER
 
 
PRODUCT NEWS
 
FEATURED SPONSORS


 
 
 
DESIGN CENTERS
 
ADVERTISEMENT
     
Reference Designs 
   
     
 
 
 

 
 
RSS
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

POLL
How do you expect your company to perform this year?
Worse than last year
Same as last year
Better than last year
View results
 
Outlook and Trends 2008