G-code for Ornamental Turning


Overview

G-code is the language most computer-controlled machines are programmed in. A G-code program is a list of lines, each telling the machine to move, or to change how it moves. It is standardised (RS274/NGC, ISO 6983), so the same ideas work on most controllers - LinuxCNC (and so Rosetta), the LatheEngraver, and many others - though each controller has its own details.

On an ornamental turning machine, the usual axis letters are:

  • X - the cross slide: the cutter moving towards or away from the work's centre (rocking, on a rose engine).
  • Z - along the lathe's bed (pumping, on a rose engine).
  • C (or A or B) - turning the work, in degrees.
  • U, V, W - extra slides, such as a curvilinear slide.

This page covers a few ideas that matter for ornamental turning in particular. The controller's own G-code reference covers the rest (see More Information, below).

######################################################################## ### Usage Notes ########################################################################

Usage Notes


 

Working from Where the Cutter Starts

On a rose engine, the turner sets the cutter against the work by eye. A G-code program for ornamental work is usually written the same way: it moves the cutter from wherever it is, not to fixed positions. There are two ways to do this:

  • Relative moves (G91): every move is a distance from the last position.
  • Reading the start position at the beginning of the program, and adding the pattern's moves to it. (In LinuxCNC, the current position of each axis is in parameters #5420 to #5428.)

Either way, the program does not need to know where the work's centre is - but the pattern's size and shape still depend on where the cutter starts. A rosette's or geometric chuck's pattern is worked out for one radius: started further out, a pattern cut by rocking comes out rounder; further in, it comes out sharper, or even turns inside out (see the de la Condamine effect).

So the cutter has to be started at the right distance from the axis the work turns on. That distance is hard to measure: the axis is inside the spindle, and on some machines the headstock itself moves.

The check circle

A simple program finds it. Turn the work one full turn with every slide standing still: the cutter draws a circle round the work's axis, and its diameter is twice the cutter's distance from the axis.

(Check circle: one turn of C, nothing else moving)
G20            (inches - G21 for mm)
G91            (relative moves)
G94 G1 C360 F720   (one turn, at 720 degrees a minute = 2 rpm)
G90            (back to absolute moves)
M2
  1. Set the cutter lightly against the work where the pattern will start, and run the check circle.
  2. Measure the circle's diameter.
  3. If it is smaller than it should be, move the cross slide out by half the difference; if larger, move it in. For example, if a circle that should be 3" across comes out 2 1/8", move out by 7/16".
  4. Run it again, until the circle is the right size.
  5. Without moving the cross slide, run the pattern.

On a paper chuck the circle does no harm; on finished work, set the radius on a scrap piece first.


 

Cutting Curves: Many Short Straight Moves

A controller moves in straight lines (G1) and arcs of circles (G2, G3). A rosette or geometric chuck pattern is neither, so it is cut as many short straight moves, each turning the work a little while the slides move a little.

Each straight move cuts slightly inside the true curve. The gap in the middle of a move is about

gap = (length of move)2 ÷ (8 × radius of the curve)

So, to stay within 0.0005" on a curve of 1" radius, each move can be about 0.063" long - about 3.6° of a turn, or 100 moves a turn. Tight curves and sharp points need shorter moves; gentle curves can take longer ones. Too few moves leaves flats; too many makes a long program, and can make the machine slow down between moves.


 

Setting the Speed: Inverse Time Feed (G93)

In ordinary G-code (G94), the feed rate F is a speed: inches or mm a minute along the slides, or degrees a minute when only a rotary axis moves. When a move turns the work and moves a slide, controllers differ in how they read F, and none of them gives the speed at which the cutter actually crosses the work's surface - which depends on how far from the centre the cutter is.

Inverse time feed (G93) solves this. In G93, F on each line says how long that move takes: F = 1 ÷ the move's time in minutes. So F 1200 means the move takes 1/1200 of a minute (0.05 seconds), whatever the axes involved. The program can then work out each move's time from the speed it wants along the pattern:

time = length of the move along the pattern ÷ cutting speed
G91 G93        (relative moves, inverse time feed)
G1 X-0.0042 C3.0 F1500   (this move takes 1/1500 minute = 0.04 s)
G1 X-0.0039 C3.0 F1600
G1 X-0.0035 C3.0 F1700
G94 G90        (back to units per minute, absolute moves)

Things to know:

  • In G93, every move line must have its own F - LinuxCNC, for one, stops with an error if it is missing.
  • Put the controller back to G94 at the end, or the next program's moves may be read wrongly.
  • Near the work's centre, the work has to turn fast to keep the same cutting speed: at 0.05" from the centre, 0.5" a second needs nearly 100 rpm. Where the machine can't turn that fast, the controller slows the move down, so the program takes longer.

 

Other Things to Watch

  • Diameter mode. A controller set up as a lathe may read X as a diameter (in LinuxCNC, G7), so every X move is halved. A program cutting a pattern on the face usually wants radius mode (G8).
  • Test first. Run a new program in the air, or on a paper chuck, before cutting work. Start with a small amplitude or size and check the moves are the size you expect.
  • Keep the settings in the program. A comment line at the top with the pattern's settings (rosette, lobes, amplitude, stages, start radius...) means the program can be understood, and cut again, later.

######################################################################## ### More Information ########################################################################

More Information

Published Articles

Books and Papers

Web Sites

Presentations

Other

########## Standard Footer for all pages ##########

About this Site

Disclaimer: eMail comments to me at OTBookOfKnowledge @ Gmail.com. The process of woodturning involves the use of tools, machinery and materials which could cause injury or be a health hazard unless proper precautions are taken, including the wearing of appropriate protective equipment.