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

    Can't touch the bed (bed leveling macro)

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    3
    6
    468
    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.
    • mitchundefined
      mitch
      last edited by

      I have recently replaced some parts and need to bed level again.

      I am running v3.4 firmware. I tried to run my trusty macro that I got from somebody on here (@Phaedrux ) perhaps. But for some reason, even after I have properly set my z-height, this macro won't let me touch the bed with the nozzle. Instead it lets me drop the Z down to 0 but zero is way above the bed. I commented out the reset Z height at the top and I still have the same problem. Can anyone spot what the issue is? Do I need a command at the top to ignore z height? If so, this confuses me because I believe the z-height to be correct already. Before I run this macro I can decrement my nozzle down to the bed manually and it touches the bed right at 0. What is this macro doing that raises the Z height so much when it runs?

      Also, before someone asks, I am aware of the following:
      https://duet3d.dozuki.com/Wiki/Using_the_manual_bed_levelling_assistant

      But it also seems to be out of date as those macros do not work either and I get errors when trying to run them.

      If anyone has a handy dummy proof manual bed leveling macro to use with a BL touch I would be much appreciated.

      For ref:

      bed.g

      ; bed.g
      ; called to perform automatic bed compensation via G32
      ;
      ; generated by RepRapFirmware Configuration Tool v2.1.8 on Sun Feb 09 2020 08:41:29 GMT-0600 (Central Standard Time)
      ;M561 ; clear any bed transform
      ;G29  ; probe the bed and enable compensation
      
      G28                            ; Home 
      M401                           ; deploy Z probe
      
      ; Probe adjustment screw locations
      G30 PO X26 Y195 Z-99999        ; Probe at adjustment screw #1 (back left)
      G30 P1 X177 Y195 Z-99999       ; Probe at adjustment screw #2 (back right)
      G30 P2 X177 Y25 Z-99999        ; Probe at adjustment screw #4 (front right)
      G30 P3 X26 Y25 Z-99999 S4      ; Probe at adjustment screw #3 (front right) and report adjustments needed
      
      M402                           ; retract probe
      

      Bed Level Macro

      ; Helps guide leveling the bed mechanically, and calibrate the ZProbe trigger height before running a grid bed compensation routine..
      ;
      
      ; Preamble to tell the user to prepare the printer before continuing
      ;
      ;M291 P"Before proceeding make sure the printer is mechanically sound and properly functioning." R"Prepare printer for leveling routine" S3 ; User must click OK
      ;M291 P"ZProbe should be configured and working. Clear the print bed of any obstacles or debris." R"Prepare printer for leveling routine" S3 ; User must click OK
      ;M291 P"This routine will take about 10-20 minutes and heat both the bed and nozzle." R"Prepare printer for leveling routine" S3 ; User must click OK
      ;M291 P"You will need a piece of paper. Filament will be unloaded." R"Prepare printer for leveling routine" S3 ; User must click OK
      ;M291 P"Make sure you have successful Gcodes logged to the console before proceeding." R"WARNING" S3 ; User must click OK or cancel
      ;M291 P"Make a note of your M558 Z value and backup current heightmap before proceeding." R"WARNING" S3 ; User must click OK or cancel
      
      M929 P"bedlevellog.txt" S3 ; start logging 
      
      ; Clear compensation map and Zprobe trigger height
      ;
      M291 P"Grid bed compensation map will be disabled. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
      M561			; Disable any current bed compensation
      G29 S2			; Clear mesh bed compensation perameters
      ;G31 Z0			; Reset zprobe trigger height
      
      ; Heat up bed and nozzle to PLA temps in prep for filament removal and probing
      ;
      M291 P"Bed and nozzle will preheat and home all axis." R"Preheat and Home" S3 T0 ; User must click OK or cancel
      M104 S130		; Set nozzle to 130 and release
      M140 S55		; Set bed to 55 and release
      
      ; home all axis
      ;
      G28 XY
      G28 Z       ; Home all axis
      G90			; Absolute positioning
      T0			; Activate first tool
      
      ; Set lower speeds for Z homing and lower Z motor current
      ;
      M566 Z10			; Set maximum instantaneous speed changes (mm/min) (Jerk)
      M203 Z400			; Set maximum speeds (mm/min)
      M201 Z100	 		; Set maximum accelerations (mm/s^2)
      M913 Z40			; Drop motor current to prevent damage in case of head crash
      
      ; Move nozzle forward for filament removal
      ;
      ;M291 P"Moving nozzle to the front for filament removal and cleaning." T0
      ;G1 X50 Y5 Z100		; Moves print head to front left and drops the bed down for easy access
      ;M109 S130		; Set nozzle to 130 and wait
      
      ; Tone to get user attention
      ;
      M400			; Clear movement buffer so tones play reliably
      M300 S666 P500
      G4 P501
      M300 S1111 P300
      G4 P301
      
      ; Unload filament and clean nozzle
      ;
      ;M291 P"Unload filament if loaded and clean nozzle, then press OK to continue" R"Unload Filament" S3 T0 ; User must click OK or cancel
      
      M702			; Unload Filament
      
      ; Preheat to probing temps
      ;
      M291 P"Preheating the bed to 60 and nozzle to 210 for accurate probing" T0
      M104 S210		; Set nozzle to 210 and release
      M190 S60		; Set bed to 60 and wait
      M109 S210		; Set nozzle to 210 and wait
      
      ; Tone to get user attention
      ;
      ;M400			; Clear movement buffer so tones play reliably
      ;M300 S666 P500
      ;G4 P501
      ;M300 S1111 P300
      ;G4 P301
      
      ; Move nozzle to center of bed at Z10 and drop to Z1
      ;
      M291 P"Nozzle will now move to center of bed and move close to the bed" T0
      M98 P"/macros/general/1_Center_Nozzle" ;P move to bed center
      
      
      ; Reset z to 8 to allow jogging up to touch bed to nozzle
      ;
      G92 Z8
      
      ; Dialog to allow user to job z to touch nozzle to bed gently and then move Z down 10
      ;
      M291 P"Carefully Jog the Z Axis until the bed and nozzle are touching and click OK" R"Setting Z=0" Z1 S3
      G92 Z0      		; set z = 0
      
      ; Move nozzle to leveling points and prompt user to level bed at each
      ;
      M291 P"Nozzle will now move to the 4 leveling points twice." S1 T2
      
      ; Move to leveling point 1
      G1 Z2      		; move to z2 for travel
      G1 X26 Y25 F6000	; Move to front left corner
      
      M400
      M291 P"Adjust point 1 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 1" S2 Z1
      
      ; Move to leveling point 2
      G1 Z2			; Move to Z2 for clearance
      G1 X195 Y195 F6000	; Move to rear right corner
      
      M400
      M291 P"Adjust point 2 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 2" S2 Z1
      
      ; Move to leveling point 3
      G1 Z2			; Move to Z2 for clearance
      G1 X195 Y25 F6000	; Move front right corner
      
      M400
      M291 P"Adjust point 3 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 3" S2 Z1
      
      ; Move to leveling point 4
      G1 Z2			; Move to Z2 for clearance
      G1 X26 Y195 F6000	; Move rear left corner
      
      M400
      M291 P"Adjust point 4 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 4" S2 Z1
      
      ; Repeat to verify
      ;
      M291 P"The adjustment sequence will now repeat for fine adjustment." S1 T2
      
      ; Move to leveling point 1
      G1 Z2      		; move to z2 for travel
      G1 X26 Y25 F6000	; Move to front left corner
      
      M400
      M291 P"Adjust point 1 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 1" S2 Z1
      
      ; Move to leveling point 2
      G1 Z2			; Move to Z2 for clearance
      G1 X195 Y195 F6000	; Move to rear right corner
      
      M400
      M291 P"Adjust point 2 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 2" S2 Z1
      
      ; Move to leveling point 3
      G1 Z2			; Move to Z2 for clearance
      G1 X195 Y25 F6000	; Move front right corner
      
      M400
      M291 P"Adjust point 3 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 3" S2 Z1
      
      ; Move to leveling point 4
      G1 Z2			; Move to Z2 for clearance
      G1 X26 Y195 F6000	; Move rear left corner
      
      M400
      M291 P"Adjust point 4 by using jog to lower nozzle to 0, then use the bed height knobs and a piece of paper to tweak tension." R"Adjustment Point 4" S2 Z1
      
      ; Move nozzle to center of bed at z10
      ;
      M291 P"Nozzle will now move to center of bed to reset Z0" S3
      G1 Z1			; Drop bed for nozzle clearance
      ;G1 X112.5 Y112.5 Z2 F4000	; Move to bed center
      M98 P"/macros/general/1_Center_Nozzle" 
      
      ; Reset z to 5 to allow jogging up to touch bed to nozzle
      ;
      G92 Z5
      
      ; Dialog to allow user to jog z to touch nozzle to bed gently and then move Z down 10
      ;
      M564 S0         ; To allow movement lower than where the firmware thinks Z=0 is.
      M291 P"Jog the Z Axis until the bed and nozzle are touching and click OK" R"Setting Z=0" Z1 S3
      G92 Z0			; Set z = 0
      G1 Z1			; Drop bed for nozzle clearance
      
      M291 P"The bed has been mechanically leveled and Z0 set." S2
      
      ; Tone to get user attention
      ;
      M400			; Clear movement buffer so tones play reliably
      M300 S666 P600
      G4 P601
      M300 S1511 P300
      G4 P301
      
      M291 P"Probing complete. Turning off heaters and homing axis."
      ; Turn off heaters
      ; 
      M104 S0		; Set nozzle to 0 and release
      M140 S0		; Set bed to 0 and release
      G28 XY		; Home XY
      
      ; Set normal settings after stall detection probing
      ;
      M98 P"/macros/general/1_Center_Nozzle" ;P define the parameter and is not part of the name
      
      ; Tone to get user attention
      M400			; Clear movement buffer so tones play reliably
      M300 S666 P600
      G4 P601
      M300 S1511 P300
      G4 P301
      
      M291 P"Run Trigger Height Macro to determine trigger height"
      M929 S0 ; stop logging
      
      
      fcwiltundefined mitchundefined 2 Replies Last reply Reply Quote 0
      • PaulHewundefined
        PaulHew
        last edited by

        Maybe if you are not in the ballpark for the macro to work, it might need some manual intervention.
        Have you tried using M564 S0 which disables the axis limits, which should allow you to get nearer the bed?

        HTH
        Paul

        RailCore II - Duet Mini + 1LC, Voron V0.1 - Duet Mini
        Voron 2.4 disassembled..... Waiting for the RailCore Mini....

        mitchundefined 1 Reply Last reply Reply Quote 0
        • fcwiltundefined
          fcwilt @mitch
          last edited by

          @mitch

          Given the bed leveling tools built-in to the firmware I don't understand the reason for the bed level macro. It appears to be an attempt to code manual bed leveling which is already in the firmware.

          Also the command in bed.g suggests you have 4 Z steppers. Do you?

          Thanks.

          Frederick

          Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

          1 Reply Last reply Reply Quote 0
          • mitchundefined
            mitch @PaulHew
            last edited by

            @paulhew

            Appreciate the reply. This is going to be helpful to get to the bottom of this.

            The Bed.g file actually defines that you are doing a four point bed calibration. It is the coordinates of your four adjustment screws and not defining that you have steppers at those screws from my understanding.

            Please expand on the bed leveling built into the firmware. If you are referring to this:
            https://duet3d.dozuki.com/Wiki/Using_the_manual_bed_levelling_assistant

            I haven't found that to be useful at all. After it completes it tells me some rough fraction of a turn on a knob which is anything but accurate. I find that it is far more convenient and accurate to actually adjust the knob until you get contact. Please elaborate if I am misunderstanding the built in feature but I have used it and haven't found it to be faster or more accurate. In fact, quite the opposite.

            fcwiltundefined 1 Reply Last reply Reply Quote 0
            • mitchundefined
              mitch @mitch
              last edited by

              @PaulHew

              I ended up commenting out the "G31 Z0" near the top and changed the "G92 Z5" to "G92 G10" and now I have enough to get to the bed and complete the macro.

              I am all for using built in leveling but I haven't found anything that seems to be as quick and accurate as something like this macro. I tried this process:
              https://duet3d.dozuki.com/Wiki/Using_the_manual_bed_levelling_assistant

              Numerous times and it ends up being a giant game of go fish. Just no way to adjust a knob based on a fraction of rotation and get any kind of accuracy out of it. Just constantly missing the mark and the number of iterations takes far longer than just running a macro like this to tune it in. I am all for learning though. Perhaps with some clarification I might see how the M671 is supposed to be faster or more accurate?

              1 Reply Last reply Reply Quote 0
              • fcwiltundefined
                fcwilt @mitch
                last edited by fcwilt

                @mitch said in Can't touch the bed (bed leveling macro):

                The Bed.g file actually defines that you are doing a four point bed calibration. It is the coordinates of your four adjustment screws and not defining that you have steppers at those screws from my understanding.

                The firmware supports Manual Bed Leveling using the Bed Leveling Assistant or Auto Bed Leveling when you have multiple Z steppers. The file bed.g is needed in either case but what the firmware does with that file is based on having or not having multiple Z steppers.

                Here is a quick-and-dirty video of my printer auto leveling the bed using multiple steppers. I forced the bed way out of level just for the video.

                Auto Bed Leveling Video

                Please expand on the bed leveling built into the firmware.

                The problem, as I understand it, with doing it as is done in your macro, is that the adjustment done at each point can affect the previous adjustments. The Bed Leveling Assistant computes how much adjustment must be done for each point so that there is no interaction. But, as you observed, it can be tricky adjusting the screws. I have found that with a bit of practice you get the hang of adjusting the screws and it becomes quick and easy.

                If your macro works for you that is all that matters.

                Frederick

                Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

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