---
tag: m0004
title: Spindle CCW / Laser On
brief: Set the spindle CCW speed or laser power
author: thinkyhead
contrib: shitcreek

since: 1.1.2
requires: SPINDLE_LASER_ENABLE
related: [ M3, M5 ]
group: control

codes: [ M4 ]

notes:
  - 'S is interpeted as the configured value range: PWM (default), Percentage, or RPM. (See `CUTTER_POWER_UNIT`)'
  - "[`M3`](/docs/gcode/M003.html) and [`M4`](/docs/gcode/M004.html) aren't needed with `LASER_POWER_INLINE` and `LASER_MOVE_POWER` enabled. Power is set directly in [`G1`](/docs/gcode/G000-G001.html)…[`G5`](/docs/gcode/G005.html)"

parameters:
  -
    tag: S
    optional: true
    description: Spindle speed or laser power in the configured value range (see `CUTTER_POWER_UNIT`). (PWM 0-255 by default)
    values:
      -
        tag: power
        type: byte
  -
    tag: O
    optional: true
    description: Spindle speed or laser power in PWM 0-255 value range
    values:
      -
        tag: power
        type: byte
  -
    tag: I
    optional: true
    description: Inline mode ON / OFF.
    values:
      -
        tag: mode
        type: bool

examples:
  -
    pre: Set spindle rotation counter-clockwise at 50% with `CUTTER_POWER_UNIT` set to `PERCENT`
    code: M4 S50
  -
    pre: Set spindle rotation counter-clockwise at 50% with `CUTTER_POWER_UNIT` set to `PWM`
    code: M4 S128
  -
    pre: Set spindle rotation counter-clockwise at 80% in `PWM`
    code: M4 O204
  -
    pre: Turn on the laser at full / `SPEED_POWER_STARTUP` power
    code: M4
  -
    pre: Fire laser at 80% on next G1,G2 and G3 move
    code: M4 S204 I

---

Wait for moves to complete, then set the spindle speed (counter-clockwise) or laser power.
