Dual Stepping:

From controlling a single stepper (using two of our bit wires), to controlling two steppers is as easy as adding another chunk of driver circuitry to our breadboard, and connecting it to two more bits-- bits 0 and 1 are taken, so we'll use #2 and #3 to control DIRECTION and STEP for our second motor.  Here's the breadboard map:

Notice that all we've done is to add an identical copy of the UCN5804 chip and its jumpers, except for the connection to bits 2 and 3 (wire #4 and #5 of the parallel port cable).

Pic of breadboard up to this point.  (I have added an LED + resistor across +5 and GND as a "power on" indicator)

Just as with the single motor circuit, attach a motor to the new circuitry's 6-prong connector and then apply power.  As before, the shaft should be frozen (disconnect power and troubleshoot if this is not so).  If the new circuit checks out, attach your other motor to the first 6-prong connector.  Shaft frozen?  Good.

Disconnect power.  Attach to the parallel port via the 26-hole connector (carefully), and reapply power.

Now let's modify steps2.bas to move our second motor:

     CLS
    INPUT "enter count value for speed control: ", speed

    FOR repetition = 1 to 10
 
    FOR counter = 1 TO 400
    OUT 888,8
    OUT 888,0
    FOR zz = 1 TO speed: NEXT
    NEXT counter
 
    FOR counter = 1 TO 400
    OUT 888,12
    OUT 888,0
    FOR zz = 1 TO speed: NEXT
    NEXT counter

    NEXT repetition

Run it-- motor #2 should now be swiveling merrily back and forth!  But what about motor #1-- can we have them both moving at the same time?  Sure-- it's as simple as addition:  change OUT 888, 8  to OUT 888, 2+8, and OUT 888, 12  to OUT 888, 3+12Running this new modification should result in both motors moving identically.  Look at what we're doing-- simply controlling DIRECTION and STEP bits, no different than any other bit-controlled device.  Just like with the Light-byte, we can have any combination of DIR and STP bits we want.  And we have room to add two more stepper drivers and motors!

OK, all this is well and good... but what can you DO with this stepper motor stuff?



next-- Egg-bot
home
Copyright © 2000 Bruce Shapiro