How to run script when printer changes states.
-
I have a safety system in place on my printer where multiple sensors (door close sensors, air pressure relays, overtravel switches, etc.) must be in a certain state for the heating elements and motion system to work. I would like to control this external system with the Duet like this:
- Door is open (servos and heaters are unpowered), user attempts to move an axis with the PanelDue, message pops up, "Doors must be closed and locked before motion can be enabled."
-Door is closed (servos and heaters are powered), user attempts to move axis with PanelDue, axis moves.
Is there some sort of state-change script that could be run, like inactiveToActive.g or ActiveToInactive.g where I could write a script to check the status of a series of inputs and bail with an M99 if they aren't met?
-
start.g is a good place to put any sanity checks in.
Check docs.duet3d.com for setting up triggers if you also want to do things like automatic pauses when the door is opened.
Look into daemon.g for continuously repeating tasks.
Check the Gcode meta command language and object model to tie it all together.