gcode_compiler does not turn off laser! [patch]
themanyone opened this issue · 1 comments
The output of this tool leaves the laser on, potentially at full power.
Example gcode output:
M107; We are using alternate laser on/off commands here. But this should make no difference.
G1 F3000.0 X78.750087 Y15.866760;
M106 S255; [turn laser on full power!]
G1 F1000.0 X78.751687 Y15.866760;
G1 X78.748587 Y15.866760;
G1 X78.750187 Y15.866760;
G1 X78.750087 Y15.866760;
What's that smell? Gcode just ends here, leaving laser on. It does not send our custom command to turn it off.
The proper fix is probably inside gcode_compiler.
We have hacked around the issue by prepending the laser off command to the footer, and making the footer default to that using extend(). But, as stated before, this is probably not the proper fix.
@@ -66,10 +66,10 @@ class GcodeExtension(EffectExtension):
with open(self.options.header_path, 'r') as header_file:
header = header_file.read().splitlines()
- footer = None
+ footer = [self.options.laser_off_command]
if os.path.isfile(self.options.footer_path):
with open(self.options.footer_path, 'r') as footer_file:
- footer = footer_file.read().splitlines()
+ footer.extend(footer_file.read().splitlines())
# Generate gcode
self.clear_debug()
Addressed in the latest commit.