how to control router on/off
-
I have a WorkBee CNC router controlled by a Duet. All works fine apart from the human element, namely I have to remember to switch the router on via its mains switch. On several occassions I have started a cut only to watch my router dive into the work and almost destroy the WorkBee because I have forgottent to switch the router on.
My plan is to control the router on/off with a relay control which I have already made. All I need now is a 24v or if necessary 5v source controlled by the Duet. Im considering picking up the 24v supply from heater 0 ( the 18amp). any controllable source will be OK.
All I need is guidance on what M codes to use to do this. I intend to put these codes in the post processor of VCarve Pro.Thanks in advance
-
Pick a spare heater or fan output and use it to drive the relay or SSR that controls the router. If using a heater output to drive a relay coil directly, you must add a flyback diode in parallel with the relay coil.
You can control that output using M42 commands, see https://duet3d.dozuki.com/Wiki/Using_servos_and_controlling_unused_IO_pins.
-
@dc42 Thanks for the very speedy reply. Are the fan pins 24v ? or do I have to change relay
-
@colin-kent said in how to control router on/off:
@dc42 Thanks for the very speedy reply. Are the fan pins 24v ? or do I have to change relay
The fan pins are VIN or 5V depending on the setting of the VFAN jumper.
-
Thank you. I will have a go and let you know when I get stuck
-
Could we control PWM or VFD that controls the spindle with this type of solution? anyone? I haven't tried this I am waiting until I gather enough information to know that I won't be wasting too much money in something that wont work. I am planning to build a delta style router for machining graphite for EDM work. Have a Duet Wifi 2 sitting around waiting for this. I promise I will post a video of this explaining my design if you help me :).
-
For me the solution turned out to be very simple. I used the fan0 connector and controlled it using M106 ie M106 S1 to turn on M106 S0 to turn off ( Fan0 being default) Works perfectly. All I need to do now is get the command, plus a short delay while the router runs up, into the Vcarve post processor. If anyone out there can give a pointer it would be appreciated.
-
@joz9982 said in how to control router on/off:
Could we control PWM or VFD that controls the spindle with this type of solution? anyone? I haven't tried this I am waiting until I gather enough information to know that I won't be wasting too much money in something that wont work. I am planning to build a delta style router for machining graphite for EDM work. Have a Duet Wifi 2 sitting around waiting for this. I promise I will post a video of this explaining my design if you help me :).
Yes. You can buy PWM to 0-10V VFD converters.
-
The modification to the post processor is also quite simple just add the M106 commands in header and footer. works perfectly for me also controls my dust extractor
-
@colin-kent said in how to control router on/off:
The modification to the post processor is also quite simple just add the M106 commands in header and footer. works perfectly for me also controls my dust extractor
You can also configure the fan output to respond to M3 and M5 spindle control commands.
-
@dc42 Thanks for that.
-
@dc42 how does one configure a fan output to respond to M3 and M5? Can that be used in conjunction with using a heater output to also respond to M3 and M5? RRF 2.
-
@halifaxalex You set the spindle output pin in the M453 command that switches the Duet to CNC mode: https://duet3d.dozuki.com/Wiki/Gcode#Section_M453_in_RepRapFirmware_1_x_and_2_x
Then you can use M3, M4 and M5: https://duet3d.dozuki.com/Wiki/Gcode#Section_M3_Spindle_On_Clockwise_CNC_specific_Laser_on_Laser_specific
You can map up to four spindles in RRF. Use M453 S parameter for each one. You should be able to use fan and heater outputs; refer to the following document for pin numbers as you're using RRF2 (update to 2.05.1 for bug fixes if still on an earlier version). Don't forget to disable the corresponding heater (using M307) or fan (using M106) first.
https://duet3d.dozuki.com/Wiki/Using_servos_and_controlling_unused_IO_pins#Section_Logical_pin_numbersI don't think you can run the fan output 'in conjunction' with a heater output, and have them both respond to the same M3/4/5 command. You need to have a separate M3/4/5 command for each spindle if you wanted them both running at the same time. But as M3/4/5 only turn the spindle on and off, I don't think this is a problem.
See this for general guidance for setting up a CNC machine: https://duet3d.dozuki.com/Wiki/Configuring_RepRapFirmware_for_a_CNC_machine
Ian
-
@droftarts I've had a look through some of this and the links you have provided, I can see how to output the PWM signal and configure it using M453 but cant see how to configure it to make M3/4/5 as well to control the ON/OFF of an output pin of my choosing. It would also be useful to configure other M codes to switch outputs for say a vacuum or air mist compressor.
-
@tyz said in how to control router on/off:
@droftarts I've had a look through some of this and the links you have provided, I can see how to output the PWM signal and configure it using M453 but cant see how to configure it to make M3/4/5 as well to control the ON/OFF of an output pin of my choosing.
You can do that using RRF3 but not with RRF2.
It would also be useful to configure other M codes to switch outputs for say a vacuum or air mist compressor.
For any M-code that RRF does not implement at all, you can create a macro file that is executed when you send that code. For example, if you want to implement NIST code M8 (flood coolant on), create a file called M8.g in the /sys folder, and inside that file put the commands that you want to execute in response to M8.
-
@dc42 Thank you, I had seen that I could create files for the unsupported M codes in the /sys folder. It does however seem very lacking for support of M3/4/5 codes when they've been implemented in to RepRap but don't actually do anything like switching a pin/port on/off to actually control a spindle. The only way to do this now is to modify a post processor to use the non standard commands for a spindle such as M7/8/9 which are normally used for coolant/air mist or M10/11 which are normally used for CNC axis clamping.
Thank you. -
@tyz they do turn on the router/spindle if you run RRF3.
-
@jay_s_uk I know, but that's no use to me as my Duet from Ooznest doesn't have RRF3 on it.
-
@tyz but its fairly easy to upgrade and there is now a CNC version of DWC for RRF3
-
@jay_s_uk It may be if you know what your doing, but the configuration on this is done by Ooznest and I don't know what else would have to be reconfigured as a result of differences between RRF2 & RRF3, some commands are different and others have the functionality moved to a different M code.