Fluidnc - MKS DLC32 - Spindle never really turns off

Hi gentle people, I’m new here and after quite a lot of silent research on this forum (which greatly helped me), I’m facing an issue I can’t find anyone who already talked about.

For two days, I’m running Fluidnc on my MKS DLC32 V2.1 to control my modified CNC 3018 (now 3040). Coupled with TMC2209 stepper drivers, I managed to get everything to work smoothly.

Only issue: the spindle automatically turns on at low RPM when booting, and I can’t really turn it off. Well, I can turn it off for about 60s if I set it to high RPM then send M5 to turn off, then it turns on again at low RPM itself.

The spindle is from aliexpress, a cheap 800w coming with a power supply that can be controlled manually with a potentiometer or via the 0-10v.

I connected the 0-10v of the power supply to the spindle pins on the MKS DLC32 board (gpio.32). I first tried the config with PWN, then switched to the 10v one just to see how it goes but same issue in both cases.

Any idea of what I could have done or thought wrong ?

Thank you already if you take the time to read me, any help/advice would be greatly appreciated.

Here’s my config btw :

name: CNC 3040
board: MKS DLC32 V2.1

kinematics:
  Cartesian:

uart1:
  txd_pin: gpio.18
  rxd_pin: gpio.23
  rts_pin: NO_PIN
  cts_pin: NO_PIN
  baud: 115200
  mode: 8N1

stepping:
  engine: I2S_STATIC
  idle_ms: 250
  pulse_us: 4
  dir_delay_us: 10
  disable_delay_us: 0

axes:
  shared_stepper_disable_pin: i2so.0
  shared_stepper_reset_pin: NO_PIN

  x:
    steps_per_mm: 800
    max_rate_mm_per_min: 2000
    acceleration_mm_per_sec2: 30
    max_travel_mm: 281
    soft_limits: true
    homing:
      cycle: 1
      feed_mm_per_min: 300
      seek_mm_per_min: 600
      mpos_mm: 0
      positive_direction: false

    motor0:
      limit_all_pin: NO_PIN
      limit_neg_pin: gpio.36:low
      limit_pos_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 1.5
      tmc_2209:
        step_pin: i2so.1
        direction_pin: i2so.2
        uart_num: 1

  y:
    steps_per_mm: 800
    max_rate_mm_per_min: 3000
    acceleration_mm_per_sec2: 30
    max_travel_mm: 350
    soft_limits: true
    homing:
      cycle: 1
      feed_mm_per_min: 300
      seek_mm_per_min: 600
      mpos_mm: 0

    motor0:
      limit_all_pin: NO_PIN
      limit_neg_pin: gpio.35:low
      limit_pos_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 2
      tmc_2209:
        step_pin: i2so.5
        direction_pin: i2so.6
        uart_num: 1

  z:
    steps_per_mm: 398
    max_rate_mm_per_min: 600
    acceleration_mm_per_sec2: 30
    max_travel_mm: 75
    soft_limits: true
    homing:
      cycle: 1
      feed_mm_per_min: 300
      seek_mm_per_min: 600
      mpos_mm: 0

    motor0:
      limit_all_pin: NO_PIN
      limit_neg_pin: gpio.34:low
      limit_pos_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 2
      tmc_2209:
        step_pin: i2so.3
        direction_pin: i2so.4
        uart_num: 1
        run_mode: CoolStep
        homing_mode: CoolStep

i2so:
  bck_pin: gpio.16
  data_pin: gpio.21
  ws_pin: gpio.17

spi:
  miso_pin: gpio.12
  mosi_pin: gpio.13
  sck_pin: gpio.14

probe:
  pin: gpio.22:low
  toolsetter_pin: NO_PIN
  check_mode_start: false

sdcard:
  cs_pin: gpio.15
  card_detect_pin: gpio.39

10V:
  forward_pin: gpio.19
  reverse_pin: NO_PIN
  output_pin: gpio.32
  enable_pin: NO_PIN
  direction_pin: NO_PIN
  disable_with_s0: true
  s0_with_disable: true
  spinup_ms: 4000
  spindown_ms: 4000
  speed_map: 0=0.000% 20000=100.000%
  off_on_alarm: true

start:
  check_limits: true
  must_home: true
  deactivate_parking: false

do you know if the spindle on/off port on the speed control unit triggers high or low? The spindle pin on your cnc controller is probably floating during boot. You can try adding a pullup or pulldown resistor based on what the spindle controller is expecting in the “off” state.

Just be careful of logic levels. I JUST had this situation this past weekend where my VFD used 5V for speed control, but 12V logic for enable and direction. Fried a few pins on my mini rambo before I realized what happened…