Mach3 Instructions – Mach3 Laser Configuration
Overview & Prerequisites
This guide explains how to configure a CNC laser in Mach3 via three popular paths: as a Spindle (with/without PWM power), as Coolant (M7/M8), and with M11/M10 for instantaneous on/off during motion. You’ll need one free digital output on your controller/breakout board and a laser driver that accepts TTL/PWM.
- Safety: wear proper laser eyewear; add interlocks; verify wiring with power removed.
- Backup: duplicate your Mach3 profile (
.xml) and work in a separate “Laser” profile. - Wiring basics: connect a free output pin to the driver’s TTL/PWM input and controller GND to driver GND. Observe polarity and any required signal inversion.
Option A — Simple ON/OFF via Spindle (M3/M4, M5)
Use the spindle relay mapping so your existing CAM posts (that output M3/M5) will toggle the laser.
- Map an output: Config → Ports & Pins → Output Signals → enable Output #1 → set proper Port/Pin → set Active Low if needed.
- Spindle relays: Config → Ports & Pins → Spindle Setup → uncheck Disable Spindle Relays → assign M3/M4 to Output #1 → set relay delays to 0 s.
- Use in G-code:
M3/M4= laser ON,M5= OFF.
(example)
M3 (laser ON)
G1 X50 F2000
G1 Y30
M5 (laser OFF)
Option B — ON/OFF via Coolant (M7/M8, M9)
Prefer to keep spindle settings untouched? Map the laser to coolant outputs and drive it with M7/M8/M9.
- Enable an output: Config → Ports & Pins → Output Signals → Output #1 with your Port/Pin.
- Coolant mapping: Spindle Setup → uncheck Disable Flood/Mist Relays → assign Mist (M7) and/or Flood (M8) to Output #1 → delays 0 s.
- Use in G-code:
M7/M8= ON,M9= OFF.
Option C — PWM Power Control via Spindle (S-values)
Enable PWM to modulate laser power directly from G-code using S values mapped to a 0–100% scale.
- Enable PWM: Config → Ports & Pins → Spindle Setup → check Use Spindle Motor Output and PWM Control; set Minimum PWM = 0. Choose a PWM Base Freq your controller supports (often hundreds of Hz; external motion cards may set this in their plugin).
- Pulley scaling: Config → Spindle Pulleys → set Min Speed = 0, Max Speed = 100, Ratio = 1 to map
S0–S100to 0–100% power. - Assign pins: Config → Ports & Pins → Motor Outputs → set the Spindle output to your PWM pin as required by your hardware.
- Use in G-code:
M3/M4arms PWM;Sdefines power;M5disarms.
(examples)
M3 S100 (100% power)
G1 X40 F2000
S50 (reduce to 50% during motion)
G1 X80
M5 (laser OFF)
Instant ON/OFF Synchronized with Motion (M11/M10)
Use M11P# (ON) and M10P# (OFF) for pin-point timing at the exact start of the next move (G0/G1/G2/G3), eliminating burn dots. The # is the Mach3 Output # you mapped (not the physical pin).
(example with PWM + M11/M10)
G90 G21
M3 S70 (arm PWM at 70%)
M11P1 (laser ON on next motion)
G1 X60 Y0 F2500
G1 X60 Y40
M10P1 (laser OFF on next motion)
G0 X0 Y0
M5 S0 (disarm)
Note: Some external motion controllers require enabling M11/M10 and PWM in their plugin as well.
Troubleshooting & Best Practices
- No output: confirm correct Port/Pin, Output # enabled, and whether logic should be inverted (Active Low).
- Burn dots or delays: set spindle/coolant delays to 0 s; prefer
M11/M10for vector engraving. - PWM flatlines: verify PWM Control is enabled and pulley range is 0–100; set PWM base frequency in the controller plugin if applicable.
- Coolant mapping tips: uncheck Disable Flood/Mist Relays; map M7/M8 to your Output #; keep delays at 0.
- CAM/G-code: use a laser-optimized post (remove unnecessary Z moves, emit
Sfor power andM11/M10if supported). - Focus & air assist: consistent focus height and air assist markedly improve edge quality and speed.
Useful Tools
Explore compatible CNC software and laser-tailored posts to streamline Mach3 laser workflows.