Raspberry Pi 4B controling XController & Router

Loving the upgrade from the Laptop to the Pi.
Still need to install the upgrade that arrived last week with the new belts and Z axis

i use the Spindle 0 ~ 10 and Gnd to connect to a solid state relay to power the Router and Vacuum.

I want to replace these relays with a Raspberry Pi zero and 4 relay HAT.

Can i connect the gnd and Spindle PWM to an input on the Zero to operate the Relays?
Has anyone done this?

I know I will need to do a program in python to set it up, just want to make sure that it is possible