Hi,
I’m here to ask for your help to understand how to create a macro that checks the rotation of the fan in order to performs specific actions in case of failure.
The fan is a 4010 HoneyBadger 3 wires which is, in theory, designed specifically for this purpose … even if no one has yet specified “how” to implement the function.
From the wiring diagram shown in the link it is assumed that there is a high signal in case of rotor block, so I created a macro that reads the signal (and it works so far)
[gcode_button HE_FAN_ALARM]
pin: ^tool_0:gpio12
press_gcode:
M118 PRESSED
EXAMPLE
release_gcode:
M118 RELEASED
Now I am stuck in creating the macro that should read the signal, evaluate for a specific time (e.g. 3s) and then if the time threshold is exceeded execute an “emergency” macro.
It sounds like you’ve configured your system so that the fan “alarm” system acts like a gcode button press, and that you want the system to react if it is “pressed” for at least a certain amount of time. The post I linked above offers a way to implement gcode button “long press,” which sounds like what you want.
Thank you for @theophile, i havn’t see it yet. I’ll study it in the next few days and try to implement it.
At first glance i think this method will help in somehow but i’m not sure if will work considering the “normal fan condition” because the signal is triggered also when the fan is normally powered or turned off, perhaps by adding some other conditions I could exclude these cases.
for example:
{% if (he_target >= 0) or (he_temp >= he_fan_on_temp) …etc
First problem i found right now with the macro below is that the signal is not triggering as declared in the datasheet.
[gcode_button HE_FAN_ALARM]
pin: ^tool_0:gpio12
press_gcode:
M118 FAN OK
release_gcode:
M118 FAN KO
I have a “FAN OK” when the fan is activated and a “FAN KO” when is deactivated by Klipper but i have nothing when the rotation is stopped manually, maybe the i burned something inside while testing stopping it manually?