Using endstop for DC motor
-
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?Thanks,
Adi -
-
@alankilian
I appreciate your response very much.
I 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 - In addition, I added to sys trigger1.g file that contains the following command: M42 P7 S0.
-
You have to use a trigger number 2 or greater as in my example.
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.
You can test your trigger macro by typing this in the console
M98 P"trigger2.g"
If you still have problems, post your complete config.g and your complete trigger2.g and we'll take a look.
-
@adistr said in Using endstop for DC motor:
M581 T1 Y S1.
Why is the trigger not executed and the DC motor continues to run?
This looks like syntax for RRF2. Surely you are on RRF3.4 now which is far more felxible?
https://docs.duet3d.com/User_manual/Reference/Gcodes#m581-configure-external-trigger