Spindle Configurations - bdring/Grbl_Esp32 GitHub Wiki

Spindle Configurations

There are several spindle types and they can all be tailored to your requirements. You can define as many as you like. Lasers are considered spindles.

Define each spindle in its own section. You can assign each spindle a tool number. If you assign tool 0 to the first spindle and tool 20 to the second one. The first spindle will be used for any tool from zero to 19. This allows the use of ATC spindles. Tool numbers are changed with the M6 Tn command. If you have a machine that is a laser and a router, for example, this method allows you to switch on the fly via gcode.

yaml Key Description
10V Targets speed controllers that use a 0-10V analog input (using PWM). They often require a separate forward and reverse signal.
BESC This allows you to use an RC Brushless Electronic Speed Controller. They generally set speed with a PWM signal of 1ms (off) to 2ms (full speed)
DAC This uses the DAC feature of the ESP32 to output an analog signal of 0-3.3V
H2A This is used with a Huanyang VFDs with the new Modbus protocol
Huanyang This is used for Huanyang VFDs with the original Modbus protocol (still very common on new controllers)
Laser This is a PWM signal with features for lasers.
NoSpindle
OnOff
PWM
Relay
YL620 This is used for YL620 type VFDs

Keys

yaml sub key Description
output_pin: This can be inverted with the :low attribute
pwm_freq: Frequency of PWM in Hz Optional, Default 5000
enable_pin:
direction_pin:
spinup_delay_ms: Time in milliseconds the firmware waits for the spindle to spin up. This is the maximum time. It is proportional to actual rpm change. Optional, Default=0
spindown_delay_ms: Same as above for spin down Optional, Default=0
speeds: See this page Optional, default depends on spindle type.
tool: Optional if you only have one spindle defined

Examples

Relay:
  output_pin: gpio.12
  direction_pin: NO_PIN
  spinup_delay_ms: 0
  spindown_delay_ms: 0
  tool: 0
  speeds: 0=0.000% 0=0.000% 1000=100.000%

YL620:
  txd_pin: gpio.14
  rxd_pin: gpio.15
  rts_pin: gpio.13
  baudrate: 9600
  modbus_id: 1
  spinup_delay_ms: 0
  spindown_delay_ms: 0
  tool: 10
  speeds: 0=0.000% 0=10.000% 2400=10.000% 12000=50.000%

Huanyang:
  txd_pin: NO_PIN
  rxd_pin: NO_PIN
  rts_pin: NO_PIN
  baudrate: 9600
  modbus_id: 2
  spinup_delay_ms: 0
  spindown_delay_ms: 0
  tool: 20
  speeds: 0=0.000% 0=25.000% 6000=25.000% 24000=100.000%

PWM:
  pwm_freq: 5000
  invert_pwm: false
  output_pin: gpio.2
  enable_pin: gpio.22
  direction_pin: NO_PIN
  enable_off_with_zero_speed: false
  spinup_delay_ms: 20
  spindown_delay_ms: 0
  tool: 30
  speeds: 0=0.000% 5000=30.000% 10000=100.000%