Hello Guest it is March 28, 2024, 10:27:14 AM

Author Topic: G16 and G83 interaction (again)  (Read 4368 times)

0 Members and 1 Guest are viewing this topic.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
G16 and G83 interaction (again)
« on: December 02, 2017, 01:20:26 AM »
Hi all.

The Mach3Mill manuals states (10-19) that you can put Mach3 into polar mode, but that this only works for G0 and G1 instructions (Note 1, 10-20). I have no problems so far.

But the same part of the manual goes on to provide an example which drills holes on a circle using a G83 instruction, ignoring the restriction in Note 1. At least on my system, programming a ring of holes this way produces a screenful of rubbish. Trying to run the code does likewise. Changing the G83 instruction (or G81) to a simple G1 results in the program working perfectly.

My interpretation is that the command sets a flag saying 'polar', but that only G0 and G1 check this flag. Executing G0 x10 y20 works fine, and saves 10 and 20 in the 'current X&Y registers'. But note that these are POLAR values. If you then issue a G83 z-5 instruction, the interpreter first sends the spindle to X=10 Y=20 and then does the peck drill. But these are CARTESIAN coordinates!

This is as expected if you believe the restriction in Note 1 that polar coords only work for G0 and G1 instructions. It is a pity that the example in the manual violates that restriction.

Or do others get different results?

Cheers
Roger
PS: Brian Barker's hole drilling wizard uses the G83 instruction - but does NOT use polar coords. Of course it works fine.

« Last Edit: December 02, 2017, 01:25:50 AM by rcaffin »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #1 on: December 04, 2017, 07:49:48 AM »
rcaffin,

Are the pages you refer to correct?

RICH

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #2 on: December 04, 2017, 08:03:46 AM »
I have not used the g15 g16 commands, BUT, not sure your interpretation is correct.
One needs to be carefull how they are using the G0 and G1 when in G16.  
Guess I need to play some with the code and see how it works and compare to what the manual says...............whenever that may be ......

RICH
« Last Edit: December 04, 2017, 08:05:52 AM by RICH »

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #3 on: December 04, 2017, 03:31:13 PM »
Hi Rich

From my experiments, I would say that the restrictions on 10-20, that you can only use G0 and G1 within a G16/G15 scope, ARE correct.
But the example included in the manual which uses the G83 instruction withing a G16/G15 scope is NOT correct. (I tried it out.)

My suspicion is that EITHER the example was written down but never checked, OR that the example may have worked a few years/versions ago, OR that the NIST Standard meant it to work but it was never implemented correctly. Dunno which one. I note that the same text and example are found in the Mach2Mill manual.

On the other hand, the G16 instruction is not listed in the HAAS manual for the VF/-HS series. HAAS do list a couple of bolt holes in a circle codes.

Cheers
Roger

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #4 on: December 07, 2017, 05:46:38 PM »
There a several ways it can be done here is one.


F20 F90
G0 X0 Y0 Z0

G16

G83 X3 Y0 Z-1 F10

G83 X3 Y45 Z-1 F10

G83 X3  Y90  Z-1 F10

G83 X3 Y135  Z-1 F10

G83 X3 Y180 Z-1 F10

G83 X3  Y225  Z-1 F10

G83 X3 Y270 Z-1 F10

G83 X3 Y315 Z-1 F10

G15
G0 X0 Y0
G90
M30
Re: G16 and G83 interaction (again)
« Reply #5 on: December 07, 2017, 06:05:47 PM »
Hi BR549,
good to hear from you...

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #6 on: December 07, 2017, 06:39:19 PM »
Hi Terry

Bit of a problem with that code.
For a start, it won't load under Mach3 as it has TWO feed instructions on the 1st line: F20 and F90. That is not permitted.

Then there is the strange business of telling Mach3 that the Feed is 20, then that it is 90, then each G83 line has an F10 at the end. Methinks the CAM program used here is a shade wonky, or at least the post is.

Then we come to the real humdinger. One can put the X and Y values in the G83 instruction explicitly on every line, as your example shows, or one can do what the Mach3 manual shows on 10-19, and replace the explicit X&Y values with an intermediate G0 instruction. The following extract shows the Mach3 manual version.
g0 x3 y45
g83 z-1
Yes, this is legal by itself, as long as the g83 instruction is not missing the X, Y and Z values (see 10-26).
Going on from here, if the Z-1 is omitted in all lines except for the first g83 (but X & Y are included), that too works fine. The previous Z value is retained.

BUT BUT BUT
The first two versions (explicit and implicit X & Y values) give wildly different results in polar mode.
With the X & Y values explicit in every g83 instruction, it works. See Test1RNC.jpg
But without the explicit X & Y in every g83, relying on the previous g0 to set them up, then you get a total disaster. See Test2RNC.jpg for this.

My conclusion is that when the g83 instruction is interpreted, if Mach3 has to go get previous values for X & Y, the program stuffs up. There is a major bug in the code.

OK, in the spirit of free enquiry, what happens if one makes the Y explicit but not the X? Like this
G16
G83 X3 Y0 Z-1
G83 Y45
G83 Y90
G83 Y135
G83 Y180
G83 Y225
G83 Y270
G83 Y315
G15
Oh Dear. More strange things! See Test4RNC.jpg to see.

Well, there's a bug. Know about it and work around it.

Cheers
Roger
« Last Edit: December 07, 2017, 06:46:01 PM by rcaffin »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #7 on: December 08, 2017, 09:49:15 AM »
A lot of things hinge on IF you are in G90 or G91 mode. Yes I fat fingered the F90 instead of a G90 (;-) Once you invoke the G16 then all XY moves are Radius(x) and polar values(y) until the G15 is called to cancel the mode.

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #8 on: December 08, 2017, 10:24:02 AM »
Here is another way (normal) to write it in G90 mode.

F20 G90 G20
G0 X0Y0
G16
X3 Y0
G81  Z-1 F10
X3 Y45
X3 Y90
X3 Y135
X3 Y180
X3  Y225
X3 Y270
X3 Y315
G15
G80
M30

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G16 and G83 interaction (again)
« Reply #9 on: December 08, 2017, 10:35:10 AM »
Here is an example in G91 mode. Do keep in mind that at times Mach3 cannot display the toolpath correctly with some gcode programs. OLD bug.

F20 G90 G20
G0x0y0
G91
G16
X3 Y0
G81 X0 Z-1 F10
 Y45
 Y45
 Y45
 Y45
 Y45
 Y45
 Y45
G15
G90
G80
M30