Custom Nozzle Temperature for Probing With Custom Filament Type
I've been printing a lot with ecogenesis GenPHA filament recently (also sold as Ambrosia PHA, but slightly different from ColorFabb allPHA). To make things easier, I added a user-defined filament type to my Core ONE L and Core ONE+ using each printer's screen. The preset I created uses a 200c printing temperature and 150c standby with no auto-retraction.
I also created a custom filament in PrusaSlicer 2.9.5 called "Ambrosia GenPHA" that's based on ColorFabb allPHA. In the Filament Properties of the Advanced tab, I changed the Filament type field to "PHA" by typing that in manually rather than selecting from the drop-down box. The Temperature fields in the Temperature section of the Filament tab are set to 150c Idle temperature, 195c First layer, and 200c Other layers.
In my printer's (not filament's) custom G-code, I changed the M109 line from:
M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : 170)} ; wait for temp
to:
M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_type[0] == "PHA") ? 150 : 170)} ; wait for temp
Note the added alternative near the end that specifically mentions an initial nozzle temp of 150 if filament type is PHA.
None of this works, though. The printer still warms up the nozzle to 170c for bed probing, which is causing annoying material dots at every probing location that are difficult to remove. I just want the nozzle probing temperature to be 150c when PHA is the filament type. Why isn't my solution working? How do I accomplish that reliably?
I'm aware that I could create a printer profile specifically for PHA that would set M109 R150 as the startup G-code, but I'm trying to minimize the number of custom PHA-related profiles I need to select when printing with this filament. I would like to only have to choose the filament type and not a custom PHA print settings profile AND printer profile in addition to that. It seems like the M109 line in the Printer Start G-code is written specifically to accommodate this for different filament types, so I'm not sure why I couldn't adapt it to include one more filament type.
Best Answer by hyiger:
Hah! Typing it out here helped me solve this myself. I ended up changing the M109 line to:
M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_notes[0]=~/.*PHA150.*/) ? 150 : 170)} ; wait for tempand adding "PHA150" to the Notes field of the Filaments section, and now it works as intended. Apparently adding a Filament type to PrusaSlicer by typing it in manually doesn't work as I expected it to, but the filament_notes[0] variable is perfectly acceptable for this.
You can simplify this some by removing the wildcards since they are optional here and maybe not have your filament specifically listed in the cascade which will start to get ugly. Your idle temp is already 150 so you can probe it generically instead of 150 per filament. So PROBE_IDLE with a sensible temperature in the filament notes.
M109 R{((filament_notes[0]=~/MBL160/) ? 160 : (filament_notes[0]=~/HT_MBL10/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_notes[0]=~/PROBE_IDLE/ and idle_temperature[0] > 0) ? idle_temperature[0] : 170)} ; wait for temp
RE: Custom Nozzle Temperature for Probing With Custom Filament Type
Hah! Typing it out here helped me solve this myself. I ended up changing the M109 line to:
M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_notes[0]=~/.*PHA150.*/) ? 150 : 170)} ; wait for temp
and adding "PHA150" to the Notes field of the Filaments section, and now it works as intended. Apparently adding a Filament type to PrusaSlicer by typing it in manually doesn't work as I expected it to, but the filament_notes[0] variable is perfectly acceptable for this.
RE: Custom Nozzle Temperature for Probing With Custom Filament Type
Hah! Typing it out here helped me solve this myself. I ended up changing the M109 line to:
M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_notes[0]=~/.*PHA150.*/) ? 150 : 170)} ; wait for tempand adding "PHA150" to the Notes field of the Filaments section, and now it works as intended. Apparently adding a Filament type to PrusaSlicer by typing it in manually doesn't work as I expected it to, but the filament_notes[0] variable is perfectly acceptable for this.
You can simplify this some by removing the wildcards since they are optional here and maybe not have your filament specifically listed in the cascade which will start to get ugly. Your idle temp is already 150 so you can probe it generically instead of 150 per filament. So PROBE_IDLE with a sensible temperature in the filament notes.
M109 R{((filament_notes[0]=~/MBL160/) ? 160 : (filament_notes[0]=~/HT_MBL10/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_notes[0]=~/PROBE_IDLE/ and idle_temperature[0] > 0) ? idle_temperature[0] : 170)} ; wait for temp
RE: Custom Nozzle Temperature for Probing With Custom Filament Type
Thank you! That's very helpful