Build Stepper Motor Controller

Posted on

If youre interested in robotics, motion control, or just want to learn about stepper motors, then you should try building this versatile stepper motor controller.

This project allows you to control the speed, direction, and step size of a unipolar four-phase stepper motor. The controller is capable of handling motor winding currents of up to 1.25 amps per phase and it operates from a single supply voltage of 6-30 volts DC. A unique feature f this project is that the circuit can operate in either remote mode or stand-alone mode. In the stand-alone mode, an on-board pulse generator and a four-position DIP switch allows you to demonstrate all of the functions without any additional connections. This mode is perfect for demonstrating basic stepper motor control principles. The circuit even has LEDs that show the energized phases for each step. In remote mode, all motor functions can be interfaced to external logic or a microcontroller. This allows the controller to be incorporated into a robot, an X-Y plotter, or any motion control project you have in mind!

Refer to the schematic of the stepper driver shown in Figure 1. Power is supplied by a DC wall transformer or DC power supply at P1. The voltage can be anything from 6 to 30 volts, depending upon the rating of the stepper motor. The stepper motor uses most of the current in this circuit, so it is powered directly from the transformer output through resistors R1 & R2. These resistors limit the current to the motor and allow the motor to be operated with a power supply voltage greater than the voltage rating of the motor for improved performance.

stepper motor controller schematic

stepper motor controller parts list

Stable voltage for the rest of the circuit is obtained by regulating the input voltage down to 5V with U4, a LM78L05 voltage regulator IC. Capacitors C7, C1, and C5 provide additional voltage filtering. U1 is capable of supplying up to 100 mA of current.

The heart of the stepper controller is U1, a UCN5804B stepper-motor translator/driver IC. It contains a CMOS logic section for the sequencing logic and a high-voltage bipolar output section to directly drive a unipolar stepper motor. U1 can generate waveforms for three different sequence modes: (1) FULL-STEP with two phases energized, (2) FULL-STEP WAVE and (3) HALF-STEP. The waveforms for these three sequence modes are shown in Figure 5. Diodes D1-4 are clamps to prevent damage to U1 if the outputs swing below ground when driving the inductive load of the motor. Each of the LEDs L1-4 light when the corresponding output goes LOW and are useful for observing the output waveforms. Resistor R3 provides current limiting to the LEDs.

ic lm555 diagramic 8504 stepper motor driver
Pins 9, 10, 14, and 15 of U1 are control inputs for phase, halfstep, direction, and output-enable. These signals are pulled-down to a logic LOW level by resistors R7-11. The control signals go to both connector P3 and the four-position DIP switch (S1-4). Switches 1-4 allow for manual control of each function, or alternatively, connector P3 allows the functions to be controlled by external logic or a microcontroller chip.The UCN5804B requires an external pulse input on pin 11 to advance the stepper motor. This signal can be supplied by external logic via connector P3 or can be provided by U2 or U3. U2 and U3 are LM555N timer ICs and are used to provide single- step or continuous pulses to U1. U2 is configured as an astable oscillator that delivers continuous pulses. The pulse rate is controlled by potentiometer R13 and capacitor C2. Jumper J2 connects C6 in parallel with C2 to give a LOW SPEED range. U3 is configured in a monostable mode to produce a single pulse when S5 is pressed. Jumper J1 selects between the single-step or continuous mode.

The easiest way to build the stepper motor controller is to use an etched circuit board as shown in Figure 2. If you don’t want to fabricate your own board, a pre-etched and drilled board can be purchased from the source shown in the parts list. Locate all the components shown in the parts list and use Figure 3 to determine component placement on the PC board. Begin by using three pieces of solid wire for J1, J2, and J3. Next install and solder the four diodes in place, noting their polarity. Then move on to the resistors and ceramic capacitors.

stepper motor pcb layout stepper motor top pcb layout

When installing the 5-watt resistors R1 and R2, leave a small space between the resistors and the PC board to allow for air circulation. Be sure to observe proper polarities when installing the electrolytic and tantalum capacitors and the voltage regulator. Note that it may be necessary to bend the leads of the U4 to fit the PC board.

Now solder IC sockets for U1, U2, and U3 to the board. If you use the switch specified in the parts list for S5, it can be soldered directly on the printed circuit board. Then install the four LEDs as shown in Figure 3.It is recommended that you use screw-terminal connectors for P1 and P2. Potentiometer R13 can be either PC mount style or panel mount style. To use a panel mount potentiometer, cut three pieces of stranded wire to connect R3 to the PC board. If you plan to use the controller in stand alone mode, solder a four-position DIP witch for S1-4. You may omit the DIP switch if you plan to use the P3 connector for remote interfacing.

Next, locate the UCN5804B integrated circuit (U1). Since U1 is a CMOS device, it can be easily damaged by static electricity. Take proper anti-static precautions when handling the chip. Refer again to Figure 3 before installing U1 to make sure of the proper orientation of pin 1, then press the IC firmly into the 16-pin socket. Repeat the procedure with ICs U2 and U3.

Before continuing, clean the foil side of the PC board with alcohol or flux remover. Then refer to Figure 4 for details on connecting the stepper motor and DC power supply. Note that the wire colors for the stepper motor shown in Figure 4 apply only to the PF-42 motor that is included in the purchased kit. If you use a different motor, you will need to determine the appropriate wire connections to P2. Also note that the circuit is designed to drive six-wire UNIPOLAR motors only. Next, attach the wires from the DC power source to the PC board, observing the polarity show in Figure 4.

stepper motor controller final assembly

To run the stepper controller using the on-board oscillator, install jumper J1 in the “A

Leave a Reply

Your email address will not be published. Required fields are marked *