problems with M581 commands - execute macro after end stop
-
Hi,
I connect dc motor to my duet 2 wifi board - through a driver, an external power source and it works great.
The question I have is how can I use one of my endstop switches to stop a dc motor (like a stepper motor) when the endstop switch is pressed?Or other option -
how can I catch an event of "endstop pressed" and after that event execute specific command?-->
I tried to connect the end stop switch to Y (without a motor)
In addition, I added to sys trigger1.g file that contains the following command: M42 P7 S0.
I also add this line at the end of the config file -
; Custom settings are not defined
M581 T1 Y S1.
Why is the trigger not executed and the DC motor continues to run?Additionally, I have tried adding M300 in the trigger file to understand if the file is executed when the end stop is pressed, but the beep is not working.
What am I doing wrong? Any suggestions?Thanks,
Adi -
@adistr From https://docs.duet3d.com/User_manual/Reference/Gcodes#m581-configure-external-trigger
Trigger number 0 causes an emergency stop as if M112 had been received. Trigger number 1 causes the print to be paused as if M25 had been received. Any trigger number # greater than 1 causes the macro file sys/trigger#.g to be executed.
So you can't use trigger 0 or trigger 1. Use trigger 2 or higher.
Ian
-
Also, don't start new threads AND continue old threads for the same problem.
It just wasted some of my time answering your question directed at me when you already had an answer in this thread.
-
@alankilian You even said to use trigger 2 in your original reply... https://forum.duet3d.com/post/284007
Ian