Stepper motor driver -- schematic help...

Hi all... I'm a software guy trying to learn the ropes of electronics.

I have the goal of controlling a stepper motor using my PC parallel port to create +5v control signals. Shouldn't be that hard, right?

My understanding of 5-wire stepper motors is that there will be one common power wire, and four other wires coming out. Attach the power wire to the power source, and attach the other wires to ground (using some logic to connect the right ones to ground at the right time), and you're all set.

I bought a unipolar stepper motor... the first one listed on this page:

formatting link

One thing I noticed is that the spec sheet lists that it has a "drive circuit".

Some more investigation led me here:

formatting link

Since I bought a unipolar stepper, I think the first schematic on the page applies. I'm not quite sure how to read it. It appears that what I want to do is attach my parallel port data pins DIRECTLY to the bases of each of the transistors (which is what the four non-power wires coming out of the motor will be).

If that's the case, it looks like I use my parallel port control signals to activate each transistor according to activate the internal electromagnets in the proper order. Being a smart software guy, I can handle that. When I do that, the power will go through the coils, through the transistors, and into the little black boxes.

What are those little black boxes? Some sort of internal ground?

Sorry for the newbish questions, but every description of a unipolar stepper motor seems to imply that I need to build or buy my own drive circuitry. So the idea that this one might come with its own already built right in is throwing me for a loop.

If someone could confirm my suspicions, or point me in the right direction, I'd appreciate it.

Also, I don't actually have the motor in my hand yet. It's being shipped. I'm just trying to get things figured out before it gets here. :)

Thanks! Adman

Reply to
Adman
Loading thread data ...

This is very helpful. Thank you so very much.

Adman

Reply to
Adman

The power transistors and your parallel port + code ARE the drive circuit. The little black boxes are ground. Put a 1K or so resitor from the parallel port pin to the transistor base and write some code to pulse the pins in the right order according to the table and away you go. Note they have two lines on at a time for full step mode.

Reply to
Dennis

formatting link

I hope this answers your questions.

Bob

Reply to
sycochkn

?

Yeah real hard, dont even think about it.

wer

Yeah thats the basic idea.

ars that

No, you want to buy/make a stepper controller.

can

Good, you can program a microcontroller instead to do that, control it from your PC over a serial link.

=EF=BF=BDWhen I do that, the power will go through the coils,

Thats because you do.

=EF=BF=BDSo the idea that this one might come with its own already

Maybe you could send it back unopend, plead for your money back.

Reply to
cbarn24050

Setting up a simple stepper motor should be a slam-dunk...but it ain't... and it gets much worse if you really want to do something interesting with the motion.

Rule number one is, "NEVER, EVER use the parallel port of your laptop or onboard motherboard parallel port." ALWAYS use a plug-in parallel port card that can be easily replaced. Even if you do everything right, you can still blow up your port. I killed my motherbord just plugging in the parallel cable with nothing on the other end. The system had been working perfectly for months.

Never drive the motor transistors directly from your parallel port. The port has limited (and variable between systems) pull-up capability. And you need some protection/current limit resistors in series with the base. You need higher-voltage than you'd initially expect, high gain transistors. Darlingtons make the available drive voltage problem worse. So, while it's certainly possible to select working devices, random junkbox transistors will not likely work well.

Even if you're a smart programmer, some things are beyond your control an may behave differently on different systems. What happens on the port during powerup/down? If you boot the system to dos or some other low level language, you have some hope of reasonable and timely control over the port. From the application level of a modern multi-tasking operating system, you have no idea how long it will take for your command to actually reach the port pins. And what happens when the printer driver decides to ask the printer how much ink is left?

When I built a 3-axis control system 15 years ago, I used DOS and still had to use 3 FPGA's programmed as stepper controllers to make the motion work smoothly and reliably with the avaialable computer processing power. I was amazed at how little timing jitter it took to shake the mechanical stuff apart.

Next time I rework the system, I'm going to use a microcontroller to do the motion control and a subset of a Gerber command interpreter. Serial gerber commands are the least obtrusive way to go unless you want to get into all the issues with USB.

So, what if you want to make some useful motion? Stepper motors are current controlled devices with large inductance and winding resistance. When you apply voltage, the initial current is zero. The more voltage you apply, the faster you can get the current to rise. But you can't leave all that voltage on the winding for long or you'll burn up the windings. So, you really want a high voltage to drive up to nominal current, hold there long enough for movement to happen then reduce the current to the minimum to hold the mechanical assembly stationary until the next step.

When you turn off the current, the coil voltage will rise to some high value. You probably want to limit this. Normally, you'd think just use a reverse clamp diode. But that makes the current decay time constant too long to let you step the motor fast.

There are lots of tradeoffs to making all this work. It's not difficult hardware design, but it IS hardware design.

But the most important issue is not to blow up your computer while experimenting. Most onboard parallel port controllers are in the same chip with lots of other stuff. When you kill a parallel port pin, you usually take out the whole computer. At the very least, use some TTL buffers (in sockets) in the path.

mike

--
Return address is VALID!
Reply to
mike

It isn't if you know what you are doing. Although if you make a mistake with the external electronics (and you sound very much like a newbie to hardware) it is quite possible to permanently damage a PC from the parallel port (although more likely just to destroy the port itself).

The risk of causing damage is much higher if you don't really know what you are doing. And I have known experienced hardware engineers that should know much better wreck PCs testing new interface cards to drive inductive loads.

BTW You will find that under modern operating systems like 2k, XP, NT & Vista that it requires a suitable driver stub to gain direct bitwise control over a parallel port.

You should be able to figure out the step sequence with a 9v battery splashed across common and each of the 4 coils until you make the rotor jump (either forwards or backwards). After that it is just a case of software to generate a one active drive moving either forwards or backwards at a suitable frequency.

Since you are a software guy rather than hardware you might be a lot better off buying a PIC based stepper motor driver kit like eg.

formatting link
(in extremis you could be better of by the price of a PC)

That way the motor isn't ever connected to your PC. And you can tweak the PIC software to do what you want without any risk. And you have a workable self contained stepper motor driver.

There are large numbers of projects around for very cheap PICs (and other microcontrollers) that will give you a chance to practice hardware without ever risking damage to your PC.

Regards,

--
Martin Brown
Reply to
Martin Brown

What about something like this? This doesn't look very complicated...

formatting link

Reply to
Adman

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.