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

    Probe accuracy macro

    Scheduled Pinned Locked Moved
    General Discussion
    3
    6
    1.2k
    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.
    • alexicundefined
      alexic
      last edited by

      I am looking for a way to test a few Z probe types for their accuracy but to my surprise I could not find a command or example macro for this. In klipper or marlin there are dedicated functions for this.

      I know from the probe calibration page that I can raise Z a few millimeters then lower Z until the probe is triggered and the height will be reported, but could I store this value in a list and repeat the command 10 times? Then (not necessarily but would be nice) do some math calculations with the numbers to determine mean value, standard deviation.

      Any of you have an idea of this can be implemented?

      Kolbiundefined 1 Reply Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk
        last edited by

        have a look at this thread
        https://forum.duet3d.com/topic/6962/m48-measure-z-probe-repeatability-and-print-to-serial-output?_=1600667938818

        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 0
        • Kolbiundefined
          Kolbi @alexic
          last edited by

          @alexic If you really want to play with the probe repeatability numbers in a spreadsheet, you could do something like this:

          ; Probe repeatability testing
          ; Directory "0:/macros/probe-results/" must exist to save results
          ; Upon completion, download zip file of the results directory, make a file listing of the directory in the form of a text file, save that file
          ; as a .csv file, import into spreadsheet - setting "-" as the deliminator.
          
          G32                                                                                  ; Home and level
          G1 Z5                                                                                ; Move Z to 5mm height
          G1 X100 Y100 F2000                                                                   ; Move to center of bed
          
          
          while iterations <=49                                                                ; Perform 50 passes
            G30 Z-99999 S-1                                                                    ; Execute Z Probe
            echo "" ^ move.axes[2].machinePosition ^ "," ^ iterations                          ; Echo the probe result and iteration number to console
          
            M28 {"0:/macros/probe-results/"^ move.axes[2].machinePosition ^"-"^iterations}     ; Create a file, named as the probe result and iteration number in the
                                                                                               ; 0:/macro/probe-results/ directory.  
            M29                                                                                ; Close file
          
            G1 Z5                                                                              ; Move Z to 5mm height
            M400                                                                               ; Wait for current moves to finish
          

          Cheers,
          Kolbi

          1 Reply Last reply Reply Quote 2
          • Kolbiundefined
            Kolbi
            last edited by Kolbi

            I should have added, to make a text file containing a directory listing you can use the following in a terminal, from within that directory you wish to list.

            Windows:
            dir /b > results.csv

            Unix family:
            ls > results.csv

            1 Reply Last reply Reply Quote 0
            • alexicundefined
              alexic
              last edited by

              Thanks guys, it seems to be what I was looking for!

              1 Reply Last reply Reply Quote 0
              • Kolbiundefined
                Kolbi
                last edited by Kolbi

                I ran the script at probing speeds from 30 to 500, dive height of 5mm - here is the results. My normal probing speed is 50.

                ; Probe repeatability testing
                ; Directory "0:/macros/probe-results/" must exist to save results
                ; Upon completion, download zip file of the results directory, make a file listing of the directory in the form of a text file, save that file
                ; as a .csv file, import into spreadsheet - setting "-" as the deliminator.
                
                G32                                                                                       ; Home and level
                G1 Z5                                                                                     ; Move Z to 5mm height
                G1 X100 Y100 F2000                                                                        ; Move to center of bed
                
                M558 F30 A1                                                                               ; Set probing speed
                while iterations <=19                                                                     ; Perform 20 passes
                  G30 Z-99999 S-1                                                                         ; Execute Z Probe
                  echo "" ^ move.axes[2].machinePosition ^ ",F30," ^ iterations                           ; Echo the probe result and iteration number to console
                  M28 {"0:/macros/probe-results/"^ move.axes[2].machinePosition ^"-F30-"^iterations}      ; Create a file, named as the probe result and iteration number in the
                                                                                                          ; 0:/macro/probe-results/ directory.  
                  M29                                                                                     ; Close file
                  G1 Z5                                                                                   ; Move Z to 5mm height
                  M400                                                                                    ; Wait for current moves to finish
                

                blt31-results-run1.png

                From dive height of 15mm (50 samples per probing-speed group)

                ; Probe repeatability testing
                ; Directory "0:/macros/probe-results/" must exist to save results
                ; Upon completion, download zip file of the results directory, make a file listing of the directory in the form of a text file, save that file
                ; as a .csv file, import into spreadsheet - setting "-" as the deliminator.
                
                G32                                                                                       ; Home and level
                G1 Z15                                                                                    ; Move Z to 15mm height
                G1 X100 Y100 F2000                                                                        ; Move to center of bed
                
                M558 F30 A1                                                                               ; Set probing speed
                while iterations <=49                                                                     ; Perform 50 passes
                  G30 Z-99999 S-1                                                                         ; Execute Z Probe
                  echo "" ^ move.axes[2].machinePosition ^ ",F30," ^ iterations                           ; Echo the probe result and iteration number to console
                  M28 {"0:/macros/probe-results/"^ move.axes[2].machinePosition ^"-F30-"^iterations}      ; Create a file, named as the probe result and iteration number in the
                                                                                                          ; 0:/macro/probe-results/ directory.  
                  M29                                                                                     ; Close file
                  G1 Z15                                                                                  ; Move Z to 15mm height
                  M400                                                                                    ; Wait for current moves to finish
                

                blt31-results-run2.png

                Raw probing values - results.csv

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