This post documents how to wire the Mesa 7I96S Ethernet motion control STEP/IO Step & Dir plus I/O card to a contactor, enabling the LinuxCNC application to switch a wood router (or grinder) on and off using G-code commands.

🐧 Index of the Complete Series.

141-feature-image.png
Raspberry Pi 4B LinuxCNC: Wiring the Mesa 7I96S Card and a Contactor to Control a Grinder/Router via the LinuxCNC Application

I am just an ordinary computer programmer and not trained in any of the electronic engineering disciplines. This LinuxCNC project is a learning process for me. This post is not meant to be a tutorial or instructional guide; it is my own documentation so I will not forget what I have learned.

I am not to be held responsible for any damages or injuries resulting from using the information presented in this post.

ā¶ The Mesa 7I96S Manual

Two pages in the manual are particularly relevant to this post:

ā— Page 14 – Describes the characteristics of the input and output pins. Our primary focus is on the output pins. I have reviewed this page several times.

ā— Page 10 – Lists the names and numbers of the input and output pins. We are interested in pins OUT1- and OUT1+, which correspond to pin 13 and 14, respectively.

ā· Contactor and Associated Components

Although I read the Mesa 7I96S manual, I didn’t fully grasp that a relay or contactor could be used to switch a load via the Mesa 7I96S card from within LinuxCNC. In hindsight, some of the videos I watched mentioned this as well, but the point didn’t register at the time.

⓵ Contactor

While seeking help on the LinuxCNC forum regarding wiring the main power distribution, Mr. RodW noted:

… So now you need to switch your router from your 7i96s. …

Following his suggestion, I sourced a 24VDC GMD-12M DC24V 5.5kW 3P Mini Contactor with 1NO Auxiliary Contact from an Australian supplier. It’s manufactured in South Korea and costs only a fraction of the price of a comparable Schneider model. This is a three-phase contactor with a Normally Open (NO) auxiliary terminal. We can, for example, use this NO terminal to power an LED indicator when the coil is energised.

ā“¶ Flyback Diode

According to page 14 of the Mesa 7I96S manual:

… Inductive loads must have a flyback diode. The output polarity of outputs 0 through 3 must be observed (reversed outputs will be stuck-on). …

Based on my research, the following flyback diodes are suitable:

  • 1N4007 – A general-purpose 1A, 1000V diode.
  • FR107 – A 1A, 1000V fast-recovery diode; a better option than the 1N4007.
  • FR307 – Similar to the FR107, but rated at 3A. I chose this one because it was in stock at my local JayCar store, saving me the need to order online.

ā“· 2A Fuse

As emphasised on page 14 of the Mesa 7I96S manual:

Note: The 7I96S outputs are not short circuit protected so a current limited power supply or a 2A to 5A fuse should be used in the power source that supplies outputs 0 through 3. Outputs 4 and 5 should be protected with a 1/4 Amp fuse.

Since this is a DC circuit, I understand that a fast-blow fuse is required. I’m using this DIN Rail fuse holder compatible with M205-series fuses. The following options are suitable:

These are all locally available, which is a big plus compared to ordering online.

⓸ 10A 240VAC Miniature Circuit Breaker (MCB) to Protect the Load

To protect the load—in this case, a wood router—an appropriately rated Miniature Circuit Breaker (MCB) should be used. I’m using the following model: BKJ63N 1P C10 |LS Miniature Circuit Breaker 10A 1P 6kA C Curve.

It’s manufactured in South Korea and supplied by the same vendor as the contactor. (Painfully, the delivery fee was AUD $22.00 šŸ˜…)

āø Wiring Diagrams

⓵ Wiring the Contactor NO Terminal and LED Indicator

Back in my undergraduate years—over two decades ago—I completed two semesters of electronic engineering, where we wired logic gates using LEDs and similar components. Unfortunately, I’ve forgotten most of it. However, I’ve recently brushed up on the basics of electronics and now feel comfortable working with breadboards, LEDs, resistors, and related components.

After some Googling and a few wiring missteps, I was able to arrive at the correct setup, shown in the diagram below:


I’m using a standard LED, with a current-limiting resistor between 330Ω and 360Ω.

