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

    How to ping Z-probe state

    Scheduled Pinned Locked Moved
    Gcode meta commands
    4
    17
    1.0k
    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.
    • Vetiundefined
      Veti
      last edited by

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

      1 Reply Last reply Reply Quote 0
      • code7undefined
        code7
        last edited by

        @Veti
        Thanks. Can you help me with the correct syntax for the following conditional statement? I'm trying to increase the power to a light when the probe makes contact with the bed.

        ;check state of zprobe and if 1 increase power to light
        if zprobe = 1
        M106 P2 S255 ;increase power of light to full power

        Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

        1 Reply Last reply Reply Quote 0
        • Vetiundefined
          Veti
          last edited by

          i dont see the probe status in the object model

          https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands

          1 Reply Last reply Reply Quote 0
          • NexxCatundefined
            NexxCat
            last edited by

            if sensors.endstops[3].triggered
                M106 P2 S255 ;increase power of light to full power
            

            Just change the "3" to the correct end-stop number for your z-probe. This likely won't work with the BLTouch because it is only triggered briefly, but for an inductive sensor or the likes, it would work.

            1 Reply Last reply Reply Quote 0
            • code7undefined
              code7
              last edited by

              @NexxCat When I run what you have suggested I receive the following error. Do you know what I may be overlooking?

              Error: in file macro line 1 column 4: meta command: array index out of bounds

              Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

              NexxCatundefined 1 Reply Last reply Reply Quote 0
              • NexxCatundefined
                NexxCat @code7
                last edited by

                @code7 What Z-Probe are you using?

                1 Reply Last reply Reply Quote 0
                • code7undefined
                  code7
                  last edited by

                  I'm using a conductive Z-probe that triggers when the nozzle makes contact with the bed.

                  Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

                  NexxCatundefined 1 Reply Last reply Reply Quote 0
                  • NexxCatundefined
                    NexxCat @code7
                    last edited by NexxCat

                    @code7 Does it show as an end stop in DWC under "Machine Specific"? There's a readout of the end stops on the right hand side, labelled beginning 0.

                    EDIT: Disregard the above. Z-Probes are elsewhere in the object model it seems. I'm not 100% sure as I'm not at my printer right now, but maybe try looking at sensors.zprobes[0].value

                    That's a guess based on looking at the code.

                    EDIT 2: Try this:

                    if sensors.probes[0].value[0] > 1
                        M106 P2 S255 ;increase power of light to full power
                    
                    1 Reply Last reply Reply Quote 0
                    • code7undefined
                      code7
                      last edited by code7

                      @NexxCat Thanks. I'll test it out. This is my first attempt using meta commands.

                      If I wanted to trigger another event when the probe is not triggered would I just swap the direction of the carrot ">" to "<" ?

                      Also, can you give me an idea of how I can implement the "else" syntax or another syntax in another macro to stop this routine?

                      Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

                      NexxCatundefined 1 Reply Last reply Reply Quote 0
                      • NexxCatundefined
                        NexxCat @code7
                        last edited by

                        @code7 You could try something similar to this, which is also a bit neater 🙂

                        if sensors.probes[0].value[0] != 0
                            ; Z-Probe triggered
                        else
                            ; Z-Probe not triggered
                        
                        ; Non conditional gcode continues here
                        

                        This would be the reverse, checking for the probe not being triggered:

                        if sensors.probes[0].value[0] == 0
                            ; Z-Probe not triggered
                        else
                            ; Z-Probe triggered
                        
                        ; Non conditional gcode continues here
                        
                        1 Reply Last reply Reply Quote 0
                        • dc42undefined
                          dc42 administrators @code7
                          last edited by dc42

                          @code7 said in How to ping Z-probe state:

                          What command can I send from the console to check the current Z-probe state?

                          You mean the triggered/not triggered status?

                          22/09/2020, 12:11:06 	echo sensors.probes[0].value[0]>=sensors.probes[0].threshold
                          false
                          

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          1 Reply Last reply Reply Quote 0
                          • code7undefined
                            code7
                            last edited by code7

                            @NexxCat Thanks. This works great.

                            Is is possible to continually run this code in real time while printing?

                            @dc42 Yes that is what I meant. Thanks.

                            Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

                            NexxCatundefined 1 Reply Last reply Reply Quote 0
                            • NexxCatundefined
                              NexxCat @code7
                              last edited by

                              @code7 You can use daemon.g for that, but I have no experience with using it. Check this thread: https://forum.duet3d.com/topic/14701/daemon-g-usage-cases

                              1 Reply Last reply Reply Quote 0
                              • code7undefined
                                code7
                                last edited by

                                @dc42 Do you see any issues with me using daemon.g to continually check the state of the probe only during print moves? I currently have a macro that runs when the filament is retracted and ends when the filament is un-retracted. I need a way to turn down a power supply within 1 second of the probe losing contact with the conductive metal print.

                                Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

                                dc42undefined 1 Reply Last reply Reply Quote 0
                                • dc42undefined
                                  dc42 administrators @code7
                                  last edited by

                                  @code7 said in How to ping Z-probe state:

                                  @dc42 Do you see any issues with me using daemon.g to continually check the state of the probe only during print moves? I currently have a macro that runs when the filament is retracted and ends when the filament is un-retracted. I need a way to turn down a power supply within 1 second of the probe losing contact with the conductive metal print.

                                  You can do that using a loop in daemon.g, however I suggest you include a G4 delay in that loop of perhaps 500ms, to prevent it using too much CPU time.

                                  Duet WiFi hardware designer and firmware engineer
                                  Please do not ask me for Duet support via PM or email, use the forum
                                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                                  1 Reply Last reply Reply Quote 0
                                  • code7undefined
                                    code7
                                    last edited by code7

                                    @dc42 OK. I'll give it a try.

                                    In regards to running real-time loops in daemon.g, would it be possible to use a loop in daemon.g to call for a variable that can reduce the feedrate mid-print to 1% while a long single line segment is being printed? Ideally I would be able to pause mid deposition, but I know the current command needs to complete before a pause can be invoked.

                                    Delta Printer Using a Duet 2 Wifi v1.04c, FW3.4.0beta2, Duet WiFi sever 1.26, Duet Web Control 3.3.0

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