GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

Programming Guide

4 Axis CNC Programming Guide

This guide covers how a fourth rotary axis changes setup, work offsets and toolpath strategy on a vertical mill. It is written for design engineers and CAM programmers who need to decide whether a part should run 3, 4 or 5 axis. Read it to judge whether your geometry justifies the extra setup work.

Indexed vs simultaneousØ400 mm rotary table±0.005 mm tolerance
CNC Programming and Processing Guide
Scope

What the fourth axis actually adds

One rotary axis, and a different way of thinking about datums.

Fundamentals

How a fourth axis changes the machine and the program

A standard 3-axis mill moves the tool in X, Y and Z. A 4-axis machine adds one rotary axis, usually the A axis turning about X, or the B axis turning about Y. The workpiece rotates while the tool stays on its linear path. That single change removes the need to re-fixture a part on four different faces. The operator loads it once and the table indexes or rotates through the required angles.

In the program this shows up as rotary coordinates alongside linear ones. On a Fanuc-style control you see A values in the same block as X, Y and Z. The post-processor decides whether those A moves are indexed (table locks, then cut) or simultaneous (table turns while the tool feeds). Both are valid. They are not the same operation, and they do not need the same CAM strategy.

The practical gain is access. A shaft with cross-drilled holes, a manifold with ports on several sides, or a bracket with features at 45° to each other can all be reached without a second op. Fewer setups means fewer datum transfers, and datum transfers are where most of your tolerance stack comes from.

  • 1
    Rotary axisA axis about X, B axis about Y. Check which one your post outputs.
  • 2
    Indexed moveTable rotates, locks, then cuts. Rigid and easy to verify.
  • 3
    Simultaneous moveTable turns during the feed. Needs CAM support and post tuning.
  • 4
    Setup countThe main reason to choose 4 axis over 3 axis.
Selection

When 4 axis is the right call, and when it is not

Choose 4 axis when the part has features on multiple faces, or when features sit on a cylindrical surface. Cross holes in a shaft, radial slots in a collar, flats milled on a turned diameter, helical oil grooves. These are classic 4-axis jobs. The rotary axis keeps the tool normal to the surface and lets you cut around the part in one continuous pass.

Stay with 3 axis when all features are reachable from one direction. Adding a rotary axis adds setup time, adds a rotary positioning error to your stack, and adds CAM programming hours. If a part fits in a vise and every feature is on top, 4 axis only makes it slower.

Go to 5 axis when the surface is organic and the tool must tilt continuously. Impeller blades, turbine vanes, deep contoured pockets with undercuts. These need two rotary axes moving at once so the tool can reach around the geometry without collision. A single rotary axis cannot tilt the tool relative to the part, so it cannot solve an undercut.

There is a middle case worth naming. A part with a few angled faces can often run on a 3-axis machine with an angle plate or a sine vise. That is cheaper than reprogramming for a rotary table, provided the angles are few and the tolerance is not tight. Once you need four or five different angles, or the angles must repeat within ±0.005 mm, the rotary table wins.

  • 1
    Good for 4 axisShafts, collars, manifolds, parts with radial features.
  • 2
    Better on 3 axisSingle-face parts, simple plates, low quantity.
  • 3
    Requires 5 axisUndercuts, organic surfaces, continuous tilt.
Comparison

3 axis vs 4 axis vs 5 axis at a glance

Use this to pick the machine class before you write a single toolpath.

Criterion3 axis4 axis5 axis
Rotary axesNoneOne (A or B)Two (A + C, or B + C)
Typical setups per part2–41–21
Cross holes and radial slotsNeeds refixtureSingle setupSingle setup
Undercuts and organic surfacesNot reachableNot reachableContinuous tilt
CAM effortLowMediumHigh
Typical tolerance on position±0.01 mm±0.005 mm±0.005 mm
Best part shapePrismatic, one faceCylindrical, multi-faceComplex contoured
Setup

Setting up the rotary axis and work offsets

The rotary table has a center of rotation. Every program depends on knowing where that center is in machine coordinates. If your CAM model assumes the center is at zero and the real table is 0.2 mm off, every indexed feature rotates around the wrong point and the error grows with radius. Measure the center once and store it in the control as a permanent offset.

Work offsets come next. For a part mounted on the rotary table, the usual pattern is G54 for the main face and G55 for a secondary face, or a single offset combined with a rotary shift. Use the same work offset for all indexed positions wherever the control allows it. Switching offsets mid-cycle invites a transcription error that no inspection report will catch until the part is off the machine.

Clamping matters as much as the offsets. A rotary table has to hold the part against cutting force in every indexed position, and the weakest position is usually the one where the part hangs furthest from the table face. Keep the overhang short. Support long parts with a tailstock, and check that the tailstock center agrees with the table center within a few microns.

For tall parts, watch the swing diameter. A Ø400 mm table does not mean a Ø400 mm part can rotate freely. The part plus fixture must clear the machine enclosure, the guards and the tool changer. Verify the swing envelope before the first cut, not after.

  • 1
    Find the centerMeasure table center of rotation, store as a permanent offset.
  • 2
    Keep offsets simpleOne work offset for all indexed positions where possible.
  • 3
    Mind the overhangLong parts need a tailstock aligned to table center.
Toolpaths

Indexed moves, simultaneous moves and post-processor checks

