How to CNC Machine Wood: Step-by-Step Guide
To CNC machine wood, you write a
G-code program that controls the cutting tool's path and speed on the wood piece. Use commands like G0 for rapid moves and G1 for cutting moves, setting spindle speed and feed rate to suit the wood type.Syntax
G-code is the language used to control CNC machines. Key commands include:
G0 X Y Z: Move the tool quickly to position (X, Y, Z) without cutting.G1 X Y Z F: Move the tool to position (X, Y, Z) while cutting at feed rateF.M3 S: Turn the spindle on at speedS(RPM).M5: Stop the spindle.G90: Use absolute positioning.G21: Set units to millimeters.
These commands tell the CNC machine how to move and cut the wood.
gcode
G21 ; Set units to millimeters G90 ; Use absolute positioning M3 S12000 ; Start spindle at 12000 RPM G0 X0 Y0 Z5 ; Move above start point G1 Z-3 F300 ; Lower tool into wood at 300 mm/min G1 X50 Y0 F500 ; Cut in X direction G1 X50 Y50 ; Cut in Y direction G1 X0 Y50 ; Cut back in X G1 X0 Y0 ; Complete square G0 Z5 ; Raise tool M5 ; Stop spindle
Example
This example cuts a simple 50x50 mm square pocket 3 mm deep in wood using G-code commands. It starts the spindle, moves the tool safely, cuts the shape, then stops the spindle.
gcode
G21 ; Set units to millimeters G90 ; Absolute positioning M3 S12000 ; Spindle on at 12000 RPM G0 X0 Y0 Z5 ; Move above start G1 Z-3 F300 ; Cut down 3 mm G1 X50 Y0 F500 ; Cut right G1 X50 Y50 ; Cut up G1 X0 Y50 ; Cut left G1 X0 Y0 ; Cut down G0 Z5 ; Raise tool M5 ; Spindle off
Output
The CNC machine cuts a 50x50 mm square pocket 3 mm deep in the wood.
Common Pitfalls
Common mistakes when CNC machining wood include:
- Setting spindle speed too high or too low, causing burning or poor cuts.
- Using incorrect feed rates, which can break tools or leave rough surfaces.
- Not setting the correct tool depth, leading to incomplete cuts or damage.
- Forgetting to use absolute positioning (
G90) causing unexpected tool paths. - Not raising the tool safely before rapid moves (
G0 Z5) risking collisions.
Always simulate your G-code in software before running on the machine.
gcode
Wrong: G1 X50 Y0 F500 ; Cutting without spindle on Right: M3 S12000 ; Spindle on G1 X50 Y0 F500 ; Cutting move
Quick Reference
| Command | Description |
|---|---|
| G21 | Set units to millimeters |
| G90 | Use absolute positioning |
| M3 S[Speed] | Start spindle at specified RPM |
| M5 | Stop spindle |
| G0 X Y Z | Rapid move to position without cutting |
| G1 X Y Z F | Cutting move to position at feed rate F |
Key Takeaways
Write clear G-code commands to control tool movement and spindle speed for wood cutting.
Use appropriate spindle speed and feed rate to avoid burning or tool damage.
Always start with safe tool positioning and end by stopping the spindle.
Simulate your G-code before running to prevent mistakes and collisions.
Use absolute positioning (G90) and units in millimeters (G21) for consistent results.