Running Gcode / CNC on Duet Wifi

Curious how one goes about running Gcode on the DuetWifi
Is there a GRBL interpretor?I use Fusion 360, Would like to output gcode that will run without modification.

So a number of our users have said they are using the DuetWifi on Lasercutters and milling machines. Does fusion360 output standard gcode? What does it look like?

some info on Fusion 360 and Gcode
http://www.instructables.com/id/CreatingASimple3DModelonFusion360andCreat/
info on post processor on fusion
https://forums.autodesk.com/t5/computeraidedmachiningcam/postprocessors101/tdp/5916925
GRBL processor for Fusion 360

So I think if Duet can read GRBL Gcode that would be easiest

Do you have some example output? It may be that the commands used are compatible. Otherwise there are two options  a GRBL compatibility, or another post processor to make it Duet compatible.
Looking at this:
https://github.com/Strooom/GRBLPostProcessor/wiki
It seams there are a bunch of restrictions (like 3 axis) that we might not want in the long run.

here is an example using the GRBL post processor built into Fusion 360
% (gcode test 1) (T2 D=3.175 CR=0  ZMIN=0.5  flat end mill) G90 G94 G17 G21 G28 G91 Z0 G90 (2D Pocket1) M9 T2 M6 S10000 M3 G54 M8 G0 X1.691 Y52.654 Z15 Z5 G1 Z1.5 F762 Z0.817 X1.684 Y52.65 Z0.747 X1.664 Y52.638 Z0.68 X1.632 Y52.618 Z0.62 X1.589 Y52.592 Z0.569 X1.538 Y52.56 Z0.531 X1.481 Y52.525 Z0.508 X1.42 Y52.488 Z0.5 G3 X0 Y52.088 I1.42 J2.318 G1 X50 G2 X52.088 Y50 J2.088 G1 Y50 G2 X50 Y52.088 I2.088 G1 X50 G2 X52.088 Y50 J2.088 G1 Y50 G2 X50 Y52.088 I2.088 G1 X0 G3 X0.098 Y52.103 J0.317 G1 X1.608 Y52.594 X1.675 Y52.615 Z0.508 X1.739 Y52.636 Z0.531 X1.796 Y52.655 Z0.569 X1.844 Y52.67 Z0.62 X1.88 Y52.682 Z0.68 X1.902 Y52.689 Z0.747 X1.91 Y52.692 Z0.817 G0 Z5 X0.146 Y0.605 G1 Z3.317 F762 G3 X0.154 Y0.583 Z3.198 I1.402 J0.557 X0.181 Y0.523 Z3.097 I1.393 J0.578 X0.226 Y0.434 Z3.027 I1.366 J0.638 X0.287 Y0.333 Z3 I1.321 J0.727 X2.808 Y1.989 Z2.835 I1.26 J0.828 X0.287 Y0.333 Z2.669 I1.26 J0.828 X2.808 Y1.989 Z2.504 I1.26 J0.828 X0.287 Y0.333 Z2.338 I1.26 J0.828 X2.808 Y1.989 Z2.173 I1.26 J0.828 X0.287 Y0.333 Z2.007 I1.26 J0.828 X2.808 Y1.989 Z1.842 I1.26 J0.828 X0.287 Y0.333 Z1.676 I1.26 J0.828 X2.808 Y1.989 Z1.511 I1.26 J0.828 X0.287 Y0.333 Z1.345 I1.26 J0.828 X2.808 Y1.989 Z1.18 I1.26 J0.828 X0.287 Y0.333 Z1.015 I1.26 J0.828 X2.808 Y1.989 Z0.849 I1.26 J0.828 X0.287 Y0.333 Z0.684 I1.26 J0.828 X2.808 Y1.989 Z0.518 I1.26 J0.828 X2.452 Y2.368 Z0.5 I1.26 J0.828 X1.523 Y1.128 I0.465 J0.62 X2.452 Y2.368 I0.465 J0.62 G2 X1.98 Y3.375 I0.711 J0.947 G3 X1.075 Y4.02 I0.659 J0.033 X2.9 Y0.524 I0.913 J2.272 X1.075 Y4.02 I0.913 J2.272 G2 X0.999 Y4.285 I0.8 J1.991 G3 X3.008 Y3.705 I0.782 J1.06 X6.983 Y0.209 I4.995 J1.957 X3.008 Y3.705 I4.995 J1.957 G2 X4.816 Y2.3 I2.085 J0.817 G3 X6.195 Y0.471 I0.197 J1.583 X10.17 Y3.025 I8.182 J1.277 X6.195 Y0.471 I8.182 J1.277 G2 X7.112 Y1.727 I2.251 J0.351 G3 X7.585 Y4.061 I1.028 J1.423 X11.56 Y7.558 I9.573 J5.809 X7.585 Y4.061 I9.573 J5.809 G2 X7.616 Y6.496 I1.965 J1.193 G3 X7.27 Y8.905 I1.566 J1.005 X11.245 Y12.402 I9.257 J10.654 X7.27 Y8.905 I9.257 J10.654 G2 X6.559 Y11.269 I1.517 J1.745 G3 X5.551 Y13.523 I1.865 J0.518 X9.526 Y17.019 I7.538 J15.271 X5.551 Y13.523 I7.538 J15.271 G2 X4.257 Y15.654 I1.027 J2.081 G3 X2.739 Y17.63 I1.99 J0.042 X6.714 Y21.126 I4.726 J19.378 X2.739 Y17.63 I4.726 J19.378 G2 X0.977 Y19.475 I0.561 J2.299 G3 X0.956 Y21.141 I2.026 J0.396 X3.019 Y24.637 I1.032 J22.889 X0.956 Y21.141 I1.032 J22.889 X1.075 Y21.123 Z0.524 I0.014 J0.317 X1.165 Y21.074 Z0.593 I0.105 J0.3 X1.215 Y21.026 Z0.696 I0.195 J0.25 X1.229 Y21.007 Z0.817 I0.244 J0.203 G0 Z15 M9 G28 G91 Z0 G28 X0 Y0 M30 %