šŸ’” Important: In the diagram, the negative side of the diode is connected to both the A2- terminal of the contactor and the negative terminal of the 24VDC power supply (PSU).

With this wiring in place, powering on the circuit causes the contactor coil to energise with a noticeable ā€œclickā€ as it pulls in. This closes the circuit and lights up the LED, confirming that the coil is active.

ā“¶ Wiring the Contactor to Switch On a Load

In this setup, the load is intended to be a wood router. Since I don’t have a router yet, I’m using a Dremel grinder for testing.

I followed the wiring shown in the diagram below:


šŸ’” Important, I DID NOT cut into the grinder’s main cable to access the Live wire. Instead, I used an extension cable with a male and female end for safe and reversible testing.

In the diagram, we’re using the contactor for single-phase switching, connecting only the first terminal pair: 1/L1 and 2/T1.

šŸ‘‰ With this wiring, power is continuously supplied to the AC outlet, and the grinder’s power switch is left in the ā€œonā€ position.

  • When the contactor is off: terminals 1/L1 and 2/T1 are open → no power flows to the grinder.
  • When the contactor is on: terminals 1/L1 and 2/T1 are closed → power flows → the grinder runs.

šŸ’„ Originally, I tested the setup using a Milwaukee AGV15-125XE angle grinder, but it wouldn’t start. It turns out that model has a built-in startup protection feature, which prevents it from being externally switched on. So, the wood router I eventually choose must not have this feature.

ā“· Wiring the Contactor to the Mesa 7I96S Controller Card

After some extensive research (with help from AI!), I put together the following wiring diagram:


šŸ™ Note: For simplicity, I’ve omitted the load wiring in this diagram. It’s assumed that the load circuit is still present and connected as shown in the previous illustrations.

I also submitted this wiring to the LinuxCNC forum
for feedback, and it was confirmed to be correct.

ā¹ 24VDC Power Supply Unit (PSU)

To power the contactor, I’m using the MEAN WELL MDR-100-24 PSU. This unit also supplies power to the proximity switches. I’ve verified that it can deliver enough current for both the contactor and the switches.

(I’ve already wired two proximity switches for the X-axis and successfully tested them with the LinuxCNC application, though I haven’t documented that part yet.)

āŗ HAL (Hardware Abstraction Layer) Configuration

In the main .hal file, add the following configuration lines:

net router-enable    <=   spindle.0.on
net router-enable    =>   hm2_7i96s.0.ssr.00.out-00

It took me several failed attempts before I got this working. The following command helped verify the signal:

$ halcmd show pin | grep spindle

This lists spindle.0.on among other entries.

As for the ssr and the out-00 components in hm2_7i96s.0.ssr.00.out-00, I figured those out with help from this LinuxCNC forum discussion. I understand that this isn’t a complete configuration—it’s just enough to test the initial wiring setup.

ā» Test Using a G-code File and Video Demonstration of Load Switching

G-code files typically use the .ngc extension and can be created using a standard text editor. The test file below is quite simple:

M3 S1000  ; Enable spindle
G4 P10    ; Wait 10 seconds
M5        ; Stop spindle
M2

This sequence turns on the contactor coil (you should hear a click), then waits 10 seconds. During this time, once the coil is energised, the load—currently a Dremel grinder—should begin running. After 10 seconds, the contactor switches off, producing another click as it returns to its normally open state, and the grinder should stop.

šŸŽ„ The full video runs for about 7.5 minutes. The link below is intended to jump directly to the section (~2 minutes long) where the LinuxCNC application starts and the Dremel grinder is switched on:

Watch the video

ā¼ I only recently learned how to work with the contactor, and I’m excited that I’ve successfully gotten it to operate—hence this post!

As mentioned earlier, I’ve also figured out the basics of how the proximity switches work (at least at this early stage), and I still need to document that part.

One thing I haven’t covered yet is that I’ve also completed the main power distribution wiring, which includes the main switch, emergency stop button, and other essential components. I’ll need to write that up as well.

If you happen to read this post, thank you for your time, and I hope I did not waste it. Stay safe, as always.

✿✿✿

Feature image source:

🐧 Index of the Complete Series.