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

    M703 inside load.g not supported

    Scheduled Pinned Locked Moved
    General Discussion
    rrf 3.5.0-b2 duet 3 mini 5+ standalone
    7
    12
    469
    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.
    • Phaedruxundefined
      Phaedrux Moderator
      last edited by

      Can you share the full contents of load.g?

      Z-Bot CoreXY Build | Thingiverse Profile

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

        Ofc:

        ; filaments/"filament"/load.g
        ; called when M701 S"filament" is sent
        
        ; ====================---------------------------------------------------------
        ; Settings section
        ; ====================
        
        ; Filament settings
        
        var FilamentType = "ABS"                                                       ; Input the filament type (only for the message)
        
        ; Message placeholders
        var Message1 = "N/A"
        
        ; ====================---------------------------------------------------------
        ; Message section
        ; ====================
        
        ; Generate message
        set var.Message1 = "" ^ var.FilamentType ^ " filament loaded"
        
        ; Filament loaded message
        M118 P0 S{var.Message1}                                                        ; Send message to DWC
        M118 P2 S{var.Message1}                                                        ; Send message to PanelDue
        
        M703                                                                           ; Load filament config.g for the selected filament
        echo "load.g end"
        

        This is what shows up in DWC console:

        8.3.2023, 16:52:10	ABS filament loaded
        

        And this is what config.g (filament) contains:

        ; filaments/ABS/config.g  (v2.1)
        ; called when M703 is sent and ABS is loaded
        
        ; ====================---------------------------------------------------------
        ; Settings section
        ; ====================
        
        ; Filament settings
        
        var FilamentType        = "ABS"       ; Input the filament type (only for the message)
        
        var Default             = false        ; Use default settings (retraction and PA), true/yes or false/no
        
        var PA                  = 0.045        ; Pressure advance amount (s)
        var RLen                = 0.400        ; Retraction length (mm)
        var X_URLen             = 0.010        ; Extra unretract length (mm)
        var RSpd                = 4200         ; Retraction speed (mm/min)
        var URSpd               = 4200         ; Unretract speed (mm/min)
        var Z_Lift              = 0.200        ; Zlift amount (mm)
        
        ; Message placeholders
        var Message1 = "N/A"
        var Message2 = "N/A"
        
        ; ====================---------------------------------------------------------
        ; Config section
        ; ====================
        
        if !var.Default
          ; Pressure Advance
          M572 D0 S{var.PA}                                                            ; Set extruder 0 pressure advance to 0.1 seconds
        
          ;Retraction & Zlift
          M207 S{var.RLen} R{var.X_URLen} F{var.RSpd} T{var.URSpd} Z{var.Z_Lift}       ; Set firmware retraction length, extra un-retract lenght, retract speed, unretract speed & zlift
        
        ; ====================---------------------------------------------------------
        ; Define & send messages
        ; ====================
        
        if var.Default
          set var.Message1 = "" ^ var.FilamentType ^ " config applied (default settings)"
        else
          set var.Message1 = "" ^ var.FilamentType ^ " config applied"
          
        if move.extruders[0].pressureAdvance = 0
          set var.Message2 = "Pressure Advance disabled"
        else
          set var.Message2 = "Pressure Advance set to " ^ move.extruders[0].pressureAdvance ^ " seconds"
        
        ; Config applied message
        M118 P0 S{var.Message1}                                                        ; Send message to DWC
        M118 P2 S{var.Message1}                                                        ; Send message to PanelDue
        
        ; Pressure advance info message
        M118 P0 S{var.Message2}                                                        ; Send message to DWC
        M118 P2 S{var.Message2}                                                        ; Send message to PanelDue
        

        None of the settings or messages within config.g gets applied/ran.

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

          @Exerqtor which Duet are you using, and are you running in standalone mode or SBC mode? Did it work in RRF 3.4.5 ?

          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

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

            @dc42 Added tags to the first post.

            I haven't tried it earlier myself, BUT i know of at least one person thats been/are doing it in different 3.4 versions on Duet 3's in standalone.

            OwenDundefined 1 Reply Last reply Reply Quote 0
            • OwenDundefined
              OwenD @Exerqtor
              last edited by

              @Exerqtor
              I think this may have been the case for a while.
              I assume (but aren't sure) it's because the filament isn't "loaded" until load.g actually exits. The docs say if you call M703 with no filament loaded it completes without warning.
              In my own files I seem to have gotten around it by using M98 to call the filament config.g
              I set up my filaments a long time ago using a single universal load and unload so can't remember the exact details regarding M703.

              Exerqtorundefined 1 Reply Last reply Reply Quote 0
              • Exerqtorundefined
                Exerqtor @OwenD
                last edited by

                @OwenD said in M703 inside load.g broken in 3.5.0b2:

                @Exerqtor
                I think this may have been the case for a while.
                I assume (but aren't sure) it's because the filament isn't "loaded" until load.g actually exits. The docs say if you call M703 with no filament loaded it completes without warning.
                In my own files I seem to have gotten around it by using M98 to call the filament config.g
                I set up my filaments a long time ago using a single universal load and unload so can't remember the exact details regarding M703.

                Yeah that might be the deal, but i suspect that ain't the intended behavior 😅
                I ended up swaping out M703 with M98 in my load.g too. Since I allready have the "filament type" defined by a variable so it's not a huge hazzle. Buuuut it would be easier/less code to just deploy a M703 lol.

                pfnundefined 1 Reply Last reply Reply Quote 0
                • pfnundefined
                  pfn @Exerqtor
                  last edited by

                  @Exerqtor

                  I already responded in discord, but I looked at my filament setting macro and it calls M703 discretely from M701. load.g probably never called config.g for me, but that didn't matter, because M702 must be called before M701 anyway, so I combined all that into the macro.

                  chrishammundefined 1 Reply Last reply Reply Quote 0
                  • chrishammundefined
                    chrishamm administrators @pfn
                    last edited by chrishamm

                    @pfn I don't think this has ever worked because the filament isn't set before the load.g macro completes AFAIR. Call your filament config.g manually if you need to configure it as part of the load macro. Note that at least DWC calls M703 after M701 anyway.

                    Duet software engineer

                    Exerqtorundefined 1 Reply Last reply Reply Quote 0
                    • Exerqtorundefined
                      Exerqtor @chrishamm
                      last edited by

                      Yeah with @pfn retracting his statement regarding it working pre 3.5 i have no grounds to say it's ever worked either (since he was my reference lol).

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

                        @Exerqtor I hope you don't mind but i have changed the title of this topic and moved it to general discussion because its not an issue specifically with 3.5b2.

                        www.duet3d.com

                        Exerqtorundefined 1 Reply Last reply Reply Quote 0
                        • T3P3Tonyundefined T3P3Tony moved this topic from Beta Firmware
                        • Exerqtorundefined
                          Exerqtor @T3P3Tony
                          last edited by Exerqtor

                          @T3P3Tony Yeah ofc, sorry I should have done that myself once we discovered it wasn't an isolated thing 🤦‍♂️

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