Hello guys! Very hope anybody can help. Sometime i made small gears. Problem - teeth are not straight, - with different inclination. I try to change degree, but not work. Sure i made something wrong. I try to change XY (G17) to XZ (G18) plane and several another G codes. Of course very simple to enter coordinates of start and end points. But very not convenient. Often necessary to change degree "on the fly". More better start point, degree of motion and end of Z movement. Can anybode help me solve this trouble. I attach sample code and picture explained what i mean. Controller is Mach3. Thanks to all!
G code Z degree movement-sample.jpg
G17 G90 G54 G49 G40 G80 G50
G21
M6 T1 (Tool Change)
M3 S2500 (Start Spindle)
M8 (Turn Coolant On)
G0 G64 A0.0 F10000
G43 H1
G0 G54 X0 Y0.0
G0 Z0

M98 P0001 Q120
G0 Z0

G1 X-2 F3500
G1 A0 F10000
G0 X0

M5(Stop Spindle)
M9(All Coolant Off)
M30(Rewind)
O0001
G1 X0 F3500
G01 Z-1.65 F800
G01 Z-1.92 F20
G01 Z-2 F10

G01 X-3.8 Z-5 F250(Here need to enter degree of movement)

G01 X-4Z0 F3000
G91 A3F10000
G90
M99