Understanding the XController and SuperPid2 operation

To use this setup you need to change two settings in the config.h file and recompile grbl.

define INVERT_SPINDLE_ENABLE_PIN
define USE_SPINDLE_DIR_AS_ENABLE_PIN

Warning - the bootloader will toggle the SCK pin during a firmware update operation and when power is first applied to the Arduino/X-controller. This will result in a brief spindle on condition during these two operations. Make sure that you have the spindle main power off when using either of these two operations

This is a picture of the setup: