Gcode variation
There’s a fair amount of variation in gcode out there. Basically because as each vendor has a problem to solve it shows up as a new gcode. Plus since the code is inprecisely described there’s variation just because implementors have jumped to different conclusions about what is happening.
Most of the time, software describes gcode flavor based on the firmware that will interpret it. So you choose your machine type and the software makes adjustments based on heuristics that have basically been discovered one bug at a time.
For the FlashForge though, it doesn’t consume gcode, it consumes x3g commands, so what matters is what the slicer outputs and how the converter to x3g interprets that gcode. In this context, there are two main flavors of gcode. MakerBot flavor that is output and consumed by ReplicatorG (and MakerBot Desktop) and RepRap flavor that is output by most slicers (like when you choose Marlin) and can be consumed by GPX. So what’s the difference?
##Tool Change EDIT: This info is derived from reading GPX source code, I need to go back and play with MakerBot and RepG because I think GPX may have got this one wrong.
Typical RepRap community gcode for change tools or extruders is just:
But from what I can tell, whatever tool was specified last is expected to persist. So a move command with T1 as a parameter is supposed to carry over to the following line.
But MakerWare and ReplicatorG won’t take any of those as a toolchange apparently. The tool parameter just applies to the command on that line. To change tools with MakerWare:
But ReplicatorG both produces (when slicing) and expects (when converting gcode to x3g) the following.
RepRap used M108 to mean set the extruder speed (in rpm). It has been deprecated however.
##Temperatures Typical RepRap community gcode for setting various temperatures and continuing or waiting are the following:
MakerWare and ReplicatorG produce and expect the same for M104 and GPX will accept all, but the following, of them in either mode (MakerBot or Reprap). The snag is the following:
Which unfortunately is the same as set nozzle temp and wait for RepRap! The slicers often have a MakerBot switch or a way to set your own temperature gcode, but as I’ve come to depend more and more on gpx. I’m inclined to just figure out how to get all of my gcode into reprap style.
##Fans The only other reprap flavor issue that gpx takes into consideration is the heatsink fan vs. cooling fan. The hotend has a fan on it that keeps it from overheating and melting the platform it is on. You can turn that on and off in gcode. You really shouldn’t though because it should just run based on the temperature of the nozzle for longevity of the machine.
RepRap style:
MakerWare/ReplicatorG style:
Oops. This means some slicers output gcode they think will be turning off cooling for the first few layers to help with bed adherence, but will actually be putting extra wear and tear on the hotend surround on the bot! There isn’t really a reason to turn on and off the heatsink fan, so this is another case to go ahead and use RepRap flavor where possible.
And that’s it. Those are all the differences gpx takes into consideration. So from here on out I’m gonna switch to reprap flavor slicing and use that with gpx. Unless I’m slicing with MakerWare or RepG for some reason. I was afraid there was more to it than this, but both Slic3r and gpx’s conditionals are only these cases.
##How about a table
RepRap | RepG | Intent |
---|---|---|
M104 | M104 | Set nozzle temperature and continue |
M109 | Set nozzle temperature and wait | |
M190 | M109 | Set bed temperature and continue |
M140 | Set bed temperature and wait | |
M116 | Wait for all temperature targets | |
M106 | M126 | Set cooling fan state |
M107 | M127 | Cooling fan off |
M106 | Set extruder heatsink fan state | |
M107 | Turn off extruder heatsink off and melt the extruder platform |