End gcode not fully executing
Hi,
I recently decided to try out Cura for cleaner supports/z-seams just to see how it went. I was lost on where to start with start and end gcode so I went to check my trusty reference manual a.k.a. bobstro's i3 notes, specifically his start/end scripts. I used his start code as a guide and modified it to fit my preference, but his end gcode looked pretty solid so I basically just copy/pasted it in. Startup went great, seems like adding the PINDA warmup to my starting code helped first layer quality slightly. Overall, it worked great for my first foray into porting my PrusaSlicer settings into Cura 4.8. Clean perimeters, barely noticeable z-seam, and just a hair (no pun intended) of wispy stringing (PETG). The only issue was, it seems like based on my pronterface log it stopped executing code at the end of the print when it should retract and fully lift away the z-axis. Does anyone see a problem here? I'm wondering if it might have something to do with the G4 command thrown in at the beginning of the end script.
Here's the end code
RE: End gcode not fully executing
So I watched Pronterface closely this time, and when the print completes and it just stops doing anything, I get a flood of this same error message to the point where it totally uses up all my RAM and freezes my computer for a minute.
RE: End gcode not fully executing
(Sorry about the three posts, I didn't make the time limit for edits)
Additionally, when I did a hard reset (hit the X button on the printer), it seems to be setting the bed and hotend temperatures to whatever values are in the text box in pronterface. It also tries to restart printing the file that was loaded into pronterface. Should I have just stuck with the default start/end code in Cura? Here's the starting code in case it helps.
; last updated 1212020
M300 S40 P10; startup chirp
M115 U3.9.2; tell printer latest fw version; set movement coordinates
M117 Initializing...
G21; set units to mm
G90; use absolute coordinates
M82; absolute extrusion mode; set initial warmup temps
M117 Nozzle preheating...
M104 S160; set extruder to no-ooze temp
M140 S{material_bed_temperature_layer_0}; set bed temp
M109 S160; wait for extruder to reach warmup temp before leveling
M300 S40 P10; chirp; home all axes
M117 Homing axes...
G28 W ; home all axes without mesh bed level; Present bed for cleaning in PINDA warmup position
G0 Z3; Raise nozzle before move
G0 X125 Y180 F10200; Move nozzle to PINDA warming position
G0 Z0.15 F10200; Lower nozzle to PINDA warming position
; Wait for PINDA warmup
M117 PINDA warmup...
M860 S35 ; wait for PINDA temp to stabilize
M140 S{material_bed_temperature_layer_0} ; set bed final temp
G0 Z3; Raise nozzle before move
M300 S40 P10 ; chirp; Mesh bed leveling
M117 Leveling bed...
G80 ; mesh bed leveling
M117 Saving results...
G81 ; save mesh leveling results
; Final warmup routine
M117 Final warmup...
G0 Z5; Raise nozzle to avoid denting bed while nozzle heats
M104 S{material_print_temperature_layer_0} ; set extruder final temp
M109 S{material_print_temperature_layer_0} ; wait for extruder final temp
M190 S{material_bed_temperature_layer_0} ; wait for bed final temp
M300 S40 P10 ; chirp; Prime line routine
M117 Priming...
G0 Z0.15 ; Restore nozzle position - (thanks tim.m30)
M900 K0; Disable Linear Advance for prime line
G92 E0.0 ; reset extrusion distance
G1 Y-3.0 F1000.0 ; go outside print area
G1 E2 F1000 ; de-retract and push ooze
G1 X20.0 E6 F1000.0 ; fat 20mm intro line @ 0.30
G1 X60.0 E3.2 F1000.0 ; thin +40mm intro line @ 0.08
G1 X100.0 E6 F1000.0 ; fat +40mm intro line @ 0.15
G1 E-0.8 F3000; retract to avoid stringing
G1 X99.5 E0 F1000.0 ; -0.5mm wipe action to avoid string
G1 X110.0 E0 F1000.0 ; +10mm intro line @ 0.00
G1 E0.6 F1500; de-retract
G92 E0.0 ; reset extrusion distance; Final print adjustments
M117 Preparing...
M300 S40 P10 ; chirp
M82 ; use absolute extrusion mode for print
M204 R1250 ; sets retract acceleration (R), mm/sec^2
M900 K{material_linear_advance_factor}
M900 W{line_width} H{layer_height} D{material_diameter}
M117 Printing...
RE: End gcode not fully executing
In the posts above did you notice you have a corrupt character after the G1 Z210 ? Notice your post above the diamond with the question mark.
That's an indication of a dodgy encoded character that the website doesn't know how to display. If I paste that text into notepadd++ it displays a little box instead but same issue. If that character is actually in your end gcode then the printer could be having even more issues with it.
Its possible that its not displaying anything in Cura as the software might just not be able to display it. I'd delete that end section and paste in a clean version.
RE: End gcode not fully executing
So I watched Pronterface closely this time, and when the print completes and it just stops doing anything, I get a flood of this same error message to the point where it totally uses up all my RAM and freezes my computer for a minute.
You'd have to watch the lines being sent to the printer to see what is specific about line 31083. I've seen CRC errors when sending very long lines to the printer with the M117 gcode command.
Do check this line:
G1 Z210� ; raise Z
If that's a direct paste from your actual gcode, check that line in your gcode to see if there is a non-ASCII character after the Z210. That might cause a CRC error if so.
and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan
RE: End gcode not fully executing
Well I opened the sliced file in my C++ IDE just so I could get actual numbered lines, and it looks like line 31083 is just a regular extrusion move, so I think that's more of a symptom than a cause. What I did notice was that when I checked the end code in Cura, all seemed to be normal, but when I opened up the sliced gcode file in VSCode, it shows that corrupted character.
Perhaps this is simply a case of Cura passing off corrupt characters as whitespace, which would fly under the radar until slicing? I'll have to see if removing that whitespace solves it.
EDIT: Can confirm that removing whitespace in Cura start gcode and re-slicing does not remove the corrupt character. How weird.
RE: End gcode not fully executing
Tried just manually entering
G1 Z210; raise z
And it sliced without introducing that character. Also, I went ahead and just removed that line and re-typed it myself, and the corrupt character doesn't get introduced into the sliced file either. Interestingly enough, if I directly copy/paste the end gcode from your blog straight into VSCode the corrupted character shows up. May have something to do with my browser or your blog's CMS's code boxes.
I am in a bit of a rush to get the parts for my Ender 3's Hydra setup printed, so for now I think I'm going to just go ahead and use my already-tuned PrusaSlicer profile to slice, but I will attempt another one of these prints soon after confirming that the corrupted character doesn't show up in the gcode.
RE: End gcode not fully executing
I did find this post that was a bit enlightening. It basically says that if an unknown character comes up in gcode then the gcode is truncated at that point. This sounds like what's happening with my setup.
https://github.com/prusa3d/PrusaSlicer/issues/600