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

M500 after PID autotune overwrites G31 in config-override.g

Scheduled Pinned Locked Moved
Tuning and tweaking
5
20
952
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
    flobler
    last edited by flobler 25 Aug 2021, 19:26

    Hello everyone 🙂

    I have encountered a problem (likely I am doing something wrong) where a present G31 command in config-override.g that defines the Z-offset is being overwritten when I run M500 after a PID autotune procedure.

    Board: Duet 3 Mini 5+
    RRF: 3.3
    DWC: 3.3
    PanelDue: 3.3

    I am auto-saving a calibrated Z-offset in config-override.g which works perfect.

    If I then run a PID autotune and save the result via M500 to config-override.g, my Z-offset is being deleted and "Probed tool offsets being added".

    Before the PID tuning:

    ; config-override.g file generated in response to M500 at 2021-08-25 21:02
    ; This is a system-generated file - do not edit
    ; Heater model parameters
    M307 H0 R0.265 C501.956:501.956 D9.70 S1.00 V24.2 B0 I0
    M307 H1 R4.542 C84.643:84.643 D2.59 S1.00 V24.3 B0 I0
    ; Z probe parameters
    G31 K0 P1000 X23.0 Y5.0 Z1.30
    ; Workplace coordinates
    G10 L2 P1 X0.00 Y0.00 Z0.00
    G10 L2 P2 X0.00 Y0.00 Z0.00
    G10 L2 P3 X0.00 Y0.00 Z0.00
    G10 L2 P4 X0.00 Y0.00 Z0.00
    G10 L2 P5 X0.00 Y0.00 Z0.00
    G10 L2 P6 X0.00 Y0.00 Z0.00
    G10 L2 P7 X0.00 Y0.00 Z0.00
    G10 L2 P8 X0.00 Y0.00 Z0.00
    G10 L2 P9 X0.00 Y0.00 Z0.00

    After saving the PID values via M500:

    ; config-override.g file generated in response to M500 at 2021-08-25 21:02
    ; This is a system-generated file - do not edit
    ; Heater model parameters
    M307 H0 R0.265 C501.956:501.956 D9.70 S1.00 V24.2 B0 I0
    M307 H1 R4.542 C84.643:84.643 D2.59 S1.00 V24.3 B0 I0
    ; Probed tool offsets
    G10 P0 X0.00 Y0.00 Z0.00
    ; Workplace coordinates
    G10 L2 P1 X0.00 Y0.00 Z0.00
    G10 L2 P2 X0.00 Y0.00 Z0.00
    G10 L2 P3 X0.00 Y0.00 Z0.00
    G10 L2 P4 X0.00 Y0.00 Z0.00
    G10 L2 P5 X0.00 Y0.00 Z0.00
    G10 L2 P6 X0.00 Y0.00 Z0.00
    G10 L2 P7 X0.00 Y0.00 Z0.00
    G10 L2 P8 X0.00 Y0.00 Z0.00
    G10 L2 P9 X0.00 Y0.00 Z0.00

    Can someone help me understand what I am doing wrong?

    config-override.g is important to us as we will store the printer unique values (like Z-offsets) there to make those independent from any config.g we publish for our users. Once we publish a new configuration users can upload it without their custom values which are unique to their printer being touched.

    For the Z-offset we use a macro that lets the user calibrate the first layer with a print and then save the resulting offset to config-override.g. This avoids that users have to touch configuration files and only need to interact with either DWC or the PanelDue to calibrate their first layer.

    Users will also be able to use babystepping during the first layer of any print and the adjustments made are automatically added/substracted to the current Z-offset and then again saved to config-override.g

    Due to the above use cases I hope there is an easy solution that prevents the overwriting of G31 in config-override.g

    Thanks in advance!

    undefined 1 Reply Last reply 25 Aug 2021, 19:33 Reply Quote 0
    • undefined
      fcwilt @flobler
      last edited by 25 Aug 2021, 19:33

      @flobler

      M500 Documentation

      Note the P31 parameter. Are you including that?

      Frederick

      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

      undefined 1 Reply Last reply 25 Aug 2021, 19:36 Reply Quote 1
      • undefined
        flobler @fcwilt
        last edited by 25 Aug 2021, 19:36

        @fcwilt Thanks for the quick reply!

        So this means I would need to include P31 for G31 to remain in config-override.g? I looked at the docs but definitely did not properly understand the explanation for M500 in this case 🙂

        Let me try this and report back.

        1 Reply Last reply Reply Quote 0
        • undefined
          Phaedrux Moderator
          last edited by 25 Aug 2021, 19:38

          Are you manually editing config-override.g to add the G31 offset or are you saving it with M500 P31?

          Z-Bot CoreXY Build | Thingiverse Profile

          undefined 1 Reply Last reply 25 Aug 2021, 19:39 Reply Quote 0
          • undefined
            flobler @Phaedrux
            last edited by flobler 25 Aug 2021, 19:39

            @phaedrux I am saving it via M500 P10:31

            Here is the macro:

            ; layer_change.g
            ; system file, called on first layer change during a print from Prusaslicer to save applied babysteps to config-override.g
            ; requires modifications to layer change G-Code in Prusaslicer
            if move.axes[2].babystep !=0 ; if no babysteps are currently adjusted - exit routine
            echo {"OLD: " ^ sensors.probes[0].triggerHeight ^ " NEW: " ^ sensors.probes[0].triggerHeight + (move.axes[2].babystep * -1)} ; displays old and new Z probe trigger height
            G31 Z{sensors.probes[0].triggerHeight - move.axes[2].babystep} ; measures and applies new Z probe trigger height
            M500 P10:31 ; saves new Z probe trigger height to config-overide.g

            This is executed during our initial Calibration Wizard and on any print from Prusaslicer after the first layer to save further adjustments made after initial calibration.

            undefined 1 Reply Last reply 25 Aug 2021, 19:42 Reply Quote 0
            • undefined
              Phaedrux Moderator
              last edited by 25 Aug 2021, 19:42

              Will have to check with DC42 on whether this is the expected behaviour of M500.

              Z-Bot CoreXY Build | Thingiverse Profile

              undefined undefined 2 Replies Last reply 25 Aug 2021, 19:44 Reply Quote 0
              • undefined
                fcwilt @flobler
                last edited by fcwilt 25 Aug 2021, 19:42

                @flobler

                The comment about changing the layer change G-Code in PrusaSlicer - what change do you make?

                How are you keeping the "macro" from updating config_override.g on every layer change?

                Frederick

                Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                undefined 1 Reply Last reply 25 Aug 2021, 19:45 Reply Quote 0
                • undefined
                  flobler @Phaedrux
                  last edited by flobler 25 Aug 2021, 19:44

                  @phaedrux I just tried with using M500 P31 to save the PID values and it worked just fine. G31 is no longer being overwritten.

                  As we use a macro for PID tuning is well I can simply store via M500 P31 and the problem should be solved.

                  Of course we cannot prevent users to run PID autotune outside our macro which then could be a potential issue. For now I think it should be OK though.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    flobler @fcwilt
                    last edited by 25 Aug 2021, 19:45

                    @fcwilt thanks for your tip!

                    Here is what I use in the "before layer change gcode" in Prusaslicer:

                    G92 E0.0 ; reset extruder position to 0
                    {if layer_z == layer_height+first_layer_height}M98 P"layer_change.g"{endif} ; execute layer_change.g
                    ;[layer_z]

                    This only executes the macro on layer change from layer 1 to 2.

                    undefined 1 Reply Last reply 25 Aug 2021, 19:51 Reply Quote 0
                    • undefined
                      fcwilt @flobler
                      last edited by fcwilt 25 Aug 2021, 19:51

                      @flobler said in M500 after PID autotune overwrites G31 in config-override.g:

                      @fcwilt thanks for your tip!

                      Here is what I use in the "before layer change gcode" in Prusaslicer:

                      G92 E0.0 ; reset extruder position to 0
                      {if layer_z == layer_height+first_layer_height}M98 P"layer_change.g"{endif} ; execute layer_change.g
                      ;[layer_z]

                      This only executes the macro on layer change from layer 1 to 2.

                      Thanks.

                      If for some reason in the future you would need to run code on other layer changes it would be easy using a RRF global variable to make the "first layer" test in your macro and simply have M98 P"layer_change.g" in the slicer.

                      This would also have the minor benefit of keeping all of your code together in your macro.

                      Frederick

                      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                      undefined 1 Reply Last reply 25 Aug 2021, 19:55 Reply Quote 0
                      • undefined
                        flobler @fcwilt
                        last edited by 25 Aug 2021, 19:55

                        @fcwilt That's a great point, thank you!

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          dc42 administrators @Phaedrux
                          last edited by dc42 26 Aug 2021, 13:17

                          @phaedrux said in M500 after PID autotune overwrites G31 in config-override.g:

                          Will have to check with DC42 on whether this is the expected behaviour of M500.

                          What should be happening is:

                          • Once you save using M500 P31 then assuming you have one or more Z probes defined, a G31 line or lines will be written to config-override.g
                          • If you have M501 in config.g then that G31 command will be read at boot time and the "save G31 settings with M500 automatically" flag will be set. So subsequently, sending M500 without the P31 parameter will include saving G31 settings.
                          • If you delete config-override.g or you manually edit out the G31 lines from config-override.g and then reboot, M500 will no longer write the G31 settings unless you specify the P31 parameter.

                          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 26 Aug 2021, 17:50 Reply Quote 2
                          • undefined
                            CR3D @dc42
                            last edited by 26 Aug 2021, 17:50

                            @dc42

                            see my post here:

                            https://forum.duet3d.com/topic/24830/config-override-parameters-gets-lost-after-saving/4

                            Looks like the same issue

                            Christian from CR-3D
                            Homepage:
                            www.cr-3d.de

                            Facebook:
                            https://www.facebook.com/cr3d.official

                            Our Discord Server
                            https://discord.gg/SxRaPNuRdA

                            Thingiverse Profile:
                            https://www.thingiverse.com/cr-3d_official/about

                            undefined 1 Reply Last reply 26 Aug 2021, 20:03 Reply Quote 0
                            • undefined
                              dc42 administrators @CR3D
                              last edited by 26 Aug 2021, 20:03

                              @cr3d this is now fixed in the 3.4 source code.

                              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 27 Aug 2021, 06:30 Reply Quote 0
                              • undefined
                                CR3D @dc42
                                last edited by 27 Aug 2021, 06:30

                                @dc42 ok perfect 🙂

                                When will it be released... we have to pack an idex machine on the weekend and that should also be included ... 😉

                                Christian from CR-3D
                                Homepage:
                                www.cr-3d.de

                                Facebook:
                                https://www.facebook.com/cr3d.official

                                Our Discord Server
                                https://discord.gg/SxRaPNuRdA

                                Thingiverse Profile:
                                https://www.thingiverse.com/cr-3d_official/about

                                undefined 1 Reply Last reply 27 Aug 2021, 07:33 Reply Quote 0
                                • undefined
                                  dc42 administrators @CR3D
                                  last edited by dc42 27 Aug 2021, 07:33

                                  @cr3d I can provide an internal build for you to test with. Would that help? Which Duet do you have?

                                  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 27 Aug 2021, 11:32 Reply Quote 0
                                  • undefined
                                    CR3D @dc42
                                    last edited by 27 Aug 2021, 11:32

                                    @dc42 Ok ... better than nothing 🙂

                                    At this printer there is a Duet 2 Wifi EA + Duex 5

                                    Christian from CR-3D
                                    Homepage:
                                    www.cr-3d.de

                                    Facebook:
                                    https://www.facebook.com/cr3d.official

                                    Our Discord Server
                                    https://discord.gg/SxRaPNuRdA

                                    Thingiverse Profile:
                                    https://www.thingiverse.com/cr-3d_official/about

                                    undefined 1 Reply Last reply 27 Aug 2021, 12:17 Reply Quote 0
                                    • undefined
                                      dc42 administrators @CR3D
                                      last edited by 27 Aug 2021, 12:17

                                      @cr3d the current internal build is at https://www.dropbox.com/sh/qkexrvhgsebbz0g/AAD9gfyS8UIU5Sau311WS1oLa?dl=0.

                                      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 27 Aug 2021, 17:31 Reply Quote 0
                                      • undefined
                                        CR3D @dc42
                                        last edited by 27 Aug 2021, 17:31

                                        @dc42

                                        Quick answer -> now it works!

                                        We can use M500 / M500 P10 / M500 P31 / M500 P10:31 and nothing gets deleted 🙂

                                        Thank you!

                                        Christian from CR-3D
                                        Homepage:
                                        www.cr-3d.de

                                        Facebook:
                                        https://www.facebook.com/cr3d.official

                                        Our Discord Server
                                        https://discord.gg/SxRaPNuRdA

                                        Thingiverse Profile:
                                        https://www.thingiverse.com/cr-3d_official/about

                                        1 Reply Last reply Reply Quote 1
                                        • undefined
                                          flobler
                                          last edited by 28 Aug 2021, 18:29

                                          Great, thanks everyone for the help! Looking forward to the fix!

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