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

Z-axis / tramming issues with 3.6.0-alpha2+3

Scheduled Pinned Locked Moved Unsolved
Beta Firmware
6
52
2.1k
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.
  • undefined
    DonStauffer @edsped
    last edited by DonStauffer 8 Mar 2024, 19:30 3 Aug 2024, 19:26

    @edsped Here's my bed.g, and the DefineBed macro you have to run to create the global Bed variable it uses for the data points:

    ;-------------------------------------------------------------------------------
    ; bed.g
    ;-------------------------------------------------------------------------------
    ; Bed leveling macro.
    ;-------------------------------------------------------------------------------
    ; Don Stauffer July, 2024
    ;-------------------------------------------------------------------------------
    ; Subscript Constants
    ;-------------------------------------------------------------------------------
    var LEV = 1
    ;-------------------------------------------------------------------------------
    ; Other Constants
    ;-------------------------------------------------------------------------------
    var ITERATION_COUNT_MAX = 15
    var ERR_ALLOWED = 0.005
    ;-------------------------------------------------------------------------------
    ; Clear any existing bed transform and move up
    ;-------------------------------------------------------------------------------
    M561
    G1 H2 Z5
    ;-------------------------------------------------------------------------------
    ; Start NeoPixel progress meters
    ;-------------------------------------------------------------------------------
    ;M98 P"0:/macros/Lights/NeoPixel/Progress/BedLeveling/StartProgressMeters" E{var.ERR_ALLOWED}
    ;-------------------------------------------------------------------------------
    ; Iteratively attempt to level the bed
    ;-------------------------------------------------------------------------------
    var Raw = null
    var Abs = null
    var Sign = null
    var x = null
    var y = null
    var z = null
    var Err = pow(2, 31) ; "infinity"
    while iterations < var.ITERATION_COUNT_MAX && var.Err > var.ERR_ALLOWED
    ;---------------------------------------------------------------------------
    ; Retrieve and probe the points
    ;---------------------------------------------------------------------------
    while iterations < #(global.Bed[var.LEV])
    ;-----------------------------------------------------------------------
    ; Decode probe point coordinates
    ;-----------------------------------------------------------------------
    set var.Raw = mod(global.Bed[var.LEV][iterations], pow(2, 15))
    set var.Abs = mod(var.Raw, pow(2, 14))
    set var.Sign = floor((var.Raw - var.Abs) / pow(2, 14) + 0.5)
    set var.x = var.Abs * (1 - var.Sign * 2)
    set var.Raw = floor((global.Bed[var.LEV][iterations]-var.Raw)/pow(2, 15)+ 0.5)
    set var.Abs = mod(var.Raw, pow(2, 14))
    set var.Sign = floor((var.Raw - var.Abs) / pow(2, 14) + 0.5)
    set var.y = var.Abs * (1 - var.Sign * 2)
    ;-----------------------------------------------------------------------
    ; Moving this way updates move.axes[i].userPosition faster
    ; (Important for NeoPixel progress meter for index)
    ;-----------------------------------------------------------------------
    set var.z =sensors.probes[0].diveHeights[0]-sensors.probes[0].offsets[2]
    ;-----------------------------------------------------------------------
    ; Probe the point
    ;-----------------------------------------------------------------------
    if iterations == #(global.Bed[var.LEV]) - 1
    G30 P{iterations} X{var.x} Y{var.y} Z-99999 S3
    ;G30 P{iterations} X{var.x} Y{var.y} Z-99999 S{#(global.Bed[var.LEV])}
    else
    G30 P{iterations} X{var.x} Y{var.y} Z-99999
    ;---------------------------------------------------------------------------
    ; Calculate the error sum
    ;---------------------------------------------------------------------------
    set var.Err = abs(move.calibration.initial.mean)
    set var.Err = var.Err + move.calibration.initial.deviation
    if global.DebugLevel > 1000
    echo "Error="^var.Err,"Mean="^move.calibration.initial.mean,"Dev="^move.calibration.initial.deviation
    if var.Err > var.ERR_ALLOWED
    echo "Leveling didn't converge;",var.ITERATION_COUNT_MAX,"tries. Error="^var.Err
    else
    echo "Leveling converged. Error="^var.Err
    ;-------------------------------------------------------------------------------
    ; Move to center (necessary for NeoPixel progress meters to detect done)
    ;-------------------------------------------------------------------------------
    G53 G1 X150 Y150 F9000
    ;-------------------------------------------------------------------------------
    ; Wait for NeoPixel progress mweter processes to end themselves
    ;-------------------------------------------------------------------------------
    ;M98 P"0:/macros/Lights/NeoPixel/Progress/WaitForEnd"
    ;-------------------------------------------------------------------------------
    ; DefineBed Macro
    ;-------------------------------------------------------------------------------
    ; Initializes global.Bed.
    ; global.Bed[var.LEV] contains the 3 probe points for bed leveling, encoded
    ; as bitmaps to save memory.
    ;
    ; This is intended to be called from config.g.
    ;
    ; The X and Y coordinates of each point are compressed into a single integer
    ; for memory conservation. The decoding routine is at the bottom of this file.
    ;-------------------------------------------------------------------------------
    ; Don Stauffer July, 2024
    ;-------------------------------------------------------------------------------
    ;if global.DebugLevel >= 1200
    ; echo "DefineBed"
    ;-------------------------------------------------------------------------------
    ; Subscript Constants
    ;-------------------------------------------------------------------------------
    var HTR = 0
    var OM = 0
    ;var STATE = 1
    var LEV = 1
    ;-------------------------------------------------------------------------------
    ; Create global.Bed if necessary
    ;-------------------------------------------------------------------------------
    if !exists(global.Bed)
    global Bed = vector(2, null)
    set global.Bed[var.HTR] = vector(2, null)
    set global.Bed[var.LEV] = vector(3, null)
    ;-------------------------------------------------------------------------------
    ; Define probe points for bed leveling; bitmap encode to save memory
    ;-------------------------------------------------------------------------------
    var x = {10, 10, 265}
    var y = {12, 228, 100}
    while iterations < 3
    ;---------------------------------------------------------------------------
    ; Encode x and y coordinates into a single integer
    ;---------------------------------------------------------------------------
    var xEnc = abs(var.x[iterations]) + (var.x[iterations] < 0 ? pow(2, 14) : 0)
    var yEnc = abs(var.y[iterations]) * pow(2, 15)
    set var.yEnc = var.yEnc + (var.y[iterations] < 0 ? pow(2, 29) : 0)
    set global.Bed[var.LEV][iterations] = var.xEnc + var.yEnc
    ;-------------------------------------------------------------------------------
    ; Set up bed heater information
    ;-------------------------------------------------------------------------------
    while iterations < #heat.bedHeaters
    if heat.bedHeaters[iterations] != -1
    set global.Bed[var.HTR][var.OM] = iterations
    break
    ;-------------------------------------------------------------------------------
    ;if global.DebugLevel >= 1200
    ; echo "Leaving DefineBed"
    ;-------------------------------------------------------------------------------
    M99
    ;-------------------------------------------------------------------------------
    ; To decode bitmap-encoded probe points:
    ;-------------------------------------------------------------------------------
    while iterations < 3
    var P = global.Bed[var.LEV][iterations]
    var xRaw = mod(var.P, pow(2, 15))
    var yRaw = floor((var.P - var.xRaw) / pow(2, 15) + 0.5)
    var xAbs = mod(var.xRaw, pow(2, 14))
    var yAbs = mod(var.yRaw, pow(2, 14))
    var xSign = floor((var.xRaw - var.xAbs) / pow(2, 14) + 0.5)
    var ySign = floor((var.yRaw - var.yAbs) / pow(2, 14) + 0.5)
    var xDec = var.xAbs * (1 - var.xSign * 2)
    var yDec = var.yAbs * (1 - var.ySign * 2)
    echo "("^var.xDec^",", var.yDec^")"
    undefined 1 Reply Last reply 3 Aug 2024, 19:43 Reply Quote 0
    • undefined
      Exerqtor @DonStauffer
      last edited by Exerqtor 8 Mar 2024, 19:43 3 Aug 2024, 19:43

      Just slapped together a stripped down bed.g, hopefully i get time to test it either today or tomorrow.

      bed.g

      1 Reply Last reply Reply Quote 0
      • undefined
        DonStauffer @dc42
        last edited by 3 Aug 2024, 20:19

        @dc42 Here are my testing results.

        In bed.g, I inserted immediately after my first G30:

        G1 Z25 F75
        M99

        Then I homed and did a G32. Nothing that happened was unexpected. The motors all ran in the correct direction. So the only issue I can confirm is that the adjustment when the G30 with the S parameter executes goes in the wrong direction for one of the motors - and not always the same one. Initially it was #7. Then when I did my "manual" tramming with bed.g doing S-1 to report the correct adjustments, it was #6. I did that manual tramming over and over, making very conservative adjustments, and throughout several hours it remained #6. But it absolutely was a different motor than the problem started on. And there's no doubt it isn't just a simple reversal - it's conditional, only apparently happening on the G30 S adjustments.

        So, my answer is "neither #1 nor #2".

        1 Reply Last reply Reply Quote 0
        • undefined
          edsped
          last edited by 3 Aug 2024, 20:24

          Switched back to 3.6 alpha 2 +3 and for me at least it looks like it's applying the the leadscrew adjustments in the wrong direction. If you look at my screenshot the offsets pretty much double on each iteration. Note, for the initial print adjustments were similar to what I got on 3.5.2 but G32 after the print gave the wonky adjustments.

          Screenshot 2024-08-03 162037.jpg

          Disregard the bed.g warnings I inadvertently hit save when exiting out of the editor.

          undefined undefined 2 Replies Last reply 3 Aug 2024, 20:32 Reply Quote 0
          • undefined
            edsped @edsped
            last edited by edsped 8 Mar 2024, 20:38 3 Aug 2024, 20:32

            @edsped Running a second tram immediately following the above resulted in my front left leadscrew ending ~4mm higher than the other two... FWIW, the front left side of my bed is also where my nozzle crashed due to that corner of the bed being too high. I should clarify, higher on my printer is actually - Z

            Edit:
            Powered down and back up and now get the following on G32...

            8/3/2024, 4:38:57 PM Error: Compensation or calibration cancelled due to probing errors
            8/3/2024, 4:38:52 PM Error: G30: Probe was not triggered during probing move

            1 Reply Last reply Reply Quote 0
            • undefined
              DonStauffer @edsped
              last edited by 3 Aug 2024, 22:21

              @edsped Interesting. I was only having one of the three go in the wrong direction.

              undefined 1 Reply Last reply 3 Aug 2024, 23:19 Reply Quote 0
              • undefined
                edsped @DonStauffer
                last edited by 3 Aug 2024, 23:19

                @DonStauffer That's what mine was doing the first time. I reverted to 3.5.2 then back to 3.6 a2+3 and added the M400 as suggested by @dc42 and what I posted above are my results. This time knowing what I was looking for I was able to bail before anything bad happened.

                undefined 1 Reply Last reply 4 Aug 2024, 07:57 Reply Quote 0
                • undefined
                  dc42 administrators @edsped
                  last edited by 4 Aug 2024, 07:57

                  Currently, after performing probing a bed tramming move is executed with all Z motors moving simultaneously in different amounts and a mixture of directions. Would there be any problem if the Z motor moves were executed one at a time sequentially instead?

                  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

                  undefined undefined 2 Replies Last reply 4 Aug 2024, 08:28 Reply Quote 0
                  • undefined
                    gloomyandy @dc42
                    last edited by 4 Aug 2024, 08:28

                    @dc42 Could this in some situations cause a nozzle strike? I'm thinking of a situation with a very highly tilted bed and homing/probing in the middle portion of the bed, you could in theory end up with the nozzle lower then one edge of the bed and if you then raise the (currently) lower edge first the bed would hit the nozzle? The same situation with a simultaneous move may not cause the strike? Probably not very likely though.

                    Possible mitigating actions: Perform any negative (moving the bed away from the nozzle) moves first? Limit the distance each motor moves in one operation and cycle through the motors until the move is complete?

                    undefined 1 Reply Last reply 4 Aug 2024, 09:12 Reply Quote 0
                    • undefined
                      dc42 administrators @gloomyandy
                      last edited by 4 Aug 2024, 09:12

                      @gloomyandy said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                      ould this in some situations cause a nozzle strike? I'm thinking of a situation with a very highly tilted bed and homing/probing in the middle portion of the bed, you could in theory end up with the nozzle lower then one edge of the bed and if you then raise the (currently) lower edge first the bed would hit the nozzle?

                      If the probe had to make a deeper than normal move ton reach the lower edge, it will still rise to the dive height above the Z=0 reference afterwards. So I don't think this is a risk, provided that the maximum permitted correction is less than the dive height - which already needs to be the case if nozzle strikes are to be avoided.

                      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
                      • undefined
                        Exerqtor @dc42
                        last edited by Exerqtor 8 May 2024, 18:50 4 Aug 2024, 13:50

                        @dc42 said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                        Currently, after performing probing a bed tramming move is executed with all Z motors moving simultaneously in different amounts and a mixture of directions. Would there be any problem if the Z motor moves were executed one at a time sequentially instead?

                        @gloomyandy said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                        @dc42 Could this in some situations cause a nozzle strike? I'm thinking of a situation with a very highly tilted bed and homing/probing in the middle portion of the bed, you could in theory end up with the nozzle lower then one edge of the bed and if you then raise the (currently) lower edge first the bed would hit the nozzle? The same situation with a simultaneous move may not cause the strike? Probably not very likely though.

                        Possible mitigating actions: Perform any negative (moving the bed away from the nozzle) moves first? Limit the distance each motor moves in one operation and cycle through the motors until the move is complete?

                        I don't know if this is possible, but is it possible to do it sequentially like you are proposing, but RRF "automatically" choose which axis/stepper to move 1st, 2nd, 3rd, etc. depending on the specified adjustmen that has to be made (taking my drive mapping as example)?

                        ; (While looking at the printer top down)
                        ; 0.0-----0.1
                        ; | 0.2 |
                        ; |-------|
                        ; |0.3|0.4|
                        ; ---+---
                        ; Front
                        ; Driver 0.1 & 0.2 is for the CoreXY motion, 0.2-0.4 is for the bed kinematics.

                        Example 1:
                        Adjustments needed after probing:

                        • Driver 0.2 = -0.5mm
                        • Driver 0.3 = -0.2mm
                        • Driver 0.4 = +0.9mm

                        To avoid potential nozzle craches RRF will move the driver/axis that needs to adjust TOWARDS the nozzle last, and the driver/axis that needs to move the most AWAY from the nozzle first:

                        1. Lower driver 0.4 by 0.9mm.
                        2. Raise driver 0.3 by 0.2mm.
                        3. Raise driver 0.2 by 0.5mm.

                        This should both put the least mechanical strain on the bed (depending on how the bed is built ofc.), and it would provide maximal clearance to the nozzle.

                        Example 2:
                        Adjustments needed after probing:

                        • Driver 0.2 = +3.7mm
                        • Driver 0.3 = -0.3mm
                        • Driver 0.4 = +1.1mm

                        Adjustment order:

                        1. Lower driver 0.2 by 3.7mm.
                        2. Lower driver 0.4 by 1.1mm.
                        3. Raise driver 0.3 by 0.3mm.
                        undefined undefined 2 Replies Last reply 4 Aug 2024, 17:05 Reply Quote 1
                        • undefined
                          dc42 administrators @Exerqtor
                          last edited by 4 Aug 2024, 17:05

                          @Exerqtor that's a good idea.

                          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 1
                          • undefined
                            gloomyandy @Exerqtor
                            last edited by 4 Aug 2024, 18:36

                            @Exerqtor said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                            To avoid potential nozzle craches RRF will move the axis the driver/axis that needs to adjust TOWARDS the nozzle last, and the driver/axis that needs to move the most AWAY from the nozzle first:

                            Yes that's what I was suggesting with:

                            @gloomyandy said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                            Possible mitigating actions: Perform any negative (moving the bed away from the nozzle) moves first

                            undefined 1 Reply Last reply 10 Aug 2024, 13:48 Reply Quote 1
                            • undefined
                              Exerqtor @gloomyandy
                              last edited by 10 Aug 2024, 13:48

                              @dc42 Got any builds I/we could test incorporating this commit?

                              undefined 1 Reply Last reply 10 Aug 2024, 15:17 Reply Quote 0
                              • undefined
                                dc42 administrators @Exerqtor
                                last edited by 10 Aug 2024, 15:17

                                @Exerqtor yes, is this for D3 Mini or another board?

                                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

                                undefined 1 Reply Last reply 10 Aug 2024, 17:43 Reply Quote 0
                                • undefined
                                  Exerqtor @dc42
                                  last edited by 10 Aug 2024, 17:43

                                  @dc42 said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                                  @Exerqtor yes, is this for D3 Mini or another board?

                                  Yes in my case it's for a D3 mini at least ☺️

                                  undefined 1 Reply Last reply 10 Aug 2024, 18:27 Reply Quote 0
                                  • undefined
                                    dc42 administrators @Exerqtor
                                    last edited by dc42 8 Oct 2024, 18:44 10 Aug 2024, 18:27

                                    I've put new RRF builds at https://www.dropbox.com/scl/fo/yc7mnauicu5vqw6yegeq7/AKnV4j8k1MCADG4VE4EIG6Y?rlkey=skjxh23i9c953yvxm2tb8qr36&dl=0. Some notes:

                                    • The issue with bed tramming might be fixed. I don't have a suitable machine to test it on.
                                    • Scanning Z probes are fixed (they didn't work in previous 3.6.0 alpha releases)
                                    • Also included are 3.6.0 alpha versions of some expansion board firmware (not EXP1HCL or M23CL). You can revert to 3.5.2 versions if you have any issues with them.

                                    See https://github.com/Duet3D/RepRapFirmware/wiki/Changelog-RRF-3.x-Beta#reprapfirmware-360-beta1-in-preparation for more details.

                                    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

                                    undefined undefined 3 Replies Last reply 10 Aug 2024, 19:40 Reply Quote 3
                                    • undefined
                                      edsped @dc42
                                      last edited by 10 Aug 2024, 19:40

                                      @dc42 Still seeing accumulation on one of the leadscrews so I'm hesitant to test...
                                      812faa74-af2f-4803-8dd3-a9aee5c65cff-image.png

                                      undefined 1 Reply Last reply 11 Aug 2024, 07:56 Reply Quote 0
                                      • undefined
                                        edsped @dc42
                                        last edited by 10 Aug 2024, 19:45

                                        @dc42 Same iterations on 3.5.2
                                        874007a2-054d-4595-8065-335a6bd4d14f-image.png

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          o_lampe @dc42
                                          last edited by 11 Aug 2024, 06:02

                                          @dc42 said in Z-axis / tramming issues with 3.6.0-alpha2+3:

                                          The issue with bed tramming might be fixed. I don't have a suitable machine to test it on.

                                          IIRC, the problem was also seen on a Delta printer...that's why I hesitate to test 3.6.a+

                                          undefined 1 Reply Last reply 11 Aug 2024, 06:34 Reply Quote 0
                                          32 out of 52
                                          • First post
                                            32/52
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA