Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    M48 Measure Z Probe repeatability and print to serial output.

    Firmware wishlist
    12
    28
    3903
    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.
    • brunofporto
      brunofporto last edited by

      That is useful for a lot of settings.... It is good to know your probe 😄

      Now what I do is use a macro to repeat a G30 S-1 several times and calculate the standard deviation and mean value by hand .

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

        Use a macro to execute repeated G30 Pn Xxx Yyy Z-9999 commands with values of n from 0 up to your chosen maximum. This is much more flexible, for example you can choose to move the head away and back between probing. You don't need to calculate the SD by hand because if you include S-1 on the last G30 command, the firmware will do it for you.

        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

        brunofporto ignacmc 3 Replies Last reply Reply Quote 0
        • brunofporto
          brunofporto @dc42 last edited by

          @dc42 I'll try it today. Thanks. 🙂

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

            @dc42 said in M48 Measure Z Probe repeatability and print to serial output.:

            Z-9999

            Worked like a charm... so.... No need for the M48.

            Maybe have a special area at the gcodes wiki page mentioning about commands alternatives - like the M109 or M48 in this case.

            Thank you very much.

            The macro:

            M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
            G28
            M401
            G30 P0 X151 Y161 Z-9999
            G30 P1 X151 Y161 Z-9999
            G30 P2 X151 Y161 Z-9999
            G30 P3 X151 Y161 Z-9999
            G30 P4 X151 Y161 Z-9999
            G30 P5 X151 Y161 Z-9999
            G30 P6 X151 Y161 Z-9999
            G30 P7 X151 Y161 Z-9999
            G30 P8 X151 Y161 Z-9999
            G30 P9 X151 Y161 Z-9999 S-1
            M402

            1 Reply Last reply Reply Quote 3
            • dc42
              dc42 administrators last edited by

              Using firmware 2.03RC3, you could put those lines of GCode in file M48.g in the /sys folder. Then you would have a working M48 command. Note, M48 already had a meaning in NIST standard GCode before Marlin hijacked it, so we won't be implementing M48 in RepRapFirmware.

              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 2
              • zapta
                zapta last edited by

                Thanks @dc42. Just tried it and it works. Using BLTouch. Deviation from mean is 0.001.

                Will it be useful to also report the span? (max - min)

                1 Reply Last reply Reply Quote 0
                • T3P3Tony
                  T3P3Tony administrators last edited by

                  Also note this: https://duet3d.dozuki.com/Wiki/G-Codes_not_implemented
                  To answer the general question about where we document gcodes that have not been implemented for whatever reason

                  www.duet3d.com

                  A Former User 1 Reply Last reply Reply Quote 1
                  • A Former User
                    A Former User @T3P3Tony last edited by

                    maybe add to that wiki the new feature where unkown g-codes will execute a macro if found, and which version that change is valid from?

                    1 Reply Last reply Reply Quote 2
                    • dc42
                      dc42 administrators last edited by

                      I've added a note to https://duet3d.dozuki.com/Wiki/G-Codes_not_implemented.

                      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
                      • veng1
                        veng1 last edited by

                        The M48 without an X and Y location appears to simply move right to the end of travel.

                        Could it be changed so that without X an Y, it probes at the current location?

                        The intended use is:

                        Probe_Corners.g
                        ; Test repeatability at mesh bed compensation locations
                        G1 X5 Y5
                        M48
                        G1 X300 Y5
                        M48
                        G1 X300 Y200
                        M48
                        G1 X5 Y200
                        M48

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

                          M48 in RepRapFirmware does nothing, unless you have a file called M48.g in the /sys folder (in which case, it executes that macro).

                          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

                          joehsmash 1 Reply Last reply Reply Quote 0
                          • veng1
                            veng1 last edited by

                            @dc42 I understand that. The macro early in this thread that takes 10 measurements at the point X151 Y161 works fine in the /sys folder. However, if it is edited to remove the X and Y co-ordinates like:

                            M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
                            G28
                            G30 P0 Z-9999
                            G30 P1 Z-9999
                            G30 P2 Z-9999
                            G30 P3 Z-9999
                            G30 P4 Z-9999
                            G30 P5 Z-9999
                            G30 P6 Z-9999
                            G30 P7 Z-9999
                            G30 P8 Z-9999
                            G30 P9 Z-9999 S-1

                            it does not stay at the current position but moves in X. I believe it should just take 10 points at the current location without moving.

                            1 Reply Last reply Reply Quote 1
                            • joehsmash
                              joehsmash @dc42 last edited by

                              @dc42 sorry to bring up such an old thread, but im having trouble trying to get this IR sensor to work.

                              ive got the macro saved, but where to do i view the SD from the probed points?

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

                                @joehsmash said in M48 Measure Z Probe repeatability and print to serial output.:

                                @dc42 sorry to bring up such an old thread, but im having trouble trying to get this IR sensor to work.

                                ive got the macro saved, but where to do i view the SD from the probed points?

                                The final G30 command (with the S-1 parameter) should display the mean and standard deviation.

                                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
                                • BoA
                                  BoA last edited by BoA

                                  Oh boy, this is some old thread. But... I actually tried G30 without X and Y parameters (G30 P0 Z-9999 - to be specific).
                                  What it does it moves head according to pobe offset and basically probes in Z. However... it does not move the head back to original position. As soon as You give the X and Y this is not a problem, but probing current location few times basically requires explicitly moving head to the original position using relative move with X and Y set to Z probe offset after each G30. Is that intended behavior of G30?

                                  1 Reply Last reply Reply Quote 0
                                  • Phaedrux
                                    Phaedrux Moderator last edited by

                                    @BoA said in M48 Measure Z Probe repeatability and print to serial output.:

                                    Is that intended behavior of G30?

                                    That's normally how it's used in homeall. You position the probe manually with a G1 XY command to place the probe where you want, and then send G30 by itself to probe the bed, then you manually position the head where you want it with another G1 XYZ move.

                                    Z-Bot CoreXY Build | Thingiverse Profile

                                    BoA 1 Reply Last reply Reply Quote 0
                                    • BoA
                                      BoA @Phaedrux last edited by

                                      @Phaedrux Yes. G30 without ANY parameter works fine, but as soon You use it like that: G30 P0 Z-9999 it move the head according to z probe offset.

                                      Phaedrux 1 Reply Last reply Reply Quote 0
                                      • Phaedrux
                                        Phaedrux Moderator @BoA last edited by

                                        @BoA https://duet3d.dozuki.com/Wiki/Gcode#Section_G30_Single_Z_Probe

                                        Using the P parameter implies providing an X Y coordinate.

                                        Z-Bot CoreXY Build | Thingiverse Profile

                                        BoA 1 Reply Last reply Reply Quote 0
                                        • BoA
                                          BoA @Phaedrux last edited by

                                          @Phaedrux So shoudn't it return an error if X and Y are not given?

                                          Phaedrux 1 Reply Last reply Reply Quote 0
                                          • Phaedrux
                                            Phaedrux Moderator @BoA last edited by

                                            @BoA I'll check.

                                            Z-Bot CoreXY Build | Thingiverse Profile

                                            BoA 1 Reply Last reply Reply Quote 0
                                            • BoA
                                              BoA @Phaedrux last edited by

                                              @Phaedrux Also... executing this G30 Px sequence causes printhead going outside of XY limits (which is understandable, as it allows to probe outside of bed area).

                                              Phaedrux 1 Reply Last reply Reply Quote 0
                                              • Phaedrux
                                                Phaedrux Moderator @BoA last edited by

                                                @BoA Yes that is mentioned too.

                                                Caution: the XY coordinates are permitted to be outside the normal printable bed area! This is intentional, because some printers (e.g. delta printers) benefit from probing areas not used for printing.

                                                Z-Bot CoreXY Build | Thingiverse Profile

                                                BoA 1 Reply Last reply Reply Quote 0
                                                • BoA
                                                  BoA @Phaedrux last edited by

                                                  @Phaedrux That is true, and it is acceptable and even desired, but ONLY if you specify X and Y. And probing "current location" by G30 P0 Z-9999 should not lead to "brrr-brrr-brrr" noise from steppers 🙂

                                                  But perhaps this is just my opinion.

                                                  1 Reply Last reply Reply Quote 0
                                                  • Leav
                                                    Leav last edited by Leav

                                                    This is similar enough that I don't think it warrants its own thread.

                                                    Is there a way to use multiple probes per point and use the average of those measurement as the Z height for that point.

                                                    The script above gives me pretty good deviation (±0.005mm, and it's consistant enough that I imagine this is a actually the stepper resolution), but I still feel like double or triple probing would be a better practice.

                                                    Is there a way to do this today? do you think it's worth implementing?

                                                    BoA fcwilt 2 Replies Last reply Reply Quote 0
                                                    • BoA
                                                      BoA @Leav last edited by BoA

                                                      @Leav When You define z probe with M558 there are params:

                                                      Snnn Tolerance when probing multiple times, default 0.03mm

                                                      and

                                                      Annn Maximum number of times to probe each point, default 1.

                                                      This probes until results are within defined tolerance.

                                                      Not sure if this does averaging measurements tho

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