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

    Does bed.g serve a purpose on a cartesian printer?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    4
    14
    455
    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.
    • drmaestroundefined
      drmaestro
      last edited by

      Hi,

      I'd like to know if bed.g serves a purpose on a cartesian printer. Here's the content of my bed.g:

      ; bed.g
      ; called to perform automatic bed compensation via G32
      ;
      ; generated by RepRapFirmware Configuration Tool on Sat Apr 15 2017 17:35:56 GMT+0300 (GTB Daylight Time)
      
      ; Clear any bed transform
      M561
      
      ; Probe the bed at 5 points
      G30 P0 X15 Y15 H0 Z-99999
      G30 P1 X15 Y175 H0 Z-99999
      G30 P2 X187 Y175 H0 Z-99999
      G30 P3 X187 Y15 H0 Z-99999
      G30 P4 X101 Y95 H0 Z-99999 S
      
      
      

      I use mesh leveling with the following macro:

      G29 S2
      M561;
      G28 XY;
      M280 P3 S10 I1;
      G28 Z;
      M280 P3 S90 I1;
      G1 Z5 F80;
      
      M280 P3 S10 I1;
      G29;
      M280 P3 S90 I1;
      

      And my starting script on Simplify3D is as follows:

      G28 XY; Home X and Y axis
      M280 P3 S10 I1; BLTouch Pin down
      G1 X100 Y100; Go to 100
      G28 Z;
      G29 S1 ; Bed leveling with already recorded height map
      M280 P3 S90 I1; BLTouch pin up
      
      

      So my question are:

      1. Do I need to modify anything on bed.g? Do I even need bed.g for some purpose?
      2. Can you find any errors on my mesh leveling macro? Do I really need a M561 there?
      3. Anything to change on my starting script?

      I am on Duet 2.051 by the way. I am asking these questions because there might be some details that changed between versions and I don't want to make an error there.

      Thanks,

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • arhiundefined
        arhi
        last edited by

        you can use mesh leveling using G29 or you can do it using G32 ... if there is bed.g G32 will call it if not it will do leveling on it's own ...

        I'm in the process of making my bed.g do the mesh leveling but "complex"

        bed.g that I use now that works

        M400
        M913 X30 Y30 Z30
        M566 Z0
        M201 Z20.00
        
        G29 S2 ; delete compensations
        M561   ; clear any bed transform
        G28    ; home
        
        M400
        G4 S1
        M400
        G31 P{sensors.probes[0].value[0] + 8}
        G29 S0 
        G1 X0 Y0 Z5 F9000
        
        ; RESTORE current, jerk, speed, acceleration
        M98 P"cfg_jerkspeedaccel.g"
        

        and the bed.g that's in progress

        
        M400
        M913 X30 Y30 Z30
        M566 Z0
        M201 Z20.00
        
        G29 S2 ; delete compensations
        M561   ; clear any bed transform
        
        ; G31 P{sensors.probes[0].value[0] + 8}
        ; G29 S0 
        
        echo "Starting calibration. Initial deviation: (" ^ move.calibration.initial.deviation ^ "mm)"
        
        ; X points: -110, -55, 0, 55, 110
        ; Y points: -100, -50, 0, 50, 100
        
        while true
          if iterations = 5
            abort "Too many auto calibration attempts"
          G28
        
          G1 X-110 Y-100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P0 X-110 Y-100 Z-9999
          if result != 0
            echo "ERROR P0"
            continue
          echo "DONE P0"
          
          G1 X-55 Y-100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P1 X-55 Y-100 Z-9999
          if result != 0
            echo "ERROR P1"
            continue
          echo "DONE P1"
          
          G1 X0 Y-100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P2 X0 Y-100 Z-9999
          if result != 0
            echo "ERROR P2"
            continue
          echo "DONE P2"
        
          G1 X55 Y-100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P3 X55 Y-100 Z-9999
          if result != 0
            echo "ERROR P3"
            continue
          echo "DONE P3"
        
          G1 X110 Y-100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 10}
          G30 P4 X110 Y-100 Z-9999
          if result != 0
            echo "ERROR P4"
            continue
          echo "DONE P4"
        
          G1 X110 Y-50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P5 X110 Y-50 Z-9999
          if result != 0
            echo "ERROR P5"
            continue
          echo "DONE P5"
        
          G1 X55 Y-50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P6 X55 Y-50 Z-9999
          if result != 0
            echo "ERROR P6"
            continue
          echo "DONE P6"
        
          G1 X0 Y-50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P7 X0 Y-50 Z-9999
          if result != 0
            echo "ERROR P7"
            continue
          echo "DONE P7"
        
          G1 X-55 Y-50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P8 X-55 Y-50 Z-9999
          if result != 0
            echo "ERROR P8"
            continue
          echo "DONE P8"
        
          G1 X-110 Y-50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P9 X-110 Y-50 Z-9999
          if result != 0
            echo "ERROR P9"
            continue
          echo "DONE P9"
        
          G1 X-110 Y0 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P10 X-110 Y0 Z-9999
          if result != 0
            echo "ERROR P10"
            continue
          echo "DONE P10"
        
          G1 X-55 Y0 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P11 X-55 Y0 Z-9999
          if result != 0
            echo "ERROR P11"
            continue
          echo "DONE P11"
        
          G1 X0 Y-0 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P12 X0 Y0 Z-9999
          if result != 0
            echo "ERROR P12"
            continue
          echo "DONE P12"
        
          G1 X55 Y0 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P13 X55 Y0 Z-9999
          if result != 0
            echo "ERROR P13"
            continue
          echo "DONE P13"
        
          G1 X110 Y0 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P14 X110 Y0 Z-9999
          if result != 0
            echo "ERROR P14"
            continue
          echo "DONE P14"
          
          G1 X110 Y50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P15 X110 Y50 Z-9999
          if result != 0
            echo "ERROR P15"
            continue
          echo "DONE P15"
        
          G1 X55 Y50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P16 X55 Y50 Z-9999
          if result != 0
            echo "ERROR P16"
            continue
          echo "DONE P16"
        
          G1 X0 Y50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P17 X0 Y50 Z-9999
          if result != 0
            echo "ERROR P17"
            continue
          echo "DONE P17"
        
          G1 X-55 Y50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P18 X-55 Y50 Z-9999
          if result != 0
            echo "ERROR P18"
            continue
          echo "DONE P18"
        
          G1 X-110 Y50 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P19 X-110 Y50 Z-9999
          if result != 0
            echo "ERROR P19"
            continue
          echo "DONE P19"
        
          G1 X-110 Y100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P20 X-110 Y100 Z-9999
          if result != 0
            echo "ERROR P20"
            continue
          echo "DONE P20"
        
          G1 X-55 Y100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P21 X-55 Y100 Z-9999
          if result != 0
            echo "ERROR P21"
            continue
          echo "DONE P21"
        
          G1 X0 Y100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P22 X0 Y100 Z-9999
          if result != 0
            echo "ERROR P22"
            continue
          echo "DONE P22"
        
          G1 X55 Y100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P23 X55 Y100 Z-9999
          if result != 0
            echo "ERROR P23"
            continue
          echo "DONE P23"
        
          G1 X110 Y100 Z5 F9000
          M400
          G4S1
          M400
          G31 P{sensors.probes[0].value[0] + 8}
          G30 P24 X110 Y100 Z-9999 S-1
          if result != 0
            echo "ERROR P24"
            continue
          echo "DONE P24"
        
          if move.calibration.final.deviation <= 0.03
            break
          echo "Repeating calibration because deviation is too high (" ^ move.calibration.final.deviation ^ "mm)"
        
        echo "Auto calibration successful, deviation", move.calibration.final.deviation ^ "mm"
        G1 X0 Y0 Z5 F9000
        
        M913 X100 Y100 Z100
        M566 Z100.00
        M201 Z50.00
        

        The problem I have with this one is that "last G30" need to have S value and that thing does not work for me ok, getting some weird errors back 😞

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

          @drmaestro G32 calls the bed.g macro. If you don't have any way to level the bed physically (eg independent Z screws), bed.g can be the same as your mesh levelling macro.

          @arhi said in Does bed.g serve a purpose on a cartesian printer?:

          The problem I have with this one is that "last G30" need to have S value and that thing does not work for me ok, getting some weird errors back

          If you want the compensation, and not just reported (with S-1), just set it to "S". You don't have to define the number:

          On the last G30 command in the sequence, the S parameter indicates that a complete set of points has been probed and instructs the firmware what sort of calibration to perform.
          If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed.

          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

          dc42undefined arhiundefined 2 Replies Last reply Reply Quote 0
          • drmaestroundefined
            drmaestro
            last edited by

            Might be slightly related but I'll ask it here too: What's the advantage of having 2 independent Z motors for bed leveling? I see some posts about it but I haven't seen a comparison where you use 2 independent motors vs 2 linked (single driver) motors.

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

              @drmaestro I don't know about you, but my nearly-4-year-old loves twiddling the Z axis motors individually when the printer is off! Running a macro levels the X axis to the bed again.

              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

              drmaestroundefined 1 Reply Last reply Reply Quote 1
              • drmaestroundefined
                drmaestro @droftarts
                last edited by

                @droftarts Ah, ok. So, you need to do a macro to correct the relation of the Z axis to the X axis if they are not level, then another macro for mesh leveling. Wouldn't mesh leveling alone compensate for this error?

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

                  @drmaestro Much quicker to do a axis level and load an existing bed mesh!

                  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

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

                    @droftarts said in Does bed.g serve a purpose on a cartesian printer?:

                    @drmaestro G32 calls the bed.g macro. If you don't have any way to level the bed physically (eg independent Z screws), bed.g can be the same as your mesh levelling macro.

                    To clarify, this doesn't have to be independent Z motors, it can just be bed levelling screws. See https://duet3d.dozuki.com/Wiki/Using_the_manual_bed_levelling_assistant.

                    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
                    • arhiundefined
                      arhi @droftarts
                      last edited by arhi

                      @droftarts said in Does bed.g serve a purpose on a cartesian printer?:

                      If you want the compensation, and not just reported (with S-1), just set it to "S". You don't have to define the number:

                      I tried it (here). I noticed (late) that @dc42 used S8 on his last point so re-read the manual and found that I missed that part. Then I tried different S values (-1, 0, 8, 25...) but none gave useful results so after exosting all the ideas I had I gave up. I am willing to give it another go if I get more data to how to go about it but with current knowledge there's not much I can do. The only thing left is to do the first 5 points in the requested order and then just add other ones in "no clue what" order and give it a go since now in RC7 the bug with return not being populated from G30 should be fixed.

                      S/S0 does this:

                      Error: Probe points P0 to P3 must be in clockwise order starting near minimum X and Y, and P4 must be near the centre
                      ERROR P24
                      
                      

                      Issue #1 P0 to P4 ?!?! What about the other 20 points?
                      Issue #2 order?! I ordered P0-P24 in the same way G29 does it. I could do 4 corners and center but what then? What would be the order of the other 20 points?
                      S-1 reports some worrying results too. Anyhow, this is the sample of what in theory could be done; obviously, I don't know how to do it.

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

                        @arhi said in Does bed.g serve a purpose on a cartesian printer?:

                        Error: Probe points P0 to P3 must be in clockwise order starting near minimum X and Y, and P4 must be near the centre

                        That's an old error message, but I think still valid. If you're calculating the bed plane, you can only have a maximum of 5 points (which, in itself is odd, as a plane is defined by three points!). This was from the time before mesh levelling, when calculating the bed plane was the only firmware-implemented levelling available. It's probably why you can only report the deviation for the rest of the points,

                        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

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

                          The old 3, 4 and 5-point bed compensation had been deprecated for several years. Use mesh bed compensation 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

                          arhiundefined 1 Reply Last reply Reply Quote 0
                          • arhiundefined
                            arhi @dc42
                            last edited by

                            @dc42 said in Does bed.g serve a purpose on a cartesian printer?:

                            The old 3, 4 and 5-point bed compensation had been deprecated for several years. Use mesh bed compensation instead.

                            how to do it point by point?
                            G0,G30P0,G0,G30P1...G0,G30P24S
                            is what's supposed to reading the doc .. but it does not

                            you are doing the same thing here only on delta and you finish with S8 after using 16 points .. how do I finish after 25 points on cartesian?

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

                              The point of mesh bed compensation is that you don't have to specify all the points, saving you a lot of work. Instead you specify the limits to be probed, and either the spacing between points or the number of points.

                              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

                              arhiundefined 1 Reply Last reply Reply Quote 0
                              • arhiundefined
                                arhi @dc42
                                last edited by

                                @dc42 said in Does bed.g serve a purpose on a cartesian printer?:

                                Instead you specify the limits to be probed, and either the spacing between points or the number of points.

                                Yes, that's how G29 works. You yourself made an example of how to do it point by point for delta. Why would the same thing not work for cartesian?

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