Simple relay control... or not?
-
@droftarts said in Simple relay control... or not?:
Just as a quick follow-up, this should work, then:
M950 R0 C"out4+out7"
...with the relay wires connected to the pins of Out 7 and the Out 7-9 jumper between V_OUTLC2 and 12V?
Thank you
-
@nightowl999 yep
-
-
@nightowl999
I just read the Amazon description for your relay-control module and it says it can be triggered by an Arduino using any voltage from 3 to 14 Volts, so you don't need to worry about drawing too much power from the onboard 12 Volt supply at all.
Where did you read that it takes 2 Amps to drive the module? I'd like to verify that.
-
Erm, I didn't @alankilian. That was @jumpedwithbothfeet wishing it was 2A!
-
@nightowl999 said in Simple relay control... or not?:
Erm, I didn't @alankilian. That was @jumpedwithbothfeet wishing it was 2A!
OK, I got it.
It looks like you're in good shape!
-
@alankilian
Yep. Just keep an eye out for a big cloud of smoke in SW England. If there is one, it didn't work -
@nightowl999 have you considered using the Laser/VFD output to drive the relay module? It provides a 5V signal.
-
My intention is to 'upgrade' to a milling motor in the not too distant future, @dc42, so I was going to leave the Laser/VFD output for that.
Doing it this way for now will support both my router and dust collector, and just the dust collector when I've saved enough for the MM.
-
@alankilian Ah, perhaps not.
I think I've missed something because, when I send the M3 code from the Console, I get the error:
M3
Error: M3: No P parameter and no active tool with spindle.Am I supposed to configure this elsewhere in the config.g file?
Thank you
-
@nightowl999
From the GCODE page:
"It is an error if there is no tool active or the active tool does not have a spindle assigned and there is no P parameter provided to define which spindle this should be applied to."
Maybe you just need to select a tool using a T command? REFERENCE
Or you need to define a tool using M563 ?
-
@alankilian Oops, well I haven't defined a tool, so that's probably a good starting point!
Would it just be a case of adding a single line like this before the M950 line, then:
M563 P0 R0 S"Makita" ; assign spindle 0 to tool 0 and name it Makita
Thank you
-
I'm still having some difficulty getting this 'simple' thing to work, but I have made some progress, thanks to you guys on here!
I've revisited my config.g file and come up with this to configure the relay:
; Makita and relay configuration
M950 R0 C"out1+out8" ; enable router relay on out8
M563 P0 S"Makita" R0 ; assign spindle 0 to tool 0 and name it Makita
T0 ; select tool 0Now, when entering M3 in the command line I don't any errors at all - but the relay doesn't activate, so nothing happens.
I know I'm getting there, but I must have missed something!
Any further help would be appreciated.
Thank you
-
@nightowl999 try adding
L1
to the M950 and then sendingM3 S1
rather than just M3 -
@nightowl999 Apologies if you have already stated this, I can't see it in the thread, but what firmware version are you on? Send M115 and post the response. Earlier versions of RRF 3.x dealt with assigning spindle outputs differently. See https://docs.duet3d.com/en/User_manual/Reference/Gcodes/M453
Ian
-
Hi @droftarts.
The result is...
m115
FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.4.0 ELECTRONICS: Duet 3 MB6HC v1.01 or later FIRMWARE_DATE: 2022-03-15 18:57:26 -
Tried that, @jay_s_uk, but got the following error:
Error: M3: Requested spindle RPM out of range.
I also tried S0, which didn't produce an error, but didn't operate the relay, either
-
@nightowl999 ok, attempt 2.
Remove theL1
from the M950.
And just send something like M3 S4000 (I know we don't have RPM control) -
Well, that worked @jay_s_uk!
-
@nightowl999 great, so any S value should activate the spindle. So just make sure your gcode has that an you'll be fine.
M5 should then turn it off