Reacting to fault state to run custom logic?
-
My heatbed has it's own power supply with a mechanical relay on mains side and a FET relay on bed side.
The mains relay is controlled by PS_ON pin and is supposed to act as an additional security step when temperature misbehavior occurs and the bed enters fault state.
I read about the same concept here and there in the forums, but I was not able to find an actual solution on how to bind the fault state to shutting down PS_ON. Is it possible to e.g. run a certain macro when a fault state occurs? -
@jbjhjm i don't think there's a specific custom macro, but what you could do is run some code in daemon.g
e.g.if heat.heaters[0].state == "fault" && state.atxPower == "on" M81
Edit: I'm not sure "on" is the correct state for the ATX power as I've never enabled it. Check the object model to be sure.
-
that sounds like a start thanks @jay_s_uk !
-
@jbjhjm You want to use M143 with the
A3
parameterhttps://duet3d.dozuki.com/Wiki/Gcode#Section_M143_in_RRF_3_01RC2_and_later
That will turn off the printer if a fault occurs on that heater. You set it up per-heater, so you'd have one M143 for your hotend, and one for your bed
-
@engikeneer said in Reacting to fault state to run custom logic?:
@jbjhjm You want to use M143 with the
A3
parameterhttps://duet3d.dozuki.com/Wiki/Gcode#Section_M143_in_RRF_3_01RC2_and_later
That will turn off the printer if a fault occurs on that heater. You set it up per-heater, so you'd have one M143 for your hotend, and one for your bed
Thanks, this would turn off the whole electronics not just the PS_ON right? Guess that would be fine too.
-
@jbjhjm no it triggers the PS_ON. There's no built in relay on the Vin rail!
I use a separate 5V PSU for my Duet WiFi so that the board will keep alive so I can see what happened if it does trigger -
@engikeneer aaaah right got it! thx!