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

Get Instant Quote

CNC Setup Guide

How to Carry Out the Automatic Locking Function of CNC Machine Tools

A shop-floor guide for machinists and process engineers. It covers how cnc machine tools locking is wired, how to set clamp pressure and confirm feedback, and when a simple spring clamp is the better choice.

Clamp pressure setupM-code sequencingSensor feedbackSafety interlock
CNC machine tools locking an engine part with an automatic clamp during 5-axis machining
Quick answers

Key takeaways

Locking is a sequence, not a buttonClamp, confirm, then cut. The M-code order matters more than the clamp brand.
Air pressure sets the holding forceMost pneumatic vises run 0.5–0.7 MPa. Below 0.4 MPa the part can shift under a roughing pass.
Confirm with a sensor, not a timerA pressure switch or proximity sensor proves the clamp closed before the spindle moves.
Soft jaws save thin partsBelow 3 mm wall thickness, use machined soft jaws and cap clamp force at 60% of rated.
Test on scrap firstRun one air-cut cycle and one light pass before committing a production part.
Fundamentals

What cnc machine tools locking actually does

Automatic locking holds a workpiece or a pallet in a fixed position without an operator turning a wrench at the machine. On a vertical mill this is usually a pneumatic or hydraulic vise, a zero-point pallet system, or a chuck on a mill-turn center. The control drives it through an M-code, waits for a confirmation signal, then allows the cycle to continue.

The point is repeatability and safety, not speed alone. A manual clamp that a tired operator tightens by feel gives different holding force at 06:00 and at 22:00. A regulated air line does not. That consistency is what keeps a ±0.005 mm bore round across a 500-part run.

Automatic locking also protects the operator. If the clamp signal never arrives, the control should stop the cycle and raise an alarm instead of starting the spindle. That interlock is the single most important part of the system, and it is the part most often bypassed during troubleshooting.

We machine parts from one prototype to 10,000+ piece runs on 127 CNC machines, so the setup advice below comes from production floors, not from a manual.

  • 1
    Workpiece lockingVise, chuck or fixture holds the part itself.
  • 2
    Pallet lockingZero-point system locks the whole tombstone or pallet.
  • 3
    Tool lockingDrawbar and spindle taper clamp the tool holder.
Hardware

Choosing the clamp type before you touch the control

Match the clamp to the part, not to what is already bolted to the table. A 6061 aluminum bracket with a 6 mm wall wants light, even pressure over a wide area. A 4140 steel shaft with a 40 mm diameter can take a hard hydraulic grip. Putting a thin wall in a hard jaw is how you get a crushed bore and a scrapped part.

Pneumatic clamps are the default for aluminum and plastics. They are fast, clean, and easy to regulate. Holding force typically lands between 3 kN and 12 kN depending on bore size and line pressure. Hydraulic clamps are for steel and titanium, or for any cut where chatter appears at moderate depth.

Zero-point pallet systems are worth the cost when the same fixture family repeats for months. They lock a pallet in seconds and repeat position to a few microns. On short prototype runs, the setup time to drill and pin a dedicated plate is often lower than the cost of the pallet hardware.

Magnetic and vacuum chucks have a narrow window. Use magnetic chucks on ferrous plate that is at least 10 mm thick. Use vacuum on flat, non-porous plate with good surface finish. Both lose holding force fast on rough or warped stock.

  • 1
    Pneumatic viseAluminum, brass, plastics. 0.5–0.7 MPa line pressure.
  • 2
    Hydraulic clampSteel, stainless, titanium. Higher force, slower cycle.
  • 3
    Zero-point palletRepeat jobs, tombstones, lights-out runs.
Control logic

How the M-code sequence and feedback loop work

A typical automatic locking sequence uses three M-codes: clamp on, clamp off, and a confirmation check. The exact numbers are machine-specific, so check the ladder or the machine builder's list. What matters is the order and the wait state between them.

