"Send me a DXF and I'll have the program in no time." Anyone who uses CAM says some version of this. So what is a DXF, and what actually happens between the file and the G-code?
This article walks the route from DXF to toolpath to G-code, one step at a time, for anyone trying CAM for the first time.
What a DXF is: the common language between CAD programs
DXF (Drawing Exchange Format) is a file format for moving drawings between CAD programs. Autodesk created it for AutoCAD, but it became the de facto standard and almost every CAD and CAM package can read and write it.
Inside, a DXF is a collection of geometry: lines, arcs, circles. A lathe CAM picks the part profile out of that collection and uses it to calculate the cutting path.
For turning, all you need is one side of the profile, the section cut lengthwise through the axis. Rather than handing over a full three-view drawing, prepare a DXF with just the profile on it.
Step 1: draw the profile, or get one
First you need the drawing data. There are three usual routes.
- Get a DXF from design — easiest. It will usually carry lines you do not need, dimensions and centre lines, so ask for the profile on its own layer if you can.
- Draw it yourself from a paper print — trace the profile in any free 2D CAD. A turned profile is only lines and arcs, which makes it a good first CAD exercise.
- Type it into the CAM — for a simple part it is often quicker to key the profile coordinates straight in.
Things to watch when you draw the profile
- Keep the geometry connected. If the profile has gaps or overlapping lines, CAM cannot read it as one continuous contour.
- Decide where the origin is. The usual choice is the centre of the face, X0 Z0. You can set it in the CAM, but getting it right from the start saves confusion.
- Draw it full size. It sounds obvious, but drawing data with a scale factor on it causes accidents.
Step 2: load the DXF, then choose operations and tools
Load the DXF and the profile appears on screen. From here it is down to the machinist, and there are three things to decide.
- Operations — OD first or ID, and where the grooving goes
- Tools — which insert, which nose radius, which included angle
- Cutting conditions — depth of cut, feed, surface speed
From that, CAM works out the roughing passes, the finish pass, and coordinates with nose radius compensation already built in. Nobody has to calculate the taper and arc corrections by hand. (How that correction works is covered in the nose radius article.)
Step 3: check the simulation
Before you post the G-code, always watch the tool move in simulation. What to look for:
- The tool does not hit the part, the chuck or the jaws
- Nothing is left on, and nothing is gouged
- The approach and retract moves are safe
- The number of roughing passes and the depth of cut are what you intended
This is the biggest single difference from hand programming. Where you used to load it on the machine and creep through a dry run, CAM lets you check it as many times as you like on screen, without stopping the machine. For bringing on a younger machinist, being able to see how the part is cut is worth a lot.
Step 4: post the G-code and take it to the machine
Once the simulation looks right, output the G-code. Transfer it to the machine on a USB stick or over the network and it runs as it is.
On the first part, CAM output or not, the rule still stands: run it in single block with the feed override turned down. CAM cannot check that the tool offsets in the control match the tools actually in the turret. That part is still yours.
How simple does it get? The LATHE-NC route
If you are worried about how much CAM operation there is to learn, here is the flow in LATHE-NC, the browser lathe CAM I build. There are three steps.
- Load a DXF (or type the profile in)
- Check the simulation (you see the stock come away in 3D)
- Output the G-code (nose radius compensation already calculated)
It runs in a browser, so there is nothing to install, and it works on an iPhone. Writing tomorrow's program on your phone during a break is a genuinely practical way to use it.
Summary
- DXF is the common CAD drawing format. A lathe CAM only needs one side of the section profile.
- The route is: prepare the profile, set operations, tools and conditions, check the simulation, post the G-code.
- Coordinate maths and nose radius compensation are CAM's job. Tool choice and the final check are yours.
- Run the first part in single block. That rule has not changed just because CAM wrote it.
DXF to G-code in three steps, even on a phone.
LATHE-NC, lathe CAM in your browser. Nothing to install, works on iPhone.
The beta is free for the first 100 users.