The link is public now and contains logs. It only occurs after bed preheating. I have recreated the issue by preheating the bed -as soon as the target is reached, the nozzle and bed start to heat and do not stop with no shut down.
Preheating the nozzle only does not cause the issue
Starting a print does not cause the issue
Firmware restart resolves the issue and as long as the bed is not preheated outside a print, the issue does not occur.
Attached is a log forcing the issue by heating the bed after a firmware restart. As soon as the bed reaches target, the nozzle goes full current with state set to OFF. klippy (8).log (248.5 KB)
“This is not troubleshooting cause if was stuck mosfet it shouldn’t go away with restart and the chances of both a external and internal mosfet going bad at the same time is very low. Also the Temps are still reported the log was 20mb which is why used gdrive…when someone has a printer smoking issue it shouldn’t be pushed aside so easily. Also I agree that klipper can’t do anything if bad mosfet but I made sure to state that a restart cures it and that it is reading the Temps and it does not shutdown or restart. I found the last issue on this #4531 and tried having Chris add the restart: command under mcu but this is deprecated.”
It’s not clear to me what you are reporting and I don’t see anything wrong in the log you attached. It would help if you could describe explicitly - 1) what actions were taken, 2) what results were observed, and 3) what results were expected.
The mosfet for the bed heater was failing and the mainboard has been replaced. It was a hardware issue BUT what we’re trying to stress is that Klipper can restart to save the printer from overheating if some additional safeties are added.
what actions were taken
Various scenarios tried to reproduce the issue. Only preheating the bed would cause both heaters to start heating above target, with no software limit
If state read 0%, heating still continuend so, Klipper wasn’t monitoring actual / target in this stage to issue a shutdown.
If state read off, no heating occurred and power to heaters was off.
When overheating, I can still control the machine from browser and firmware restart resets the machine and heating doesn’t occur again until commanded.
results expected are that a Klipper shutdown will actually shut the system down so it doesn’t continue heating.
Klipper has two heater safety checks relevant here: 1) If the measured temperature exceeds the min_temp / max_temp range then Klipper transitions to a shutdown state, and 2) if Klipper is commanding a heater on and the heater is not responding accordingly then Klipper will transition to a shutdown state.
Neither of the above seems to have occurred in the attached log. So, Klipper seems to be working as intended. (Specifically, the extruder temperature starts increasing, but it doesn’t increase beyond the configured max_temp nor was Klipper commanding it on at the time.)
I’m guessing you are proposing that Klipper could check for unusual temperature swings within min_temp and max_temp even when Klipper has commanded the heater off. I guess that’s possible, but I’m not sure there is much gain to that beyond the existing max_temp check. In particular, if Klipper hasn’t turned the heater on, in the general case, it’s not clear what advantage there is in transitioning to a shutdown state.
Note that it is common for heaters to increase in temperature when they are off - a bed heater or chamber heater will often raise the extruder temperature by virtue of a chamber temperature increase (and vice-versa). So, I’m not aware of a simple rule that the software could use.
I can perhaps offer a few cents worth of an opinion here, for consideration…
Better safety margins are always good. However, as Kevin pointed out, it would be exceedingly difficult to implement an elegant solution, because there are just simply too many external variables influencing the behaviour of a heater system in a generic 3D printer. Even in a complex critical system (aerospace applications for example), it could be challenging to monitor the system for “expected” vs. “unexpected” behaviours. It generally requires a real-time dynamic model of the system behaviour that accounts for all possible normal and abnormal input variables. In most cases this is not implemented because of complexity, uncertainties, risk and computational requirements.
It is possible to implement a simplified “sanity” monitor, but those usually carry with them risks of not catching some events or unintentionally catching conditions that are not actual events. One very simple approach for a 3D printer would be to define a “safety temperature” threshold that, when exceeded under conditions that Klipper is not commanding a heater, would trigger a shutdown. It could then be up to the user to select an appropriate temperature if they wished to enable this feature.
There could obviously be other similarly simple approaches, but the benefit of those vs the probability of an event occurring may not justify the complexity of implementation and configuration. Particularly since pretty much all printers lack any safety redundancies to protect against “stuck” heater drivers. If a MOSFET shorts and therefore commands 100% power to its heater, the only way to avoid a thermal runaway is to de-power the printer/heater power supply. Most printers lack this capability. Ideally you’d want to either pull the plug on the power supply or have a secondary series relay (or MOSFET) to come on permanently whenever the software (Klipper) commands the respective heater not OFF. You’d then use one switch for PID control and the second switch for safety. But this requires total architectural change to most of the consumer printers.
Moonraker supports several different types of smartplugs. Utilizing one of these plugs is cheap insurance and would likely require no modification to the printer.
It would have if you allowed the hotend to continue heating. The log robthide provided on GH showed Klipper shutting down when the ADC was out of range. The max_temp setting will prevent machine damage or fire as long as it’s set to a safe value and you use a smart plug that can cut power to the heaters.