Lathe Axis C Customization
In this page i'm gonna show you how to customize the output code for Lathe Axis C operation.
This g-code is used to mill a square side 10 mm, with a depth of 5mm.
Click here to download the machine definition we are going to create in this tutorial.
Put in the machine directory and select to use it. Read this documentation to add a new machine definition.
Default machine folder is this :
C:\Users\<user-name>\Documents\eCam\Machine
Original Output Code
%
O2(SQUARE SIDE 10)
N5
(CONTOUR)
M8
M69
G98G18M45
G0G28H0
G50S500
(END MILL D 10MM)
G0T0202
G97S4775M13
G0X22.Z2.
G112
X-10.C15.5
G1Z0.5F2000
Z-5.F205
C10.F310
X10.F621
G2X20.C5.I0.J-5.
G1C-5.
G2X10.C-10.I-5.J0.
G1X-10.
G2X-20.C-5.I0.J5.
G1C5.
G2X-10.C10.I5.J0.
G0Z2.
G113
X22.
G53X0.Z0.
M1
M5
M9
M46
M30
%
Desired Output Code
%
:0001
N1 (SQUARE SIDE 10MM)
N2 G28 U0
N3 ( END MILL D=10 )
N4 T0202
N5 G43
N6 G17
N7 M43
N8 G28 C0
N9 G98 G97 S3200 M13
N10 G0 Z200.
N11 G12.1
N12 X15 C0
N13 Z0.
N14 G1 Z-5. F320
N15 X10.
N16 C-5.
N17 G2 X5. C-10. I-5. J0.
N18 G1 X-5.
N19 G2 X-10. C-5. I0. J5.
N20 G1 C5.
N21 G2 X-5. C10. I5. J0.
N22 G1 X5.
N23 G2 X10. C5. I0. J-5.
N24 G1 C-0.109
N25 G1 X15 C0
N26 G0 Z0.
N27 Z3.
N28 G13.1
N29 M40
N30 M15
N32 G28 U0
N33 (ZMIN -5MM)
N34 M30
%
Post-Processor editing
Open the edit machine dialog.
It's better if you use the search box field to filter the properties and find faster what you need.
a) Numeration
- [ Force Line Numeration ] = true
- [ Numeration First Number ] = 1
- [ Numeration Increment ] = 1
b) G-CODE HEADER
- [ Program Number Format ] = 0000
- Template [Head New Program ] =
%{NO_LINE_N} :{PRG_NUM}{NO_LINE_N}
c) Axis C - Live Tool Operation Header
- Template [ Operation (WITH LIVE TOOL) head code ] =
({OP_DESC})
{ORIGIN}
{COOLANT_CODE}
G0G28U0
(Z MIN {MIN_Z_VALUE} mm )
({TOOL_LABEL})
T{TOOL_POS}{TOOL_COR}
G43
G17
M43
G28C0
{FEED_MODE}{SPEED_MODE}S{SPEED_VALUE}{SPINDLE_ORIENTATION}
d) G112 / G113 codes
- [ Active Polar Coordinate ] = G12.1
- [ Deactive Number Format ] = G13.1
e) Radial X in G112 mode
In the result output code we need to express the x coordinate in radial value.
To get this we are going to switch this tag {COO_X_DIA} with this tag {COO_X} in this following templates :
- Template [ Linear Mode - LIVE TOOL ] =
{MOVE_MODE}{COMP_CODE}{COO_X}{COO_Y}{COO_Z}{FEED_CODE}
- Template [ Arc Mode - LIVE TOOL ] =
{MOVE_MODE}{COMP_CODE}{COO_X}{COO_Y}{COO_Z}{ARC_I}{ARC_J}{FEED_CODE}
f) G-Code FOOTER
- Template [ End Program ] =
M15 M40 M30 %{NO_LINE_N}
g) Force Spaces Between code ( OPTIONAL)
- [ Force Spaces ] = true