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

    Probe repeatability.

    Scheduled Pinned Locked Moved
    General Discussion
    5
    7
    281
    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.
    • smaaashundefined
      smaaash
      last edited by

      Is there some function like M48 in Marlin? I’m running RRF 3.4.

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @smaaash
        last edited by

        @smaaash M48 is not supported, but you can do the same thing with a macro. This one has been posted on the forum a few times; adjust the X and Y position for a point within the bed limits:

        M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
        G28
        M401
        G30 P0 X100 Y100 Z-9999
        G30 P1 X100 Y100 Z-9999
        G30 P2 X100 Y100 Z-9999
        G30 P3 X100 Y100 Z-9999
        G30 P4 X100 Y100 Z-9999
        G30 P5 X100 Y100 Z-9999
        G30 P6 X100 Y100 Z-9999
        G30 P7 X100 Y100 Z-9999
        G30 P8 X100 Y100 Z-9999
        G30 P9 X100 Y100 Z-9999 S-1
        M402
        

        If you create a file called M48.g in the /sys folder, and copy the above to it, you can call it by sending M48, if you really want to emulate Marlin!

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        oliofundefined 1 Reply Last reply Reply Quote 1
        • oliofundefined
          oliof @droftarts
          last edited by

          @droftarts I cold coded a Macro that is more in line with M48 (except the star motion stuff) a couple weeks ago, I should test it and then publish (-:

          <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

          dc42undefined 1 Reply Last reply Reply Quote 2
          • dc42undefined
            dc42 administrators @oliof
            last edited by

            @oliof please do!

            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

            oliofundefined 1 Reply Last reply Reply Quote 0
            • oliofundefined
              oliof @dc42
              last edited by

              @dc42 here goes. It still is buggy regarding position setting and misses the circular/star motion feature of Marlin's implementation (I have an even more buggy sub macro for that).

              M48.g

              <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

              Exerqtorundefined 1 Reply Last reply Reply Quote 1
              • Exerqtorundefined
                Exerqtor @oliof
                last edited by

                I've got one i made a while back too:

                ; M48.g  v3.0
                ; Called as response to M48
                ; Used to run probe repeatability test
                
                 ;---/
                ; -/--/--/--/--/--/--/--/--/--/--/--/--/--/--/--/--
                ; THIS MACRO ONLY WORKS WITH RRF 3.5.0b1 AND LATER!!
                ;--/--/--/--/--/--/--/--/--/--/--/--/--/--/--/--/--
                ;-/
                
                ; ====================---------------------------------------------------------
                ; Settings section
                ; ====================
                
                ; Bed size
                var bedX                = 350                                                  ; Input your beds X axis size here (used to calculate bed center)
                var bedY                = 350                                                  ; Input your beds Y axis size here (used to calculate bed center)
                
                ; Nozzle clearance (gets overridden if you have global.Nozzle_CL)
                var Clearance           = 5                                                    ; The "safe" clearance you want to have between the noszzle and bed before moving the printhead
                
                ; Don't touch anyting bellow this point!
                ; ====================---------------------------------------------------------
                ; Prep phase
                ; ====================
                
                ;Calculate bed center
                set var.bedX = var.bedX / 2
                set var.bedY = var.bedY / 2
                
                if exists(global.Nozzle_CL)
                  set var.Clearance = {global.Nozzle_CL}
                
                var msg = "How many samples do you want to take? (3-32)"
                
                ; Ask to set sample amount
                M291 S6 J1 R"Probe repeatability test" P{var.msg} L3 H32 F10
                
                var Samples = {input}
                
                set var.msg = "Doing " ^ var.Samples ^ " samples. Please wait..."
                
                M291 S1 R"Probe repeatability test" P{var.msg} T5
                
                M561                                                                           ; Clear any bed transform
                M290 R0 S0                                                                     ; Reset baby stepping
                M84 E0                                                                         ; Disable extruder stepper
                
                if exists(global.sb_leds)
                  set global.sb_leds = "homing"
                
                ; Lower Z currents
                if fileexists("/sys/lib/current/z_current_low.g")
                  M98 P"/sys/lib/current/z_current_low.g"                                      ; Set low Z currents
                else
                  M913 Z60                                                                     ; Set Z motors to 60% of their max current
                 
                ; Lower Z relative to current position if needed
                if !move.axes[2].homed                                                         ; If Z ain't homed
                  G91                                                                          ; Relative positioning
                  G1 Z{var.Clearance} F9000 H1                                                 ; Lower Z(bed) relative to current position	
                  G90                                                                          ; Absolute positioning
                elif move.axes[2].userPosition < {var.Clearance}                               ; If Z is homed and less than var.Clearance
                  G1 Z{var.Clearance} F9000                                                    ; Move to Z var.Clearance
                
                ; ====================---------------------------------------------------------
                ; Home all axes
                ; ====================
                
                ; Make sure all axes are homed, and home Z again anyways
                if !move.axes[0].homed || !move.axes[1].homed                                  ; If X & Y axes aren't homed
                  ; Home X & Y axis
                  M98 P"/sys/homex.g" Z{true} A{true}                                          ; Home X axis, pass param.Z since we allready lowered Z & A to indicate this is part of a homing sequence
                  M98 P"/sys/homey.g" Z{ture} C{true}                                          ; Home Y axis, pass param.Z since we allready lowered Z & C since XY currents/speeds are also ok
                
                ; Home Z axis
                M98 P"/sys/homez.g" Z{true} A{true}                                            ; Home Z axis, pass param.Z since we allready lowered Z & A to indicate this is part of a homing sequence
                
                ; ====================---------------------------------------------------------
                ; Probing code
                ; ====================
                
                ; Move to bed center
                G90                                                                            ; Absolute positioning
                G1 X[var.bedX] Y[var.bedY] F6000                                               ; Move to the center of the bed
                
                ; LED status
                if exists(global.sb_leds)
                  set global.sb_leds = "leveling"
                
                M558 K0 F180 A1
                
                var loopCounter = 0
                while true
                  G30 P{var.loopCounter} K0 Z-9999
                  if iterations >= 1
                    echo "Sample number " ^ {iterations} ^ ": " ^ {sensors.probes[0].lastStopHeight - sensors.probes[0].triggerHeight} ^ "mm"
                  set var.loopCounter = iterations
                  if iterations = var.Samples - 1
                    G30 P{var.loopCounter} K0 Z-9999 S-1
                    break
                
                M558 K0 F300:180 A3
                
                ; ====================---------------------------------------------------------
                ; Finish up
                ; ====================
                
                ; Uncomment the following lines to lower Z(bed) after probing
                G90                                                                            ; Absolute positioning
                G1 Z{var.Clearance} F2400                                                      ; Move to Z var.Clearance
                
                ; Full currents
                if fileexists("/sys/lib/current/xy_current_high.g")
                  M98 P"/sys/lib/current/xy_current_high.g"                                    ; Set high XY currents
                else
                  M913 X100 Y100                                                               ; Set X Y motors to var.100% of their max current
                if fileexists("/sys/lib/current/z_current_high.g")
                  M98 P"/sys/lib/current/z_current_high.g"                                     ; Set high Z currents
                else
                  M913 Z100                                                                    ; Set Z motors to var.100% of their max current
                
                set var.msg = "" ^ var.Samples ^ " samples complete, see console"
                
                M291 S1 R"Probe repeatability test" P{var.msg} T5                              ; Test done message
                
                ; If using Voron TAP, report that probing is completed
                if exists(global.TAPPING)
                  set global.TAPPING = false
                  M402 P0                                                                      ; Return the hotend to the temperature it had before probing
                
                ; LED status
                if exists(global.sb_leds)
                  set global.sb_leds = "ready"
                
                dc42undefined 1 Reply Last reply Reply Quote 2
                • dc42undefined
                  dc42 administrators @Exerqtor
                  last edited by

                  Another useful one is to test for backlash on the delta printers, or tilt+backlash on most other types of printer with a moving X carriage. An outline is:

                  • Move to X minimum Y centre
                  • Move X to centre
                  • Probe several times as per these M48 macros and report the resulting mean and SD
                  • Move to X max
                  • Move X back to centre
                  • Probe several times as per these M48 macros and report the resulting mean and SD
                  • Look for differences in the mean between the two sets of results

                  On deltas, also do the above using Y movements instead of X movements.

                  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
                  • droftartsundefined droftarts referenced this topic
                  • droftartsundefined droftarts referenced this topic
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA