jario_
Back to overview

CNC Basics · Chapter 1

Coordinates and rapid traverse

Picture graph paper. With two numbers you can find any point on it: so far to the right, so far up. A CNC machine works the same way. The program gives it numbers, and it moves the tool to the point they describe. In this chapter you learn how to describe points and send the machine there. Nothing is drilled yet.

The coordinate system

The workpiece is a block of 100 × 60 × 40 mm. Three axes describe every point:

  • X points to the right.
  • Y points to the back.
  • Z points up.

All numbers are millimetres. The zero point X0 Y0 is the front left corner. At Z0 lies the surface of the workpiece. Whatever is above it has a positive Z, whatever is in the material a negative one. The machine starts at X0 Y0 Z50, 50 mm above the workpiece.

Blocks and words

A program is made of lines called blocks. Each block is one command and is made of words: a letter and a number, for example X20 or G00. Text in brackets is a comment that the machine skips. The end of the program is M30.

G90 switches to absolute dimensions: every number is measured from the zero point. X60 always means "60 mm from the zero point", wherever the tool is at the moment. The words G21 and G17 in the header line are explained in the next chapter.

Rapid traverse with G00

G00 is rapid traverse: the machine moves to the target in a straight line as fast as possible. You give only the axes you want to change. If an axis is missing, it stays as it was.

Rapid traverse is only meant for positioning in the air. Inside the material the machine must not move at rapid speed.

(Three points with rapid traverse)G90 G21 G17G00 X20 Y15   (20 mm right, 15 mm back from the zero point)G00 X60 Y15   (only X changes)G00 X60 Y45M30

Safe height

Z50 is the safe height. There the tool hits nothing. For every move: first up, then sideways, then down. You move sideways only at the safe height. Rapid traverse always ends at Z0 or higher, in the example at Z5.

(Safe height: up, sideways, down)G90 G21 G17G00 X25 Y30   (move over the point)G00 Z5        (down, still above the surface)G00 Z50       (up to the safe height)G00 X75 Y30   (sideways only at the safe height)G00 Z5G00 Z50M30

Common mistakes

  • Comma instead of point

    The machine only knows the decimal point. X42,5 is not a word to it but an error. Write X42.5.

  • Rapid move into the material

    Moving below Z0 with rapid traverse is forbidden. The machine shows an alarm. Inside the material you will later only move with a feed rate.

  • Sideways first, then up

    If you move sideways before lifting, the tool scrapes the workpiece. Remember the order: up, sideways, down.

  • Forgetting M30

    Without M30 the machine does not know the end and shows an alarm. Every program ends with it.