Dual Stepper motor controller

greencardigan

Senior Member
Quite a few years ago I built a curtain opener using lego bits and pieces and controlled by a 386PC.

This was upgraded to a RF remote control system using geared DC motors.

Now it's time for version 3. ;)

I plan to reuse the RF remote stuff but hope to drive 2 stepper motors controlled by an 18X and clock chip.

I've attached a preliminary circuit schematic. Comments or suggestions are welcomed.
 

Attachments

greencardigan

Senior Member
My circuit above shows an LED connected directly to the sqw/out pin on the ds1307. A more thorough read through the data sheet suggests that I cant do this.

The data sheet says the sqw/out pin is an open drain and requires a resistor between it and Vcc.

So can someone tell me how I connect an LED in these circumstances?
 

greencardigan

Senior Member
I've been testing parts of this ciruit on breadboard.

The i2c clock is working but have a question re the stepper motor control.

I've got the stepper motor working well (fast/slow/forward/back etc) but it seems this setup (see circuit up top) will continue to draw current through the motor even when it's not going.

Is there any way I can stop this without using another picaxe output?
 
Last edited:

BCJKiwi

Senior Member
I believe that current draw is requierd to hold the stepper motor in postion.

If all power is removed, it will free wheel.

That's probably OK for a curtain control (would also enable manual movement of curtain).

Since the motors are contolled by ULN2803s, when the limit switch confirms end of travel has been reached, all the ULN2803 inputs could be turned off.
 

greencardigan

Senior Member
Since the motors are contolled by ULN2803s, when the limit switch confirms end of travel has been reached, all the ULN2803 inputs could be turned off.
I'm using ULN2003s not 2803s and I was hoping not to use limit switches.

When all the outputs from the picaxe are low, 2 of the coils are still energised.
 

BCJKiwi

Senior Member
Well whatever is used to know when the motor has stopped is good enough.

The 2003 (or 2803) is just a bunch of outputs.

There should be some combination of outputs that turns off all the coil power.

Have no idea of the program so can't really help further.
 
Last edited:

SD2100

New Member
There is always going to be power on the steppers using this method to drive them but there is a way to cut power to the motors, use the serial output pin to drive a relay. Connect the serial output pin to one of the unused darlington drivers then use a relay on the driver output to turn the 12v supply to the steppers ON/OFF when needed.

Code:
Poke $05,%00001000 'Turn relay ON, serial out pin high

Poke $05,0  'Turn relay OFF, serial out pin low
 

BCJKiwi

Senior Member
@Phil,
Your crystal ball is working well, we don't know what sort of motor or how it is being controlled do we?

Turning motor power off is the obvious way and using serial out is a good idea. Would there need to be some additional jumper arrangement on serial out to avoid interference with program downloads?
 

SD2100

New Member
@Phil,
Your crystal ball is working well
The ball seems to be working OK, I just had it serviced :)

we don't know what sort of motor or how it is being controlled do we?
Appears to be unipolar in the drawing, Stepper 1 is being controlled by alternating pins 6 & 7 and stepper 2 is being controlled by alternating pins 3 & 5. It looks to be a simillar setup as in manual 3. So any state the output pins are left in there will be power on the motor.

Turning motor power off is the obvious way and using serial out is a good idea. Would there need to be some additional jumper arrangement on serial out to avoid interference with program downloads?
Jumper on serial out, maybe/maybe not, usually there is just a bit of mild humming from the relay during download but not enough to move the contacts, depends on the relay I suppose, you would have to test it to see what happens, or just put the jumper in and be on the safe side.
 

greencardigan

Senior Member
I could possibly use the output connected to the LED to switch the stepper power via a Logic Level MOSFET. However, this will cut power to both steppers.

I was also thinking of some additional circutry to monitor the activity of pins 6, 7, 3 and 5. When there's no change for a specified time, cut power to steppers. Is this a sensible solution?
 

SD2100

New Member
I could possibly use the output connected to the LED to switch the stepper power via a Logic Level MOSFET. However, this will cut power to both steppers.
You could use the LED output for one stepper and the serial output for the other one.

I was also thinking of some additional circutry to monitor the activity of pins 6, 7, 3 and 5. When there's no change for a specified time, cut power to steppers. Is this a sensible solution?
You could do this from within your program without any additional circuit to monitor the output pins, or just power them up when their required to move and turn them off when not moving.
 

greencardigan

Senior Member
I'll probably use the LED output to cut power to both motors.

I'm planning to use a logic level mosfet to switch the ULN2003's ground connections? Is this the best way to do it?

An updated schematic is attached.
 

Attachments

Top