The control should issue the clamp-on M-code, then wait for an input from a pressure switch or proximity sensor. Only after that input is high should the program advance to the spindle start and feed move. If you skip the wait, the program runs on a timer and the machine will happily cut a loose part when the air line is pinched.

Many builders offer an optional clamp-confirmation timer as a fallback. Treat it as a backup, not the primary signal. A timer set to 0.5 s will pass even if the clamp never moved, because the timer only measures elapsed time.

On 5-axis and mill-turn centers, add a second check for rotary table or chuck position. A pallet that is clamped but not seated on its locating pins will still trip the pressure switch. A proximity sensor on the seat face catches that case.

  • 1
    Clamp onM-code energizes the solenoid valve.
  • 2
    ConfirmControl reads the pressure or proximity input.
  • 3
    ProceedSpindle start and feed only after confirmation.
Setup numbers

Setting pressure and force for the material in front of you

Start with the clamp maker's rated pressure and work down, not up. For a pneumatic vise, set the regulator to 0.5 MPa and test. If the part moves during a 2 mm depth roughing pass in 6061, raise in 0.05 MPa steps to a maximum of 0.7 MPa. Above that you risk denting soft jaws and distorting thin walls.

For hydraulic clamps on steel, the force scales with the piston area and the set pressure. A common range is 20–40 bar for a 40 mm bore clamp. Do not exceed the clamp's rated force just to stop chatter. Chatter from a long tool overhang is a tooling problem, not a clamping problem.

Thin-wall parts need a different approach. Machine soft jaws to the part profile, then cap clamp force at about 60% of the clamp's rated value. On a 2 mm wall in 6061, that often means 0.35–0.45 MPa. Check the wall with a micrometer before and after clamping on the first part.

Record the final pressure on the setup sheet. The next operator should not have to rediscover it.

  • 1
    Aluminum, thin wall0.35–0.45 MPa with soft jaws.
  • 2
    Aluminum, solid0.5–0.7 MPa.
  • 3
    Steel, hydraulic20–40 bar, watch for jaw marks.
Troubleshooting

Common failures and how to read them

The clamp closes but the cycle will not start. Nine times out of ten the feedback input never goes high. Check the sensor gap first, then the wiring, then the input card. A proximity sensor mounted 3 mm from a target that moves 2 mm will not trigger reliably.

The part moves during roughing. This is usually pressure, jaw condition, or part support. Recheck pressure at the gauge while the clamp is closed, not at rest. Worn jaw serrations on a pneumatic vise are a common cause on machines that run 20 hours a day.

The clamp is slow to close. Look at the air filter and the exhaust muffler on the solenoid valve. A clogged muffler traps back pressure and doubles the close time. Replace it, do not clean it.

The machine alarms out mid-cycle on clamp-off. Some controls expect the clamp-off signal within a fixed window. If the part is heavy or the spring return is weak, the clamp may take longer than the window allows. Extend the monitor time rather than disabling it.

On cnc machine tools locking problems, always test the interlock before you test the cut. A clamp that holds but never reports is a safety fault, not a productivity fault.

  • 1
    No start after clampCheck sensor gap and input LED.
  • 2
    Part shiftsRecheck pressure under load and jaw wear.
  • 3
    Slow closeReplace the valve exhaust muffler.
Procedure

Step by step: enabling automatic locking on the machine

