William A. Leonard

Computer Consultant

3D Scanner


Part 2 - Electronics

I decided to control the stepping motors using the parallel port. Furthermore, I wanted to generate the sequence of pulses in hardware rather than generating and writing them to the port. This way I could send "commands" to the scanner in the nature of "move 10 pulses forward". I could also avoid software timing loops which are otherwise necessary when sending a train of pulses.

I found a very good stepper motor tutorial in a series of pages by Douglas W. Jones at www.cs.uiowa.edu/~jones/step/. He provides a sequencer schematic which I modified to accomodate limit switches. The modified schematic is shown here:

Stepper motor sequencer circuit schematic  

The shaded area shows the limit switches. J1 goes low when the platform reaches the CW limit. J3 goes low when the platform reaches the CCW limit. The limit switches are debounced.
The Direction is low when moving in the CCW direction and high when moving in the CW direction.
U1A outputs TRUE when the direction is CW and the CW limit is not reached. U1C outputs TRUE when the direction is CCW and the CCW limit is not reached. U3C outputs TRUE when U1A is TRUE or U1C is TRUE. (Note: U1A and U1C cannot both be TRUE simultaneously so an XOR works as well as an OR.)
An equivalent expression is: U3C outputs FALSE if the direction is CW and the CW limit is reached OR if the direction is CCW and the CCW limit is reached.

The schematic for the unipolar driver is here, figure 2.1. I omitted the open collector buffers (the author does too in figure 6.1). I think they were there to protect the parallel port. I'll use some buffers elsewhere but not here. He also used 1N4001 diodes. I have a pile of diodes which I can't identify but have used anyway in the true spirit of a dedicated scrounger.

Stepper motor sequencer and driver device To date, the basic sequencer and driver have been completed (including limit switches) and is shown to the left. The driver is for a unipolar stepper motor. Another, identical, sequencer and driver will be used for the other axis.

The ICs are an XOR(74LS86), a D flip-flop(74LS74) and an AND gate(74LS08). The transistors are TIP110s.

The black lead is ground, red is VCC(5v), blue is the external clock, green is the direction, red is motor power. A header connects via ribbon cable to the motor coils. Yellow leads show the limit switch connection pins and the blue lead between them is the pulse enable input (from the pulse counter). The wave forms of TTL test points from the D-flip flops are displayed in the photo to the right. TP1 - TP4 stepper motor control waveform

A clock circuit is also completed which uses a LM555 timer generating about 55 pulses per second. There are numerous sources of information about putting a timer circuit together and mine is nothing special. Download this Timer Wizard to help you design your own.


shClock (23K)

10/25/06

Home
Part 1 - Mechanics
Part 2 - Electronics (continued)
Part 3 - Software
Part 4 - Summary