Tool Enable - M15 - IOT Relay - & Breakout board (auto turn off/on router)

Output Max is 3.3v according to Buildbotics information, which is what Onefinity forked. I thought I read something in their forum about jumping some pins to get higher output.

I have the same IOT relay, although somewhat modified, and have tested it with a calibrated 3.3v dc input to the control connector. It is polarity sensitive but worked just fine. I havenā€™t hooked it to the controller yet.

1 Like

Nadaā€¦no workie workie. :joy:

Well, I donā€™t understand how it randomly doesnā€™t work anymoreā€¦but I guess my IOT relay took a crap. :joy:

Sorry to hear. When you sent the M3 S1 command through the MDI, the icon turned to green + for tool enable outputs? Then back to black - when sending M5?

Noticed the power toggle is in the off position, was it on during your tests. Not speaking down to you, just an observation.

Yes sir. Even giving the IOT relay 12v to trigger the internal relay it still doesnā€™t click on.

Itā€™s all good. But to answer your question, the toggle switch shouldnā€™t matter if Iā€™m not mistaken. Thats just to turn power onto the switched outlets.

Yeah mine makes an audible click when it comes on. Seems like everything is right from the CNC end. I edited my post, not sure if you seen it but the power toggle was on? Itā€™s off in your one screenshot.

Yeah I saw. I suppose I should say Iā€™ve done a pretty elaborate VFD & SPINDLE setup previously on my shapeoko. Iā€™m a Commercial HVAC service technician and Iā€™ve got experience in moderate controls wiring. Lol. I think my IOT relay is just dead. Although my controller is putting out a bit less than the 3.3vdc the IOT states as the lowest input voltage it takes to enable the relay itself. But even with the 12vdc applied it still doesnā€™t do anything. Just dead.

I did just tested mine, and it did need to be powered on, even for the switched ports.

Iā€™ll be damned. I guess I havenā€™t used it in so long I donā€™t recall it needing to physically have 120v applied to actually trigger the internal relay. :joy: :rofl: :joy: :rofl:

1 Like

My bad. I feel like an idiot now. I literally used it maybe 2 times before I just went full on VFD & SPINDLE.

3 Likes

Got it working is all that matters!

I guess the incoming 120vac is needed to step up the incoming control voltage to 48vdc which is what the coil voltage is for the internal relay.

I modified my IOT relay when I first got it so that the one outlet that is NORMALLY ON but switches off when control voltage is applied is now an ALWAYS ON outlet.

1 Like

Okay thatā€™s sketchy. I donā€™t think Iā€™ll be using the PWM spindle (tool enable). If you happen to click on either Z zero or the XY zero in the jog commands area to the upper left of the screen it for some reason enables the tool which would turn on your router.

That is dangerous, went out to my machine and jogged all around and didnā€™t have that. Then I tested the M3S1 via the MDI to make sure it would turn on and it did. Just went out again to power it down and jogged and the router did turn on. Wonder if somehow the MDI is getting replayed as I sent a M5 command to shut it down and then jogged again and it didnā€™t happen. I use the controller mostly, only using the touch screen to probe xyz/z and start the job, probably why I havenā€™t seen it sooner.

2 Likes

Just did another simple test and that seems to be what is happening. If you previously sent a M3S1 command through the MDI and used the stop button instead of sending a M5 to stop the router, subsequent jogging seems to be replaying the M3S1 starting the router. Far from an exhaustive test but seems to be what is happening. @OnefinityCNC, if this is the case, this is one for the bug list to be resolved quickly as it could cause injury. @MindOfMcClure, this might be a solution to your issue as well.

1 Like

Iā€™ll give that a shot tomorrow. To your point thoughā€¦ That should be a top priority to fix, when I hit the jog itā€™s fortunate that I did not have the wrench on my router yet. Someoneā€™s I do job the machine a little closer went Iā€™m in the middle is a bit change.

Wonā€™t be doing that until itā€™s fixed. Iā€™m still waiting on controller #3, so itā€™s the screen buttons or bust until I get that 3rd and hopefully last one.

Thanks,
-Alex

There are two aspects to controlling an external relay highlighted in this excellent thread. I will break them down separately below.

Electrical Connections/PWM Settings

The tool output (PWM spindle) can be used to control an external relay with a few caveats:

  • The output will provide a PWM waveform with a duty cycle set by the M3SXXX command.
  • The duty cycle of the output is controlled by the XXX number in the M3SXXX command and the ā€œMin/Max Spinā€ settings under the ā€œToolā€ settings. For example, if we assume the following:

Min Spin = 0 RPM
Max Spin = 255 RPM
PWM Min Duty = 1%
PWM Max Duty = 99.99%
PWM Frequency = 1000Hz

This means that M3S127 will set the output signal to a 50% duty cycle (127/255 = 0.5). The output signal will have a 1kHz frequency and it will be high (3.3V) for 0.5ms and low (0V) for 0.5ms.

If we send M3S1 we are asking for a 1/255 = 0.4% duty cycle. Since this is below the PWM Min Duty setting, the controller will output a 1% duty cycle and we will get a 1kHz signal that his high for 0.01ms and low for 0.99ms.

  • The PWM signal cannot be reliably measured with a multimeter, especially at high frequencies. A multimeter will read close to 0V for low duty cycles and close to 3.3V for high duty cycles but it will not give an accurate reading in between because of its relatively low sampling rates. If you have access to an oscilloscope, that is the best way to view/check PWM signals.
  • For anyone reading this thread in the future, as noted above, the PWM output can only supply a few milliamps of current at 3.3V so it cannot be used to directly drive a relay coil. In this case, the IoT device has internal logic and circuitry to drive the relay.
  • The IoT relay probably has some high impedance input circuitry that feeds the logic circuitry which controls the SPDT relay inside the unit. I would be a bit concerned with feeding it a PWM signal instead of a straight DC signal as it could lead to a situation where the relay is being switched on and off at high frequency. This may not be observable in a highly inductive load like a spindle or vacuum motor but it would wear out the relay in fairly short order.
  • All that being said, the load 1 and 2 outputs should also work to control the relay. The Amazon listing says it will take control voltages up to 48VDC. The 36VDC load outputs should do the trick as they are straight DC output but please confirm the input voltage rating with the manufacturer first!

MDI/Jog Interaction

I was able to duplicate the same behavior with the spindle turning on when executing a jog from the UI after issuing an M3 command in the MDI command window:

  • Sending the M3S1 command from the MDI window activates the PWM signal which would turn on the relay (and the attached spindle).
  • Hitting the ā€œstopā€ button will stop executing any active gcode and turn off the outputs but it does not change the machine state. i.e. The PWM output is still commanded to be in the ā€œonā€ state with respect to the machine state.
  • The jog button saves the machine state using the M70 (Save Modal State) command before executing an incremental move and then restoring the machine state with M72 (Restore Modal State). When this happens the spindle output in the ā€œonā€ state is saved because it was never switched off in the machine state with the M5 commands. The M72 command restores the saved state, including the spindle in the ā€œonā€ state.

All that being said, this sequence of events can cause the spindle to come on while jogging if no M5 command is ever issued. Since it is a potential safety issue, we will modify the jog commands to drop the save/restore modal state in the next software release.

Hope that helps! Let me know if you need any additional info.

14 Likes