Follow in order. Do not skip the air-cut test.

  • 1
    1. Verify air supply and filterCheck line pressure at the machine gauge. It should hold 0.5–0.7 MPa with the clamp cycling. Drain the filter bowl. Water in the line causes slow clamp action and false sensor trips.
  • 2
    2. Mount and align the clampClean the table and the clamp base. Indicate the jaw face to within 0.02 mm over 100 mm. A clamp that is not square to the spindle will push the part sideways as it closes.
  • 3
    3. Set the regulatorStart at 0.4 MPa for aluminum or 20 bar for hydraulic. Lock the regulator knob. Note the reading on the setup sheet.
  • 4
    4. Wire or confirm the feedback signalCheck that the pressure switch or proximity sensor is connected to the correct input. Trigger the clamp by hand and watch the input LED on the I/O board. It must change state cleanly, with no flicker.
  • 5
    5. Enter the M-code sequenceAdd clamp-on, wait-for-input, and clamp-off calls to the program. Place the wait before the first spindle start. Keep clamp-off after the tool retracts and the spindle stops.
  • 6
    6. Run an air-cut cycleRun the program with no tool in the spindle and the feed override at 0%. Confirm the clamp closes, the input goes high, and the cycle waits if you unplug the sensor.
  • 7
    7. Take a light test cutLoad scrap of the same material. Take a 0.5 mm depth pass at 50% feed. Stop, check the part for movement with a dial indicator, then check the clamp pressure again.
  • 8
    8. Document and lock outWrite the pressure, clamp model, jaw type and M-code order on the setup sheet. Put the regulator under a lock nut so the next shift cannot drift it.
Selection table

Which locking method fits the job

Pick the column that matches the part, then set pressure from the row above.

Clamp typeBest forTypical pressureWatch out for
Pneumatic viseAluminum, brass, plastics0.5–0.7 MPaWater in air line, slow close
Hydraulic clampSteel, stainless, titanium20–40 barJaw marks on finished faces
Zero-point palletRepeat jobs, tombstonesPer maker specChips on locating pins
Magnetic chuckFerrous plate over 10 mmPer maker specLoses force on thin plate
Vacuum chuckFlat, non-porous plate−0.06 to −0.08 MPaLeaks on rough or warped stock
Soft jaws in viseThin walls under 3 mm0.35–0.45 MPaJaw wear changes grip
FAQs

Frequently asked questions

Can I run automatic locking without a feedback sensor?

You can, but you give up the safety interlock. The control will start the spindle on a timer even if the clamp never closed.

For one-off prototype work on a manual mill, a timer is a tolerable risk. For anything running unattended or on a pallet system, fit a pressure switch or proximity sensor and wire it into the cycle start logic.

What air pressure should I start with on a pneumatic vise?

Start at 0.5 MPa for solid aluminum parts and 0.35–0.45 MPa for thin walls with machined soft jaws.

Raise in 0.05 MPa steps only if the part moves during a roughing pass. Never exceed the vise maker's rated pressure to chase chatter; fix the tool overhang or the depth of cut instead.

Does automatic locking work on 5-axis machines?

Yes, and it is common on trunnion tables and zero-point pallet systems. The difference is that you need a second confirmation for the rotary axis or the pallet seat, not just the clamp.

A pallet can be clamped but not fully seated on its pins. A proximity sensor on the seat face catches that, while a pressure switch alone will not.

How often should clamp pressure be checked?

Check at the start of every shift and after any air line work. Log the reading on the setup sheet.

A slow drift from 0.6 MPa to 0.45 MPa over a week usually means a leaking fitting or a failing regulator, not a normal change.

Will automatic clamping mark a finished surface?

It can, if you clamp on a finished face with hard jaws. Use soft jaws machined to the part profile, or clamp on a rough stock face that will be removed later.

For cosmetic parts, plan the fixture so the clamp contacts a surface that is not visible after assembly.

Can GreatLight set up clamping for my part?

Yes. We machine from one prototype to 10,000+ piece runs on 127 CNC machines, including 16 simultaneous 5-axis centers.

Send the drawing and we return a quotation and free DFM analysis within 12 hours, with the fixture and clamping approach noted.

Send the drawing, get a clamping and machining plan

Upload your part and we will confirm the fixture approach, clamp pressure range and tolerance capability before you commit to a run.

12-hour quoteFree DFM analysis100% inspection

Follow GreatLight

More machining notes from the shop floor

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

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