[Brainstorming] Force absolute extrude values in filament estimate #1690

Open
Moredread opened this Issue Jan 6, 2017 · 6 comments

Projects

None yet

4 participants

@Moredread

The Craftware slicer generates an M83 (relative extrude values) at the start of the GCODE when a startup extrude is set, but generates absolute extrude values. This throws of the time and filament usage estimates, i.e. they are often much larger as expected, as octoprint.util.gcodeInterpreter.gcode uses M82/M83 to detect the extrusion value mode.

Would it be worthwhile to have a detection of Craftware GCODE to force the setting of absolute values? Or is there infrastructure for the user to replace text in the GCODE on the fly (per regex or string replacement) I haven't seen?

@foosel
Owner
foosel commented Jan 9, 2017

Sounds like Craftware should fix their GCODE generator if I understand that correctly.

But in general, the octoprint.filemanager.preprocessor hook might be of interest here - if there's a way to detect Craftware GCODE files easily, it could simply rewrite the contained M83, either by removing it completely or replacing it with M82 instead or something.

@nophead
Contributor
nophead commented Jan 9, 2017

Seems legitimate GCODE to me. When using Cura I also switch between relative and absolute in my start.gcode and end.gcode because Cura only does absolute, which is no good for manual manipulation.

@foosel
Owner
foosel commented Jan 9, 2017

M83 followed by relative extrusion values I'd call legitimate. M83 followed by absolute values sounds broken to me though.

@nophead
Contributor
nophead commented Jan 9, 2017 edited

I assumed the OP meant that it did some relative extrusions in the start gcode and then switched to absolute. If there is no M82 in between then I can't see how it works. The firmware must be broken.

Of course, for the first extrude, relative and absolute are the same, so perhaps it just ignores M83.

@foosel
Owner
foosel commented Jan 9, 2017

At least that is what I understood was the issue here, M83, no M82 after but absolute extrusion values throughout the file anyhow. Maybe @Moredread could provide us with an example file though, to have some certainty of what is actually the case here? :)

I agree that I'd expect the printer to also go haywire in such cases, if it supports M83 (who knows, maybe it doesn't).

@Moredread

@foosel is correct. It seems the Craftbot (the main target for Craftware) ignores M82/83, so I only noticed it when tracking down bogus filament usage values. I've attached a sample file below.

I'll look into using the hook @foosel mentioned above, the GCODE generated by Craftware should be detectable by the comment in the first line. Of course it'd be better if it is fixed in Craftware itself. :/

craftbot cube.gcode.txt

I hope I haven't mixed up what absolute and relative values mean. Sorry in advance if this is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment