CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] A question about parallel port

Posted by Chris Baugher
on 2003-01-02 19:08:08 UTC
On Thu, 2 Jan 2003, Mail List wrote:

> each motor use 2 bits of the LPTx port. To move one motor one must raise the
> step bit, keep it high for a while and then clearing the bit.
>
> The frequency of this sequence determine the motor speed.

Hi,
Yes, and the maximum step rate you can get is 1/2 of the fastest switch
rate your parallel port can achieve. If the parallel port can switch the
outputs 10000 times/second then the fastest step rate you can get is 5000
steps/second. This of course assumes the CPU can keep up.

> This is not difficult with the outp() functions in W9.x. But what about
> moving two or more motors at different speeds in the same time ?? I mean:
> moving motors at speeds that are not multiple of each other. One have to
> raise differents bits of LPT port and keep them high for different times.
> Does anybody ever encountered this problem ? I have to drive 4 motors (2
> couples of two motors) and I don't know how to get reliable results.

I can think of two ways you could do something like this.

The first way is to have a global timer that runs at 2x the fastest step
rate you will ever need. Every cycle it calculates whether or not a
particular port bit needs to be high or low in order to create the output
frequency needed for that motor.

The second way is to have separate timers for each motor; and each timer
changes only the port bit corresponding to it's own motor. There can be
problems with this in that 2 timers may need to update their bits at the
same time, and since they don't know about each other they try to write to
the port at the same time. One of them will have to wait until the other
finishes. Also it's inefficient because you end up writing to the port
twice when you could have combined the writes and only done it once.

Either way you are still limited by the maximum rate that the port can
achieve. For example, with the rate of 10000 switches/second mentioned
above the fastest step rate will be 5000 steps/second. The output would
look something like this: (you will need to use a fixed width font in your
email program for this illustration to come out right.)
_ _ _ _ _ _ _
|_| |_| |_| |_| |_| |_| |

The next fastest rate would be 10000/3 or 3333.3 steps/second which might
look like this:
_ _ _ _ _ _
|__| |__| |__| |__| |__| |

The next is 10000/4 or 2500 steps/second:
_ _ _ _ _
|___| |___| |___| |___| |___

And then 10000/5, 10000/6, and so on.

As you get closer to the maximum frequency the parallel port can operate
at, the frequencies that you can output exactly become fewer. So you want
to make that main timer loop run almost as fast as the parallel port can
go. This can vary widely from computer to computer, and it's mostly
hardware dependant.
Does all of that make sense?

> Accurate waiting functions in W9.x is a must but this is another (and very
> difficult) problem.

Yes, I can imagine. How are you doing the timing?

> I'm just wandering how to solve this problem because it's the last problem
> to solve in order to get my foam cutting machine working.

Have you looked into something like TurboCNC? It's a DOS program (can run
under Win9x that takes care of running the steppers for you. You can see
it here:

http://www.dakeng.com/turbo.html

If you register it for $20 they will even send you the source code.

> Thanks anyway for your opinions or suggestions !

Your welcome. I hope you aren't more confused than before!

C|

>
> Sandro
>
>
>
> Addresses:
> FAQ: http://www.ktmarketing.com/faq.html
> FILES: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO/files/
> Post Messages: CAD_CAM_EDM_DRO@yahoogroups.com
>
> Subscribe: CAD_CAM_EDM_DRO-subscribe@yahoogroups.com
> Unsubscribe: CAD_CAM_EDM_DRO-unsubscribe@yahoogroups.com
> List owner: CAD_CAM_EDM_DRO-owner@yahoogroups.com, wanliker@...
> Moderator: jmelson@... timg@... [Moderator]
> URL to this group: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO
>
> OFF Topic POSTS: General Machining
> If you wish to post on unlimited OT subjects goto: aol://5863:126/rec.crafts.metalworking or go thru Google.com to reach it if you have trouble.
> http://www.metalworking.com/news_servers.html
>
> http://groups.yahoo.com/group/jobshophomeshop I consider this to be a sister site to the CCED group, as many of the same members are there, for OT subjects, that are not allowed on the CCED list.
>
> NOTICE: ALL POSTINGS TO THIS GROUP BECOME PUBLIC DOMAIN BY POSTING THEM. DON'T POST IF YOU CAN NOT ACCEPT THIS.....NO EXCEPTIONS........
> bill
> List Mom
> List Owner
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

Discussion Thread

Mail List 2003-01-02 11:26:25 UTC A question about parallel port turbulatordude <davemucha@j... 2003-01-02 17:02:14 UTC Re: A question about parallel port Chris Baugher 2003-01-02 19:08:08 UTC Re: [CAD_CAM_EDM_DRO] A question about parallel port torsten98001 <torsten@g... 2003-01-03 03:46:28 UTC Re: A question about parallel port Mail List 2003-01-03 05:50:40 UTC RE: [CAD_CAM_EDM_DRO] Re: A question about parallel port