On my to-do list is a solution to switch on/off the router using gcode (so no longer pushing the switch, a nice to have feature). Running a 240 volt Katsu / Makita clone I can’t use PWM for this.
So began tinkering and wonder if someone placed a coupling relay like this in its circuit between the power socket and router. The DC coil is 12 volt, so I think that wiring it to a fan port on the SKR Pro, could power it by running PWM at a 100%.
In the specification sheet I’ve read it’s about 78mm high, so I imagine it might fit between the rails to hide it away safely.
You would never want to do PWM control with a mechanical relay- best case you’ll kill it fairly quickly. Worst case, it’ll weld the contacts closed and you’ll have an always on router.
I don’t know if it’s a good idea to try and PWM the router in the first place (VS just setting a speed control), but if you were wanting that, you’d be after a zero crossing SSR (a special AC type of SSR that switches the current at 0V AC crossing, otherwise the SSR can get stuck on)
If you’re using octoprint there’s a tasmota plugin so you could have the router controlled by a tasmota plug or relay
Oh, wrong forum, was expecting something else…
No, still using the good old way of working by jamming in a usb stick I will read into the matter though! So thanks for pointing that out.
So there are also optical relays, a bit more expensive but still doable. I speak about PWM only because I need to have 12V off by default, but on when starting the script, so could use a heater port to as an alternative (I think).
Well the relay is only to power it on / off. But since you brought up the matter, I believe the speed dial on the router is just a pot meter. So that could be replaced by PWM. No?
Optical (optocoupled) mechanical relay is still a mechanical relay… It will die quickly if driven as a PWM. If the relay has mechanically actuated contacts, it’s not a good choice for PWM control
If you are using a relay in that manner, it needs to be a zero crossing SSR.
The router speed control on these compact routers is likely a resistive potentiometer, but that’s not the same as PWMing the inlet power.
I’ve never tried to PWM these small routers, but I’ve heard (and I think saw this confirmed here on the forums) that it doesn’t yield good results.
interesting discussion, i know that V1 sells something that i believe is for this?
I would be interested to hear what they are like? Maybe someone can chime in with a link for the OP.
PWM at 100% or 0% would be fine. It won’t toggle the relay at the pwm frequency.
I don’t know enough about the relay you posted, but many people have done that. In the US, there is an “IOT Relay” you can search for (in the forums). There are also premade boards by companies like sainsmart. If you search amazon for “arduino relay”, you will find a bunch. Bare relays need a little more electronics to work. Specifically the flyback diode and maybe some input power filtering. These boards handle that, and are pretty inexpensive. I think the relay you posted would work.
If looking for simple “on/off” control with a relay, look for a simple digital on/off pin. In my experience, this is often described as the “spindle enable” signal.
I built out a full closed-loop variable RPM solution using the AC dimmer board sold in the V1 shop. It works, but it is not a single board, turn-key solution. This experimental project is covered in the extensive PID -Hardware Solution needed for a software fix discussion thread. For CNC control it requires an additional microcontroller (I’m using an Arduino Nano) that runs code (I had to tweak to work correctly with my non-V1 control board) which monitors an RPM sensor added to the spindle which then mediates the PWM signal coming out of the CNC controller and turns it into the analog voltage input the AC dimmer board needs, and to tweak this analog voltage to maintain the commanded RPM under changing cutting loads. I added a switch and a potentiometer to give me manual RPM control as well. I like the solution, but I like to tinker and it’s way more intricate than simply identifying an on/off pin for a relay.
Yes, I’ve seen it in one of Ryan’s posts. However I was unable to find a 240v version of it, that’s why I looked at Coupling Relays (the arduino’s rarely switch higher voltages) as there is also a fly back & filtering in those.
I got confused, I remember that opto’s are safer to use in case the relay breaks, the low level circuit doesn’t get blown away by the higher voltage. But I fail to understand why the relay would fail? The PWM would only be used to switch the relay, not for other purposes.
Thanks for the feedback Tom, RPM control isn’t really on my wishlist right now, as I do not seem to have use for it now. But good to know that my reasoning is somewhat correct.
I’ll order a relay one of the days and will try it out. I’ll provide feedback once up and running so others might take use of it too.
I think the rationale behind the concern that connecting a relay to a PWM pin might cause the relay to fail is that the PWM signal would have the possibility of crossing the trigger voltage level for the relay often, thereby triggering the relay on and off a lot more often than they are built to handle.
There’s no doubt that a relay is the right tool for the switching job. The recommendation I’m seeing is to not us a PWM pin to drive the relay.
alright, now I understand!
That´s indeed a risk.
Will look into it if I can use a pin from Extension 1 or 2, on my SKR Pro, instead to trigger the Relay.
Searching for “arduino relay” seems to me to be the magic sauce to find a bunch of relays that can be triggered by the 5V, digital output of an arduino. These type of boards:
These are only rated for 125VAC. But it may be possible to find similar boards where you are. And the one you linked may be that. I just don’t want to look closely at it (mostly because I don’t want you to trust me. I want you to know for yourself, so you can know enough to accept the risk).
I personally don’t see a lot of risk using the pwm pin to get 12V. As long as you never use any duty cycle other than 0% or 100%.
Tom has correctly described the concern I expressed.
If you use a non-PWM pin and the relay is either ON for periods when the router is milling, or OFF- then pretty much no concerns.
If the pin is a PWM pin and there is any level of pulsing, the relay will wear out quickly. (I’ve seen that happen in other applications where even at “100%” duty cycle, the pin still glitches)
So, test it and as Jeff said, if it’s not toggling at 100% duty cycle then it should be fine.
I don’t think I saw what board you are using, so I’m not sure if it would be a good idea to add a flyback diode for that relay. The danger there is that the inductive collapse when the relay is shut off could end up blowing the driver in the board that runs the relay. Optoisolated mechanical relay modules don’t have that problem, but then you have to directly supply the relay module with power to run the coil. Like Jeff said, better that you research this well so you don’t end up blowing the output on the controller you plan to use.
You can use M42 to set the pin. It won’t do any pwm. I really think we are making a mountain out of a mole hill here.
Thanks for the feedback guys, I appreciate the warning and detailed explanation.
I´ll use the coupling relay so I can mount it in the electrical box, and when using PWM pin I will look for a PWM to analog convertor too, to avoid the issue described by MakerJim.
Just a followup question. Does anyone know what voltage the PWM pins use (other then the Fan, that´s just 12v)? And am I correct the Heat0 / 1 / 2 need the 12V power from hot bed or bed power?
It is low side drive. That means the positive end is tied directly to your 12V rail. The negative is the switched side. It switches between floating and ground (on when it is ground).
Need to look for a 12V PWM to analog convertor instead of 5v
I just skimmed the posts above, so my comments below may have already been mentioned.
One solution is a solid-state relay (SSR). For inductive loads, you want amperage rating of the SSR to be 10X the rated amperage of the load. Here is one off Amazon that will work with your router.
If you go with a relay designed for an Arduino as suggested by Jeff, I suggest spending a little bit more and purchasing the 30A version like this one. It is optocoupled, and it is rated for an inductive load of 1 1/2 HP at 240V.
Neither solution should require converting PWM to analog as long as you set the pin HIGH (or select a non-PWM pin).