Stepper Motor Controller

AVR Project 조회 수 142148 추천 수 1262 2004.12.07 13:36:36 새 페이지 2


Stepper Motor Controller
Connection Diagrams

The wires from the Logic PCB connector to the stepper motor in a TM100 Disk Drive are as follows

 Motor Connector

This means that, to use the stepping sequences as is, the Green and Brown wires are the wrong way round. There is no need to alter the wires at the connector, of course - it can be done in the cable from the PC parallel port or microcontroller.

If you have a stepper motor with different wiring, look here.


 Four-Wire Connection

The ULN2003 / MC1413 is a 7-bit 50V 500mA TTL-input NPN darlington driver. This is more than adequate to control a four phase unipolar stepper motor such as the KP4M4-001.

4-wire connection diagram GIF

It is recommended to connect a 12v zener diode between the power supply and VDD (Pin 9) on the chip, to absorb reverse (or "back") EMF from the magnetic field collapsing when motor coils are switched off. (See Douglas W. Jones' rather more sophisticated example)


Here's one I made earlier

I recycled the power and motor lead connectors from the TM100 Logic PCB. A convenient source of 12v and 5v is an old IBM-PC power supply unit. The 9-way D-type connector is appropriate for the number of (parallel) control lines needed in the cable.

Here's some example software for this setup


 Data Sheets

Allegro MicroSystems has a PDF datasheet for its 2003 thru 2024 high-voltage high-current Darlington arrays.

Texas Instruments supplies the SN75468, which is a higher-voltage version of the ULN2003A.

The ULN2803 is an 8-bit 50V 500mA TTL-input NPN darlington driver. The extra Darlington pair means that two stepper motors can be controlled by this method with the single chip.

Motorola has PDF datasheets for its MC1413 and ULN2803 chips


 Two-Wire Connection

With the addition of a few resistors, you can control this kind of motor with only two data lines (compared with the Four-Wire Connection, above). This uses the fact that, with Two-Coil Excitation, at any time two of the coils have the inverse excitation (on/off) of the other two.

2-wire connection diagram GIF

(based on Parallax BASIC Stamp Application Note 6)


You only need to supply the on/off signals for coils 3 and 2, according to the Two-Coil Excitation sequence. The corresponding inverted signals for coils 1 and 4 are supplied by the circuit itself.

Turtle Circuitboard

I used this circuit (times two) for the StoneAge DiskDrive Logo Turtles and the Pan-and-Tilt Mount for a camera.

The same technique is used by the (discontinued) UDN2544B (PDF) Quad Darlington Power Driver chip from Allegro MicroSystems

A disadvantage of this method is that you cannot half-step the motor.

Allegro's UCN5804B Stepper-Motor Translator/Driver chip supports all three excitation modes.


 Allegro 5804B 

This translator/driver chip provides complete control and drive for a four-phase unipolar stepper motor.

from the data sheet (PDF)

The logic section provides the sequencing logic, DIRECTION and OUTPUT ENABLE control, and a power-on reset function. Three stepper-motor drive formats, wave-drive (one-phase), two-phase, and halfstep are externally selectable.


Drive Format Pin 9 Pin 10
Two-Phase L L
One-Phase H L
Half-Step L H
Step-Inhibit H H

I used the following circuit (times two) for a third (different) controller board for my students.

With Pin 15 OUTPUT ENABLE tied to Ground (always enabled), four data lines are required to interface the chip, for all three drive formats to be selectable in software.

From the Data Port of the PC Parallel Port, I used:


Bit Function
0 Step Input
1 Direction CW/CCW
2 One-Phase/Two-Phase
3 Half-Step/Full-Step

Bits 1-3 need to be set to 1 or 0 to reflect the desired direction of rotation and drive format. Bit 0 must be set to 1 initially. To step the motor, Bit 0 must be reset to zero for a minimum 3 µsec then set back to 1.

Note: If the controller board is powered up but not connected to the PC and under software control, the motor(s) will free run as Pin 11 STEP INPUT floats low. This behaviour can be prevented by connecting a 10K pullup resistor between pin 11 and +5v.


 Other Sources of Information 
  Stepper Motors Index  

List of Articles
번호 제목 글쓴이 날짜 조회 수