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.
    • dc42undefined
      dc42 administrators @DonStauffer
      last edited by dc42

      @DonStauffer @Exerqtor @edsped thanks for reporting this. I'm sorry for any damage caused.

      I don't have a system with multiple Z motors that I can test on, but I think I know what is causing this. It's to do with getting the motor direction wrong when switching between normal Z moves and leadscrew adjustment moves. Please can you identify for me which of the following is happening:

      1. When the first bed tramming move is executed, some of the motors move in the wrong direction.
      2. Immediately after the first bed tramming move is executed, when executing a normal Z move (which could be part of a new G32 probing sequence), some of the the Z motors move in the wrong direction.
      3. Both of the above.

      If the main problem is #2 then a workaround for now might be to insert M400 after the G32 call, to ensure motion stops before another Z move is executed.

      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

      Exerqtorundefined DonStaufferundefined 3 Replies Last reply Reply Quote 0
      • Exerqtorundefined
        Exerqtor @dc42
        last edited by Exerqtor

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

        @DonStauffer @Exerqtor @edsped thanks for reporting this. I'm sorry for any damage caused.

        It's part of the course with testing pre-release stuff imo! Win some loose some 😅

        I don't have a system with multiple Z motors that I can test on, but I think I know what is causing this. It's to do with getting the motor direction wrong when switching between normal Z moves and leadscrew adjustment moves. Please can you identify for me which of the following is happening:

        1. When the first bed tramming move is executed, some of the motors move in the wrong direction.
        2. Immediately after the first bed tramming move is executed, when executing a normal Z move (which could be part of a new G32 probing sequence), some of the the Z motors move in the wrong direction.
        3. Both of the above.

        If the main problem is #2 then a workaround for now might be to insert M400 after the G32 call, to ensure motion stops before another Z move is executed.

        Well, when I think back the first time it happened for me was during the Z homing routine before tramming start. I think it was between one of the "tolerance" moves when doing G30. Did the first move, went to lower the bed to specified dive height, but rather than switching over the two front axis to rise up again to "engage" the second probe once dive height was reached they contiuned on a downwards motion.

        The other times it happened it seemd to apply the axis adjustements wronlgy (in 1 or all axis) when it was done with the G30 moves for tramming.

        If that made sense?

        1 Reply Last reply Reply Quote 0
        • DonStaufferundefined
          DonStauffer @dc42
          last edited by

          @dc42 I have not had bed tramming without one of the motors going the wrong direction since installing alpha 2. I will have to test for #2. I don't think I've seen it but I wasn't looking for it.

          1 Reply Last reply Reply Quote 0
          • DonStaufferundefined
            DonStauffer @edsped
            last edited by DonStauffer

            @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^")"
            
            
            Exerqtorundefined 1 Reply Last reply Reply Quote 0
            • Exerqtorundefined
              Exerqtor @DonStauffer
              last edited by Exerqtor

              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
              • DonStaufferundefined
                DonStauffer @dc42
                last edited by

                @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
                • edspedundefined
                  edsped
                  last edited by

                  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.

                  edspedundefined DonStaufferundefined 2 Replies Last reply Reply Quote 0
                  • edspedundefined
                    edsped @edsped
                    last edited by edsped

                    @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
                    • DonStaufferundefined
                      DonStauffer @edsped
                      last edited by

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

                      edspedundefined 1 Reply Last reply Reply Quote 0
                      • edspedundefined
                        edsped @DonStauffer
                        last edited by

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

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

                          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

                          gloomyandyundefined Exerqtorundefined 2 Replies Last reply Reply Quote 0
                          • gloomyandyundefined
                            gloomyandy @dc42
                            last edited by

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

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

                              @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
                              • Exerqtorundefined
                                Exerqtor @dc42
                                last edited by Exerqtor

                                @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.
                                dc42undefined gloomyandyundefined 2 Replies Last reply Reply Quote 1
                                • dc42undefined
                                  dc42 administrators @Exerqtor
                                  last edited by

                                  @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
                                  • gloomyandyundefined
                                    gloomyandy @Exerqtor
                                    last edited by

                                    @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

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

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

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

                                        @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

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

                                          @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 ☺️

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

                                            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

                                            edspedundefined o_lampeundefined 3 Replies Last reply Reply Quote 3
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA