Stepper motor control from an Intel PXA255

Hi,

I'm trying to figure out how to control 4 small 5v (unipolar or dipolar) stepper motors from an Intel PXA255 microprocessor (on a gumstix). The GPIO pins on the CPU use 3.3v logic, and I'm running off

4 1.2v NiMH AA cells. The motors will only be driving either indicator needles or small wooden wheels, so high torque isn't a requirement.

Though I need to drive the motors independantly, when more than one is moving, it'll be at the same rate and direction, so I figure I can probably get away with 4 GPIO lines for the motor stepping, and 4 selector lines to determine which motors get controlled. I know I can probably use darlington drivers to convert the logic voltage to the motor voltage, but I don't know what chip(s) I should be using, and how to wire it all up. I also don't know if I'll need some sort of switch-mode regulator to up the power to 5v, or if the 4.8 from the batteries will be sufficient.

Is anyone able to provide me with some guidance on this? A circuit diagram would be even better. ;)

Reply to
arachnidster
Loading thread data ...

To clarify, by 'small wooden wheels', I meant small discs of wood with letters and numbers at regular intervals along the rim, used as a display device, not wheels in the move-something-around sense.

Reply to
arachnidster

wrote in message news: snipped-for-privacy@g44g2000cwa.googlegroups.com...

Have a look at:

formatting link
This is a fairly typical circuit for driving a small stepper like this for low power. You would need the 'right hand' half of this with a driver like the ULN2003, Now you may have to be 'careful'. A stepper, driven at it's 'rated' voltage, can only give slow movements. The problem is that the high inductance of the coils, limits the rate at which current builds. You can increase the rate that current builds by increasing the 'endpoint' voltage of your drive circuit, but this then means greater complexity (and voltages you don't hve available). You have obviously accepted the low movement torque that driving at the rated voltage implies, and provided you step slowly, the system should be workable. There is a big 'caveat', that a stepper has almost no 'holding' torque, unless current is applied to the coils. Provided your indicators are well balanced, you may be able to accept completely removing power when not driving a motor, but it is an area where problems may exist (since if the needle is 'knocked' in this state, the indication will in future be wrong, unless you add an ability for the indicator to detect it's position). The ULN2003, requires it's inputs driven to 2.4v, for the sort of current I imagine you are likely to use. If the outputs of your processor cannot achieve this, you would need to consider perhaps the ULN2001 instead, and provide your own input resistors (perhaps 1KR). Now the complexity, is deciding the best way to switch the drives, using your four 'select' pins. You can basically use two approaches. The first is to multiplex the four drive pins, using simple logic. The second is to switch the actual 'supply' to the motors, perhaps uing four FETs. The latter would be the simpler to implement, and with the caveat already mentioned about the lack of holding torque, would probably be acceptable, though introduces yet another voltage drop into the drive. Remember that your control sequence should be:

Disable all motor power feeds. Select the last bit pattern fed to the motor required, on the four 'step' outputs. Turn on this motors power feed. Now step the motor to the new position. Turn off the power feed.

The 'point' is that you must set the four drive lines to the same pattern that you 'last' used on a particular motor, before applying the power line, otherwise steps will be lost.

You would need something like an 'end stop', and on power up, seek the motors all back to this point, to give you a starting point for motions. If you step at something like 2.5mSec/step, most motors should allow this sort of rate, without needing ramping of the movement. You could get a much higher torque solution, probably simpler, by just using four RC servos, and generating the pulse trains to control these. These have the advantage that given a particular pulse width feed, they adjust their motor power to try to hold the specified position, using little current with no load, but holding firmly, if a load is applied. Might be worth considering. You would only need one CTC channel, and two bits to multiplex this. There are even driver IC's on the market, that will do this under simple serial control, using just one pin on your micro. Have a look at the FT639 for example!.

formatting link

Best Wishes

Reply to
Roger Hamlett

Thanks. I note, however, that this diagram is for a unipolar motor - how would I drive a bipolar one? Most of the small steppers available seem to be bipolar.

2.4v shouldn't be a problem - the processor uses 3.3v logic. Just how slow are we talking, though? 1RPM? 100? 1000?

I gather I only need to do this when selecting new motors, not for every step?

Yup. I was planning on having a microswitch triggered by a notch on the wheel between the last and first states.

Don't RC servos have restricted rotation? I need to be able to make multiple rotations.

Reply to
arachnidster

Bipolar is a harder to drive. You need a 'H-bridge' driver circuit. Fortunately, there are several pre-built IC's that do this. The advantage of bipolar, is more torque. You said 'bipolar or unipolar', and in terms of circuitry, unipolar is simpler. Pull the data sheet for the SN754410. This is cheap, and will just operate down to your supply voltage OK. Many of the other drivers are designed for higher voltage applications.

Probably in the order of 300Hz. With a 1.8 degree step size motor, you are then talking 90RPM, if you 'full step'. Remember also there will be noticeable vibration, unless you 'micro step', and you may get resonance, with a significant 'undamped' mass attached to the motor at some speeds.

Hence the line 'step to the new position'.

There are 'sail winch' servos, which give ten turns, and you can modify standard servos, by replacing the feedback postentiometer, with a multi-turn design, and removing any mechanical stops. Beware, you need to think in terms of an optical/Hall effect detector, rather than a switch for your zero-point on the stepper approach. If you have a detent, there will be torque needed to overcome this, and if you are not careful, if a 'power down' was done, close to the stop, the output may well move either into the 'dip', or away from the 'hump', depending on how the switch is operated. A Hall effect sensor IC would be simple.

Best Wishes

Reply to
Roger Hamlett

Unipolar definitely does seem simpler. I can't figure out the purpose of the diode arrangement in the H driver's circuit, but then, I can't figure out the internal diagram for the darlington drivers, either. :/

So, if I may be permitted one further stupid question: Do I need the pullup resistors in the example circuit, given the CPU will never give an open circuit?

-Nick Johnson

Reply to
arachnidster

No, you should be fine, without these. I'd suspect they were present to ensure a good +ve drive. With all motor drives, probably the most important thing to work out/remember, is where does the energy in the coil 'go', when a driver is switched 'off'. Failure to provide a path for this, is a 'sure' way to destroy other components. With unipolar motors, you can generally clamp this with a single diode from each drive, directly into the supply +ve rail. With bipolar, you have to deal with the coil being energised in either direction. Hence the diodes shown.

Best Wishes

Reply to
Roger Hamlett

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.