The problem with the Grbl output is that it always start at max Z of the model and works towards the bed which is fine for a cnc mill but not for a 3D Printer I don't actually know if Fusion can output a GCODE File for a print object TBH.
HTH
Doug

Here is he same code but in a Mach 3 Post processor got Generic CNC
(GCODE TEST MACH3) (T2 D=3.175 CR=0\.  ZMIN=0.5  FLAT END MILL) G90 G94 G91.1 G40 G49 G17 G21 G28 G91 Z0. G90 (2D POCKET1) M5 M9 T2 M6 S10000 M3 G54 M8 G0 X1.691 Y52.654 G43 Z15\. H2 Z5. G1 Z1.5 F762. Z0.817 X1.684 Y52.65 Z0.747 X1.664 Y52.638 Z0.68 X1.632 Y52.618 Z0.62 X1.589 Y52.592 Z0.569 X1.538 Y52.56 Z0.531 X1.481 Y52.525 Z0.508 X1.42 Y52.488 Z0.5 G3 X0\. Y52.088 I1.42 J2.318 G1 X50. G2 X52.088 Y50\. I0\. J2.088 G1 Y50. G2 X50\. Y52.088 I2.088 J0. G1 X50. G2 X52.088 Y50\. I0\. J2.088 G1 Y50. G2 X50\. Y52.088 I2.088 J0. G1 X0. G3 X0.098 Y52.103 I0\. J0.317 G1 X1.608 Y52.594 X1.675 Y52.615 Z0.508 X1.739 Y52.636 Z0.531 X1.796 Y52.655 Z0.569 X1.844 Y52.67 Z0.62 X1.88 Y52.682 Z0.68 X1.902 Y52.689 Z0.747 X1.91 Y52.692 Z0.817 G0 Z5. X0.146 Y0.605 G1 Z3.317 F762. G3 X0.154 Y0.583 Z3.198 I1.402 J0.557 X0.181 Y0.523 Z3.097 I1.393 J0.578 X0.226 Y0.434 Z3.027 I1.366 J0.638 X0.287 Y0.333 Z3\. I1.321 J0.727 X2.808 Y1.989 Z2.835 I1.26 J0.828 X0.287 Y0.333 Z2.669 I1.26 J0.828 X2.808 Y1.989 Z2.504 I1.26 J0.828 X0.287 Y0.333 Z2.338 I1.26 J0.828 X2.808 Y1.989 Z2.173 I1.26 J0.828 X0.287 Y0.333 Z2.007 I1.26 J0.828 X2.808 Y1.989 Z1.842 I1.26 J0.828 X0.287 Y0.333 Z1.676 I1.26 J0.828 X2.808 Y1.989 Z1.511 I1.26 J0.828 X0.287 Y0.333 Z1.345 I1.26 J0.828 X2.808 Y1.989 Z1.18 I1.26 J0.828 X0.287 Y0.333 Z1.015 I1.26 J0.828 X2.808 Y1.989 Z0.849 I1.26 J0.828 X0.287 Y0.333 Z0.684 I1.26 J0.828 X2.808 Y1.989 Z0.518 I1.26 J0.828 X2.452 Y2.368 Z0.5 I1.26 J0.828 X1.523 Y1.128 I0.465 J0.62 X2.452 Y2.368 I0.465 J0.62 G2 X1.98 Y3.375 I0.711 J0.947 G3 X1.075 Y4.02 I0.659 J0.033 X2.9 Y0.524 I0.913 J2.272 X1.075 Y4.02 I0.913 J2.272 G2 X0.999 Y4.285 I0.8 J1.991 G3 X3.008 Y3.705 I0.782 J1.06 X6.983 Y0.209 I4.995 J1.957 X3.008 Y3.705 I4.995 J1.957 G2 X4.816 Y2.3 I2.085 J0.817 G3 X6.195 Y0.471 I0.197 J1.583 X10.17 Y3.025 I8.182 J1.277 X6.195 Y0.471 I8.182 J1.277 G2 X7.112 Y1.727 I2.251 J0.351 G3 X7.585 Y4.061 I1.028 J1.423 X11.56 Y7.558 I9.573 J5.809 X7.585 Y4.061 I9.573 J5.809 G2 X7.616 Y6.496 I1.965 J1.193 G3 X7.27 Y8.905 I1.566 J1.005 X11.245 Y12.402 I9.257 J10.654 X7.27 Y8.905 I9.257 J10.654 G2 X6.559 Y11.269 I1.517 J1.745 G3 X5.551 Y13.523 I1.865 J0.518 X9.526 Y17.019 I7.538 J15.271 X5.551 Y13.523 I7.538 J15.271 G2 X4.257 Y15.654 I1.027 J2.081 G3 X2.739 Y17.63 I1.99 J0.042 X6.714 Y21.126 I4.726 J19.378 X2.739 Y17.63 I4.726 J19.378 G2 X0.977 Y19.475 I0.561 J2.299 G3 X0.956 Y21.141 I2.026 J0.396 X3.019 Y24.637 I1.032 J22.889 X0.956 Y21.141 I1.032 J22.889 X1.075 Y21.123 Z0.524 I0.014 J0.317 X1.165 Y21.074 Z0.593 I0.105 J0.3 X1.215 Y21.026 Z0.696 I0.195 J0.25 X1.229 Y21.007 Z0.817 I0.244 J0.203 G0 Z15. M9 G28 G91 Z0. G28 X0\. Y0. M30

