AN 488: Stepper Motor Controller Using Altera MAX Series

ID 683592
Date 9/22/2014
Public

1.1. Stepper Motor Controllers Using Supported Altera Devices

The motor controller design is implemented in the device to govern the performance and operation of a unipolar permanent magnet stepper motor. The design uses a few switches and buttons on the demo board to serve as the user interface.

This motor controller design offers the following advantages:

  • Two types of control for starting and stopping the motor and selecting forward or reverse rotation: manual control (through the user interface) or automatic control (through a microcontroller).
  • Two modes of operation: continuous mode and step mode.
  • Eliminates the need for an external clock signal as the devices have a unique internal oscillator which is incorporated in this design.

The following figure shows the organization of the stepper motor controller. The driver circuitry is supplied by a DC source because of the requirements of the motor’s windings. In accordance with the controller logic, the ports connected to the device drive the inputs of the motor driver, thereby driving the stepper motor. The controller incorporates logic for half stepping the motor.

Figure 1. Implementing a Stepper Motor Controller Using a Supported Altera Device
Table 1.  Input and Output Signals of Motor Controller
Signal Direction Description
RESET Input Resets the position of the motor to the initial reference position.
MODE Input Switches between the continuous mode (normal motor) or the step mode of operation.
DIR Input Enables the rotor to rotate counterclockwise.
MOVE Input Uses in step mode for the rotor to move in a particular direction by half step (45°).
PHASEOUT[3:0] Output 4-bit output of the device that goes to the MOSFET driver circuit.

The rotation steps are controlled by the excitation on each of the coils that follows. A 4-pole stepper motor has four electromagnets uniformly placed over its circumference. The motor controller must provide the following sequence of inputs to these electromagnets through its output ports (PHASEOUT) to rotate the rotor by four times the step size of the motor being used:

1000, 1100, 0100, 0110, 0010, 0011, 0001, 1001, 1000...

The preceding half-step sequence of operation causes the rotor of a 200-tooth, 4-pole motor to rotate by 0.9° at each step.

This design offers continuous mode and step mode for motor control.
  • Continuos mode (set MODE input low)—the motor rotates normally without any discontinuity in rotor displacement.
  • Step mode (set MODE input high)—the motor operates every time you press the MOVE button. The MOVE input is normally pulled high by a pull-up resistor. Every time a negative edge is detected on the MOVE input, the motor advances by half a step.

The RESET input returns the motor to its reference position. The rotor works until it reaches the position where PHASEOUT is 1000, regardless of its initial displacement.