Mach4 with Duet on CNC
-
I plan to use the Duet with Mach4 to control my CNC machine. Is Duet able to handle Mach4? I really need to know before shelling out for it. If not, what does everyone use for a g-code generator for their CNC?
-
@perseveranze You wouldn't need Mach4 with the Duet, you would create your gcode from your favourite cad/cam tool like Vectric Aspire, Fusion 360 etc and then upload this to the Duet via the web interface, the Duet then handles running the gcode and doing the motion control that Mach4 would normally do.
-
Basically with Mach3/4 and similar CNC machines, the controllers are quite dumb - they connect to a computer (or these days one can use a RaspberryPi or similar) via USB, and software on this computer sends the gcode commands one-by-one. A downside to this is the speed at which commands can be sent (if you have high detail curved surfaces, which are sent as segments, the machine may start to stutter; this is why these machines typically support the G2 and G3 commands for curves).
With a Duet mainboard, you can copy the gcode files over the network to your machine and then have it 'print' the gcode file - which runs the job (so it acts as both the controller and controlling computer at the same time). Since the Duet can read as fast as as it needs to and have a much better processor, having a high detailed curve as segments does not (at least in my setup) cause stuttering.
I have uploaded a Post Processor file for Fusion 360 in this forum - this is what I use on my machine and it works just fine (support for multiple tools etc).
-
@jacotheron said in Mach4 with Duet on CNC:
Basically with Mach3/4 and similar CNC machines, the controllers are quite dumb - they connect to a computer (or these days one can use a RaspberryPi or similar) via USB, and software on this computer sends the gcode commands one-by-one. A downside to this is the speed at which commands can be sent (if you have high detail curved surfaces, which are sent as segments, the machine may start to stutter; this is why these machines typically support the G2 and G3 commands for curves).
With a Duet mainboard, you can copy the gcode files over the network to your machine and then have it 'print' the gcode file - which runs the job (so it acts as both the controller and controlling computer at the same time). Since the Duet can read as fast as as it needs to and have a much better processor, having a high detailed curve as segments does not (at least in my setup) cause stuttering.
I have uploaded a Post Processor file for Fusion 360 in this forum - this is what I use on my machine and it works just fine (support for multiple tools etc).
With that being said, do you use a corner finder probe for XYZ to zero in on a corner or to compensate for angle deviation or do you use another method that I'm not thinking of? If you do zero a corner of the work, how do you do it?
-
@perseveranze Your required functionality is a higher level one. With Mach3/4 that is done for sure in the PC, with the controller providing just bare functionality - move toward positive/negative of a coordinate, on a specified axis, until the probe is triggered. With Duet you could achieve most of the functionality with simple macros you have to write yourself, or, maybe, find some examples on the forum.
With the DWC getting more and more advanced, hopefully some of these CNC functions will also get implemented. Things like automatically determining angle deviation of an axis or finding the center of a certain feature (like inner or outer circle or rectangle) require variables and math in macros or some clever code in DWC.
With Mach3/4 you have the controller that is just providing pulses to the steppers as needed and controlling some inputs and outputs, with the PC software converting the GCode to controller commands, showing the GUI and implementing some of the more advanced features, like the ones mentioned above.
With Duet you get the controller and the part of code that converts GCode to its internal commands always running, plus the GUI implemented by DWC that you can open only now and then if you don't continuously monitor the running job.
You could get the Duet controlled through Mach3/4 software if a completely different firmware would be written, able to handle the probably totally different communication protocol.
-
I have implemented a simple probe (the cheap Z only style probes), and it is nice and accurate. I move to the correct X/Y coordinates for the stock, then run a Macro that sets the current position as origin for the current coordinate system. The probe runs on every tool change to ensure they are all correctly positioned.
-
@jacotheron I do the same. For X/Y alignment I rely strictly on mechanical ways of finding the position (finding the coordinate where the cutting tool touches the work piece). For Z I use a proper tool height sensor, but in the end the effect is the same.
M585 allows simple X/Y tool alignment if a proper probe is installed (I personally don't trust the metal plate touching solution - I broke quite a few mills because something was not "conductive enough" in the process). More complex things, like center finding, is upper level stuff, not the job of the controller part of the firmware.
-
@perseveranze said in Mach4 with Duet on CNC:
I plan to use the Duet with Mach4 to control my CNC machine. Is Duet able to handle Mach4? I really need to know before shelling out for it. If not, what does everyone use for a g-code generator for their CNC?
If you are determined to use Mach4 (shudder, shudder), pick a controller for which M4 has a "Plug In". A "Smoothstepper", or a "TinyG", and old style "BOB" or similar.
At this time, Duet does not have such a plug in. Interfacing M4 and Duet/RepRap will be a "by hand" stitch-together effort. Personally, I'd never consider it. In addition, once Duet is "hidden" behind such an M4 interface, I can't see that it brings any advantage, as vs. one of the above suggestions.
.
Since I put in my editorial "Shudder" above, I suppose I should explain what I mean. M3 was OK for its time, and I used it quite a bit. M4 happened after the M3 author sold the company... it's a pure marketing grab, a new version number with several reduced capabilities from M3 (because the new people don't really understand shop floor operations of CNC). Purely a marketing/money-grab play. In short, M4 sucks.
I would HIGHLY recommend CNCjs and TinyG, instead of Mach4. Even Chilipeppr and TinyG would be a better choice.
P.S. If you go "Smoothstepper" (a good board), go Ethernet. The Ether version is incredibly stable; the USB version is a bit flaky, in particular the USB cable is sensitive to EMI. Yes... I've run a bunch of Mach...