Hello Guest it is April 24, 2024, 01:22:19 AM

Author Topic: G18 display vs G19 tool path display  (Read 3539 times)

0 Members and 1 Guest are viewing this topic.

G18 display vs G19 tool path display
« on: August 08, 2014, 06:16:50 PM »
This is probably one of the gremlins that "is", but does anyone know if an earlier
version of Mach3 displays G18 properly.

This G-code is running in the latest version of Mach3, ver R3.043.067.

For those who have not used it, G17 is the X-Y plane, G18 is the X-Z plane, and G19
is the Y-Z plane.

If you want o cut a half round pocket, moving in the X or Y direction, with a ball mill,
these are the G-codes you would use.


The displays is fine for G19, but the G18 tool path is totally out of whack, but it
cuts correctly.

I spent quite some time trying to correct the G-code, but finally realized it is a
Mach3 problem.

This example works properly.

( G19 G-code example program )
G00 X0 Y0
M6 T3
G43 H3
#11=[0]
G0 X0 Y0 Z.1
G01 Z0.0 F20

M98 p1000 L5
G00 Z.1
G4 P2
G00 Z.5 M5
M30

( G19 subroutine )
O1000
G19 Y-1 X#11 F40
G3 Y1 J0 K0
#11=[#11+.1]
G01 X#11
G2 Y-1 J0 K0
#11=[#11+.1]
m99

If you load the above G-code, the image in the tool path display is a half-round pocket,
1" radius, cut by alternate cw, ccw cutting arcs in the Y-Z plane, advancing .1 with each
arc in the positive X direction. #11 is the parameter used for incrementing the X travel
after each cutting arc.

------------------

( G18 G-code example program )
G00 X0 Y0
M6 T3
G43 H3
#11=[0]
G0 X0 Y0 Z.5
G1 Z0 F10

M98 p1000 L5
G0 Z.5
M30

(G18 subroutine)
O1000
G18 X1 F40
G3 X-1 I0 K0
#11=[#11+.1]
G1 Y#11
G2 X1 I0 K0
#11=[#11+.1]
G1 Y#11
m99

The above G18 G-code is the same basic routine, but the half round pocket is in the X-Z plane,
advancing after each G3, G2 arc in the Positive Y direction. If you loaded the code, the tool
path display shows a complete circle, half above the stock Z0 surface, which is NOT where the
tool ever goes. Running the code shows the machine working correctly, and all the G3 arcs are
cut, but the tool path is not where the G3 arc display shows. The G2 arcs are correct, and
follow the tool path lines.

When I first wrote the code, I thought the coding order was wrong, and kept trying to fix it.
I finally ran the program, and then saw it was the display problem, not incorrect G-code
writing.


John