Yeah its quite different from the RepRap "standard" gcode ( which to be fair is very far away from the original gcode standard).
I think writing a mode that accepted this GRBL or MACH3 code in the firmware is probably not the way to go, it would be better to write a plugin for Fusion 360 to output compatible gcode. I have o idea how difficult that would be though.

I would have to look again because i never use the feature in 360 but I believe 360 itself doesnt even produce the gcode for printers, the print option (i believe) sends it to a slicer like simpllify3d

Autodesk does have their own slicer it can send to, you might take a look there

I do feel that this is something which should be an all integrated capability of Duet…. I envision a future where a Duet is controlling 5 independant xyz carriages like Project Escher but a couple tool heads are running a spindle or even pick and place for combining additive and subtractive manufacturing within a single printer.
Hint Hint

This is strictly for CNC milling and not 3D printer related.
the idea of a Duet Post Processor sounds interesting. I know with Smoothieboard it has a CNC mode, thought something similar could happen with Duet
Since GRBL is so common, wouldn't it be easier to have a interpreter in Duet to convert GRBL Gcode to Duet Code.that way all the CAM packages that can output GRBL gcode would be compatible and a custom processor for each CAM software wouldn't need to be created or maintained.

Hi I just registered here, but a few of you might recognize my user name from RepRap forum.
Over there, I had the same discussion with David (dc42) about CNCimplementation.
There seemed to have been an implementation of a "Roland" mill, but it is no longer pursued ATM. ( see M580 )
Might be a good idea to reuse these code fragments to implement a grblmachine. 
If GRBL is the defacto standard for CNC gcode then it starts to make sense to have those commands when the firmware is in CNC mode (or maybe split up CNC mode to milling/turning/mutiaxis). What was not clear to me was that there was any particular standard for CNC gcode (other than the original gcode standard which everything has extended in different directions).
What does the gcode generation for subtractive CNC?

