Notifications
Clear all

Start gcode optimization results  

  RSS
ggppjj
(@ggppjj)
Active Member
Start gcode optimization results

Hello!

I got into a rabbit-hole of customizing and where I felt I could improving the default start gcode included for the MK3S in PrusaSlicer, and wanted to share what I've cobbled together to see if what I'm doing makes sense and isn't garbage. So far it seems to improve my print reliability by removing the oozes from the nozzle at the beginning of a print by preheating the nozzle at a lower temp (3/4ths of the first layer temp minus an arbitrarily hardcoded 10 degrees). It will also perform what the "Pretty PLA" profile that I used as a base calls a purge bubble at the beginning of the intro line, which additionally seems to improve the reliability of the intro line itself in my so-far limited testing. My only  concern is that I don't really know enough about the PINDA and the SuperPINDA to know whether the nozzle changing temps as mesh bed levelling is happening (which, with PETG and the 7x7 MBL grid enabled, reaches the print temp just near the end of the bed level) would negatively impact the measured distances. So far on my MK3S+, I haven't seen any issues that would indicate that this would cause problems, but it is something that I'm curious about.

Anyways, hopefully someone finds it helpful (or tells me any mistakes I made).

M862.3 P "[printer_model]" ; printer model check
M862.1 P[nozzle_diameter] ; nozzle diameter check
M115 U3.10.0 ; tell printer latest fw version
G90 ; use absolute coordinates
M83 ; extruder relative mode
M104 S{first_layer_temperature[0]/2+first_layer_temperature[0]/4-10} ; set extruder temp to 3/4th first layer temp -10 as preheat without waiting
M140 S[first_layer_bed_temperature] ; set bed temp without waiting
G28 W ; home all without mesh bed level
M190 S[first_layer_bed_temperature] ; wait for bed temp
M104 S[first_layer_temperature] ; set extruder temp without waiting
G80 ; mesh bed leveling
G1 Y-3.0 Z0.6 F1000.0 ; go outside print area
M109 S[first_layer_temperature] ; wait for extruder temp
G92 E0.0
G1 Z0.2 E8 ; Purge Bubble
G1 X60.0 E9.0  F1000.0 ; intro line
G1 X100.0 E12.5  F1000.0 ; intro line
G92 E0.0
M221 S{if layer_height<0.075}100{else}95{endif}

; Don't change E values below. Excessive value can damage the printer.
{if print_settings_id=~/.*(DETAIL @MK3|QUALITY @MK3).*/}M907 E430 ; set extruder motor current{endif}
{if print_settings_id=~/.*(SPEED @MK3|DRAFT @MK3).*/}M907 E538 ; set extruder motor current{endif}
Posted : 25/07/2021 10:11 pm
fuchsr
(@fuchsr)
Famed Member
RE: Looks okay

I don't see anything wrong with it. I'm not sure there's much point in using a calculator "holding" temperature rather than going with say 170 as used in the Mini startup gcode.

Personally, I'm using an adaptation of @bobstro's startup code which works really well for me. The only changes I made was to remove the M300 and M117 user interactions, set the holding temp to 170, and to move the nozzle up to 80mm after the MBL and while heating the nozzle up, so I can do a last minute cleanup of the nozzle, if needed.

In that version of the code, the priming line is done a bit differently than you do it, and it works great.

Posted : 26/07/2021 11:14 am
fuchsr
(@fuchsr)
Famed Member
specific code

Edit period expired, so here's the specific prime line code used by bobstro:

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 wipe action
G1 E0.6 F1500; de-retract
G92 E0.0 ; reset extrusion distance 
Posted : 26/07/2021 11:21 am
ggppjj
(@ggppjj)
Active Member
Topic starter answered:
Oooh

The calculated temp is something that I feel gives it some additional flexibility for higher-temp print materials so my PLA, TPU, and PETG both preheat to 10 degrees lower than 70% of their various print temps. It's probably unnecessary (especially the hardcoded minus ten that my brain decided would be good for "safety", keeping in mind that it would only really be effective in some way in the case of low print temps anyways), but it doesn't increase print time or slicing time to any appreciable degree. 

I'll change out my intro line to the one you suggested and test it out, the wipe seems like a good addition!

Posted : 26/07/2021 2:47 pm
bobstro
(@bobstro)
Illustrious Member
Best to wait to hit no-ooze temp to avoid possible PEI damage

