Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Posted by
Les Newell
on 2005-07-25 02:23:26 UTC
Hi Alan,
The Mach2/3 driver is not a normal windows task. It installs itself as
an interrupt handler for the timer then reprograms the interrupt
controller to make the timer the highest priority. The task scheduler is
also interrupt driven but as it is now at a lower priority the Mach2
driver will be serviced before the task scheduler. The driver is then
fed from the main Mach2 application which runs as a normal high priority
Windows task. The application communicates with the driver through a
circular buffer. Each entry in the buffer is the equivalent to one cycle
of EMC's servo loop. EMC works out the velocities in real time every x
milliseconds while Mach2 calculates them in advance. The buffer is
continually filled from Mach2 and emptied by the driver. There are a few
weaknesses in this arrangement:
DMA or any hardware that disables the CPU will of course interrupt the
pulses. This is the case with any software based pulser including EMC.
Some applications and services such as qttask reprogram the timer and/or
interrupt controller causing the driver to run slow or end up running at
a lower priority.
If the system is heavily loaded and Mach2 does not keep the circular
buffer full the pulses will abruptly halt until Mach2 catches up then
they will abruptly start up again. Using a bigger circular buffer helps
but slows down jogging/pause response. This is why response can become
very choppy for slow CPUs. It doesn't help that the driver is taking up
a fair percentage of CPU time.
Les
KM6VV wrote:
The Mach2/3 driver is not a normal windows task. It installs itself as
an interrupt handler for the timer then reprograms the interrupt
controller to make the timer the highest priority. The task scheduler is
also interrupt driven but as it is now at a lower priority the Mach2
driver will be serviced before the task scheduler. The driver is then
fed from the main Mach2 application which runs as a normal high priority
Windows task. The application communicates with the driver through a
circular buffer. Each entry in the buffer is the equivalent to one cycle
of EMC's servo loop. EMC works out the velocities in real time every x
milliseconds while Mach2 calculates them in advance. The buffer is
continually filled from Mach2 and emptied by the driver. There are a few
weaknesses in this arrangement:
DMA or any hardware that disables the CPU will of course interrupt the
pulses. This is the case with any software based pulser including EMC.
Some applications and services such as qttask reprogram the timer and/or
interrupt controller causing the driver to run slow or end up running at
a lower priority.
If the system is heavily loaded and Mach2 does not keep the circular
buffer full the pulses will abruptly halt until Mach2 catches up then
they will abruptly start up again. Using a bigger circular buffer helps
but slows down jogging/pause response. This is why response can become
very choppy for slow CPUs. It doesn't help that the driver is taking up
a fair percentage of CPU time.
Les
KM6VV wrote:
>Hi Les,
>
>Interrupt priority? That's it? But isn't it more like the highest TASK
>priority? the pulse stream could still be delayed or altered if another task
>was still "taking it's good sweat time", and not relinquishing control. Do you
>have more detail?
>
>Alan KM6VV
>
>
>
Discussion Thread
ibewgypsie
2005-07-24 06:41:06 UTC
Windows timing subroutines, how do they work?
Jack Hudler
2005-07-24 12:59:51 UTC
RE: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Jon Elson
2005-07-24 13:00:59 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
KM6VV
2005-07-24 13:14:20 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
ibewgypsie
2005-07-24 13:30:22 UTC
Re: Windows timing subroutines, how do they work?
Jim Peck
2005-07-24 14:45:43 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Les Newell
2005-07-24 15:04:21 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
KM6VV
2005-07-24 16:46:14 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
notoneleft
2005-07-24 17:20:45 UTC
Re: Windows timing subroutines, how do they work?
Jon Elson
2005-07-24 20:00:49 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Jack Hudler
2005-07-24 21:17:33 UTC
RE: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
ibewgypsie
2005-07-24 22:04:15 UTC
Re: Windows timing subroutines, how do they work?
Mariss Freimanis
2005-07-24 23:41:25 UTC
Re: Windows timing subroutines, how do they work?
Jack Hudler
2005-07-25 00:45:30 UTC
RE: [CAD_CAM_EDM_DRO] Re: Windows timing subroutines, how do they work?
caedave
2005-07-25 02:23:24 UTC
Re: [CAD_CAM_EDM_DRO] Re: Windows timing subroutines, how do they work?
Les Newell
2005-07-25 02:23:26 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Les Newell
2005-07-25 02:34:10 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Fred Smith
2005-07-25 07:47:13 UTC
Re: Windows timing subroutines, how do they work?
Alan Marconett
2005-07-25 08:44:15 UTC
RE: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Jon Elson
2005-07-25 09:30:49 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
ibewgypsie
2005-07-25 10:01:52 UTC
Re: Windows timing subroutines, how do they work?
Les Newell
2005-07-25 11:02:16 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Alan Marconett
2005-07-25 13:22:42 UTC
RE: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
Les Newell
2005-07-25 14:58:54 UTC
Re: [CAD_CAM_EDM_DRO] Windows timing subroutines, how do they work?
caudlet
2005-07-25 19:46:24 UTC
Re: Windows timing subroutines, how do they work?
ibewgypsie
2005-07-25 21:19:36 UTC
Re: Windows timing subroutines, how do they work?
Jymmm
2005-07-25 22:29:38 UTC
Re: Windows timing subroutines, how do they work?
yahoo@h...
2005-07-26 02:10:13 UTC
RE: [CAD_CAM_EDM_DRO] Re: Windows timing subroutines, how do they work?
Mariss Freimanis
2005-07-26 08:15:13 UTC
Re: Windows timing subroutines, how do they work?
Mariss Freimanis
2005-07-26 08:19:33 UTC
Re: Windows timing subroutines, how do they work?
ibewgypsie
2005-07-26 10:36:48 UTC
Re: Windows timing subroutines, how do they work? JitteryMonkey pic
ibewgypsie
2005-07-26 10:48:27 UTC
Re: Windows timing subroutines, how do they work? JitteryMonkey pic
ibewgypsie
2005-07-26 11:08:39 UTC
Re: Windows timing subroutines, how do they work?
Andrey Lipavsky
2005-07-27 06:05:52 UTC
Converting a rotary table
victorlorenzo
2005-07-27 07:02:24 UTC
Re: Converting a rotary table
David Micklethwaite
2005-07-27 16:36:34 UTC
Re: [CAD_CAM_EDM_DRO] Converting a rotary table
cutsgems
2005-07-27 18:38:06 UTC
Re: Converting a rotary table
Andrey Lipavsky
2005-07-27 20:24:07 UTC
RE: [CAD_CAM_EDM_DRO] Re: Converting a rotary table
cutsgems
2005-07-28 08:54:39 UTC
Re: Converting a rotary table
Les Newell
2005-07-28 09:23:43 UTC
Re: [CAD_CAM_EDM_DRO] Re: Converting a rotary table
Andrey Lipavsky
2005-07-31 16:43:28 UTC
RE: [CAD_CAM_EDM_DRO] Re: Converting a rotary table