TB6560 CNC spindle relay configuration for Mach3 or LinuxCNC

posted in: CNC, CNC Router | 4

TB6560 4 axis spindle relay configuration with Mach3 or LinuxCNC is fairly straightforward.   But it took me some time to figure out. So here’s how I got it to work.

I wanted to be able to control my Katsu (Makita clone) router from Mach3 and LinuxCNC.   The goal was that it would switch on and off from the g-code running. Several times I started to run the code and forgot to switch the router on.

This configuration is just a simple on/off, no speed control.  The TB6560 is able to control spindle speed with extra hardware and configuration. But I don’t have this setup, so I can’t confirm.

The TB6560 4 axis board is fitted with a relay which can be controlled by Mach3 or LinuxCNC using the g-codes M3 (on) and M4 (off). The relay is limited to 36 Volts and 7.5 amps.  As most routers are mains powered a relay is required to switch the AC on and off.

After some research, I decided to use a solid-state relay that would switch the AC on by supplying a small DC voltage.   I purchased one from Amazon and wired it as the diagram below.  Please be very careful you are dealing with mains electricity it can kill!!

The Spindle interface has 4 connectors two ground and on my board MOU and MIN.  Basically, the MOU and MIN are the relay contacts.  You can put a multi-meter across them on a continuity setting with a buzzer and it will switch on and off by sending M3 and M4 to it.

solid state relay configuration

Mach 3 configuration

Goto Ports and Pins and check that Output#1 is enabled and set to Port 1 and Pin 2

Port and Pins Mach3 for Spindle configuration
Port and Pins Mach3 for Spindle configuration

On the Spindle Setup tab make sure “Disable Spindle Relay” is not checked and the “Output# “is set to 1 as below

Mach3 Spindle Configuration

That’s all there is to it for Mach3

If you press Reset and click  “Spindle Toggle”  button on the Diagnostics screen it should start the router.  Make sure the router is left switched on.

LinuxCNC Configuration

In the StepConf Wizard select your configuration and set Pin2 to Spindle ON.   That’s it, even simpler than Mach3.  When the g-code M3 and M4 is sent the router will stop and start.

linuxcnc stepconf parallel port


As you can see its an easy solution for Mach3 or LinuxCNC just be careful with the wiring mains power can kill.  The relays are very cheap and mine has been 100% reliable.

4 Responses

  1. Taylor

    If this works I owe you a fat kiss right on the mouth! This TB6560 has not been my favorite thing in the world but this tutorial is really well written and detailed! Fingers crossed, and thanks again!

    • Keith

      Thanks. It’s been very reliable for me. Hope it works for you

  2. antonio ramon calderon

    Gracias por regalarnos informacion muy importante para los que iniciamos de cero en cnc.
    compre kit 4axis de 290 oz. y tarjeta controladora tb6560 y estoy aprendiendo pero aun no he logrado mover los motores. Gracias

    • Keith

      encantado de ayudar. revisa mi canal de YouTube. Estoy agregando subtítulos a mis videos que se traducirán al español. Tengo varios en LinuxCNC y Mach3.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.