Wrong gcode to finish a print?
-
So I ran in to a problem with my finish gcode. I basically use the same code in cura but it I belive the new board and firmware interpret it a bit differently than I expected.
At some point during the finishing gcode execution the printer will retract several hundred millimeters of filament. This takes a min to complete then the rest of the code is executed. below is the modified version of Gcode. Originaly it had a line for G91 relative positioning before starting retraction and moving axis but for simplicity I removed it and made sure all the G1 commands used subtraction, addition , or absolute position that is executed from the start code.I suspect it has something to do with line 3 or 5 but those are subtraction from current position with federate. I must be doing something wrong cause the retraction is happening at the end of every print.
- M104 S0 ;extruder heater off
- M140 S0 ;heated bed heater off
- G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
- G1 Z+3 E-5 F9000 ;move Z up a bit and retract filament even more
- G1 X1 Y1 ;move X/Y to min endstops, so the head is out of the way
- G1 Z204.85 ;move Z to max
- M84 ;steppers off
-
Hi,
I had the same problem.
I noticed that in the code that was generated by Cura, there was a 5 mm retraction before the end code was executed. For me, this 5 mm retraction was enough, so I decided to delete line 3 and the E-5 code in line 4.Now at the end of the print, the filament is retracted 5 mm (generated by Cura) and then the end code is executed and the nozzle moves to the side of the print.
I'm not sure why the problem is happening with the original code, but the solution works fine for me.
-
Cura defaults to absolute extruder moves - in all the scripts.
If you are using relative extruder moves, you need to manually set that before doing custom retractions. -
@resam
So your saying I should used G91 ;relative positioning then use the G1 E-1 F300? Cause that was originally there but it seemed to go ignored. -
0_1551543416549_UMO_Layer acc check.gcode
For clarification I have attached the .gcode output from cura.
Start of the code in file
M140 S60
M105
M190 S60
M104 S205
M105
M109 S205
M82 ;absolute extrusion mode
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
M107 ;start with the fan off
G4 P100 ;delay for BLTouch
G1 Z10 F8000; move z fast to 10mm
G28 W ; home all without mesh bed level
G29 ;auto bed leveling
G1 Y0 X0 F8000.0; move print head to home position
G1 Z-9.5 Y-3.0 F1000.0 ; go outside print area and print bed close to hotend
G92 E0.0 ; reset extruder to 0
G1 X80.0 E15.5 F600.0 ; intro line, purge strip slow
G1 X150.0 E20.5 F1000.0 ; intro line pryge strip fast
G1 Z+3 ; raise Z 3mm before print start
G92 E0.0 ; reset extruder to 0
G92 E0
G1 F3600 E-6End of the code in the file
G1 F3600 E1388.3745
M140 S0
M107
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+3 E-5 F9000 ;move Z up a bit and retract filament even more
G1 X1 Y1 ;move X/Y to min endstops, so the head is out of the way
G1 Z204.85 ;move Z to min endstops
M84 ;steppers off
M82 ;absolute extrusion mode
M104 S0 -
I'm going to use the following code and see what happens. Will report back.
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off
G91 ;relative positioning
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+3 E-5 F9000 ;move Z up a bit and retract filament even more
G90 ;absolute positioning
G1 Z204.85 ;move Z to min endstops
G1 X1 Y1 ;move X/Y to min endstops, so the head is out of the way
M84 ;steppers off -
G91 only affects the X/Y/Z axis.
You want M83: https://duet3d.dozuki.com/Wiki/Gcode#Section_M83_Set_extruder_to_relative_mode
-
@resam said in Wrong gcode to finish a print?:
G91 only affects the X/Y/Z axis.
You want M83: https://duet3d.dozuki.com/Wiki/Gcode#Section_M83_Set_extruder_to_relative_mode
@resam
(facepalm) that makes things much more clear. Thanks for the assist. Bookmarking that page full of goodness.