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

    Script to make babysteps permanent

    Scheduled Pinned Locked Moved
    Firmware wishlist
    9
    20
    1.1k
    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.
    • jens55undefined
      jens55
      last edited by T3P3Tony

      Hi, and thanks for reading.
      There are a couple of threads going about a script to make babysteps, as tweaked at the beginning of a print, permanent.

      See here:

      https://forum.duet3d.com/topic/18052/need-to-lower-the-nozzle

      and here:

      https://forum.duet3d.com/topic/16328/baby-stepping-can-it-or-can-it-not-be-permanent

      This is the macro I am currently running:

      ; 0:/macros/Save-Z
      ; This macro adds the current babystep offset to the Z trigger height and saves it to config-overide.g
      ; ! M501 needs to be in config.g to automatically be recalled on reset. If using multiple filament settings,
      ; and this is for a specific filament type, recommend placing this yielded information in the filament's config.g.
      
      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)}
         G31 Z{sensors.probes[0].triggerHeight - move.axes[2].babystep}
         echo {"Place either M501 -or- G31 Z" ^ sensors.probes[0].triggerHeight^ " in your config.g"}
         M500 P10:31                                              ; save settings to config-overide.g - G31 P31 saves trigger height, 
                                                                  ; trigger value, and X and Y offsets for each possible Z probe type 
                                                                  ; P10 parameter saves the G10 tool offsets.
         M290 R0 S0 												; clear babystepping 
      
      else
         echo "Baby stepping is not currently employed, exiting."
      
      
      

      The sequence of actions is that I start with a freshly homed Duet with babysteps set to zero. I start a print job and I realize that my nozzle is too high. I babystep down until I get a good first layer (this being done while the print job is running). I have now determined the correct nozzle height and I want to make that permanent so I run the macro (print job is still running).
      From what I can ascertain, the variable sensors,probes{0}.triggerHeight as used in the macro's G31 command seems to be set incorrectly when run while there is a print job going.
      After the G31 line is run, the sensor.probes[0].triggerHeight is a value that doesn't make sense. I have seen it at (roughly) 69, 120, 450 mm and other values.
      There have been occasions when the trigger height was correct but lately I get crazy values after even a single run of save z.
      I have not seen crazy values if there is no print job running.

      It would appear that the variable /memory location is somehow re-used or over-written and then restored (one possible scenario) during an active print job.

      Would you please have a look-see at the situation and the code and see if you can find an issue somewhere in the bowels of the firmware (or in the way the macro is coded or run) ?

      There have been a couple of new versions of this floated but I have stuck to an older version as it shows the issue nicely.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • jens55undefined
        jens55
        last edited by

        Additional info: When I refer to 'the print job running' I refer to stuff actually moving about. If I 'pause' the current job, the save operation succeeds in all the tries that I have done. As soon as I try to save z while the printhead is moving, things go pear shaped.

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

          @jens55 just changed the topic to something more useful

          www.duet3d.com

          jens55undefined 1 Reply Last reply Reply Quote 0
          • jens55undefined
            jens55 @T3P3Tony
            last edited by

            <sigh>
            Now we have three threads for the same issue.

            1 Reply Last reply Reply Quote 1
            • fcwiltundefined
              fcwilt
              last edited by

              I admire your persistence.

              😉

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

              A Former User? 1 Reply Last reply Reply Quote 0
              • A Former User?
                A Former User @fcwilt
                last edited by

                @fcwilt said in Script to make babysteps permanent:

                I admire your persistence.

                😉

                Is that what you call it......

                Sometimes you just have to say f*** it and go have a beer

                1 Reply Last reply Reply Quote 1
                • jens55undefined
                  jens55
                  last edited by

                  Did that, ran out of suds, problem didn't go away ... 😞
                  Oh yeah ... figured I would save somebody a lot of grief down the road when the issue reared it's ugly head again in another situation.

                  1 Reply Last reply Reply Quote 0
                  • jens55undefined
                    jens55
                    last edited by jens55

                    @DC42 Bump .....

                    Could a mod please make sure that DC42 is aware of this issue?
                    I realize that he is probably busier than a one armed paper hanger and I will gladly step back and forget about this issue for now once I know that it reached him.

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

                      @jens55 Probably best to actually tag him with @dc42 if you want him to look!

                      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

                      A Former User? 1 Reply Last reply Reply Quote 0
                      • A Former User?
                        A Former User @droftarts
                        last edited by

                        @droftarts said in Script to make babysteps permanent:

                        @jens55 Probably best to actually tag him with @dc42 if you want him to look!

                        Ian

                        That doesnt seem to work I asked a question in another thread last week (regarding firmware)

                        I tagged him and got no reply, so either its not working or he didn't want to answer the question.....

                        droftartsundefined 1 Reply Last reply Reply Quote 0
                        • jens55undefined
                          jens55
                          last edited by

                          Thanks .... how do you tag somebody and what does that do? Does he get a message when it's tagged ?

                          1 Reply Last reply Reply Quote 0
                          • droftartsundefined
                            droftarts administrators @A Former User
                            last edited by

                            @CaLviNx He gets a lot of requests. Last week he was on holiday, so try 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

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

                              @jens55 Type an '@' sign in your post, and you'll get a list of people that have replied to the post. If the person who's attention you want is not on the list, just continue and type their name. Like replying to a particular post (the blue 'Reply' or 'Quote' words on each post), the person tagged will get a notification via the bell icon.

                              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

                                @jens55, are you running firmware 3.1.1, or an earlier version?

                                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

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

                                  @dc42 , thanks for replying!
                                  3.1.1

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

                                    I confirm that's a bug, which I will fix in 3.2beta1. Meanwhile, you may be able to work around it by putting M400 just before the G31 command.

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

                                      Thanks! No need to work around it ... I just wanted to make sure you were aware.

                                      1 Reply Last reply Reply Quote 0
                                      • floblerundefined
                                        flobler
                                        last edited by

                                        @jens55 thanks for your work on getting this macro right.

                                        I just tried using what you shared here. For my use case I see an issue with the macro:

                                        1. I have configured my "rough" trigger height, then start a print
                                        2. During the first layer I realize I want to adjust the trigger height slightly
                                        3. I apply the desired change through baby stepping
                                        4. I execute the macro to write the change to config-override.g

                                        As far as I understand this will then reset the baby stepping on my current print and will bring me back to the initial trigger height I had at 1.)

                                        This means the updated trigger height will be only applied after I restart the printer and would not persist for the print I have ongoing at that moment, is that correct?

                                        My ideal scenario for this macro would be:

                                        1. Start the print with per-configured "rough" trigger height
                                        2. Fine tune through babystepping during the print
                                        3. Execute the macro to save the new trigger height to config-override.g
                                        4. Continue printing at the adjusted trigger height (taking the baby stepping I applied into account)

                                        Now I know this could probably be solved through simply removing the M290 R0 S0 command but I would like to have the option to to another round of adjustments through baby stepping if needed and save it again with the macro. Problem here would be that if the reset is removed, I would then adjust my trigger height by the value I have adjusted originally + the value I have adjusted with in my second round of baby stepping adjustments which results in a too small or too big trigger height value. (e.g. first save was baby steeping +0.02, second adjustment is +0.04 which will then save a total of +0.06 to the value I have saved after my first round of adjustments).

                                        Does that make sense? Do you have an idea how I could solve this?

                                        If not, I only see the following options to achieve what I want to do:

                                        a) Use the macro as shared above and always run a specific calibration print to fine tune the trigger height, save it, restart the printer and then kick off the print I actually want to print

                                        b) Remove the reset of baby stepping and only save it to config-override.g when I am 100% happy with my adjustment, so I would not have to do it a second time throughout the print

                                        1 Reply Last reply Reply Quote 0
                                        • droftartsundefined droftarts referenced this topic
                                        • Tinchusundefined
                                          Tinchus
                                          last edited by

                                          Usefull script. Question: how would you do it if you have a second tool? A second tool offset is always relative to the other Tool (T0 offfset is set using G31, T1 offset is set using G10).
                                          Lets say you have T0 offset OK, and now you are printing a test with T1 and using babystep you get to the sweet spoot, the babystep value you get is recognized as belonging to T1 when you execute the M500 P10:31 command?

                                          1 Reply Last reply Reply Quote 0
                                          • Herniczundefined
                                            Hernicz
                                            last edited by

                                            I already have this working. It saves babystep value on pause, cancel, print end and loads it at print start.

                                            G32 and G29 resets it to 0.

                                            It's also possible to continously monitor it with daemon.g in case of event of power loss.

                                            There are known knowns and known unknowns, things we know that we don't know. But there are also unknown unknowns.

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