V1 Setting V2 Setting Description

Enables the spindle control module. When true, the spindle module is loaded and available for G-code control (M3/M5 commands).

  • V1: dedicated spindle module with PID control, tachometer feedback, and Modbus VFD support
  • V2: simple switch module instance for basic on/off or PWM control (no PID or feedback)

Spindle control mode.

V1 supports three types:

  • pwm — closed-loop PID control with tachometer feedback for precise RPM
  • analog — open-loop PWM output for VFDs/ESCs with 0-10V or PWM inputs
  • modbus — RS485 communication for Modbus VFDs like Huanyang

V2 only supports:

  • digital — on/off relay
  • pwm — variable speed, open-loop only

PWM output pin for spindle control. Must be hardware PWM-capable on Smoothieboard: 2.0-2.5, 1.18, 1.20, 1.21, 1.23, 1.24, 1.26, 3.25, 3.26.

Controls spindle speed either directly (for PWM-capable spindles) or through a VFD's analog input.

Pin can be inverted with the ! suffix (e.g., 2.4!).

PWM frequency for spindle control.

  • V1: period in microseconds (default 1000µs = 1kHz; frequency = 1,000,000 / period)
  • V2: frequency in Hz, via pwm1.frequency or pwm2.frequency settings

Most VFDs and spindle controllers work with 1-50 kHz — check your VFD documentation for the required frequency.

Maximum PWM duty cycle (0.0-1.0). Acts as both a safety limit and a calibration factor.

Some spindle controllers (like MC2100) require less than 100% duty cycle for maximum speed — MC2100 uses 0.85.

Setting below 1.0 limits maximum spindle speed even when G-code requests full power, protecting the motor from overcurrent.

Controls spindle behavior during an emergency stop.

  • false (recommended): spindle stops immediately on any halt condition (emergency stop, limit switch trigger), for safety
  • true: spindle continues running during halts

This is a safety-critical setting — use with extreme caution.

Tachometer input pin for closed-loop RPM control (V1 PWM mode only). Must be an interrupt-capable pin on Port 0 or Port 2 (pin number must be 2.x or 0.x).

Receives pulses from a hall-effect sensor, optical encoder, or other tachometer, and is used with the PID controller for precise RPM maintenance.

Not available in V2.

Number of tachometer pulses per spindle revolution (V1 PWM mode only). Used to calculate actual RPM from tachometer feedback.

  • Hall-effect sensors: typically 1 pulse per revolution
  • Optical encoders: may provide many pulses per revolution

Essential for accurate RPM calculation in closed-loop mode. Not available in V2.

Default RPM when M3 is issued without an S parameter (V1 PWM mode only) — if G-code contains "M3" without specifying speed, this RPM is used.

Default: 5000 RPM. Only applies to the PWM spindle type with feedback control. Not available in V2.

PID proportional term for closed-loop spindle control (V1 PWM mode only). Controls how aggressively the controller responds to RPM error.

Higher values give faster response but may cause oscillation; lower values give smoother operation but slower response. Requires tuning for the specific spindle.

  • Unit: 1/RPM
  • Default: 0.0001

Not available in V2.

PID integral term for closed-loop spindle control (V1 PWM mode only). Eliminates steady-state error by accumulating error over time.

Higher values eliminate offset faster but may cause overshoot; set too high and the system becomes unstable. Requires tuning for the specific spindle.

  • Unit: 1/(RPM × seconds)
  • Default: 0.0001

Not available in V2.

PID derivative term for closed-loop spindle control (V1 PWM mode only). Responds to the rate of change of error, providing damping to reduce overshoot and oscillation.

Higher values give more damping but may slow response and amplify noise. Often set lower than the P and I terms.

  • Unit: 1/(RPM/seconds)
  • Default: 0.0001

Not available in V2.

Low-pass filter time constant in seconds for tachometer smoothing (V1 PWM mode only). Filters out noise and transient fluctuations in RPM measurement.

Higher values give more smoothing but slower response to actual speed changes; lower values give faster response but may amplify tachometer noise.

Default: 0.1 seconds. Not available in V2.

Minimum RPM when the spindle is on (V1 analog mode only). When the spindle is enabled, speed cannot go below this value — it prevents stalling and ensures a minimum cutting speed.

If G-code requests a speed below min_rpm (but greater than 0), this minimum is used instead. M5 or S0 still turns the spindle completely off. VFDs typically have minimum frequency requirements.

Default: 100 RPM. Not available in V2.

Maximum RPM at 100% PWM (V1 analog mode only). Calibrates the PWM output to the spindle's maximum speed.

For example, if your VFD is configured for 24000 RPM maximum and you request 12000 RPM (S12000), the system outputs 50% PWM. Essential for accurate speed control with VFDs and ESCs.

Default: 5000 RPM. Not available in V2.

Optional digital output pin to enable a VFD/power supply (V1 analog mode only). Typically connected to the VFD's RUN/ENABLE input via an optocoupler.

Goes high when the spindle is commanded on (M3), low when commanded off (M5) — providing a hardware enable signal separate from the PWM speed control.

Not available in V2 (use a separate switch instance instead).

VFD manufacturer/model for Modbus control (V1 modbus mode only). Currently only supports "huanyang" VFDs, and determines the Modbus protocol and register mapping used for RS485 communication.

Huanyang VFDs must be configured for RS485 control before use:

  • PD001=2 (run command source: communication port)
  • PD002=2 (frequency source: communication port)
  • PD163=1 (address: 1)
  • PD164=1 (baud: 9600)
  • PD165=3 (data method: 8N1 RTU)

Not available in V2.

RS485 receive pin for Modbus communication (V1 modbus mode only). Used with the TX and DIR pins to communicate with Modbus VFDs.

Requires an RS485 transceiver chip (MAX485 or similar) between Smoothieboard and VFD. This pin receives data from the VFD.

Not available in V2.

RS485 transmit pin for Modbus communication (V1 modbus mode only). Used with the RX and DIR pins to communicate with Modbus VFDs.

Requires an RS485 transceiver chip. This pin sends data to the VFD.

Not available in V2.

RS485 direction control pin (V1 modbus mode only). RS485 is half-duplex, so a single pair of wires is used for both sending and receiving.

This pin switches the RS485 transceiver between transmit and receive modes — typically connected to the DE/RE pins on a MAX485 chip.

Not available in V2.

G-code command to turn the spindle on (V2 only, via the switch module). Typically M3 for spindle clockwise, but can be configured to any G-code or M-code.

Not needed in V1 (M3 is hardcoded).

G-code command to turn the spindle off (V2 only, via the switch module). Typically M5 for spindle stop, but can be configured to any G-code or M-code.

Not needed in V1 (M5 is hardcoded).

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.