Kirk Wallace wrote:

> The turret rotates at about one revolution per second, giving 125ms per
> tool position. My guess is that if I can process four or five position
> samples in that time, it should work. The problem is that, I think it is
> taking around 200ms to do it. If I were using a precompiled program, I
> think I should be able to do tens or hundreds of samples per position
> even in userspace(?).

> I still have a problem, sort of. I had to fall back on a less desirable
> method to get it to work. It now does a complete single tool position
> change using only solenoid commands and sleep - no position processing.
> After the turret parks, I sample the position and if the requested
> position and current position don't match, I have it jump to the next
> position, park and test again until I get a match. What I would prefer,
> is to process the location during rotation and only stop and park after
> I get a match.
> 
> Bottom line (I think), how can I get enough processing done in 30ms to
> decode and match two (32 bit unsigned?) words?

It is not a matter of speed.  Just about _any_ programming language can 
do what you want in 30ms (or even 30uS) as long as it is actually 
running.  But a user space program isn't always running.  There are 
dozens of things going on in your PC, and Linux can and does suspend any 
user space program to let other things run.  Most of the time it is only 
for a fraction of a millisecond, or a few milliseconds, but there are NO
guarantees for user space programs.

If you need measure or control things on a time scale that is less than 
seconds, you _really_ should be doing it using realtime code.  That can 
mean classicladder, or realtime HAL components, or EMC itself.

Steven has suggested ways to do it with HAL components, but I'd really 
recommend classicladder.  PLCs were invented to do _exactly_ what you 
are trying to do.  Why reinvent something?

Regards,

John Kasunich

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to