Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
According to my best recollection, I don't remember.
-- Vincent "Jimmy Blue Eyes" Alo
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the Automation List department...
Stepper Motor control and Encoder monitoring with Parallel Port
Engineering and workplace issues. topic
Posted by Anonymous on 31 March, 2007 - 11:44 am
I'm relativly new to all these sorts of thing; however, I've been given a task to design a relativly cheap (under $100) for a circuit/bread board that connects a stepper motor, and 2 optical encoders to the computer.

The encoder I'm using is this:
http://www.usdigital.com/products/e4p/

The bipolar stepper motor I'm using is this:
http://web1.automationdirect.com/adc/Shopping/Catalog/Motion_ Control/Stepper_Systems/Motors_-z-_Cables/STP-MTR-23055

I am planning to connect and control these devices via the parallel port.

I have semi-figured out how to connect the stepper motor to the parallel port using the dual H-bridge IC SN754410, where the 4 output are connected to 4 of the data pin on the parallel port (with optical isolators of course). One thing I have yet to figure out is where am I suppose to put resistor and capacitors on the board?

For the encoders, I've been told various things. Some people say that you need an A/D converter for connecting it to the parallel port, while some say I don't. So, which one is it?

Furthermore, I am using pin 1 on the parallel port to power the IC, and the 2 encoders, and I was wondering, is that enough?


Posted by Robert Scott on 1 April, 2007 - 3:40 pm
To read a quadrature encoder you need a board that has a quadrature counter input. These boards have a counter that counts up for clockwise and down for counter-clockwise indications from the encoder. You can make such a thing yourself, but why bother? They are available off-the-shelf.

I would also advise you that there is no good cost-effective reason for continuing along the line you have begun with the parallel port. You talk about the limitation of $100. But you are going to spend the equivalent of over $10,000 of engineering development time to create something like this. The parallel port has no future. Modern computers are being made without any parallel port. If you indend to run under Windows, you will have problems getting the kind of real-time access you need to do any serious high-speed stepper motor control. Just look at what you can buy ready-made and I think you will see that it is just not worth it to try to design something like it.

Robert Scott
Real-Time Specialties
Embedded Systems Consulting


Posted by no way on 26 April, 2007 - 11:12 pm
Robert, you are wrong and I'm sure you work for a big firm doing desk work. But with a week-end of work and a few Visual Basic lessons he will do it.

Ciao


Posted by cnc002 on 27 October, 2008 - 9:19 pm
Actually, both you and Robert are at least partially correct. Robert is correct that the parallel port is going the way of the DoDo bird and there is existing hardware out there at modest cost that will accomplish the same thing. Now you are also correct in that it doesn't take all that long to write the code to do what the original poster wanted. Of course, he still has to design and fabricate the interface circuitry.

Anyway, I do industrial CNC machinery, and for what the original poster wanted to do I would recommend using existing off the shelf components.

Just my two cents worth.


Posted by Robert Scott on 28 October, 2008 - 8:06 am
It is much more than coding. The OP doesn't even have a plan for reading an incremental encoder. That is going to take some serious circuit design in addition to coding. Trying to put all the intelligence into the host computer is not going to work. The host computer does not have the needed real-time response. By the way, in case "no way" is still reading this thread a year and a half later, no, I don't work for a big firm. I run a 1-person consulting business out of my home and I build prototype boards in my basement. So I know the home-brew world too. And I still think that when off-the-shelf equipment is available, you can never "roll your own" for the same price without sacrificing a lot of quality or functionality.

Robert Scott
Real-Time Specialties
Embedded Systems Consulting


Posted by Michael Griffin on 27 April, 2007 - 9:45 am
This reply is a bit late, but I hope it might still be useful.

For the encoder, the hardware requirements depend upon how fast the encoder is turning. At typical speeds, the output will be in the kilohertz. That is too fast to do with a PC in software and you'll need a hardware counter for this. You'll need a counter/timer chip as someone else has mentioned. I cannot imagine why someone would tell you that you need an A/D converter for this.

As for details of driving a stepper motor with a PC parallel port, please see the following article. I've referenced the following article several times this year for previous similar questions.

"http://linuxgazette.net/122/sreejith.html".

It describes controlling stepper motors using the parallel port of a PC. It includes circuit diagrams as well as 'C' source for the device driver and an example program. The article is intended to describe the basics of controlling motors for student robotics projects.

Most people trying to do a "cheap" stepper system would leave out the encoder and control the stepper motors "open loop" (no feedback). If you really need the encoders, you might look at running your board with a microcontroller chip and interfacing with the PC using an RS-232 connection (instead of the parallel port). You could send commands and receive position data via the serial link while the board operates autonomously.

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2009 Reed Business Information. Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2009 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!