PathPilot 24R Coolant Mod – Full M7/M8/M9 Support via USB I/O Relays and DIY HAL Patch

Hey!

We’ve been running our 24R for a few years with mist coolant for metal work, but it’s always been a bit painful having to turn it on and off manually — especially when PathPilot already has built-in support for coolant commands (M7, M8, M9) and a button on the UI for manual activation.

I reached out to Tormach support, but they confirmed it’s “not supported” on the 24R.

So… I looked under the hood and found a way to add that feature using a HAL patch that remaps PathPilot’s coolant commands to the USB I/O relay control.

We then load the patch automatically at boot (after a delay, so PathPilot doesn’t get upset) using cron.

Below is exactly how we did it.

Step 0 — install the USB IO kit

Without the USB I/O kit, the HAL signals we’re remapping won’t exist.

Step 1 — Create the HAL patch

Make a folder for HAL patches:

mkdir -p /home/operator/tmc/hal_patches

Create the patch file:

nano /home/operator/tmc/hal_patches/coolant_patch.hal

Contents:

# Map M8 (flood) → relay 0
show sig dig-out-0
unlinkp motion.digital-out-00
net dig-out-0 iocontrol.0.coolant-flood

Create the patch file:

nano /home/operator/tmc/hal_patches/mist_patch.hal

Contents:

# Map M7 (Mist) → relay 1
show sig dig-out-1
unlinkp motion.digital-out-01
net dig-out-1 iocontrol.0.coolant-mist

This unlinks PathPilot’s existing relay mapping and reconnects M8 (coolant flood) to USB I/O relay 0 and M7 (coolant mist) to USB I/O relay 1.

Step 2 — Create the apply script

Make a helper script to apply the patch once PathPilot has started:

nano /home/operator/tmc/bin/apply_coolant_patch.sh

contents:

#!/usr/bin/env bash
# Apply coolant (flood + mist) HAL patches after PathPilot starts

# -------- settings --------
PP_HOME="/home/operator/v2.12.3"
FLOOD_PATCH="/home/operator/tmc/hal_patches/coolant_patch.hal"   # M8 → relay 0
MIST_PATCH="/home/operator/tmc/hal_patches/mist_patch.hal"       # M7 → relay 1
LOG_FILE="/home/operator/router_data/hal_patch.log"
WAIT_SECS=30        # initial boot settle time
RETRY_SECS=120      # additional time to wait for HAL to be ready
# --------------------------

# be noisy in the log
log() { printf '%s %s\n' "$(date '+%F %T')" "$*" | tee -a "$LOG_FILE" ; }

# load PathPilot HAL env (rip-environment.sh is picky about -u)
set +u; source "$PP_HOME/scripts/rip-environment.sh"; set -u

log "Starting HAL patcher (will wait ${WAIT_SECS}s, then try up to ${RETRY_SECS}s)"
sleep "$WAIT_SECS"

# Wait for halcmd to see HAL
ready=0
for _ in $(seq 1 "$RETRY_SECS"); do
  if "$PP_HOME/bin/halcmd" show sig dig-out-0 >/dev/null 2>&1; then
    ready=1
    break
  fi
  sleep 1
done

if [[ $ready -ne 1 ]]; then
  log "HAL not ready after wait; aborting."
  exit 1
fi

# Apply flood patch (M8 → relay 0)
if [[ -f "$FLOOD_PATCH" ]]; then
  if "$PP_HOME/bin/halcmd" -f "$FLOOD_PATCH" >/dev/null 2>&1; then
    log "Applied flood patch: $FLOOD_PATCH"
  else
    log "FAILED to apply flood patch: $FLOOD_PATCH"
  fi
else
  log "Flood patch not found: $FLOOD_PATCH (skipping)"
fi

# Apply mist patch (M7 → relay 1)
if [[ -f "$MIST_PATCH" ]]; then
  # Optional: verify dig-out-1 exists before applying
  if "$PP_HOME/bin/halcmd" show sig dig-out-1 >/dev/null 2>&1; then
    if "$PP_HOME/bin/halcmd" -f "$MIST_PATCH" >/dev/null 2>&1; then
      log "Applied mist patch: $MIST_PATCH"
    else
      log "FAILED to apply mist patch: $MIST_PATCH"
    fi
  else
    log "dig-out-1 signal not found; skipping mist patch."
  fi
else
  log "Mist patch not found: $MIST_PATCH (skipping)"
fi

log "Done."
exit 0

Make it executable:

chmod +x /home/operator/tmc/bin/apply_coolant_patch.sh

Step 3 — Add it to cron @reboot

Edit the crontab for the operator user:

crontab -e

Add:

@reboot /home/operator/tmc/bin/apply_coolant_patch.sh

This ensures the patch is reapplied every time the machine boots.

The script waits 30 seconds, then applies the patch once PathPilot is fully running.

reboot the machine

Step 4 — Use it

  • In MDI mode, type M8 to turn on the flood coolant relay (USB Relay #0) and M7 to turn on Mist coolant relay (USB Relay #1), M9 to turn both off.
  • You can also use the coolant button on the PathPilot UI. (though LED will stay off but still working)

Just need to hook up your flood pump and mist air valve to the corresponding relay and you are good to go !

Good Luck !
Cheers !

PS : To revert, just comment/remove the @reboot line in crontab and reboot
, optionally, delete the HAL patch files and reboot

Nice feature. Would this feature work if/when Pathpilot updates to a newer version than v2.12.3?