Controlling Router power relay automatically

I just wired up an SSR to my MPCNC to allow the software to start and stop the router. Currently, I have it wired into the Fan pins so that it is controllable via M106/M107. However, the Buffy Post Processor wants to control the spindle using M3/M5 commands. Is there a way to wire the relay up so that it responds to the M3/M5 commands? I haven’t found anything in my searching yet.

Take a look at the pins.h for your board. For example, RAMPS is:
//

// M3/M4/M5 - Spindle/Laser Control

//

#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN)

#if !NUM_SERVOS // Use servo connector if possible

#define SPINDLE_LASER_ENA_PIN     4   // Pullup or pulldown!

#define SPINDLE_LASER_PWM_PIN     6   // Hardware PWM

#define SPINDLE_DIR_PIN           5

#elif HAS_FREE_AUX2_PINS

#define SPINDLE_LASER_ENA_PIN    40   // Pullup or pulldown!

#define SPINDLE_LASER_PWM_PIN    44   // Hardware PWM

#define SPINDLE_DIR_PIN          65

#else

#error "No auto-assignable Spindle/Laser pins available."

#endif

#endif

So I THINK it’s saying default is pin 40? Maybe pin 4? That’s at least somewhere for you to start.

Thanks. I’ll have to investigate that.

I guess also to note, I believe those other pins are 5V, but if you’re using the default fan pins, is your relay using 12V? If so, you can also change your pins file and swap the M3 pin with the M106 pin and keep it wired as you have it.

I’m working on the same topic here:

I haven’t had a chance to try these suggestions yet.

I figured out that the spindle can be controlled using the Motex2 connector. Specifically, pin 4 for signal and pin 2 for ground. Wired those up to the +/- terminals on the relay (in the correct orientation) then enabled spindle control in marlin and set it to enameled the spindle with High level instead of Low. Reconciled and installed, and the GCode worked like a charm.