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

    Prusa Style Filament AutoLoad macro

    Scheduled Pinned Locked Moved
    Gcode meta commands
    1
    1
    164
    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.
    • Nate.Nygrenundefined
      Nate.Nygren
      last edited by Nate.Nygren

      Thought I'd share my Prusa style autoload macro (firmware => 3.5.0) for others to use or improve. Please feel free to add your suggestions! This assumes you have a filament sensor.

      EDIT: I've updated the load.g code to make it a little more smart.

      daemon.g

      ; Monitor the Filament Sensor to see if it's loaded
      if {sensors.filamentMonitors[0].status = "noFilament"}
          M98 P"0:/macros/load.g"
      

      load.g

      ; Filament AutoLoad Macro for RepRapFirmware
      ; While waiting for the user to load filament, check the filament sensor
      while {sensors.filamentMonitors[0].status = "noFilament"}
          M117 "Please load filament."
      ; Read filament sensor and if filment is present, continue the load process
      if {sensors.filamentMonitors[0].status = "ok"}
          ; Ask user what type of filament is loaded
          M291 S4 T0 P"Select Filament Type" R"Filament Type" K{"PLA","PETG","ABS","TPU","Nylon"}
          ; Set the temperature based on the filament type
          if {input == 0}
              G10 S200 ; Set temperature for PLA
          elif {input == 1}
              G10 S235 ; Set temperature for PETG
          elif {input == 2}
              G10 S240 ; Set temperature for ABS
          elif {input == 3}
              G10 S220 ; Set temperature for TPU
          elif {input == 4}
              G10 S250 ; Set temperature for Nylon
          M116 ; Wait for the temperatures to be reached
          M83 ; Extruder to relative mode
      
          ; Move E till filament is grabbed by gears
          G1 E15 F120 ; Extrude 15mm of filament at a speed of 120mm/min
          
          ; Ask user if filament was grabbed by gears. If not, grab a little more filament
          var loaded = false
          while {var.loaded = false}
              M291 S4 T0 P"Filament Loaded?" R"Filament Loaded?" K{"Continue","Try Again"}
              if {input == 1} ; Try again
                  set var.loaded = false
                  G1 E15 F120 ; Extrude 15mm of filament at a speed of 120mm/min
                  continue
              elif {input == 0} ; Continue
                  set var.loaded = true
                  break
          if {var.loaded == true}
              ; Change the extruded amount depending on the size of your hotend setup.
              G1 E80 F240 ; Extrude 80mm of filament at a speed of 240mm/min.
              ; Ask user if filament is extruding properly
              var extruded = false
              while {var.extruded = false}
                  M291 S4 T0 P"Filament Extruding?" R"Did filament come out?" K{"No","Yes"}
                  if {input == 0} ; No
                      set var.extruded = false
                      G1 E15 F240 ; Extrude 15mm more of filament at a speed of 240mm/min
                      continue
                  elif {input == 1} ; Yes
                      set var.extruded = true
                      break
              ; Set the extruder position to 0
              G92 E0
              M104 S0 ; set tool temp to 0
      
      1 Reply Last reply Reply Quote 4
      • Phaedruxundefined Phaedrux moved this topic from General Discussion
      • First post
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA