Skip to content

CNC programming: from CAD drawing to G-code

How you work with electrical installations safely

A tool starts as a drawing on screen and ends as movements in a machine that removes material with accuracy to thousandths of a millimeter. The path in between goes through CAD/CAM and CNC programming—the ability to plan and execute tool component manufacturing from working drawings and using conventional and CNC-controlled machining equipment, as the decree formulates it.

§From 3D model to tool path in CAM

When the construction is drawn finished in CAD, it's imported into a CAM program, where you define which tools (mills, drills) should be used, in what order operations should run, and how fast the machine should go. The CAM program calculates the tool path itself—the precise route the tool must follow across the part—and translates it into a CNC program the machine can understand.

§G-codes and M-codes — the machine's language

CNC programs are made up of G-codes that control movement and M-codes that control machine functions such as spindle and coolant. It is the same basic code structure regardless of whether you are programming a milling machine or a lathe although details vary from control to control.

CodeMeaning
G00Quick positioning without processing
G01Linear movement with cutting
G02 / G03Circular movement with and against the clock
M03 / M05Spindle speeds

§5-axis milling and high-speed machining

On more advanced tool components, an ordinary 3-axis milling machine is not always enough — especially not on complex curved surfaces with slanted walls and curved transitions. 5-axis milling adds two extra rotation axes so the tool can always stand optimally in relation to the workpiece, while high-speed machining (HSM) uses high speeds and small chip thicknesses to machine hardened steel quickly and with a surface that requires less finishing.

§Simulation and collision check

Before a new program is run on the actual machine, it is simulated on screen so you can discover collisions between tool, clamping, and piece before they happen in reality. The first run on the machine also often happens in single-block or reduced speed so you can intervene if something doesn't match.

§Zero points and clamping

The machine must be equipped with one or more emergency stops that can quickly stop a dangerous movement. The emergency stop is designed so it remains in stop position after activation — it must be actively released and the machine consciously restarted so it does not suddenly start again on its own. The emergency stop is a last resort not the daily stop button: good work consists of avoiding the situation where the emergency stop is the only thing between you and an accident.