Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Activate GP1 output by zprobe.in or endstop X and Y

    Scheduled Pinned Locked Moved
    Using Duet Controllers
    3
    10
    432
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • krys3dundefined
      krys3d
      last edited by

      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 sensor

      For 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

      jay_s_ukundefined OwenDundefined 2 Replies Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @krys3d
        last edited by

        @krys3d use daemon.g
        something like

        if {{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

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 1
        • OwenDundefined
          OwenD @krys3d
          last edited by OwenD

          @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 pin

          M42 P0 S1
          

          create file trigger4.g

          M42 P0 S1
          
          krys3dundefined 1 Reply Last reply Reply Quote 1
          • krys3dundefined
            krys3d @OwenD
            last edited by

            @owend

            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.23

            I tried to replace in the M581 the Z by

            "zprobe.in"
            

            but it has no effect

            OwenDundefined 1 Reply Last reply Reply Quote 0
            • OwenDundefined
              OwenD @krys3d
              last edited by

              @krys3d
              Try

              M581 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

              krys3dundefined 1 Reply Last reply Reply Quote 1
              • krys3dundefined
                krys3d
                last edited by

                @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 interpreted

                Thank 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?

                1 Reply Last reply Reply Quote 0
                • krys3dundefined
                  krys3d @OwenD
                  last edited by krys3d

                  @owend

                  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?

                  OwenDundefined 1 Reply Last reply Reply Quote 0
                  • OwenDundefined
                    OwenD @krys3d
                    last edited by

                    @krys3d
                    Try M582 immediately after your M581 calls

                    https://duet3d.dozuki.com/Wiki/Gcode#Section_M582_Check_external_trigger

                    krys3dundefined 1 Reply Last reply Reply Quote 0
                    • krys3dundefined
                      krys3d @OwenD
                      last edited by

                      @owend

                      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
                      
                      krys3dundefined 1 Reply Last reply Reply Quote 0
                      • krys3dundefined
                        krys3d @krys3d
                        last edited by

                        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.

                        https://youtu.be/vkGkOMY7Mt4

                        Good day

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA