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

    any way to pass parameters to start.g?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    5
    17
    896
    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.
    • oliofundefined
      oliof
      last edited by

      Usually start.g is implicitly called at the beginning of a print. Would there be a way to call it explicitly to pass in parameters such as bed and hotend temperature?

      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

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

        @oliof
        I'm curious what the advantages and use case are?
        I suppose you could put a conditional statement at the start of start.g to exit unless a certain parameter was passed.
        That would short circuit the default behaviour.
        But you could as easily have an empty start.g and explicitly call any macro you like. 🤷

        oliofundefined 1 Reply Last reply Reply Quote 0
        • moth4017undefined
          moth4017
          last edited by

          Would be nice on the heated chamber set chamber to 80C and not start printing untill upto temperature

          <

          1 Reply Last reply Reply Quote 1
          • oliofundefined
            oliof @OwenD
            last edited by

            @owend just some way to pass temperatures from a slicer into start.g without needing another script. I guess I could go about setting global variables or look into RRF based filament management.

            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

            oozeBotundefined fcwiltundefined 2 Replies Last reply Reply Quote 0
            • oozeBotundefined
              oozeBot @oliof
              last edited by

              @oliof We are doing this through the selected filament. Our slicer profile doesn't include any temps in the output gCode. Instead, each filament config contains something like the following:

              set global.bedTemp= 110      ; Defines build plate temperature
              set global.chamberTemp= 70   ; Defines chamber temperature
              set global.filamentTemp= 250 ; Defines extrusion temperature
              

              And then start.g handles it through M703.

              ;==========================================================================================
              ;== Configure Filament ====================================================================
              M703 ; Load selected filament settings
              
              ;==========================================================================================
              ;== Enables Heat / Stabilizes =============================================================
              M140 S{global.bedTemp} R0        ; Enable build plate heater
              G10 P0 S{global.filamentTemp} R0 ; Enable hot end heater
              M116                             ; Wait for temps to stabilize
              M141 S{global.chamberTemp}       ; Enable chamber heater
              
              oliofundefined 1 Reply Last reply Reply Quote 2
              • fcwiltundefined
                fcwilt @oliof
                last edited by

                @oliof said in any way to pass parameters to start.g?:

                I guess I could go about setting global variables or look into RRF based filament management.

                That's how I do it.

                Though I don't use start.g since that happens before any slicer code and it is possible, depending on the specific slicer and settings, that the slicer code could conflict with the start.g code.

                I use the capability to specify in the slicer code to execute at certain times, such as the start and end of the print.

                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

                1 Reply Last reply Reply Quote 0
                • oliofundefined
                  oliof @oozeBot
                  last edited by

                  @oozebot how do you select the filament though?

                  <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                  oozeBotundefined fcwiltundefined OwenDundefined 3 Replies Last reply Reply Quote 0
                  • oozeBotundefined
                    oozeBot @oliof
                    last edited by

                    @oliof I believe one has to be initially selected in DWC? Maybe not if you don't have any defined.. Regardless, after creating a filament profile(s), there is the option to select the active filament in DWC here:

                    aff8d5fb-0898-44f2-aff8-36252ce812bd-image.png

                    You can see that we also adding nozzle size to the filament profiles as we can move a .4mm nozzle faster than .6mm and pressure advance needed to be tweaked between them.

                    Once I finally wrapped my head around using Filaments and start.g, it's changed a lot of how we now operate. We use the Slicer to output nothing but the movement/extrusion codes (and also firmware retraction codes). Everything else is stored in the various filament profiles. What this allows is the same model to be printed with various filaments.. that sounds ambitious, but it works well if you spend the time to baseline your standard printing speeds. If a certain filament can only print at 80% of your baseline speed, that can also be compensated with M220 S80.

                    1 Reply Last reply Reply Quote 2
                    • fcwiltundefined
                      fcwilt @oliof
                      last edited by

                      @oliof said in any way to pass parameters to start.g?:

                      how do you select the filament though?

                      Via the DWC.

                      As part of my "print start" code I also have what I call "sanity checks", which is code that verifies that a filament has been selected, that the global variables have been populated with reasonable values, etc.

                      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

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

                        @oliof said in any way to pass parameters to start.g?:

                        how do you select the filament though?

                        DWC stores the last filament(s) in filaments.csv
                        I use that in conjunction with a global variable in config.g
                        In my filaments config.g I have cold extrude temps, retraction etc that's specific to the filament.
                        I don't set print temp here but you could.
                        All my filament load and unload files point to a central load/unload and I also have a "pre-heat-current-filament.g" file.

                        In my slicer start code I set the global variable for filament.
                        If that doesn't match what's on the machine then it automatically does a filament change.

                        As mentioned, the problem as I see it with doing everything in start.g is that anything a user does in the slicer will over-ride it.
                        Not such a deal for a single user, but if I were selling machines I would expect problems.

                        I'm hoping when we get arrays that I can simplify the filaments to maybe a single file.
                        It would be great if we could read a csv file into an array or perform a sort of VLookup search.

                        fcwiltundefined 1 Reply Last reply Reply Quote 0
                        • fcwiltundefined
                          fcwilt @OwenD
                          last edited by

                          @owend said in any way to pass parameters to start.g?:

                          DWC stores the last filament(s) in filaments.csv
                          I use that in conjunction with a global variable in config.g

                          There is a unique config.g file for each created filament entry and executing M703 runs the file for the current filament.

                          That has proven to be sufficient for my needs.

                          What are you doing different that needs the filaments.csv file?

                          Thanks much.

                          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

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

                            @fcwilt
                            I just populate my global variable at startup in config.g based on what RRF/DWC loads from filaments.csv
                            I also call M703 in config.g if a filament was loaded.

                            If I slice using a different filament the changed global prompts the necessary new settings and load/unload

                            The individual config.g in the filaments directory I use for unique settings which are of course applied when M703 is called.

                            fcwiltundefined 1 Reply Last reply Reply Quote 0
                            • fcwiltundefined
                              fcwilt @OwenD
                              last edited by

                              @owend said in any way to pass parameters to start.g?:

                              @fcwilt
                              I just populate my global variable at startup in config.g based on what RRF/DWC loads from filaments.csv
                              I also call M703 in config.g if a filament was loaded.

                              If I slice using a different filament the changed global prompts the necessary new settings and load/unload

                              The individual config.g in the filaments directory I use for unique settings which are of course applied when M703 is called.

                              Thanks for the feedback but I cannot visualize what you are doing.

                              You mentioned that you do not set print temps using the filament specific config.g file. If you don't do it there where do you do it?

                              Thanks.

                              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

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

                                @fcwilt
                                In my config.g I have

                                ;load config for filament
                                if move.extruders[state.currentTool].filament=""
                                	echo "No filament loaded.  Cold extrude & retract set to defaults"
                                	M302 S190 R110 ; Allow extrusion starting from 190°C and retractions already from 110°C (defaults)
                                	set global.LoadedFilament="No_Filament"
                                else
                                	set global.LoadedFilament=move.extruders[state.currentTool].filament ; set the variable to the currently loaded filament
                                	echo "Loading config for " ^ global.LoadedFilament ^ " filament"
                                	M703 ; if a filament is loaded, set all the heats and speeds for it by loading config.g
                                

                                I set my print temp in the slicer start code.
                                Most slicers will put a temp in the start code if you don't , so if you rely on start.g it'll possibly be over written.

                                set global.minProbeX = {first_layer_print_min[0]}
                                set global.maxProbeX = {first_layer_print_max[0]}
                                set global.minProbeY = {first_layer_print_min[1]}
                                set global.maxProbeY = {first_layer_print_max[1]}
                                T[current_extruder] ; 
                                set global.LoadedFilament="[filament_type]" ; set the global filament name variable
                                M98 P"0:/macros/filament/check-filament-type.g"
                                M703 ; load config file for [filament_type]
                                M568 P[current_extruder] R{"{heat.coldExtrudeTemperature+5}"} S[first_layer_temperature_0] ; (set standby and active temperatures for active tool.  Standby is 5 degrees above cold extrude temp 
                                

                                Check filament type just ensures that what I've sliced with matches what is loaded.

                                I'm not near my computer but I have it all in a GitHub repository
                                There's probably less complicated and/or better ways.
                                I'm sure E=MC2 started out three pages long 😂

                                fcwiltundefined 2 Replies Last reply Reply Quote 2
                                • fcwiltundefined
                                  fcwilt @OwenD
                                  last edited by fcwilt

                                  @owend

                                  Thanks very much.

                                  I'm going to study that and see what I can learn.

                                  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

                                  1 Reply Last reply Reply Quote 0
                                  • fcwiltundefined
                                    fcwilt @OwenD
                                    last edited by

                                    @owend said in any way to pass parameters to start.g?:

                                    Most slicers will put a temp in the start code if you don't , so if you rely on start.g it'll possibly be over written.

                                    JOOC what slicer do you use?

                                    When faced with the possibility of slicer generated code conflicting with my code I did a number of tests for the slicers I have (Simplify3D, Prusa, Cura, ideaMaker) and found ways to insure there were no conflicts - so I am able to set the temp specified by each filament config.g file in my print start code which is invoked by the slicer using M98 commands.

                                    For example from ideaMaker 4.2.3 - notice there is no slicer generated temperature setting code - so it can be done in print_begin.g or print_filament_start.g which is my code:

                                    M221 T0 S90.00
                                    M98 P"print_begin.g"
                                    M98 P"print_filament_start.g"
                                    M83
                                    M106 S0
                                    M82
                                    M98 P"print_layer_change.g"
                                    M83
                                    

                                    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

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

                                      @fcwilt
                                      I used to use Cura
                                      I seem to remember it trying to add temperatures if you didn't have one on its start code.
                                      I now mainly use superslicer.
                                      I can't recall if it does or not, but as I set a temperature in the slicer it doesn't bother me.
                                      I tend to tweak sliced temps based on the size of the model.
                                      I understand your approach gives you slicer independence if you overcome the slicer interfering.

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