Probe accuracy macro



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





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



  • 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



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



  • 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


Log in to reply