flexi-bot/docs/marlin/_gcode/M004.md
2023-09-05 20:38:49 +02:00

1.7 KiB

tag title brief author contrib since requires related group codes notes parameters examples
m0004 Spindle CCW / Laser On Set the spindle CCW speed or laser power thinkyhead shitcreek 1.1.2 SPINDLE_LASER_ENABLE
M3
M5
control
M4
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)
tag optional description values
S true Spindle speed or laser power in the configured value range (see `CUTTER_POWER_UNIT`). (PWM 0-255 by default)
tag type
power byte
tag optional description values
O true Spindle speed or laser power in PWM 0-255 value range
tag type
power byte
tag optional description values
I true Inline mode ON / OFF.
tag type
mode bool
pre code
Set spindle rotation counter-clockwise at 50% with `CUTTER_POWER_UNIT` set to `PERCENT` M4 S50
pre code
Set spindle rotation counter-clockwise at 50% with `CUTTER_POWER_UNIT` set to `PWM` M4 S128
pre code
Set spindle rotation counter-clockwise at 80% in `PWM` M4 O204
pre code
Turn on the laser at full / `SPEED_POWER_STARTUP` power M4
pre code
Fire laser at 80% on next G1,G2 and G3 move M4 S204 I

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