Creating a Lathe G code file
The basic steps to create G code for a profile to be turned on a lathe is:
-
Create a Qcad drawing of the profile.
-
Have the Arc Generator for Lathes as an External Tool in Gedit.
-
Open the Property Editor in Qcad and doc it to the side bar.
-
Click on each entity and use the data to create your G code.
Make a drawing of a profile
-
Open Qcad and if the Property Editor is not visible go to View > Property Editor. Dock the Property editor in your favorite place.
-
Draw the part as if you are sitting on the spindle and looking down on the part with the tooling side on the right of the drawing.
-
In Gedit start a new document and click on Tools > External Tools and what ever you named the Lathe Arc Generator. Make sure your cursor is on the first line in the document then click Send Preamble in the Lathe Arc Generator.
-
Save the file in linuxcnc/nc_files as lathe01.ngc
-
Add a tool if your lathe needs one with T2 M6 G43
-
Add a rapid move to the clearance point of your start move. Click on the entry move in Qcad and note the Start Point in the Geometry of the Property Editor. The Y: is the Z in a lathe.
-
Add a feed move to the end of the first line with G1 X0.000 Z-0.100 F25.
-
Add a second feed move to the end of the second line with G1 X0.100 Z-0.100
-
Skip a few lines and add a M2 so the program will load without errors. Put the cursor at the blank line after the rapid move.
-
You should be able to load the G code in the Axis Lathe Simulator without errors.
-
Click on the first arc in Qcad and using the info in the Property Editor with the Lathe Arc Generator create your first arc.
-
Click Send Arc and the arc is sent to the Gedit document.
-
After each insertion of G code reload the file in Axis to test the validity of your addition.