Indexed programming is the safer default. The table rotates to an angle, locks, and then the tool cuts a normal 3-axis toolpath from that orientation. Your existing 3-axis strategies still work. The CAM software only needs the correct stock model and a rotary transform. Most shops start here and stay here for the majority of work.

Simultaneous programming is where the fourth axis earns its keep on curved geometry. Think of a helical groove wrapped around a cylinder, or a lobe profile on a camshaft. Here the A value changes continuously with X, and the post must convert a wrapped 2D path into coordinated linear and rotary motion. Not every post handles this well. Test on scrap before running a production part.

Check three things in the posted code. First, that the rotary direction and sign match the real machine. Second, that the feed rate in simultaneous blocks is expressed in degrees per minute or in inverse time, not in mm/min, or the control will interpret it wrongly. Third, that safe retract heights clear the part in every indexed position, including the ones where the part is standing up.

Collision checking is not optional once the part rotates. Simulate the full cycle with the fixture and the tool holder in the model. Rotary moves are where holders crash into tables, and a crash at 4,000 rpm is expensive.

  • 1
    IndexedRotate, lock, cut. Reuse 3-axis strategies.
  • 2
    SimultaneousContinuous A motion with X feed. Post must output inverse time.
  • 3
    Simulate everythingInclude fixture and holder in the collision model.
Tolerances

Tolerance, surface finish and material notes

The rotary axis adds one more error source to the stack. Positioning error at the table shows up as angular error, and angular error becomes linear error at the part radius. A 0.01° error is 0.017 mm at a 100 mm radius. Keep that in mind when you specify true position on a bolt circle. If the circle is large, the angular tolerance is doing more work than you think.

We hold ±0.005 mm on critical features and inspect 100% of parts before shipment. Surface finish depends on the operation: Ra 0.8–1.6 μm is normal for milled faces, Ra 0.2–0.8 μm for fine finishing passes. A rotary axis can improve finish on cylindrical surfaces because the tool stays engaged and the feed is continuous, which avoids the witness marks you get from stopping and restarting at each index.

Material choice affects the rotary strategy less than you might expect, but it affects speeds and feeds a lot. Aluminum 6061 and 7075 cut freely and tolerate higher rotary feed rates. Stainless 316 and 17-4PH work-harden, so keep the tool engaged and avoid dwelling during a simultaneous move. Titanium Ti-6Al-4V and Inconel need lower surface speed and rigid setups, which usually means shorter overhang and a tailstock.

If the part is a one-off prototype, the programming time can exceed the machining time. Ask whether the geometry truly needs the fourth axis, or whether a 3-axis setup with an angle plate reaches the same features. We run both and will tell you which one is cheaper for your drawing.

  • 1
    Angular error scales with radius0.01° becomes 0.017 mm at 100 mm radius.
  • 2
    Finish on cylindersContinuous rotary feed avoids index witness marks.
  • 3
    Hard materialsKeep the tool engaged, avoid dwell in simultaneous moves.
FAQs

Common questions about 4 axis CNC programming

Can I program 4 axis with standard CAM software?

Yes for indexed work. Most CAM packages handle 3+1 indexing with a rotary transform and a post that outputs A or B values. Simultaneous 4-axis toolpaths, where the rotary axis moves during the cut, need a CAM module that supports it and a post tuned to your control.

If your CAM cannot output simultaneous motion, you can still machine wrapped features by unwrapping the geometry into a 2D path and using a rotary post. It works for simple grooves and slots but is awkward for complex surfaces.

What is the difference between 3+1 and true 4-axis machining?

3+1 means the rotary axis positions the part and then locks. The cut itself is a normal 3-axis cut. True 4-axis means the rotary axis moves while the tool is feeding, so the tool follows a path around the rotating part.

3+1 is easier to program, easier to verify and usually more rigid. True 4-axis is needed when the feature wraps continuously around the part.

How do I choose between a 4-axis mill and a mill-turn center?

A 4-axis mill rotates the part about one axis while milling. A mill-turn center combines turning and milling in one machine and can also index or rotate the spindle. If your part is mostly cylindrical with milled features, mill-turn is often faster.

If the part is mostly prismatic with a few features on different faces, a 4-axis mill is the simpler choice. We run both and match the machine to the part geometry.

What tolerances can a 4-axis setup hold?

We hold ±0.005 mm on critical features, with 100% inspection before shipment. The achievable tolerance depends on the feature. A diameter cut on the rotary axis is easier to hold than a true position on a large bolt circle, because angular error grows with radius.

Tell us which dimensions are critical. We will flag any feature where the rotary setup makes the tolerance hard to hold and suggest an alternative.

How do I prepare a model for 4-axis programming?

Model the part in its as-machined orientation, with the rotary axis at a known location. Include the fixture and the stock in the CAM setup so collision checking is meaningful.

If you send us a STEP file, note which face is the datum and where the part should sit relative to the rotary center. That one piece of information saves a setup iteration.

Do you offer DFM feedback on parts that might need 4 axis?

Yes. We return a quotation and a free DFM analysis within 12 hours. The analysis covers whether the part needs 4 axis, 5 axis or plain 3 axis, and points out features that will be difficult to reach or measure.

Uploads are secure and confidential. An NDA is available on request.

Send a drawing, get a machining plan

Tell us which features are critical. We will come back with a quote, a DFM note, and a clear answer on whether the part runs better on 3, 4 or 5 axis.

12-hour quoteFree DFM analysis100% inspection

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC