[FR] Automatic Extrusion

Hi,

If I understand this discussion correctly, the goal would be to replace a typical G1 X10 Y10 E2 command with a configuration command to set the extrusion width (something like SET_EXTRUSION EXTRUSION_HEIGHT=0.2 EXTRUSION_WIDTH=0.45) followed by explicit “move with extrusion” commands (something like MOVE_WITH_EXTRUSION DESTINATION_X=10 DESTINATION_Y=10 DESTINATION_Z=0.4). Thus, not sending encoded extrusion amounts on each movement command, and instead sending commands that try to better relay the intent.

This is something I’ve thought about a bit in the past, and I can give some of my high-level thoughts on it. My thoughts here are just “philosophical musings” and should not be taken too seriously.

To summarize though, for what it is worth, I’m not sure making a change like the above would be worthwhile.

If I could go back 15 years and scream about how painful it would be to add E to G0/G1 movement commands I certainly would. As I understand it, this was an invention of the RepRap team, and I don’t think it was a good choice. I’d certainly prefer it if the firmware received more context with extrusion (the other parameters of the movement commands are in millimeters relative to the bed, it is bizarre that the E parameter is not). Alas, I can’t go back in time to fix that, and nor can anyone else. It seems to me that “ship has sailed”.

In my opinion, the problem with trying to “improve legacy g-code” is that it never works in practice. Instead of getting a “better g-code”, one just ends up with two different “quirky g-codes”. Specifically, none of the slicers can remove support for the “older g-code style” (because there will be printers that don’t support it) and none of the firmware can stop supporting the “older g-code style” because there will always be prints/slicers emitting it. So, instead of “fixing g-code” one just makes “more quirky variants of g-code”. Thus, in my experience, the end result of “trying to improve g-code” just leads to “an even worse g-code”.

If I understand the proposal here, it’s mainly a semantic change. That is, one could mechanically translate to/from G1 and MOVE_WITH_EXTRUSION commands using a little math - for example one could mechanically convert a MOVE_WITH_EXTRUSION to G1 X{DESTINATION_X} Y{DESTINATION_Y} Z{DESTINATION_Z} E{MOVE_DISTANCE * EXTRUSION_WIDTH * EXTRUSION_HEIGHT / E_RATE}. For what it is worth, that’s what I’d recommend doing instead of attempting to “redefine g-code” - that is, accept that “g-code has quirky encoding rules” and just internally encode/decode to that quirky encoding as needed.

At some point in the future, of course, it might be realistically possible to fully replace g-code. I look forward to that day.

Again, this is just some of my high-level thoughts on the topic. I’m happy to be proven wrong. Please feel free to work on whatever topics you feel are worthwhile.

Cheers,
-Kevin

1 Like

Not exactly, the intention is following:
Add ability to work with simplified GCode, in general replace typical command G1 X10 Y10 E2 with G1 X10 Y10, extrusion amount will be calculated automatically by firmware (klipper), if you need a move without extrusion just use command G0 X20 Y20
In general that’s all

This feature is an attempt to remove the pain of E calculation when somebody is working with a printer and ask firmware to completely control extrusion, you can call it “Firmware extrusion control” I’m calling it “Velocity extrusion” just because original authors did call it this way.

This feature can give us following benefits:

  • Simplify commands for manual coding
  • Make calibration routines independent from slicers - get repeatable predictable behavior
  • Make existing software/libraries for G-code generation compatible with 3D printers (to some extends)
  • Speed up new software development
  • Return back portability of G-Code files between machines (at least in Klipper)
  • And much more will become possible when firmware can take full control of extrusion

In current basic implementation I didn’t touch internals of “E” processing, it just throwing it away from G0/G1 (if it was provided), calculate it automatically and injecting calculated value to G1 command. And of course it’s optional, you can enable/disable/change_parameters in runtime.
Most probably i will move it out to separate module.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.