Activate GP1 output by zprobe.in or endstop X and Y
-
hello everyone, i have my 3d printer project going well.
I am under RRF3 with a duet 2 wifi + duex5 and I would like to use a GPIO output to activate an LED indicator when detecting an endstop X, Y or zprobe.in sensorFor the wiring, no problem, but for the configuration I'm struggling.
I declared the GP1 output as follows:
M950 P0 C "duex.gp1"But then I block
I am thinking of using M581 P "xstop+ystop+zprobe.in" T "duex.gp1" S1 R0
but it does not work.Do you have any advice to give me.
Thank you, and have a good day
-
@krys3d use daemon.g
something likeif {{sensors.endstops[0].triggered || sensors.endstops[0].triggered = true} || sensors.probes[0].value[0] > 500} M42 P0 S1 else M42 P0 S0
that turns on the output if X, Y or the probe are triggered
-
@krys3d said in Activate GP1 output by zprobe.in or endstop X and Y:
I declared the GP1 output as follows:
M950 P0 C "duex.gp1"But then I block
I am thinking of using M581 P "xstop+ystop+zprobe.in" T "duex.gp1" S1 R0
but it does not work.Assuming you're running latest firmware
It's untested but it may be possible
Try this in config.g to create triggers for both rising and falling conditions if that's possible
M950 P0 C "duex.gp1" M581 T3 X Y Z S1 M581 T4 X Y Z S0
Then create a file trigger3.g
Inside that use M42 to control your gpio pinM42 P0 S1
create file trigger4.g
M42 P0 S1
-
Thank you very much,
there is a lot of progress with this:
M950 P0 C "duex.gp1" M581 T3 X Y Z S1 M581 T4 X Y Z S0
trigger3.g
M42 P0 S0
trigger4.g
M42 P0 S1
The led activates well when the X or Y sensors are activated, but for the Z it does not work, there must be a small modification to make
My Z sensor is configured as follows:
M574 Z0 P "nil" M558 P5 C "zprobe.in" H50 F120 T10000 A5 S0.01
My firmware configuration is as follows:
Circuit: Duet 2 WiFi (2WiFi)
Firmware: RepRapFirmware for Duet 2 WiFi / Ethernet 3.2 (2021-01-05)
Duet WiFi Server Version: 1.23I tried to replace in the M581 the Z by
"zprobe.in"
but it has no effect
-
@krys3d
TryM581 T3 X Y P"zprobe.in" S1 M581 T4 X Y P"zprobe.in" S0
I think the axis letters may only work on end stop pins, so you need the P parameter for the probe.
Again untried, just spitballing -
@owend
unfortunately, I tried with / without P but nothing worked, the signal is not interpreted unlike the X or Y sensor.In fact I just wanted the led for the Z sensor (zprobe.in), the other X and Y sensors were used to verify that the operation was possible, and I know that it is doable.
On the other hand I still do not understand why the signal of "zprobe.in" is not interpretedThank you very much for your help.
I am also looking on my side, but there is little information on the use that I want to make.Maybe I could duplicate the signal from my Zprobe sensor by plugging the signal output into a GPIO input in addition to the zprobe.in?
-
I managed to use double the signal from zprobe.in on input GP1 and assigned the output to GP2 as follows :
; Led Capteur Nivellement GPIO 2 M950 J0 C"duex.gp1" ; Duplication signal Capteur Z GPIO 1 M950 P0 C"duex.gp2" ; Sortie GPIO 2 Allumage Indicateur Led M581 T3 P"duex.gp1" S1 ; Activation fichier trigger3.g M581 T4 P"duex.gp1" S0 ; Activation fichier trigger4.g
trigger3.g
M42 P0 S0
trigger4.g
M42 P0 S1
it works well, but when starting the card, the output is always active until the first switchover of the contact, is there a command to initialize the output to 0 or force the output to update?
-
@krys3d
Try M582 immediately after your M581 callshttps://duet3d.dozuki.com/Wiki/Gcode#Section_M582_Check_external_trigger
-
A very big thank you to you for taking the time to help me. It's really awesome.
The M582 is indeed an initialization of the trigger compared to the received signals, it works perfectly
Here are my command lines if anyone ever needs them:; Led Capteur Nivellement GPIO 2 M950 J0 C"!^duex.gp1" ; Duplication signal Capteur Z GPIO 1 M950 P0 C"duex.gp2" ; Sortie GPIO 2 Allumage Indicateur Led M581 T3 P"duex.gp1" S1 ; Activation fichier trigger3.g M582 T3 ; Initialise Trigger 3 M581 T4 P"duex.gp1" S0 ; Activation fichier trigger4.g M582 T4 ; Initialise Trigger 4
Trigger 3 :
M42 P0 S1
Trigger 4 :
M42 P0 S0
-
Here is a little test video, for information, I plugged the X's sensor into the Zprobe connector for testing and it works fine.
I still have to install the Zprobe sensor as soon as I receive it.
Good day