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

Setting up configuration files for BLtouch/bed leveling

Scheduled Pinned Locked Moved
General Discussion
bltouch
4
8
3.4k
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
    DDuetbot
    last edited by 24 Apr 2018, 08:04

    Just bought a Duet Wifi (first time using Reprap firmware coming from marlin) . Setting it up for the first time .It will be on my new D-Bot corexy build. Just updated it to firmware 1.21 Have a couple questions on the BLtouch smart probing(Using heater 3 for the BLtouch).

    What is the difference between Automatic bed leveling and mesh leveling ?

    What i want it to is the first time run all the probing points and save the mesh map so then after when i go to print it will just home/probe the center of the bed and print with compensation using the saved bed map.

    I made a macro for the mesh leveling
    G91
    G1 Z6 F200
    G90
    M98 Pdeployprobe.g
    G29 S2
    M557 X30:220 Y35:285 S40 ; Define mesh grid
    G29
    M98 Pretractprobe.g

    For the config.g and bed.g im not sure what to do ,if i should have G29 or G30 ? Right now it looks like this

    Config.g
    ; Z-Probe
    M307 H3 A-1 C-1 D-1 ;Disables Heater 3 to free up pwm channel by ACD-1 ,positive turns on
    M574 Z1 S2 ; Set endstops controlled by probe
    M558 P5 X0 Y0 Z1 H4 F450 T4000 ; Set Z probe type to unmodulated and the dive height + speeds
    G31 P1 X-25 Y-31 Z1.5 ; Set Z probe trigger value, offset and trigger height
    M557 X30:220 Y35:285 S40 ; Define mesh grid

    Bed.g
    ; bed.g
    ; called to perform automatic bed compensation via G32
    ;
    ; generated by RepRapFirmware Configuration Tool on Mon Apr 23 2018 02:58:33 GMT-0400 (Eastern Daylight Time)
    M561 ; clear any bed transform
    G28 ; home all axes
    M98 Pdeployprobe.g ; deploy mechanical Z probe
    ; Probe the bed at 5 points
    G30 P0 X30 Y35 H0 Z-99999
    G30 P1 X30 Y285 H0 Z-99999
    G30 P2 X220 Y285 H0 Z-99999
    G30 P3 X220 Y35 H0 Z-99999
    G30 P4 X125 Y160 H0 Z-99999 S
    M98 Pretractprobe.g ; retract mechanical Z probe

    Am i doing this right to get what i want? Should i only have one point there instead of 5 and will it use the previously created mesh?

    Also last question.On a D-bot corexy is the z offset positive or negative. Like is it 0 at the bed and as the bed moves down its positive?

    1 Reply Last reply Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by Phaedrux 24 Apr 2018, 17:18

      You're in luck, as I recently finished implementing mesh bed compensation with a BLTouch on my Dbot.

      I'll share my config set with you and try and answer your questions.

      Auto bed leveling and mesh bed compensation are different.

      ABL is when you have multiple lead screw motors and the Duet adjusts them to make your bed level. This is usually done manually with adjustment screws and a piece of paper. ABL uses the probe and the motors to tram the bed for you.

      MBC is when the Duet probes a grid of points on the bed and creates a height map which is then compensated for during the first few layers of a print adjusting the Z position on the fly as the head moves over the bed in X and Y. This can compensate for the actual surface of the bed, which could be concave or convex, or tilted or any combination of.

      Depending on how you have your Z axis setup on your Dbot you might be able to use both. If you have 2 or 3 or 4 motors on the Z, you could use ABL to level the bed. Personally, I only have 1 Z motor driving 3 lead screws with a belt, so I only use MBC.

      If your probe is working correctly, you're nearly there.

      The relevant documentation is here:
      https://duet3d.dozuki.com/Wiki/Using_mesh_bed_compensation#main

      I've created 3 macros to help automate the leveling process for myself.

      The first heats the bed, moves the nozzle to the center of the bed, lets me jog the nozzle down until its touching the bed, then moves around to the 3 leveling screws letting me adjust them until the nozzle is just touching the bed. This should leave the bed leveled.

      The next calibrates the probe trigger height for me. It heats the bed. Moves the nozzle to the center. lets me jog the nozzle until it touches the bed, then probes the Z height 10 times with G30 S-1 which will echo the trigger height to the DWC console. I take the average of those values and use that in my G31 Z value. For me that's a positive value. This is also a good time to measure the X and Y offset if you don't have it already.

      The last macro runs the G29 grid probing routine. You only need to run this once, and it gets applied before a print. It saves the heightmap and you load it automatically in the config.g. It can also be cleared, disabled, or reploaded at any time.

      G30 is a single probe, and you would use that in your Homez.g file to set the height before a print.

      With firmware 1.21 the BLTouch has it's own probe type now for the M558 command. P9. This will let the system automatically call the deploy and retract commands when needed. You still need to add the servo commands to the deploy and retract files, but you don't need to explicitly call those macros anymore. You can also use M401 and M402 to deploy and retract as needed.

      Anyway, here are is my config bundle.

      Config.g
      ; ############################
      ; 3 - ENDSTOPS AND ZPROBE
      ; ############################
      M574 Y2 S0 ; Set active-low switch (Makerbot 3-wire) at the high end endstop for Y Max.
      M574 X1 S1 ; Set active-high switch (NC Switch) at the low end for X Min.
      M574 Z2 S1 ; Set active-high switch (Opto) at the high end for Z Max.
      M574 Z1 S2 ; Use zprobe and home to Z Min.
      M307 H3 A-1 C-1 D-1 ; Unbind heater 3 pins for probe use.
      M558 P9 X0 Y0 Z1 H3 F100 T6000 A10 R0.5 S0.005 ; P9 for BLTouch, dive height 3mm, probe at 100mm/s, travel 6000mm/s, up to 10 probes, pause 0.5s
      G31 X-41.8 Y32.2 Z2.213 P25 ; probe offset from nozzle, p is trigger value, set low for bltouch, set Z=0 for testing
      ; (z height is 2.213 after calibration April 23rd)
      M557 X10:280 Y0:240 S20 ; Define mesh grid
      M376 H3 ; Taper off compensation over 3mm of height
      M375 ; Load heightmap.csv

      Z-Bot CoreXY Build | Thingiverse Profile

      undefined 1 Reply Last reply 24 Apr 2018, 23:26 Reply Quote 0
      • undefined
        npm1
        last edited by 24 Apr 2018, 19:22

        Run both,

        the g29 at start of ur printing this will determine the trigger height for 20 to 30 different points depending on how ur setting it up. store all g code commands in a macro with load heightmap.csv at the end of it.

        in the bed.g use the g30 command to load 5 differant point, and use g32 command in the start gcode of ure print

        another command used in the console will determine whether mesh is being used or not.

        make sure the conistency of the probe in use is good

        PS good luck

        Ender 5 pro(LGXextruderddewith e3d revo rapid changer) with fly rrf e3 and a standard prusa mk3, both siting air-tight in a ikea kitchen cabinet.

        undefined 1 Reply Last reply 25 Apr 2018, 05:23 Reply Quote 0
        • undefined
          DDuetbot @Phaedrux
          last edited by 24 Apr 2018, 23:26

          @phaedrux Awesome .Thats exactly what i wanted to know. Thanks . Im using 2 motors/leadscrews btw .Also the direct mount titan/bltouch carriage for the D-bot

          1 Reply Last reply Reply Quote 0
          • undefined
            dc42 administrators @npm1
            last edited by 25 Apr 2018, 05:23

            @npm1 said in Setting up configuration files for BLtouch/bed leveling:

            Run both,

            the g29 at start of ur printing this will determine the trigger height for 20 to 30 different points depending on how ur setting it up. store all g code commands in a macro with load heightmap.csv at the end of it.

            in the bed.g use the g30 command to load 5 differant point, and use g32 command in the start gcode of ure print

            another command used in the console will determine whether mesh is being used or not.

            make sure the conistency of the probe in use is good

            PS good luck

            If you do that, the mesh will be ignored. The 5-point bed compensation is the old way, mesh bed compensation is the new way. You can't use both at the same time.

            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 25 Apr 2018, 19:24 Reply Quote 2
            • undefined
              DDuetbot @dc42
              last edited by 25 Apr 2018, 19:24

              @dc42 good to know , thanks

              1 Reply Last reply Reply Quote 0
              • undefined
                npm1
                last edited by 26 Apr 2018, 13:26

                My start gcode is:
                g28
                g32
                G29 S1;

                Would that work.

                As when i type the:
                M122 command it comes up with:
                ABL......Mesh
                Bed Compensation: 0.5 0.45 0.36 0.56 0.20

                the command is typed once BC is completed and the bed is done @dc42

                Is it still the case where one can only be used at any point

                Ender 5 pro(LGXextruderddewith e3d revo rapid changer) with fly rrf e3 and a standard prusa mk3, both siting air-tight in a ikea kitchen cabinet.

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by dc42 26 Apr 2018, 16:27

                  Yes, that will work. The G32 command is needed only if you are using multiple independently-driven leadscrews for the Z axis and have used M671 to set up the coordinates; then G32 will probe the bed and adjust them to level it. If instead you have a single Z motor and a belt driving multiple leadscrews, then you don't need the G32.

                  If you have a very accurate and level build, you don't need G29 either.

                  The bed compensation figures in the M122 report have no meaning when mesh bed compensation is in use.

                  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
                  8 out of 8
                  • First post
                    8/8
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA