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.
Nadaā¦no workie workie.
Well, I donāt understand how it randomly doesnāt work anymoreā¦but I guess my IOT relay took a crap.
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.
My bad. I feel like an idiot now. I literally used it maybe 2 times before I just went full on VFD & SPINDLE.
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.
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.
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.
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.