CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] Re: Encoder counts/revolution

on 2002-06-16 14:06:28 UTC
Hi Barry,

That's the beginning of it. Arc's specified by Gcodes are 360 degrees
(a full circle) or less. Therefore normally a modulo operation of 360
works out (if over 360, subtract 360). The interesting part comes when
one starts at say 275.33 (someplace in the 4th quadrant), and ends up
somewhere like 32.45 (1st quadrant). having an ending point be a higher
number then the starting point is desirable (for CCW angles, G03). For
this case one can add 360 to the end angle, and get that. CW angles are
treated in the reverse. Another point, angles may take up to five
quadrants to cut (if they start and end in the same quadrant), and of
course, not all angles start/stop on quadrant boundaries. Cutting
partial and full quadrants is necessary to avoid the reversal of an
axis' motion in mid-cut). Add to that the fact that arctan functions
don't like it when both parameters are zero, and also the range is often
only -pi to pi radians (recall that we sometimes add 2pi, 360 to some
points).

I bring this up because I recently found a bug in arc code that I had
ran (and tested) for over a year. There is a further complication to
our arc calculations, I was working in the III quadrant (-X, -Y). And a
rounding error (wrong direction) pushed my calc's off, causing the wrong
arc to be cut.

Alan KM6VV


curious925072002 wrote:
>
> --- In CAD_CAM_EDM_DRO@y..., Alan Marconett KM6VV <KM6VV@a...> wrote:
>
> Dear Mr. Marconett,
>
> I am not sure but maybe this is the kind of problem you are
> talking about. Suppose a 0-360 degree dial on a rotating shaft
> reads 31.07 degrees at some time and the shaft then rotates say
> through another 2351.35 degrees. Now what does the dial read?
>
> If we add the two numbers we get 2382.42 degrees. Now form
> 2382.42/360 = 6.61783... . Kill the integer part (6.) and
> multiply the result by 360, i.e. 0.61783...X360 = 222.42
> degrees. This is what the dial will read. So the algorithm
> is:
> add the start reading and the amount of advance
> divide by 360
> take the fractional part (i.e. subtract the integer part)
> multiply by 360
>
> Hope this helps.
>
> Sincerely,
> Barry
>
> > Now what I'm having fun with is the calculations needed to calculate
> > moves around arcs. Getting the start angle, and end angles that
> "wrap"
> > around 0 degrees is a problem! Even the quadrant boundaries cause
> > problems in calculations! Anytime something "chases it's tail" as
> in
> > moves around arcs, or circular buffers where a fixed "depth" exists
> > cause similar problems, as I've recently found out!
>

Discussion Thread

vavaroutsos 2002-06-13 15:40:03 UTC Encoder counts/revolution JanRwl@A... 2002-06-13 20:26:42 UTC Re: [CAD_CAM_EDM_DRO] Encoder counts/revolution Jon Elson 2002-06-13 22:50:16 UTC Re: [CAD_CAM_EDM_DRO] Encoder counts/revolution Peter Harrison 2002-06-14 13:44:06 UTC Re: [CAD_CAM_EDM_DRO] Encoder counts/revolution Alan Marconett KM6VV 2002-06-14 21:25:04 UTC Re: [CAD_CAM_EDM_DRO] Encoder counts/revolution curious925072002 2002-06-16 12:13:38 UTC Re: Encoder counts/revolution Alan Marconett KM6VV 2002-06-16 14:06:28 UTC Re: [CAD_CAM_EDM_DRO] Re: Encoder counts/revolution