PrusaSlicer
PrusaSlicer copied to clipboard
Implement bed and nozzle temperature offsets
This is useful when printing with nozzles with different thermal conductivities. Bed temperature offset may also be used when dealing with skews during to thermistor placement, or different surfaces.
Change all the GCodeWriter#set_temperature and #set_bed_temperature call sites to include the offset. Pass parsed GCode temperatures through without modification.
This implementation requires that printers with custom starting GCode that want make use of this feature should modify temperature-related instructions, like so:
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
To:
M104 S{first_layer_temperature[initial_extruder] + temperature_offset} ; set extruder temp
M140 S{first_layer_bed_temperature[initial_extruder] + bed_temperature_offset} ; set bed temp
This is partially intended, as start GCode is much closer to the "metal" than the filament temperature settings, which is what we're looking to offset here. It also shouldn't be an issue for the profiles shipped with PrusaSlicer - any change to the offsets configuration would require the user to clone the configuration anyway, so changing the start GCode is not an issue. (If this is a deal-breaker, I'd be happy to revisit offsetting these as well. I also wouldn't mind updating the profiles to make the change, just let me know.)
Handling multiple extruders is an open question. In theory, one may want to apply different temperature offsets to different extruders, but it feels like a niche concern that may be best left to implement for whomever has the need. Assume the temperature offsets apply globally, to all extruders.
Fixes #2498. There's a similar, better-tested implementation in #3180, which, however, doesn't address what I was after - nozzle temperature offsetting.
For what it's worth, I would love to see this merged into main. I'm moving from stock brass nozzles to hardened steel, and I was thinking it would be nicer to just code an offset that I can use with a particular nozzle diameter/material combo in Prusa Slicer as opposed to having to manually adjust.
At least in the meantime I can use the offset in OctoPrint, but I think that might be resetting itself periodically
@hejllukas :wave: sorry for the direct call-out (you did touch it last ;) ), but I was wondering if there is anything I can do to get this merged in?
Frankly, I don't quite get the hesitation to merge this in, or even give it any feedback at all. It seems like this PR solves a real problem and finds acceptance in the community, and yet, it's been sitting in the queue for 1.5 years now. Y'all are now also branching out into industrial printers, where nozzle materials with different temperature coefficients are more commonplace, so it seems like it would make sense overall for print farms to have a feature to store this per-machine.
No ill will intended by the way, I know open source maintenance is tough work. Just wondering if there's anything blatantly wrong about the approach taken in this PR that I hadn't considered.
Some of these changes conflict badly every iteration, but oddly enough, the code comment around void GCodeGenerator::_print_first_layer_bed_temperature is the biggest offender so far. If you were willing to take it in as a separate PR, it would make my life a bunch easier every release.