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

    common start and end gcode for all the slicer configurations

    Scheduled Pinned Locked Moved
    General Discussion
    3
    7
    334
    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.
    • A Former User?
      A Former User
      last edited by

      Good afternoon, I use Ideamaker as slicer and I have a configuration for every filament I use. Is there a way to make the start and end gcode to "call" a .g file to make ALL the different configuration have the same behaviour in the end and almost the same in the beginning? (I say almost boecause in the start gcode I have "common" parts as well as filament-related parts like the pressure advance).

      Is there a way to do so?

      Thanks!

      dc42undefined fcwiltundefined 2 Replies Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @A Former User
        last edited by

        @the_dragonlord yes, use the M98 command. In fact, RRF already calls start.g when you start printing from SD card, and end.g when a SD card print finishes with M0.

        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

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

          @the_dragonlord

          For quite some time I have been using M98 P"print_begin.g" and M98 P"print_end.g" as the only user code in the slicer.

          I also use the filament handling feature of DWC to deal with filament related settings such as bed temp and extruder temp.

          I've used this approach with Simplify3D, Cura and PrusaSlicer with no problems.

          I can provide more details if you wish.

          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

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

            @fcwilt said in common start and end gcode for all the slicer configurations:

            @the_dragonlord

            For quite some time I have been using M98 P"print_begin.g" and M98 P"print_end.g" as the only user code in the slicer.

            I also use the filament handling feature of DWC to deal with filament related settings such as bed temp and extruder temp.

            I've used this approach with Simplify3D, Cura and PrusaSlicer with no problems.

            I can provide more details if you wish.

            Frederick

            it would be great, thanks!

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

              @dc42 said in common start and end gcode for all the slicer configurations:

              @the_dragonlord yes, use the M98 command. In fact, RRF already calls start.g when you start printing from SD card, and end.g when a SD card print finishes with M0.

              excellent, thanks!

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

                @the_dragonlord

                Let's start with the filament handling feature of the DWC since it is an essential part of the way I do things to achieve a degree of slicer independence.

                When you create a filament in the DWC the system creates three files for each filament:

                • load.g
                • unload.g
                • config.g

                The file config.g is the one that is important here. Note that this is not the main config.g file but a file with the same name unique to each filament.

                The command M703 is used to invoke this config.g for the currently selected filament.

                M703 documenttion

                Here is an example of one of my filament config.g files:

                M291 R"PLA - Generic - White" P"Configuring..." T0
                
                M221 S100 D0         ; set extrusion multiplier
                G10 S190 R0          ; set extruder temps
                M140 S60 R0          ; set bed temps
                
                M291 R"PLA - Generic - White" P"Configuring - Done" T1
                

                Here is my print_begin.g file. This file is invoked from the slicer using M98 P"print_begin.g", which is placed in the slicer location for user code to be executed at the start of a print.

                ; select tool and configure based on filament selected
                
                T0   ; select tool 0 so extruder commands below will work
                M703 ; configure selected filament (sets bed/extruder temps, extrusion multiplier)
                
                ; *** the following "sanity checks" test for required conditions to make my approach work ***
                
                ; check for selected filament
                
                if move.extruders[0].filament = ""
                  M291 R"No Filament Selected" P"Cannot Continue" S2 T0
                  abort
                
                ; check bed heater active temp setting
                
                if heat.heaters[0].active = 0 
                  M291 R"Bed Heater Active Temp = 0" P"Cannot Continue" S2 T0
                  abort
                
                ; check extruder heater active temp setting
                
                if heat.heaters[1].active = 0 
                  M291 R"Extruder Heater Active Temp = 0" P"Cannot Continue" S2 T0
                  abort
                
                ; check if homed - allows homing (OK button) or canceling (CLOSE button)
                
                if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
                  M291 R"Printer has not been homed" P"Home and Continue?" S3 T0
                  G28
                
                ; setup to print
                
                M291 R"Preparing to print" P"Please wait..." T0
                
                G90               ; absolute moves
                G1 Z100 F1200     ; position for cleaning
                G1 X0 Y-145 F6000 ; position for cleaning
                
                M291 R"Heating Extruder & Bed" P"Please wait..." T0
                
                M116 ; wait for temps to reach set points
                
                M291 R"Priming Extruder" P"Please wait..." T0
                
                M83         ; insure extruder relative mode
                G92 E0      ; reset the extruder logical position
                G1 E10 F120 ; prime the extruder
                M400        ; wait for extruding to finish
                G92 E0      ; reset the extruder logical position
                
                M291 R"Clean Nozzle and Bed" P"Click OK to begin printing" S3 T0
                
                G1 E-0.1 F120 ; retract to control oozing
                M400          ; wait for extruding to finish
                G92 E0        ; reset the extruder logical position
                
                M98 P"mesh_load.g" ; load height map
                

                The code above is configured for the way I do things on my single tool printers. There are others ways you could do things, like priming the extruder.

                The important parts are using T0 to select the tool, using M703 to invoke the selected filament config.g file and the "sanity checks" to verify the required conditions exist.

                Check it over and let me know if you would like to see more of what I do.

                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

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

                  @fcwilt said in common start and end gcode for all the slicer configurations:

                  @the_dragonlord

                  Let's start with the filament handling feature of the DWC since it is an essential part of the way I do things to achieve a degree of slicer independence.

                  When you create a filament in the DWC the system creates three files for each filament:

                  • load.g
                  • unload.g
                  • config.g

                  The file config.g is the one that is important here. Note that this is not the main config.g file but a file with the same name unique to each filament.

                  The command M703 is used to invoke this config.g for the currently selected filament.

                  M703 documenttion

                  Here is an example of one of my filament config.g files:

                  M291 R"PLA - Generic - White" P"Configuring..." T0
                  
                  M221 S100 D0         ; set extrusion multiplier
                  G10 S190 R0          ; set extruder temps
                  M140 S60 R0          ; set bed temps
                  
                  M291 R"PLA - Generic - White" P"Configuring - Done" T1
                  

                  Here is my print_begin.g file. This file is invoked from the slicer using M98 P"print_begin.g", which is placed in the slicer location for user code to be executed at the start of a print.

                  ; select tool and configure based on filament selected
                  
                  T0   ; select tool 0 so extruder commands below will work
                  M703 ; configure selected filament (sets bed/extruder temps, extrusion multiplier)
                  
                  ; *** the following "sanity checks" test for required conditions to make the my approach work ***
                  
                  ; check for selected filament
                  
                  if move.extruders[0].filament = ""
                    M291 R"No Filament Selected" P"Cannot Continue" S2 T0
                    abort
                  
                  ; check bed heater active temp setting
                  
                  if heat.heaters[0].active = 0 
                    M291 R"Bed Heater Active Temp = 0" P"Cannot Continue" S2 T0
                    abort
                  
                  ; check extruder heater active temp setting
                  
                  if heat.heaters[1].active = 0 
                    M291 R"Extruder Heater Active Temp = 0" P"Cannot Continue" S2 T0
                    abort
                  
                  ; check if homed - allows homing (OK button) or canceling (CLOSE button)
                  
                  if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
                    M291 R"Printer has not been homed" P"Home and Continue?" S3 T0
                    G28
                  
                  ; setup to print
                  
                  M291 R"Preparing to print" P"Please wait..." T0
                  
                  G90               ; absolute moves
                  G1 Z100 F1200     ; position for cleaning
                  G1 X0 Y-145 F6000 ; position for cleaning
                  
                  M291 R"Heating Extruder & Bed" P"Please wait..." T0
                  
                  M116 ; wait for temps to reach set points
                  
                  M291 R"Priming Extruder" P"Please wait..." T0
                  
                  M83         ; insure extruder relative mode
                  G92 E0      ; reset the extruder logical position
                  G1 E10 F120 ; prime the extruder
                  M400        ; wait for extruding to finish
                  G92 E0      ; reset the extruder logical position
                  
                  M291 R"Clean Nozzle and Bed" P"Click OK to begin printing" S3 T0
                  
                  G1 E-0.1 F120 ; retract to control oozing
                  M400          ; wait for extruding to finish
                  G92 E0        ; reset the extruder logical position
                  
                  M98 P"mesh_load.g" ; load height map
                  

                  The code above is configured for the way I do things on my single tool printers. There are others ways you could do things, like priming the extruder.

                  The important parts are using T0 to select the tool, using M703 to invoke the selected filament config.g file and the "sanity checks" to verify the required conditions exist.

                  Check it over and let me know if you would like to see more of what I do.

                  Frederick

                  I'ts very interesting! If you have time give me more details, thanks!

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