Hi .
I'm trying to output an operation with thread milling but the gcode output for z position is static.
Code:
(THM_DRILL.NGC)
( 2-AUG-2025)
N1
N2 #12=1
N3 #13=0
N4
N5 #14=1
N6 #15=0
N7 G21 G49 G0 G54 ( ABS mm clr_Z_offset rapid_motion )
(MSG, Óñòàíîâè T1.
N8 M9 (turn all coolant off)
o106 repeat [#14]
o105 repeat [#12]
S3500 M3
G0 X0. Y0. Z25.
N9 M98 P2
N10 g0 x0 y0
N11 g92 x-#13
N12 o105 endrepeat
N13 g92.1
N14 g90
N15 g92 y-#15
N16 o106 endrepeat
N17 g92.1
N18 g90
N19 M30
O2
N20 (
)
N21 (THM-DRILL - THREAD)
N22 (
)
N23 G0 X0. Y0. Z25.
N24 M98 P3
N25 G0 X0. Y0. Z25.
N26 M99
O3
N27 G91 G0 Z-23.
N28 G1 Z-12. F300
N29 G41 G1 X7.379 Y-1.516 F800
N30 G3 X0.286 Y8.692 Z0.12 R6.15
N31 Z1. I-7.665 J-7.176
N32 Z1. I-7.665 J-7.176
N33 Z1. I-7.665 J-7.176
N34 Z1. I-7.665 J-7.176
N35 Z1. I-7.665 J-7.176
N36 Z1. I-7.665 J-7.176
N37 Z1. I-7.665 J-7.176
N38 Z1. I-7.665 J-7.176
N39 Z1. I-7.665 J-7.176
N40 X2.835 Y-7.176 Z0.88 R-10.5
N41 X-6.15 Y6.15 Z0.12 R6.15
N42 G40 G1 X-4.35 Y-6.15
N43 G0 Z24.88
N44 G90 M99
The Z axis stays at 1 mm.
I did discover if you open the machine editor of youre machine and go to Working Style => General and you put Software Transform to YES , the gcode output gives the corect z output:
Code:
N16 (
)
N17 (THM-DRILL - THREAD)
N18 (
)
N19 X0. Y0. Z25.
N20 Z2.
N21
N22 G1 Z-10. F300
N23 G41
N24 G1 X7.379 Y-1.516 F800
N25 G3 X7.665 Y7.176 Z-9.88 R6.15
N26 Z-8.88 I-7.665 J-7.176
N27 Z-7.88 I-7.665 J-7.176
N28 Z-6.88 I-7.665 J-7.176
N29 Z-5.88 I-7.665 J-7.176
N30 Z-4.88 I-7.665 J-7.176
N31 Z-3.88 I-7.665 J-7.176
N32 Z-2.88 I-7.665 J-7.176
N33 Z-1.88 I-7.665 J-7.176
N34 Z-0.88 I-7.665 J-7.176
N35 X10.5 Y0. Z0. R-10.5
N36 X4.35 Y6.15 Z0.12 R6.15
N37 G40
N38 G1 X0. Y0.
N39
N40 G0 Z25.
The problem is there is no more subroutines, the o call does not exist anymore so is M98 , M99.
The post processor is from here:
github.com/G-S-E/SolidCAM-postprocessor-for-LinuxCNC
Thanks