Re: [CAD_CAM_EDM_DRO] Re: Re: step pulse timing resolution
Posted by
Anne Ogborn
on 2000-10-14 00:41:36 UTC
DDA should handle converting the stream of interrupts into
smooth motion pulses. Works like this, pseudocode
simplified to illustrate the idea by assuming DX > DY
and DX > 0.
DX, DY are distances to be moved.
VY is float.
VY = DY / DX;
X = XFRAC = 0;
Y = YFRAC = 0;
while (x < DX)
{
step the X axis;
YFRAC += VY;
if (YFRAC > 1.0)
{
step the Y axis;
YFRAC -= 1.0;
}
}
The "error" in this is only the resolution of the math package.
Of course we don't need to actually use floating point.
We'll implement this in fixed point.
The
acceptable error is the 1/(# steps end to end, longest axis)
Suppose we step 0.0001 and have 40" of travel. Then the
required resolution is 1/400,000 - sane thing to do is
to just go ahead and use 24 bits of resolution. If you can accept
the 0.0001 per 6.4" loss of accuracy, you can use 16 bit math, but
24 bits gives you 0.0001 loss every 140'.
(and yes, I've fixed this bug once, by explaining the problem to
the plotter manufacturer who will remain nameless).
A handy modification of this is to keep the interrupt interval constant
and use VX != 1.0 , so you can control both speed and direction.
Your real problem is going to be that you can't just turn the interrupts
off and leave them off. You'll starve the rest of the system, which was doing
important, exciting, interesting things like swapping VM out to disk and mundane
but useful things like dealing with the video interrupt.
Frankly, folks, this is the classic case for using a hardware controller.
smooth motion pulses. Works like this, pseudocode
simplified to illustrate the idea by assuming DX > DY
and DX > 0.
DX, DY are distances to be moved.
VY is float.
VY = DY / DX;
X = XFRAC = 0;
Y = YFRAC = 0;
while (x < DX)
{
step the X axis;
YFRAC += VY;
if (YFRAC > 1.0)
{
step the Y axis;
YFRAC -= 1.0;
}
}
The "error" in this is only the resolution of the math package.
Of course we don't need to actually use floating point.
We'll implement this in fixed point.
The
acceptable error is the 1/(# steps end to end, longest axis)
Suppose we step 0.0001 and have 40" of travel. Then the
required resolution is 1/400,000 - sane thing to do is
to just go ahead and use 24 bits of resolution. If you can accept
the 0.0001 per 6.4" loss of accuracy, you can use 16 bit math, but
24 bits gives you 0.0001 loss every 140'.
(and yes, I've fixed this bug once, by explaining the problem to
the plotter manufacturer who will remain nameless).
A handy modification of this is to keep the interrupt interval constant
and use VX != 1.0 , so you can control both speed and direction.
Your real problem is going to be that you can't just turn the interrupts
off and leave them off. You'll starve the rest of the system, which was doing
important, exciting, interesting things like swapping VM out to disk and mundane
but useful things like dealing with the video interrupt.
Frankly, folks, this is the classic case for using a hardware controller.
Discussion Thread
Jon Elson
2000-10-12 23:47:34 UTC
Re: step pulse timing resolution
Matt Shaver
2000-10-13 05:19:20 UTC
Re: [CAD_CAM_EDM_DRO] Re: step pulse timing resolution
Art Fenerty
2000-10-13 12:07:19 UTC
Re: [CAD_CAM_EDM_DRO] Re: step pulse timing resolution
Jon Elson
2000-10-13 12:21:23 UTC
Re: [CAD_CAM_EDM_DRO] Re: step pulse timing resolution
Jon Elson
2000-10-13 16:24:07 UTC
Re: [CAD_CAM_EDM_DRO] Re: step pulse timing resolution
ballendo@y...
2000-10-13 20:27:20 UTC
Re: Re: step pulse timing resolution
ballendo@y...
2000-10-13 20:53:54 UTC
Re: Re: step pulse timing resolution
Jon Elson
2000-10-13 23:34:21 UTC
Re: [CAD_CAM_EDM_DRO] Re: Re: step pulse timing resolution
ballendo@y...
2000-10-14 00:13:36 UTC
Re: Re: Re: step pulse timing resolution
Anne Ogborn
2000-10-14 00:41:36 UTC
Re: [CAD_CAM_EDM_DRO] Re: Re: step pulse timing resolution
Art Fenerty
2000-10-14 05:12:10 UTC
Re: [CAD_CAM_EDM_DRO] Re: Re: step pulse timing resolution
Terry Ackland
2000-10-14 06:11:58 UTC
Re: step pulse timing resolution
Art Fenerty
2000-10-14 10:51:37 UTC
Re: [CAD_CAM_EDM_DRO] Re: step pulse timing resolution
ballendo@y...
2000-10-14 11:54:21 UTC
Re: step pulse timing resolution
Alan Marconett KM6VV
2000-10-14 12:22:12 UTC
Re: [CAD_CAM_EDM_DRO] Re: step pulse timing resolution