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

    Detachable Probes and Probing

    Scheduled Pinned Locked Moved Unsolved
    General Discussion
    7
    31
    1.9k
    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.
    • Phaedruxundefined
      Phaedrux Moderator @o_lampe
      last edited by

      @o_lampe said in Detachable Probes and Probing:

      It wasn't on RRF3.x but v2.05...did it change?

      I think it checks to see if they are present and if so will execute them. There have been cases where the files are present when they should not be and deleting them solves a probing problem. So I believe that's the case.

      Z-Bot CoreXY Build | Thingiverse Profile

      1 Reply Last reply Reply Quote 0
      • engikeneerundefined
        engikeneer @sinned6915
        last edited by

        @sinned6915 I guess the other question is when you want to pick up/put down the probe. I think that the deploy/retract scripts are called for every probe dive (so doing a 400 point mesh, it will pick up, probe, put down, pick up, probe, put down etc 400 times!). A BLTouch pin needs to be extended for every probe dive, whilst yours probably doesn't.
        You might be better putting your own pick up/ put down macros and calling them explicitly in your homing, bed leveling, mesh creation etc macros?

        E3D TC with D3Mini and Toolboards.
        Home-built CoreXY, Duet Wifi, Chimera direct drive, 2x BMG, 300x300x300 build volume
        i3 clone with a bunch of mods

        1 Reply Last reply Reply Quote 1
        • sinned6915undefined
          sinned6915 @Phaedrux
          last edited by sinned6915

          EDIT: why is my link missing in the previous post? I'l chalk it up to lack of sleep.... video of deply and retract. The following probaly makes more sense now....

          https://youtu.be/HiKOW4jA3oU

          YouTube Video

          EDIT2: I put all my configs and files on github instead of pasteting it all here-
          RRF3.x sys folder

          @phaedrux I was hoping to not get into the nitty gritty, but here goes.

          I have explicit deploy and retract scripts and call them in my homez.g and homeall.g scrips. they work there just fine.

          if i issue a G29 command, then the bot will pick up the probe and probe the mesh sequetially w/o returnging the probe between point. It runs the whole mesh then returns the probe.

          The deploy probe is conditional gcode. Since i am picking it up from a fixed X,Y but variable Z position I have it doing some gymnastics. I do have comment codes in the macros to track its progress.

          The probe deploy flow chart is basically:

          • after homing X & Y,
          • move Z 15,
          • translate to dock position in X,Y,
          • move Z -10,
          • while loop starts
            -move Z incrementally -0.5,
            -check probe status. if probe value is 1000, repeat,
          • if probe value is not 1000, exit while loop.
          ; ***********************************************************
          ; deployprobe.g
          ; ***********************************************************
          echo "Running deployprobe.g"
          G91
          M564 H0 S0          ; allow movement while not homed
          G1 Z15 F6000        ; move Z 15 for clearance above dock.
                              ; need to figure out some safety check on this
          G90 
          ; echo sensors.probes[0].value[0]
          if sensors.probes[0].value[0]!=1000    ; if sensor is value other than 1000 do this
            abort "deployprobe start value Probe already picked up.  Manually return probe to the dock"
            echo sensors.probes[0].value[0]
          ; if we're here we know it's becasue the above is true which I assume is because you have an NC switch as a probe.
          echo "Pass first logic test"
          G1 X0.0 Y4 F6000      ; move above probe dock location
          G91
          G1 Z-10
          G90
          M400                  ; wait for moves to finish
          echo "Probe Pickup while loop running"
          while sensors.probes[0].value[0]=1000
            G91
            G1 Z-0.5 F600
            M400
            G90
            ; echo sensors.probes[0].value[0]
            ; echo iterations
            if iterations=100
               break
          
          G91                 ; relative coords
          G1 Z-0.25 F600      ; move bed up to clear probe from dock since mags pull it up 
          M400                ; wait for move to finish
          G1 X50 F3000        ; move right so probe moves out of the dock
          G1 Z6.5 F3000       ; move bed to clear probe from glass build surface 
          G1 X100 F6000       ;
          G90                 ; absolute coords
          M400                ; wait for moves to finish
          G4 S2               ; wait 1 second
          M400
          
          if sensors.probes[0].value[0]!=0
             abort "deployprobe endvalue not 0 Probe not picked up!  Print cancelled."
          
          echo "deployprobe.g complete"
          

          The probe retract is simpler since the X,Y & are determined-

          ; ***********************************************************
          ;
          ; retractprobe.g
          ;
          ; ***********************************************************
          
          echo "Running retractprobe.g"
          
          if sensors.probes[0].value[0]!= 0
              abort "retractprobe: Probe not currently picked up!"
          
          echo "pass first logic loop"
          ; M564 S0	                 ; allow movement outside of print area
          G90	                         ; absolute positioning
          
          G1 X100 Y4 Z8.10 F12000          ; move to the starting point 
          G1 X45  Y4  F6000                ; move to the entry position for the dock
          G1 X0   Y4  F3000                ; move to the dock position
          G1 X0  Y50  F12000               ; move to the side adjacent to the dock
          M400
          G1 X100 Y50 F12000               ; move to the right to clear dock
          G1 X145 Y0  F6000                ; move to start point at middle front 
          M400
          M564 S1                          ; limit axis to print area
          echo "complete movement commands"
          
          if sensors.probes[0].value[0]!= 1000
              abort "retractprobe: Probe not correctly dropped off in dock!"
          	
          echo "retractprobe.g macro complete"   
          
          

          @engikeneer funny you should bring up the allen key probe, that was one of the insprirations to my probe design. sort of 'get it when you need it' that and the semi-automatic constant wired probe for i3's you manualy deplyed.

          I migrated from a well working 2.05 setup to 3.x. Granted, I had eveything set up differently 2.x with a fixed probe dock and no logic checks, but doing this in RRF 3 it seems to make a bit more sense and has provided some failsafes in the system.

          for clarity, here is an example of one of my probe point macros- teh back left corner specifically.

          ; *******************************
          ; probeBL.g
          ; Probe Back Left Corner
          ; *******************************
          
          M561                    ; clear all transforms  
          G91                     ; relative coords
          G1 Z5                   ; move Z up 5 to ensure clearance
          G90                     ; absolute coords
          G1 X5 Y280 Z5 F6000     ; move to bacl keft corner
          G30 S-1                 ; probe point report status	
          
          1 Reply Last reply Reply Quote 0
          • sinned6915undefined
            sinned6915 @o_lampe
            last edited by

            @o_lampe what was the reasoning to the conclusion for having the deply/retract macros NOT in the system folder?

            I am not seening the conclusions in the posts.

            1 Reply Last reply Reply Quote 0
            • Phaedruxundefined
              Phaedrux Moderator
              last edited by Phaedrux

              If you only need to do the pickup and drop off once then it's not exactly a deploy retract situation. Instead of using deploy retract macros, you could use mesh.g and simply add the pickup and drop off there with the G29 S1 in between. Then when you call G29 it will execute mesh.g, pick up the probe, run a mesh, and drop it off.

              Z-Bot CoreXY Build | Thingiverse Profile

              sinned6915undefined 1 Reply Last reply Reply Quote 0
              • sinned6915undefined
                sinned6915 @Phaedrux
                last edited by

                @phaedrux i am not trying to mesh probe.

                i am trying to probe the 4 corners and center of the bed. for example, to validate the results of 4 point leveling.

                if i do

                G1 X5 Y280 Z5 F6000     ; move to back left corner
                G30 S-1                 ; probe point report status	
                

                shouldnt the system realize the probe needs to be picked up?

                o_lampeundefined T3P3Tonyundefined dc42undefined 3 Replies Last reply Reply Quote 0
                • o_lampeundefined
                  o_lampe @sinned6915
                  last edited by

                  @sinned6915 said in Detachable Probes and Probing:

                  shouldnt the system realize the probe needs to be picked up?

                  If you add a resistor voltage divider to your dock and connect it to the probe pin, it would read a certain voltage. That tells the FW if the Z-probe is attached or not. (via conditionals)
                  With the probe attached, your switch would short out one of the resistors and the value changes to 'probe is deployed, but not triggered'

                  Kind of 'three state' switch probe.

                  1 Reply Last reply Reply Quote 0
                  • T3P3Tonyundefined
                    T3P3Tony administrators @sinned6915
                    last edited by

                    @sinned6915 can you summarise the issue? Is it that deploy and retract macros are not being run for G30 but they are for G29?

                    www.duet3d.com

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

                      @sinned6915 if you have the probe type set to anything other than 9 (which is for BLTouch) then the behaviour is as follows:

                      • M401 and M402 increment and decrement the probe deployment count. When M401 causes the deployment count to go from 0 to 1, RRF executes deployprobe.g. When M402 causes it to go from 1 to 0, RRF executes retractprobe.g.
                      • At the start of executing G29 S1, RRF implicitly executes M401. At the end, it implicitly executes M402.
                      • When executing G30, RRF implicitly executes M401 before and M402 after.

                      Therefore:

                      • When using single G30 command to home Z, the probe will be deployed and retracted automatically
                      • When executing G29 S1 the probe will be deployed and retracted automatically
                      • Within a bed.g file that contains multiple G30 commands, when using a deployable probe it is best to use M401 before the first G30 command and M402 after the last one. That way, the probe will be deployed and retracted just once for the entire sequence, instead of once per G30 command.

                      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

                      sinned6915undefined 3 Replies Last reply Reply Quote 0
                      • sinned6915undefined
                        sinned6915 @dc42
                        last edited by sinned6915

                        dc42: thank you for answering the question. Knowing that there is a probe deplyment counter is the key I was missing.

                        If I may suggest that your succinct explanation get added to G29 & G30 or M401/M402 wiki entries.

                        Which now got me to thinking to check the Object Model for the token- I dont see anything for probe deplyment. I see

                        sensors.probes.0.deplyedByUser=true

                        and

                        sensors.probes0.value=1000

                        but no deployment count. Any idea what that might be stored as?
                        I am thinking it might be more reliable to use that instead of theraw probe data.

                        1 Reply Last reply Reply Quote 0
                        • sinned6915undefined
                          sinned6915 @dc42
                          last edited by sinned6915

                          @dc42 I think I have noticed a pattern that may highlight the probe pickp/retract issue. I am using Duet3 Ethernet, RRF version 3.2.2

                          Case 1: Printer is homed. Probe is detached. Carraige is at X,Y of 100,100
                          Issue G30 S-1 command to perform a single probe. The expectation is probe will occur at 100,100.
                          Printer will execute M401 and sucessfuly deply the probe EXCEPT that instead of probing the original position of 100,100, it will execute the probe at the final positiion of the deployprobe.g macro.

                          Expectation is that the printer would have returned to the position (100,100) to perform the probe.

                          Case 2: Priner is homed, Probe is detached.
                          Issue M401 P0 command, printer picks up the probe.
                          G1 move to the point 100,100 and then issue
                          G30 S-1
                          and it executes the single probe at the point.

                          EDIT- Case 3 Printer is homed, Probe is detached
                          Issue G30 X100 Y100 S-1 command, priner will sucessfuly deply the probe and will execute the probe at the final positiion of the deployprobe.g macro instead of the X100 Y100 coordinate.

                          Bothe cases: issuing M402 P0 errors and reports back probe is not present.
                          Which is because of my gcode metal logic of sensing the presence of the probe via the probe's actual value of 0 or 1000 (open circuit vs closed vircuit).
                          As the machine stops Z motion at the probe trigger, the probe is still triggered, NC having gone open.
                          Moving the Z away from the probe will reset the probe back to the NC state and then the M402 script will execute.

                          1 Reply Last reply Reply Quote 0
                          • Phaedruxundefined
                            Phaedrux Moderator
                            last edited by

                            I wonder if you could use G60 to store the location and then use G1 R to restore to that location.

                            https://duet3d.dozuki.com/Wiki/Gcode#Section_G60_Save_current_position_to_slot
                            https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_G0_G1_Move

                            Z-Bot CoreXY Build | Thingiverse Profile

                            sinned6915undefined 1 Reply Last reply Reply Quote 0
                            • sinned6915undefined
                              sinned6915 @Phaedrux
                              last edited by sinned6915

                              @phaedrux you could, but that seems like that would not be nescessary.

                              The wiki says that if the G30 -S1 command is issued without X or Y coordinates, the probe would occur at that point. To me, that means it will probe the X,Y where the command was issued.

                              I could just issue a G30 X100 Y100 S-1 but that is different than giving the G30 by itself. I don't remember the results of that offhand and have to redo it when the machine is not in use.

                              The system realizes that if there is no probe attached, it goes to deploy it. The G30 then seems to occur when the moves of the deploy macro are complete. It has forgotten the starting point.

                              EDIT: I updated the case of giving a G30 with coordiantes to the original post.

                              1 Reply Last reply Reply Quote 0
                              • sinned6915undefined
                                sinned6915 @dc42
                                last edited by sinned6915

                                @dc42 @T3P3Tony I am pretty certain that something is up with the deploy and retract scheme. The system does not realize that the probe is picked up, even though it has sucessfully picked up the probe.

                                The approach that I am trying to used is to change the probe pin inversion and do homing moves instead of using one probe type and incremental moves.
                                Can you answer these questions and offer any guidance?

                                1. Does changing the probe pin inversion reset the probe pickup state?

                                2. What is the token in the object model that represents the probe deployment state? I can not tell from the OM Browser. Screen snip at the end.

                                Here is a video of my machine tying to deploy the probe using a G1 move command instead of a controlled incremental move. And for good measure, the macros and config in a zip file if you want to delve deeper.

                                Console & Machine video

                                Firmware files

                                Here is the commented deployprobe.g file that is running in the video.

                                ; ***********************************************************
                                ; deployprobe.g
                                ; config.g is M558 K0 P8 C"^zprobe.in" H10 R0.5 F240:120 T9000 A3 S0.03
                                ; ***********************************************************
                                echo "Running deployprobe.g"
                                echo "Reset Probe to NC"
                                M558 K0 P8 C"^zprobe.in" H10 R0.5 F240:120 T9000 A3 S0.03
                                
                                G91
                                M564 H0 S0          ; allow movement while not homed
                                G1 Z17 F6000        ; move Z 15 for clearance above dock.
                                                    ; need to figure out some safety check on this
                                G90 
                                echo "First logic check"
                                echo  "Probe State Value" ^sensors.probes[0].value[0]
                                if sensors.probes[0].value[0]!=1000    ; if sensor is value other than 1000 do this
                                  abort "deployprobe start value Probe already picked up.  Manually return probe to the dock"
                                ;  echo sensors.probes[0].value[0]
                                ; if we're here we know it's becasue the above is true which I assume is because you have an NC switch as a probe.
                                echo "Pass first logic test"
                                
                                echo "Move to doc"
                                G1 X0.0 Y-27 F6000      ; move above probe dock location
                                G91
                                G1 Z-10
                                G90
                                M400                ; wait for moves to finish
                                echo "Redefine probe type" 
                                M558 K0 P8 C"^!zprobe.in" H10 R0.5 F240:120 T9000 A3 S0.03
                                echo "M558 Inverted"
                                G4 S1
                                
                                echo "Probe Pickup while loop running"
                                ; while sensors.probes[0].value[0]=1000
                                echo  "Probe State Value" ^sensors.probes[0].value[0]
                                while sensors.probes[0].value[0]=0
                                  G91
                                  ; G1 Z-0.5 F600
                                  ; was controled move in previous scheme
                                  G1 Z-100 H1 F300
                                  ; move in -Z to trigger endstop via G1 H1 
                                  M400
                                  G90
                                  ; echo sensors.probes[0].value[0]
                                  ; echo iterations
                                  ; if iterations=100
                                  ;    break
                                echo "Probe Pickup while loop complete"
                                
                                G91                 ; relative coords
                                G1 Z-0.5 F600       ; move bed up 0.5 to clear probe from dock since mags pull it up 
                                M400                ; wait for move to finish
                                G90
                                G1 X50 F3000        ; move right so probe moves out of the dock
                                M400
                                G1 Z12 F3000         ; move bed to clear probe from glass build surface 
                                G1 X100 F6000       ;
                                G90                 ; absolute coords
                                M400                ; wait for moves to finish
                                G4 S2               ; wait 1 second
                                echo  "Probe State Value " ^sensors.probes[0].value[0]
                                echo "Restore probe type"
                                M558 K0 P8 C"^zprobe.in" H10 R0.5 F240:120 T9000 A3 S0.03
                                echo  "Probe State Value " ^sensors.probes[0].value[0]
                                M400
                                G4 S2 
                                
                                echo "Last Logic Check"
                                echo  "Probe State " ^sensors.probes[0].value[0]
                                if sensors.probes[0].value[0]!=0
                                   abort "Abort deployprobe endvalue not 0 Probe not picked up!  Print cancelled."
                                
                                echo "deployprobe.g complete"
                                

                                f5c791e8-8742-4a80-a2e7-2fb0e3e88553-image.png

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

                                  @sinned6915 said in Detachable Probes and Probing:

                                  I am pretty certain that something is up with the deploy and retract scheme. The system does not realize that the probe is picked up, even though it has sucessfully picked up the probe.

                                  How are you commanding the probe to be picked up? The system should realise it is picked up if and only if you use M401 to pick it up.

                                  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
                                  • sinned6915undefined
                                    sinned6915
                                    last edited by sinned6915

                                    @dc42 I am explicitly calling M401 to deploy the probe in the homez.g file. Line 13 of the homez.g file

                                    it's already picked up and in position when the G30 command in issued in the bed.g file (4 point leveling, 3 Z screws).

                                    The error message that the system reports from the gcode meta command comes from the M401 file.

                                    If you watch the youtube video, you will see the console messages with the carriage movements.
                                    Console & Machine Video - https://www.youtube.com/watch?v=0A3sT0sjbHs

                                    You can see where in the homez.g macro, where the pritner has has picked up the probe and successfully completed M401, it returns and calls the bed.g macro. Taht is where the M401 is called again and i errs out becasue the probe is already picked up.

                                    ; ***********************************************************
                                    ; homez.g
                                    ; ***********************************************************
                                    if !move.axes[0].homed || !move.axes[1].homed     ; If the printer hasn't been homed, home it
                                       M98 P"0:/sys/homexy.g"  
                                    M561                                            ; clear any bed transform
                                    M290 S0 R0                                      ; clear baby steps per Wes C
                                    G91                                             ; relative positioning
                                    M400
                                    ; G1 H2 Z6 F6000                                ; lift Z relative to current position
                                    G90                                             ; absolute positioning
                                    echo "Call deployprobe.g macro" 
                                    M401 P0                                         ; This runs macro file deployprobe
                                    echo "returned from deployprobe.g"
                                    echo "Go to center of bed & probe"
                                    G1 X145 Y162.5 F3000                            ; go to bed center
                                    M400
                                    ; echo "Perform G30 S-2 Command"
                                    ; G30                                           ; Probe the bed at the current XY position. When the probe is triggered, 
                                                                                    ; adjust the Z offset of the current tool to make the current position Z=0.
                                    echo "Perform G1 Z-10 H1 Command"
                                    G1 Z-10 H1                                      ; Move and terminate the move when the endstop switch is triggered and set the axis position to 
                                    echo "Perform G92 Z2.6 Command"
                                    G92 Z2.6                                        ; Set the Z axis to the probe offset height  
                                    
                                    M400
                                    G91                                             ; Relative Coordinates
                                    G1 Z1 F6000
                                    M400
                                    G90                                             ; Absolute Coordinates
                                    G1 Z10 F6000
                                    M400
                                    G4 P500
                                    echo "Call bed4point.g macro"
                                    M98 P"0:/sys/bed4point.g"                       ; tram bed
                                    ;
                                    echo "Return from 4-point macro"
                                    echo "Re-probe to set Z incase it drifted"
                                    G1 X145 Y165 F9000                              ; go back to the first probe point and reprobe 0 in case it moved
                                    G30
                                    echo "Call retractprobe.g macro"
                                    M402 P0                                         ; retract probe
                                    echo "Return from M402"
                                    G1 Z10 F600                                     ; lift Z relative to current position
                                    G90                                             ; absolute positioning
                                    M564 S1 H0
                                    ; G1 X150 Y0 F9000                              ; move carraige to center front
                                    
                                    jay_s_ukundefined dc42undefined 2 Replies Last reply Reply Quote 0
                                    • jay_s_ukundefined
                                      jay_s_uk @sinned6915
                                      last edited by

                                      @sinned6915 use conditional gcode in the bed file to check whether the probe has already been picked up or not.
                                      sensors.probes[0].deployedByUser
                                      that object should do it for you.
                                      so something like

                                      if sensors.probes[0].deployedByUser == 0
                                         M401
                                      

                                      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

                                      sinned6915undefined 1 Reply Last reply Reply Quote 0
                                      • sinned6915undefined
                                        sinned6915 @jay_s_uk
                                        last edited by

                                        @jay_s_uk ok, i will try using that as a token to report the status.

                                        i could not tell what that token was telling me.

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

                                          @sinned6915 said in Detachable Probes and Probing:

                                          The error message that the system reports from the gcode meta command comes from the M401 file.

                                          What error message? I didn't see an error message in your video.

                                          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

                                          sinned6915undefined 1 Reply Last reply Reply Quote 0
                                          • sinned6915undefined
                                            sinned6915 @dc42
                                            last edited by

                                            @dc42: i am sorry if i mis-spoke.

                                            I wrote the echo comment to read

                                            abort "deployprobe start value Probe already picked up. Manually return probe to the dock"

                                            Bottom line, I can not determine why the system seems to loose track of the probe pickup token.

                                            Do you have any ideas? Can you offer any help?

                                            I have been fighitng this for weeks, months really if you go back to my other thread on trying to pick up the probe from the bed.

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