Quick observations:

Posted by: @ggppjj

 

[...]
M104 S{first_layer_temperature[0]/2+first_layer_temperature[0]/4-10} ; set extruder temp to 3/4th first layer temp -10 as preheat without waiting
M140 S[first_layer_bed_temperature] ; set bed temp without waiting
G28 W ; home all without mesh bed level

You are setting the nozzle temp presumably to a "no ooze" temp before doing mesh bed leveling. This is a good thing, however:

  • One reason for doing the 2 step warmup is to heat the nozzle up enough that any ooze hanging off the nozzle will be sufficiently warm to bend if and not mar the PEI surface if you don't spot and remove it before mesh bed leveling. You're carefully calculating and setting a temperature, but not waiting for the nozzle to actually hit that temperature before leveling. You might as well set the final 1st player nozzle temp in that line, or insert M109 to wait for your no-ooze nozzle temp before mesh bed leveling.
  • If your fancy math is calculating 75% of your print temp, be sure it's high enough to soften the filament if that's your goal. For PLA at 190C, you're only hitting 142C which is a bit low IME. I like to use 160C as the no-ooze temp to make sure any filament will bend if it hits the PEI surface when homing.
  • If you want to use 75% of your 1st layer temp, you can just use {first_layer_temperature[0] * 0.75}.

Other than those considerations, it looks fine. You can do all sorts of customizations with start gcode, so have fun with it. I've got a documented example here you might find interesting.

My notes and disclaimers on 3D printing

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

Posted : 26/07/2021 3:48 pm
ggppjj
(@ggppjj)
Active Member
Topic starter answered:
Thanks!

My reasoning behind the 2-step warmup is to prevent the ooze from happening in the first place by bringing the nozzle temp up high enough that it cuts down on heating time later during the MBL, but not high enough for material to flow while waiting for the bed to heat. So far it's been effective, and I haven't had to deal with the default gcode's behavior of leaving a nice long ooze at the beginning of every print dangling from the nozzle during the first layer. I've found that my printer doesn't ooze too much at the end of most prints, but does ooze quite a bit at the beginning with default behaviors. I'm not sure how common that ooze behavior is, but so far it's been fairly consistent with my prints before the adjustments.

I kinda forgot how to do basic math while I was setting the preheat line up, I'll adjust to your suggestion out of self-shame haha. 

Posted : 26/07/2021 3:56 pm
bobstro
(@bobstro)
Illustrious Member
No-ooze is good, but you can also protect your PEI against damage during MBL
Posted by: @ggppjj

My reasoning behind the 2-step warmup is to prevent the ooze from happening in the first place by bringing the nozzle temp up high enough that it cuts down on heating time later during the MBL, but not high enough for material to flow while waiting for the bed to heat.

Yes, that's the main idea of the 2-step warmup process. However, you can also use it to protect against errant hardened ooze scraping your PEI sheet. That's why putting an M109 to wait for the filament to soften before MBL is recommended. As-is, you're setting that no-ooze temp but you just launch right into MBL before it can likely do much. Ditto for the bed temp. That does get things warming up during MBL but no more so than just setting your actual 1st layer bed & nozzle temps would. Not a big deal, just pointing this out.

So far it's been effective, and I haven't had to deal with the default gcode's behavior of leaving a nice long ooze at the beginning of every print dangling from the nozzle during the first layer. I've found that my printer doesn't ooze too much at the end of most prints, but does ooze quite a bit at the beginning with default behaviors. I'm not sure how common that ooze behavior is, but so far it's been fairly consistent with my prints before the adjustments.

Prusa has implemented the 2 step warmup in the default gcode for the Mini but has not done anything similar for the Mk3. There are a lot of variants on the process out there, and you can do a few more prep things. I like to wait a bit with the bed heated to get the entire printer warmed up before launching. I've had a few contacts from users who find preheating the SuperPINDA improves results. Other folks like to do artwork or signatures with the prime line. There are interesting variations on scraping the nozzle on a sponge or wire brush, or using an ooze bucket. You can go a little nuts with it.

I kinda forgot how to do basic math while I was setting the preheat line up, I'll adjust to your suggestion out of self-shame haha. 

It might be easier to remember what the calculation does later!

And then you can start perfecting your end gcode. 😀   

 

My notes and disclaimers on 3D printing

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

Posted : 26/07/2021 4:19 pm
Share: