Circuit Lake

Electronic Project and Circuit Collection

Microstepping Bipolar Stepper Motor Driver

05/17/2010 Category: AVR, Control, Microcontroller, Motor, Project

This project is the implementation of a low-cost, high-performance bipolar stepper motor driver. This driver was designed for the hobbyist who is retrofitting a piece of equipment for CNC operation using one of the inexpensive and readily available interpreter programs. Generally speaking, these programs are capable of reading the GCode output from a CAM program and outputting step and direction signals to the parallel port. It is the function of the driver built in this project to receive these step and direction signals and control a stepper motor based upon them.

CNC Machine Stepper Motor Driver

The “brain’ of the driver is an ATMega48 running on its internal 8 MHz oscillator. When tenth stepping, this is sufficient to run the stepper motor at speeds up to 3000 rpm, or a step pulse every 80 instruction cycles. A status LED normally flashes at a predetermined rate. If a fault is detected – though one of the numerous software traps – it will illuminate solid.

Aaron Garber, project designer, explained that the “brawn” of the driver is two National Semiconductor LMD18245 full-bridges – one for each stepper motor phase. Each full-bridge includes a built-in 4-bit D/A converter as well as current sensing capability. The sensed current is limited to a maximum value as set by the user with an external trimmer potentiometer. The current is further limited based on the input signal to the D/A converter and its reference voltage. This capability allows us to (a) implement microstepping and (b) drive the motor with up to 55 VDC for maximum speed performance.

To allow movement in subdivisions of a full-step, micro stepping tables are stored in the controller’s program memory. Microstepping allows for maximum smoothness and increased resolution. For maximum flexibility, there are a total of 8 different tables of various microstepping resolutions that the user may use DIP switches to select. An enable signal is continuously monitored by the microcontroller. When enabled and upon the receipt of a step signal, the direction signal is sampled. Based on the state of the direction signal, either the previous or next micro stepping table entry is read from memory. This data is then transferred to inputs of the full-bridges’ D/A converters. One D/A converter (and winding current) is driven with a sine-wave approximation and the other D/A converter (and winding current) with a cosine-wave approximation.

Stepper Motor Driver
Project Detail and Documentation