-
This is a very simple query which is that I need to find a way of switching the "e1heat" 24v output, which is connected to a relay with flyback diode, to switch a router spindle and dust collector at the beginning and end of a job using the M3 and M5 commands.
I've looked but can't find any guidance specific to this- all the responses appear to be about driving a VFD! -
@woodcarver Welcome to the forum
M3 and M5 control a spindle, but first the spindle needs to be configured using M950:
https://docs.duet3d.com/User_manual/Reference/Gcodes#m950-create-heater-fan-spindle-or-gpioservo-pinSo most simply
M950 R0 C"e1heat"
you may need to invert the PWM logic in this manner:
M950 R0 C"!e1heat"
If you know the best PWM frequency for your motor this can be set with the Q value:
similarly if you know the RPM of the motor at full power then using the L parameter allows you to set this.
I am moving this thread to the CNC forum as there are people at lot more knowledgeable than me there that can help
-
-
@T3P3Tony
Thanks for your advice- however I've inserted that command line into the spindle setup file to no effect. (there's no need fo L and Q values) The G-code files I use all have M3 and M5 in the header and post script. Is there anything else I should be doing before looking for a hardware fault? -
Try setting that pin as a simple GPIO out and then using M42 to switch it to confirm if the hardware is working
e.g.
M950 P0 C"e1heat"
then send
M42 P0 S1 for full on, M42 P0 S0 for fully off, M42 S0.5 for 50% PWMif thats not working then check that the output of e1heat switches using a multimeter and the M42 command above. When its "on" e1heat should be close to GND, when "off" e1heat should be close to VIN.
-
@woodcarver I'm wondering if you have to switch the Duet to CNC-mode to allow M3 and M5 commands?
-
@o_lampe said in on-off control of router using M3 and M5 g-code commands:
@woodcarver I'm wondering if you have to switch the Duet to CNC-mode to allow M3 and M5 commands?
That's correct in firmware 3.4.x and earlier. In firmware 3.5 you should be able to use M3 and M5 in FDM mode too.