Setup Relay-Controlled Spindle
-
Is there some better place on the forum to post this?
-
@n7jti
It's just wild guessing and you might have tried it yourself already, but I'd defineM950 R0 C"nil+out1" L*somevalue*
My guess is, that out3 as nonexisting PWM pin has no valid signal and/or using M3 without a S(peed) value only works with a predefined speed from the L-parameter.
You might get away with setting out3 to high in config -
@o_lampe I'm following, but you're not using a spindle, per se, but a trim router, which is what I intend to do from my Duet3 MB6HC.
I'm happy to be corrected, but I don't think you need the second part of the code. Raymond Stone has published a blog (here: https://codingblog.galcomp.net/2020/08/15/adding-a-relay-to-a-duet-2-to-switch-on-a-router-via-gcode/?fbclid=IwAR3dWqBOuMMktVsoJPvOqLCNTAernA0aN4__sVvq2TbP3ZL2_Tdv6BDmFL4) explaining how he did it with a Duet 2, but he used macros. I think these are essentially M3 and M5 commands?
Hope this helps.
-
@o_lampe I tried using nil as a pin and it errors when I try it. SO I'm using an unused pin. I'll give the "L" a shot
-
@nightowl999 I can already switch my router on and off via a relay. The problem here is that I have to hand-edit the g-code that comes out of the post-processor in order to get my router to turn on and off automatically. That is painful. I'd rather have the router respond to M3/M5.
So how do we get a pin to be high/low in response to an M3/M5 command?
-
Sorry, @n7jti. I probably can't help you then
-
@n7jti The "L" made no difference at all.
-
@n7jti It may help showing a picture of your relay wiring/what type of relay etc and your full config.g file, adding an ! before the the output will also invert the signal, but you need to know if it requires a high or low signal to turn on the relay.
-
@n7jti which firmware version are you using?
Why are you using 2 pin names in the M950 R0 command when you have only one spindle control pin? Some of the examples in the M950 and M453 command descriptions use only a single pin name in the M950 R0 command.
-
@n7jti I'll need to pick your brains on that, probably. I still haven't quite got my head around how to do that, yet.