Recently the smart preheat plugin broke for me. I have upgraded to python 3, and installed klipper on the printer.
Now when it's "preheating", and i have recently done a print, as in, it's already hot. It WAITS for the bed to cool down to 45c before heating up things again. Which is quite the opposite of what i want this plugin to do. How can i help fix this issue?
I have this same issue, I was wondering if you ever found a fix or if anyone could recommend how to do this with IF statements in the Klipper config>?
This is a problem with Klipper not conforming to the GCode "standard" for M109
/M190
.
Thanks for that, it was a bit of a deep dark path for that argument but glad to see that the "TEMPERATURE_WAIT" command was implemented to address this... That said, in order to incorporate that for use with Smart Preheat ... At first I was thinking to replace the M190 commands with the Klipper temp wait command, but I'm not sure how to do so and make sure that I'm keeping the variables correct... I don't think I can just go into the Plugin config and "find/replace" "M190 S" with "TEMPERATURE_WAIT" ??? or is it really just that simple??
My thought was to do something like this:
The "default" Smart Preheat statement is"
; Wait for bed to reach 80% of required temp then set to required temp
{% if printer_profile.heatedBed %}
M190 S{{ (plugins.smartpreheat.bed * 0.8)|round }}
M140 S{{ plugins.smartpreheat.bed }}
{% endif %}
[1:19 PM]
My thought was to do something like:
{% if printer_profile.heatedBed %}
TEMPERATURE_WAIT SENSOR=<config_name> MINIMUM={{ (plugins.smartpreheat.bed * 0.8|round }} MAXIMUM={{ plugins.smartpreheat.bed }}
{% endif %}
Thoughts? (where config_name is the Klipper config name of the heated bed temp sensor)
I just did this for my machine:
$ cat M190.cfg
# Workaround for M190 S
[gcode_macro M190]
rename_existing: M190.0
default_parameter_S: off
default_parameter_R: off
variable_tolerance: 1.0
gcode:
{% if S != 'off' %}
M140 S{S}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={S|float - tolerance}
{% elif R != 'off' %}
M191 S{R}
{% else %}
M140 S0
{% endif %}
I take it you got rid of or don't use the plugin anymore then, just the Klipper Config?
I still use the plugin. It shaves heat time off by a few minutes.
This issue has slightly bugged me for years too. Here's a replacement Smart Preheat GCODE Script for those who just want a copy/paste solution that actually makes sense with hot beds.
The key change: It only waits for bed heating when current bed temp is BELOW target bed temp. When current bed temp is ABOVE target, it sets the target temp and continues - no more waiting for cooling!
Trade-off: Sometimes prints might start with bed temp a bit higher than target, but who cares? The bed temp will naturally converge to the target temp while printing.
Just copy/paste this into your Smart Preheat GCODE Script:
; Wait for bed to reach 80% of required temp then set to required temp
{% if printer_profile.heatedBed %}
{% set target_temp = plugins.smartpreheat.bed %}
{% if printer.temperatures.bed.actual < target_temp %}
M190 S{{ (target_temp * 0.8)|round }}
M140 S{{ target_temp }}
{% else %}
M140 S{{ target_temp }}
{% endif %}
{% endif %}
; Set tool temps
{% for tool, temp in plugins.smartpreheat.tools.items() %}
M104 T{{ tool }} S{{ temp }}
{% endfor %}
; Wait for bed only if current temp is below target
{% if printer_profile.heatedBed %}
{% if printer.temperatures.bed.actual < target_temp %}
M190 S{{ target_temp }}
{% endif %}
{% endif %}
; Wait for tools
{% for tool, temp in plugins.smartpreheat.tools.items() %}
M109 T{{ tool }} S{{ temp }}
{% endfor %}
Works with both Marlin and Klipper (though Klipper users might want to check out @kantlivelong's M190 macro solution above).
Let me know if this fixes it for you!