Emergency stop
-
@jay_s_uk I tried to add the M669 command, but I don't see any change in behavior, when toggling the switch during a move.
I have set the C parameter of M581 to 0, to trigger at any time.
Among the configuration files there is "pause.g" which, according to the generated comment, is called when: "a print from the SD card is paused".
Is there a specific file that I should add code to that is called when pausing, while not printing from the SD card? -
@MiguelDK when would you not be printing from the SD card?
-
@jay_s_uk I am using the controller as a robot controller, not as a 3D printer. So I primarily use the G28 and G1 commands using the USB/Serial port.
The robot is inside an enclosure with a door with access for users. The switch connected to input 3, will work as a door switch to detect whenever the door is open.
The robot are normally controlled from a remote location.
Therefore I'd like the robot to pause and perhaps perform a series of G-codes whenever somebody opens the door. -
@MiguelDK the concept of a pause is only valid when a job file is being run. You can call "pause.g" directly using M98 if you want the actions contained in pause.g to run when a job is not being run.
-
@T3P3Tony Ok.
So, is there a way, to stop any movement when an input is triggered. Without the need for re-homing/restarting? -
@MiguelDK
M0 is what you are looking for i think:
https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m0-stop-or-unconditional-stop -
-
@T3P3Tony Hmm.. Yeah. I don't think that, it would work.
But meanwhile, I have been playing with the idea that; if I just perform all moves with the H4 parameter like eg.:G1 H4 X150
Then it should, by my understanding stop, when an end-stop is activated and update the current position.
Therefore have updated my config.g with this end-stop definition update:; Endstops M574 X2 S1 P"!^io0.in" ; configure switch-type (e.g. microswitch) endstop for high end on X via pin !^io0.in M574 Y2 S1 P"!^io1.in" ; configure switch-type (e.g. microswitch) endstop for high end on Y via pin !^io1.in M574 Z2 S1 P"!^io2.in" ; configure switch-type (e.g. microswitch) endstop for high end on Z via pin !^io2.in ; Doorswitch M574 X1 Y1 Z1 S1 P"^io3.in" ; configure switch-type endstop for low end on XYZ via pin ^io3.in (We use this as door-switch)
So the doorswitch(endstop) is common for all three axes and then I would expect that if moving with the G1 H4, then all movement would stop and the position would be updated when the door was opened.
But it doesn't work, the movement are not stopped when opening my switch.
Can you tell me what is wrong? -
@MiguelDK You can only have one endstop per motor, or one per axis if there is only one motor. You can only define the endstop for one axis with each M574 command. So the Doorswitch M574 command just isn't going to work. You can only set that input as a trigger, rather than an endstop.
One option might be to wire two endstops in series (if the endstops are Normally Closed) or in parallel (if they are Normally Open). Then if either of them get activated, it functions as an endstop would.
Ian
-
@droftarts Thank you for clarifying this Ian. Contacts in series might be a good solution for this.
Do you know if there is a way to check the status of endstops/inputs using G-code?
Miguel -
@MiguelDK M119 reports the state to the console. If you want to use the state programmatically in meta gcode then the OM keys to look at are:
sensors.endstops[n].triggered