If GRBL is the defacto standard for CNC gcode then it starts to make sense to have those commands when the firmware is in CNC mode (or maybe split up CNC mode to milling/turning/mutiaxis). What was not clear to me was that there was any particular standard for CNC gcode (other than the original gcode standard which everything has extended in different directions).
What does the gcode generation for subtractive CNC?
I am by no means an expert in any of this, just starting to wrap my head around all of it (so forgive me if this is wrong) But when I was looking at Fusion360 and its ability to send CAM gcode to UCCNC controller for my CNC router what i found was there is not a built in post processor for UCCNC like there is for Mach3.
But I also found a number of UCCNC pros discussing this on a forum where they tried a number of post processors inside Fusion360 and the one they found to not only produce compatible code for UCCNC but also Mach3 and others was the post processor called "WinCNC"
Wouldn't it make sense to base the Duets gcode abilities on that of what WinCNC produces since it seems to be the most compatible amongst many controllers, seems to me they did their homework on gcode compatibility and if i understand it correctly (have not taken the time to look yet) you are able to edit the post processors inside fusion to see what needs to be added to Duet

IMHO the easiest way to support all kind of dialects is to include a module, which enables any user to define his own G/Mcodes and put them in the macro folder. Of course a global database can help collecting them, so less experienced users can use them too.
The configoverride file then contains a list of the standard G/M codes that have been altered by the user.Starting point would be a basic RRF version, where most of the in/outputs are not reserved for fans, endstops, thermistors etc.
Pins required for stepper drivers stay reserved.I don't know if that's possible, but it would put an end to discussions which CNC dialect deserves support by RRF.

I think we need to understand the problem in more detail before recommending one action or the other.
A general gcode override ability as o_lampe suggests is interesting but I can see how that could end up being very complex to support, especially for inexperienced users.
Is anyone able to point me to a resource that lists the various CNC dialects (great term!), The various codes they use and what functionality that actually is?

I've counted more than 80 different post processors in Fusion 360. Way to much to work out the differences between them.
It seems they wrapped the firmware around the machine, now we try the opposite way: finding one code for all machines…I believe they all have some basic functions in common.
On my wish list are:
3 axis control incl. homing, spindle management, coolantpump for spindle and part and maybe some safety inputs ( flow sensor for coolant, temp sensor for spindle, enclosure door switch ) 
80 post processors? So 80 different gocde dialects? thats unfortunate.
For your wishlist:
All axis can be homed using G1 with the S1 switch.
Much of the rest could be implemented using these reprap gcodes:
M3: Spindle On, Clockwise (CNC specific)

M4: Spindle On, CounterClockwise (CNC specific)

M5: Spindle Off (CNC specific)

M6: Tool change

M7: Mist Coolant On (CNC specific)

M8: Flood Coolant On (CNC specific)

M9: Coolant Off (CNC specific)

M10: Vacuum On (CNC specific)

M11: Vacuum Off (CNC specific)
These are in the reprap gcode specification but not implemented in RepRapFirmware except for M3 which is Roland Mill specific
I think it makes sense to extend the the :
https://duet3d.com/wiki/Gcode#M580:_Select_RolandGcode into a "select CNC" and then
Having additional temperature triggers to trigger macros is on the wishlist, maybe a flow sensor can be similar enough to a temp or endstop trigger to run a macro when a threshold or state change is sensed.
