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

    Time estimates from PrusaSlicer

    Scheduled Pinned Locked Moved Solved
    Tuning and tweaking
    5
    22
    2.7k
    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.
    • Exerqtorundefined
      Exerqtor @Exerqtor
      last edited by

      globals.g:

      ; /sys/lib/globals.g
      ; Called by init.g
      ; Used to initialize global variables
      
      ; Global declarations and defaults values
      
      ; ====================---------------------------------------------------------
      ; Temperature
      ; ====================
      
      if !exists(global.bed_temp)
        global bed_temp = 0
      
      if !exists(global.hotend_temp)
        global hotend_temp = 0
      
      if !exists(global.chamber_temp)
        global chamber_temp = 0
      
      ; ====================---------------------------------------------------------
      ; Stepper currents
      ; ====================
      
      if !exists(global.xy_current)
        global xy_current = move.axes[0].current
      
      if !exists(global.z_current)
        global z_current = move.axes[2].current
      
      if !exists(global.e_current)
        global e_current = move.extruders[0].current
      
      ; ====================---------------------------------------------------------
      ; Mechanical Z pin
      ; ====================
      
      if !exists(global.z_pin_x)
        global z_pin_x = 194
      
      if !exists(global.z_pin_y)
        global z_pin_y = 355.5
      
      ; ====================---------------------------------------------------------
      ; Klicky probe
      ; ====================
      
      ; Setup the klicky status
      if !exists(global.klicky_status)
        global klicky_status = "none"
      
      ; The distance from the body of the klicky probe to it's own trigger point
      if !exists(global.klicky_offset)
        global klicky_offset = -1.49  ; a larger values makes the nozzle closer to the bed after running Z calibration
      
      ; The Z distance from nozzle to bed surface
      if !exists(global.klicky_clearance)
        global klicky_clearance = 20 ; going lower than 8 will make the probe scary-close to the bed in most setups!
      
      
      ; Dock settings:
      
      ; The absolute X location of the klicky while docked
      if !exists(global.klicky_dock_x)
        global klicky_dock_x = 19.4
      
      ; The absolute Y location of the klickywhile docked
      if !exists(global.klicky_dock_y)
        global klicky_dock_y = 356.4
      
      ; The relative disance and direction of the klicky docking move	
      if !exists(global.klicky_wipe)
        global klicky_wipe = 35  ; -30 for a left wipe 30 for a right wipe
      
      ; ====================---------------------------------------------------------
      ; Bed
      ; ====================
      
      ; Define the bed size on x-axis(print area from 0 to max)
      if !exists(global.bed_x)
        global bed_x = 350
        
      ; Define the bed size on y-axis(print area from 0 to max)
      if !exists(global.bed_y)
        global bed_y = 350
      
      ; If the bed has been leveled or not
      if !exists(global.bed_leveled)
        global bed_leveled = false
      
      ; ====================---------------------------------------------------------
      ; Print area
      ; ====================
      
      ; Setup the variables for min/max print area
      if !exists(global.paMinX)
        global paMinX = "N/A"
        
      if !exists(global.paMaxX)
        global paMaxX = "N/A"
      
      if !exists(global.paMinY)
        global paMinY = "N/A"
      
      if !exists(global.paMaxY)
        global paMaxY = "N/A"
      
      ; ====================---------------------------------------------------------
      ; MISC
      ; ====================
      
      if !exists(global.RunDaemon)
        global RunDaemon = true
      
      if !exists(global.initial_extruder)
        global initial_extruder = 0
      
      if !exists(global.first_layer_height)
        global first_layer_height = "none"
      
      ; The length needed to clear the meltzone of the extruder (as speced by E3D for the Revo)
      if !exists(global.unload_length)
        global unload_length = 18
      
      if !exists(global.job_completion)
        global job_completion = 0
      
      if !exists(global.debug_mode)
        global debug_mode = true
      
      if !exists(global.chamber_leds)
        global chamber_leds   = "off"
      
      if !exists(global.sb_leds)
        global sb_leds        = "boot"
      
      if !exists(global.Z_cal)
        global Z_cal          = false
      
      if !exists(global.Print_Probe)
        global Print_Probe = false
      
      if !exists(global.Adaptive_Probing)
        global Adaptive_Probing = false
        
      if !exists(global.Adaptive_Purge)
        global Adaptive_Purge = true
      
      ; ====================---------------------------------------------------------
      ; Output current values
      ; ====================
      
      echo "Klicky probe is: " , global.klicky_status
      

      speed_printing.g:

      ; /sys/lib/speed/speed_printing.g
      ; called to set speed and accelerations settings for printing
      
      ; Axis accelerations and speeds
      M566 X700.00 Y700.00 Z30.00 P1                                                 ; set maximum instantaneous speed changes (mm/min) and jerk policy
      M203 X18000.00 Y18000.00 Z900.00                                               ; set maximum speeds (mm/min)
      M201 X2000.00 Y2000.00 Z150.00                                                 ; set accelerations (mm/s²)
      
      ; Extruder accelerations and speeds
      M566 E8000.00 P1                                                               ; set maximum instantaneous speed changes (mm/min) and jerk policy
      M203 E15000.00                                                                 ; set maximum speeds (mm/min)
      M201 E1800.0                                                                   ; set accelerations (mm/s²)
      
      ; Printing and travel accelerations
      M204 P1500 T2000                                                               ; Set printing acceleration and travel accelerations (mm/s²)
      

      xy_current_high.g:

      ; /sys/lib/current/xy_current_high.g
      ; Called when printing
      ; Used to set X Y motor currents for printing
      
      M913 X100 Y100                                                                 ; Set X Y motors to 100% of their max current
      set global.xy_current = move.axes[0].current
      

      z_current_high.g:

      ; /sys/lib/current/z_current_high.g
      ; Called when printing
      ; Used to set Z motor currents for printing
      
      M913 Z100                                                                      ; Set Z motors to 100% of their max current
      set global.z_current = move.axes[2].current
      

      fw_retraction.g & klickly_status.g aren't worth sharing since i've got filament specific retraction settings etc. and the status update is just what it sounds like.

      But here is my filament config for ABS:

      ; 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.025        ; 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
      
        ; Travel & acceleration
        ;M204 P800 T3000                                                             ; Set printing and travel accelerations (mm/s²) 
      
        ;Cancel Ringing (Ghosting)
        ;M593 P"none" F50                                                            ; Cancel ringing at 50Hz
      
      ; ====================---------------------------------------------------------
      ; 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
      
      Exerqtorundefined 1 Reply Last reply Reply Quote 0
      • Exerqtorundefined
        Exerqtor @Exerqtor
        last edited by

        This is what my custom start gcode on PS looks like:

        ; Start G-code: START
        ; Inform of first layer height
        set global.first_layer_height = {first_layer_height}
        ; Define print area
        set global.paMinX = {first_layer_print_min[0]}
        set global.paMaxX = {first_layer_print_max[0]}
        set global.paMinY = {first_layer_print_min[1]}
        set global.paMaxY = {first_layer_print_max[1]}
        ; Set temps & the initial extruder
        set global.bed_temp = [first_layer_bed_temperature]
        set global.hotend_temp = {first_layer_temperature[initial_extruder]}
        set global.initial_extruder = [initial_extruder]
        M83                                                                            ; use relative distances for extrusion
        M98 P"/sys/lib/print/print_start.g"                                            ; run print start routine
        ; Start G-code: END
        

        print_start.g:

        ; /sys/lib/print/print_start.g
        ; Called when starting a print
        ; Used to configure print parameters
        
        ; For E3D Revo Micro
        
        ;LED status
        set global.sb_leds = "heating"
        
        
        set global.job_completion = 0
        
        G21                                                                            ; set units to millimeters
        G90                                                                            ; use absolute coordinates
        M83                                                                            ; use relative distances for extrusion
        M220 S100                                                                      ; reset speed multiplier
        M140 S{global.bed_temp}                                                        ; set bed temperature
        ;M141 S{global.chamber_temp}                                                   ; set chamber temperature
        G10 P{global.initial_extruder} R{global.hotend_temp} S{global.hotend_temp}     ; set active and standby temps for the initial tool
        M116                                                                           ; wait for bed and hotend to reach there temperatures
        M42 P0 S0.3                                                                    ; Turn on chamber lights to 30%
        M98 P"/sys/lib/print/print_level_bed.g"                                        ; level the bed while everything is hot
        G29 S1                                                                         ; load & turn on bed height map
        M376 H5                                                                        ; set bed compensation taper to 5mm
        T{global.initial_extruder}                                                     ; select initial tool
        M98 P"/sys/lib/nozzle_scrub.g"                                                 ; clean the nozzle
        G1 X{global.z_pin_x} Y{global.z_pin_y - 60} F6000                              ; Move out on the printbed
        G0 Z{(global.first_layer_height + 5)} F3000                                    ; Drop bed to first layer height + 5mm to reduce pucker factor
        M98 P"/sys/lib/print/print_purge.g"                                            ; purge the nozzle before starting print
        M400                                                                           ; wait for moves to finish
        
        ;LED status
        set global.sb_leds = "printing"
        

        print_level_bed.g:

        ; /sys/lib/print/print_level_bed.g
        ; Called as part of print_start.g	
        ; Used to make sure the bed is leveled
        
        ; ====================
        ; homing check
        ; ====================
        
          ; Lower currents, speed & accel
          M98 P"/sys/lib/current/xy_current_low.g"                                       ; Set low XY currents
          M98 P"/sys/lib/current/z_current_low.g"                                        ; Set low Z currents
          M98 P"/sys/lib/speed/speed_probing.g"                                          ; Set low speed & accel
        
        ; Make sure all axes are Homed
        if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed           ; If axes aren't homed
          ; Home all axis
          G91                                                                            ; Relative positioning
        
          ; Lower Z relative to current position if needed
          if !move.axes[2].homed                                                         ; If Z ain't homed
            G1 Z20 F9000 H1                                                              ; Lower Z(bed) relative to current position	
          elif move.axes[2].userPosition < 10                                            ; If Z is homed and less than 10
            G1 Z20 F9000                                                                 ; Move to Z 10
        
          ; Coarse home X or Y
          G1 X600 Y600 F2400 H1                                                          ; Move quickly to X or Y endstop(first pass)
        
          ; Coarse home X
          G1 X600 H1                                                                     ; Move quickly to X endstop(first pass)
        
          ; Coarse home Y
          G1 Y600 H1                                                                     ; Move quickly to Y endstop(first pass)
        
          ; Move away from the endstops
          G1 X-5 Y-5 F9000                                                               ; Go back a few mm
        
          ; Fine home X
          G1 X600 F360 H1                                                                ; Move slowly to X axis endstop(second pass)
        
          ; Fine home Y
          G1 Y600 H1                                                                     ; move slowly to Y axis endstop(second pass)
        
          ; Absolute positioning
          G90                                                                            ; Absolute positioning
        
          ; Home Z
          ; Load the probe
          M401 P0                                                                        ; Load the klicky probe
          M400                                                                           ; Wait for moves to finish
          M98 P"/sys/lib/klicky/klicky_status.g"                                         ; Refresh klicky status
        
          ; Last check to ensure klicky is attached
          if global.klicky_status = "attached"
            echo "Probe ATTACHED"
          else
            echo "Error probe not attached - aborting"
            M291 T5 R"Z Homing Aborted!" P"Z haven't been homed - check probe" 
            abort
        
          ; Move to bed center and home Z
          M98 P"/sys/lib/goto/bed_center.g"                                              ; Move to bed center
          M98 P"/sys/lib/speed/speed_probing.g"                                          ; Set low speed & accel
          G30 K0 Z-99999                                                                 ; Probe the center of the bed
        else
          ; Home Z
          ; Load the probe
          M401 P0                                                                        ; Load the klicky probe
          M400                                                                           ; Wait for moves to finish
          M98 P"/sys/lib/klicky/klicky_status.g"                                         ; Refresh klicky status
        
          ; Last check to ensure klicky is attached
          if global.klicky_status = "attached"
            echo "Probe ATTACHED"
          else
            echo "Error probe not attached - aborting"
            M291 T5 R"Z Homing Aborted!" P"Z haven't been homed - check probe" 
            abort
        
          ; Move to bed center and home Z
          M98 P"/sys/lib/goto/bed_center.g"                                              ; Move to bed center
          M98 P"/sys/lib/speed/speed_probing.g"                                          ; Set low speed & accel
          G30 K0 Z-99999                                                                 ; Probe the center of the bed
        
        ; ====================
        ; check if bed is leveled
        ; ====================
        
        ; If the bed isn't leveled
        if global.bed_leveled = false
        
          ;LED status
          set global.sb_leds = "leveling"
        
          ; ====================
          ; prepare to probe
          ; ====================
        
          ; report whats going on
          M291 R"Bed leveling" P"Please wait..." T0                                    ; leveling bed message
        
          M561                                                                         ; clear any bed transform
          M290 R0 S0                                                                   ; reset baby stepping
          M84 E0                                                                       ; disable extruder stepper
        
          ; ====================
          ; probing code
          ; ====================
        
          ; Coarse leveling pass  
          M558 K0 H15 F600 A1                                                          ; increase the depth range, gets the bed mostly level immediately
          M98 P"/sys/bed_probe_points.g"                                               ; probe the bed
        
          ; Probe the bed
          while true
            ; --- probe near lead screws -
            M558 K0 H3 F240:120 A30                                                    ; reduce depth range, probe slower for better repeatability 
            M98 P"/sys/bed_probe_points.g"                                             ; probe the bed
        
            ; check results - exit loop if results are good
            if move.calibration.initial.deviation < 0.02                               ; if probing result is less than 0.02mm
              break                                                                    ; stop probing 
        
            ; check pass limit - abort if pass limit reached
            if iterations = 5                                                          ; if probed more than 5 times
              M291 P"Bed Leveling Aborted" R"Pass Limit Reached"                       ; abort probing, something wrong
              set global.bed_leveled = false                                           ; set global state
              abort "Bed Leveling Aborted - Pass Limit Reached"                        ; abort probing, something wrong
        
          ; ====================
          ; finish up
          ; ====================
        
          ; Home Z
          ; Move to bed center and home Z
          M98 P"/sys/lib/goto/bed_center.g"                                              ; Move to bed center
          M98 P"/sys/lib/speed/speed_probing.g"                                          ; Set low speed & accel
          G30 K0 Z-99999                                                                 ; Probe the center of the bed
        
          ; Dock the probe
          M402 P0                                                                        ; Dock the klicky probe
          M400                                                                           ; Wait for moves to finish
        
          set global.bed_leveled = true                                                ; set global state
        
          ;echo "global.bed_leveled. Value : " , global.bed_leveled
          M291 R"Bed leveling" P"Done" T5                                              ; bed leveling done message
        
        else
          ; ====================
          ; response if leveled
          ; ====================
        
          ; Dock the probe
          M402 P0                                                                        ; Dock the klicky probe
          M400                                                                           ; Wait for moves to finish
          M98 P"/sys/lib/klicky/klicky_status.g"                                         ; Refresh klicky status
        
          ; Bed already leveled, no need to probe  
          M291 S1 R"Bed leveling" P"Bed allready leveled" T1
        
          M561                                                                         ; clear any bed transform
          M290 R0 S0                                                                   ; reset baby stepping
        
        ;LED status
        set global.sb_leds = "ready"
        
        Exerqtorundefined 1 Reply Last reply Reply Quote 0
        • Exerqtorundefined
          Exerqtor @Exerqtor
          last edited by

          nozzle_scrub.g:

          ; /sys/lib/nozzle_scrub.g  (v2.5)
          ; Called when "M98 P"/sys/lib/nozzle_scrub.g" is sent
          ; Used to clean and (alternatively) purge the nozzle
          
          ;--------------------------------------------------------------------------------------------------------------------------------------
          
          ; Sample macro config to be used in conjunction with a Purge Bucket & Nozzle Scrubber combo and RepRapFirmware 3.4.x
          
          ; The goal of this macro is to provide a nozzle scrubbing and purging routine that is easily copied/referenced into your  printer.
          ; Users can simply change parameters and enable/disable options in the first half. Descriptions are plentiful, making this macro
          ; look huge but informative and are laid out in sequence to be read first describing the line below; PLEASE READ CAREFULLY.
          
          ; This sample config assumes the following: The user has implemented a purge bucket & nozzle scrubber to their printer
          ; It can be tweaked for customized purge bucket geometries and brushes.
          
          ; Features in this macro: purge routine that can be enabled/disabled.
          ; By default, bucket is located at rear right of bed and purge routine is enabled. The purge and scrubbing routine is randomized
          ; in either left or right bucket to ensure as even as possible distribution of filament gunk.
          
          ; Default parameters are set for safe speeds and movements. Where necessary, tweak the parameters for the nozzle scrub procedure
          ; to fit your printer.
          
          ;--------------------------------------------------------------------------------------------------------------------------------------
          
          ; If you want the purging routine in your bucket enabled, set to true (and false vice versa).
          var enable_purge        = false
          
          ; These parameters define your filament purging. The retract variable is used to retract right after purging to prevent unnecessary
          ; oozing. Some filament are particularly oozy and may continue to ooze out of the nozzle for a second or two after retracting. The
          ; ooze dwell variable makes allowance for this. Update as necessary. If you decided to not enable purge, you can ignore this section.
          
          var purge_len           = 10         ; Amount of filament, in mm, to purge.
          var purge_spd           = 150        ; Speed, in mm/min, of the purge.
          var purge_temp_min      = {global.hotend_temp - 5}        ; Minimum nozzle temperature to permit a purge. Otherwise, purge will not occur.
          var purge_ret           = 2          ; Retract length, in mm, after purging to prevent slight oozing. Adjust as necessary.
          var ooze_dwell          = 2          ; Dwell/wait time, in seconds, after purging and retracting.
          
          ; Adjust this so that your nozzle scrubs within the brush. Currently defaulted to be a lot higher for safety. Be careful not to go too low!
          var brush_top           = 1
          
          ; These parameters define your scrubbing, travel speeds, safe z clearance and how many times you want to wipe. Update as necessary. Wipe
          ; direction is randomized based off whether the left or right bucket is randomly selected in the purge & scrubbing routine.
          
          var clearance_z         = 5          ; When traveling, but not cleaning, the clearance along the z-axis between nozzle and brush.
          var wipe_qty            = 3          ; Number of complete (A complete wipe: left, right, left OR right, left, right) wipes.
          var prep_spd_xy         = 3000       ; Travel (not cleaning) speed along x and y-axis in mm/min.
          var prep_spd_z          = 1500       ; Travel (not cleaning) speed along z axis in mm/min.
          var wipe_spd_xy         = 5000       ; Nozzle wipe speed in mm/min.
          
          ; These parameters define the size of the brush. Update as necessary. A visual reference is provided below. Note that orientation of
          ; parameters remain the same whether bucket is at rear or front.
          
          ;                  ?   brush_width   ?
          ;                   _________________
          ;                  |                 |  ?
          ;  brush_start (x) |                 | brush_depth
          ;                  |_________________|  ?
          ;                          (y)
          ;                      brush_front
          ;__________________________________________________________
          ;                     PRINTER FRONT
          
          ; Input where your brush assembly start is on the x axis
          var brush_start         = 237
          
          ; This value is for the brush width (with brush holder), change it if your brush setup width is different.
          var brush_width         = 50
          
          ; Specify the location in y axis for your brush - see diagram above.
          var brush_front         = 353
          var brush_depth         = 8
          
          ; These parameters define the size of your purge bucket. Update as necessary. If you decided to not enable purge, you can ignore
          ; this section. A visual reference is provided below. Note that orientation of parameters remain the same whether bucket is at rear
          ; or front.
          
          ;                                     bucket_gap
          ;                                      ? ---- ?
          ;                     __________________________________________
          ;                    |                 |      |                 |
          ;                    |                 |      |                 |
          ;  bucket_start (x)  |                 |______|                 |
          ;                    |                 |      |                 |
          ;                    |                 |      |                 |
          ;                    |_________________|. . . |_________________|
          ;                     ? ------------- ?        ? ------------- ?
          ;                     bucket_left_width        bucket_right_width
          ;_______________________________________________________________________________________
          ;                                    PRINTER FRONT
          
          ; Input your left bucket width
          var bucket_left_width   = 23.5
          
          ; Input your gap width
          var bucket_gap          = 25
          
          ; Input your left bucket width
          var bucket_right_width  = 35.5
          
          ; Input where your bucket start is on the x axis
          var bucket_start        = 219
          
          ;--------------------------------------------------------------------------------------------------------------------------------------
          
          ; From here on, unless you know what you're doing, it's recommended not to change anything. Feel free to peruse the code if you stumble apon it
          ; and reach out to me on Discord (Exerqtor#3178) or the duet forum (Exerqtor) if you spot any problems, or have any sugestions for improvements!
          
          ; Shout-out to "fcwilt" on the duet forum for helping me with ironing out bugs and streamlining the macro! <3
          
          ;--------------------------------------------------------------------------------------------------------------------------------------
          
          ; Placeholder. The variable wil later be set to contain the overhang for the brush assembly in the buckets
          var brush_oh            = 0
          
          ; Brush overhang calculation:
          set var.brush_oh = {(var.brush_width - var.bucket_gap) / 2} 
          
          ; Placeholder. The variable will later be set to contain, at random, a number representing the left(0) or right(1) side
          var pos                 = 1
          
          ; Randomly select left or right side
          set var.pos = random(2)
          
          ; Check if the axes are homed - if not homed just abort - it exits this routine and none of the rest of the code is executed
          if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
            M291 R"Axes not homed" P"Please home all axes first!" T0
            abort "nozzle_scrub.g aborted - axes were not homed"
          
          ;LED status
          set global.sb_leds = "cleaning"
          
          ; Report what's going on
          M291 S1 R"Cleaning nozzle" P"Please wait..." T5
          
          ; Set to absolute positioning.
          G90
          
          ; ====================---------------------------------------------------------
          ; purging code
          ; ====================
          
          ; Check if user enabled purge option or not.
          if var.enable_purge
          
            ; If hotend needs to be loaded, to it now (at 2x purge_spd).
            if exists(global.unload_length)
              if global.unload_length > 0
                G1 E{global.unload_length + 0.5} F{var.purge_spd * 2}
                echo "Hotend loaded"
          
            ; Purge if the temp is up to min temp. If not, it will skip and continue executing rest of macro.
            if heat.heaters[1].current > var.purge_temp_min
                echo "Purging"
          
              ; Raise Z for travel.
              G1 Z{var.brush_top + var.clearance_z} F{var.prep_spd_z}
          
              ; Move towards brush.
              G1 Y{var.brush_front + (var.brush_depth / 2)} F{var.prep_spd_xy}
          
              ; Position for purge. Randomly selects middle of left or right bucket. It references from the middle of the left bucket (while compensating for any brush overhang).
              if var.pos = 0 
                ; Left bucket selected
          
                G1 X{var.bucket_start + ((var.bucket_left_width - var.brush_oh) / 2)}
              else
                ; Right bucket selected
                G1 X{(var.bucket_start + var.bucket_left_width) + (var.bucket_gap + var.brush_oh) + ((var.bucket_right_width - var.brush_oh) / 2)}
          
              ; Perform purge with a small retract after purging to minimize any persistent oozing at (retract 5x purge_spd).
              M83                                                                        ; relative mode
              G1 E{var.purge_len} F{var.purge_spd}
              G1 E{0 - var.purge_ret} F{var.purge_spd * 5}
              G4 S{var.ooze_dwell}
              G92 E0                                                                     ; reset extruder
          
            else
              echo "To cold to purge"
          
          ; ====================---------------------------------------------------------
          ; wiping code
          ; ====================
          
          ; Placeholders
          var pos1                = 0
          var pos2                = 0
          
          ; Position for wipe. Either left or right of brush based on var.pos to avoid unnecessary travel after purging
          if var.pos = 0
            set var.pos1 = var.brush_start
            set var.pos2 = var.brush_start + var.brush_width
          else
            set var.pos1 = var.brush_start + var.brush_width
            set var.pos2 = var.brush_start
          
          G1 Z{var.brush_top + var.clearance_z} F{var.prep_spd_z}
          
          G1 X{var.pos1} F{var.prep_spd_xy}
          
          ; Move in to the brush.
          G1 Y{var.brush_front + (var.brush_depth / 2)}
          
          ; Move nozzle down into brush.
          G1 Z{var.brush_top} F{var.prep_spd_z}
          
          ; Perform wipe. Wipe direction based off pos for cool random scrubby routine.
          while true
            G1 X{var.pos2} F{var.wipe_spd_xy}
            G1 X{var.pos1}
          
            if iterations = var.wipe_qty + 1
              break
          
          ; ====================---------------------------------------------------------
          ; finish up
          ; ====================
          
          ; Clear from area.
          G1 Z{var.brush_top + var.clearance_z} F{var.prep_spd_z}
          
          G1 X{var.bucket_start + ((var.bucket_left_width - var.brush_oh) / 2)} F{var.prep_spd_xy}
          
          M400                                                                           ; Wait for moves to finish
          
          M118 S"Nozzle cleaned!"
          
          ;LED status
          set global.sb_leds = "ready"
          

          print_purge.g:

          ; /sys/lib/print/print_purge.g  (v1.2)
          ; Called when "M98 P"/sys/lib/print/print_purge.g" is sent
          ; Used to purge the nozzle close to the actual print area
          
          ;--------------------------------------------------------------------------------------------------------------------------------------
          
          ;  Adaptive Purging with VoronDesign Logo for RepRapFirmware 3.4.x
          
          ; This macro will parse information from objects in your gcode to define a min and max area, creating a nearby purge with Voron flair!
          ; For successful purging, you may need to configure:
          
          ; Declare global.unload_length, and define what length it's needed to be.
          ; Declare global.Adpative_Purge,and set it true
          ; Declared globals for X/Y min/max, and have these to defined in your slicer.
          
          ;--------------------------------------------------------------------------------------------------------------------------------------
          
          ; ====================---------------------------------------------------------
          ; Variable declarations & defaults
          ; ====================
          
          ; To enable adaptive purging "global.Adaptive_Purging" must be declared and true.
          
          var z_height              = 0.4                            ; Height above the bed to purge
          var prime_dist            = {global.unload_length + 1}     ; Distance between filament tip and nozzle tip before purge (this might require some tuning)
          var purge_amount          = 20                             ; Amount of filament to purge
          var flow_rate             = 10                             ; Desired flow rate in mm3/s
          var x_default             = 10                             ; X location to purge, overwritten if adaptive is True
          var y_default             = 10                             ; Y location to purge, overwritten if adaptive is True
          var size                  = 10                             ; Size of the logo in mm
          var distance_to_object_x  = 15                             ; Distance in x to the print area
          var distance_to_object_y  = 0                              ; Distance in y to the print area
          var travel_speed          = 300                            ; Travel speed
          
          ; Placeholders:
          var x_origin = "N/A"
          var y_origin = "N/A"
          var consoleMessage = "N/A"
          
          ; ====================---------------------------------------------------------
          ; Purge location calculation
          ; ====================
          
          if global.Adaptive_Purge
            set var.x_origin = {global.paMinX - var.distance_to_object_x - var.size}
            set var.y_origin = {global.paMinY - var.distance_to_object_y - var.size}
          else
            set var.x_origin = var.x_default
            set var.y_origin = var.y_default
          
          var prepurge_speed = (var.flow_rate / 2.405)
          var purge_move_speed = {2.31 * var.size * var.flow_rate / (var.purge_amount * 2.405)}
          
          ; Info messages
          set var.consoleMessage = "X: " ^ var.x_origin ^ "; Y: " ^ var.y_origin ^ "; Purge move speed: " ^ var.purge_move_speed ^ "; Prepurge speed: " ^ var.prepurge_speed  ; Set the console message
          
          M118 P2 S{var.consoleMessage}  ; send used probe grid to paneldue
          M118 P3 S{var.consoleMessage}  ; send used probe grid to DWC console
          
          ; ====================---------------------------------------------------------
          ; Purging code
          ; ====================
          
          ; LED status
          set global.sb_leds = "pink"
          
          G92 E0
          G0 F{var.travel_speed * 60}                                                                                            ; Set travel speed
          G90                                                                                                                    ; Absolute positioning
          G0 X{var.x_origin} Y{var.y_origin + var.size / 2}                                                                      ; Move to purge position
          G0 Z{var.z_height}                                                                                                     ; Move to purge Z height
          M83                                                                                                                    ; Relative extrusion mode
          G1 E{var.prime_dist} F{var.prepurge_speed * 60}                                                                        ; Move tip of filament to nozzle
          G1 X{var.x_origin + var.size * 0.289} Y{var.y_origin + var.size} E{var.purge_amount / 4} F{var.purge_move_speed * 60}  ; Purge first line of logo
          G1 E-.5 F2100                                                                                                          ; Retract
          G0 Z{var.z_height * 2}                                                                                                 ; Z hop
          G0 X{var.x_origin + var.size * 0.789} Y{var.y_origin + var.size}                                                       ; Move to second purge line origin
          G0 Z{var.z_height}                                                                                                     ; Move to purge Z height
          G1 E.5 F2100                                                                                                           ; Recover
          G1 X{var.x_origin + var.size * 0.211} Y{var.y_origin} E{var.purge_amount / 2} F{var.purge_move_speed * 60}             ; Purge second line of logo
          G1 E-.5 F2100                                                                                                          ; Retract
          G0 Z{var.z_height * 2}                                                                                                 ; Z hop
          G0 X{var.x_origin + var.size * 0.711} Y{var.y_origin}                                                                  ; Move to third purge line origin
          G0 Z{var.z_height}                                                                                                     ; Move to purge Z height
          G1 E.5 F2100                                                                                                           ; Recover
          G1 X{var.x_origin + var.size} Y{var.y_origin + var.size / 2}  E{var.purge_amount / 4} F{var.purge_move_speed * 60}     ; Purge third line of logo
          G1 E-.5 F2100                                                                                                          ; Retract
          G92 E0                                                                                                                 ; Reset extruder distance
          G0 Z{var.z_height * 2}                                                                                                 ; Z hop
          
          ; LED status
          set global.sb_leds = "ready"
          

          Good luck sifting thru all that, had to split it up in several posts lol.

          But like i said, i checked the object modell during last print, and all the values seemed correct 😕

          1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator
            last edited by

            It'll take me some time to go through that.

            Do you happen to use input shaping? Pressure advance?

            Z-Bot CoreXY Build | Thingiverse Profile

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

              @Phaedrux said in Time estimates from PrusaSlicer:

              It'll take me some time to go through that.

              Do you happen to use input shaping? Pressure advance?

              It's alot 🤢
              Yeah input shaping gets defined in config.g M593 P"zvd" F49.3

              Pressure advance get set in filament config.g M572 D0 S0.025.

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

                Just simulated AND printed another file, estimated 1h7m, simulated 1h32m, printed 1h31m (with preheated bed and hotend).

                I'm lost...

                Another one:
                Estimated 0h21m, simulated 0h26m, printed 0h31m.

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

                  @Exerqtor did you see my earlier post? User n8bot has made modifications to PS to make the estimates more accurate for RRF. Part of this is a facility to fetch the maximum speeds and accelerations from RRF. https://github.com/n8bot/PrusaSlicer/releases

                  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

                    @dc42

                    Yeah i did 😅 :

                    @dc42 said in Time estimates from PrusaSlicer:

                    @Exerqtor try the PrusaSlicer fork from n8bot. It can fetch the Duet machine parameters to compute more accurate estimates.

                    He's fork haven't been updated in ages either (even older than SuperSlicer), so not to keen on jumping on an even more buggy build lol. But i saw the pull request on the master branch he made and commented on it yesterday so maybe something happes.

                    1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator
                      last edited by

                      Can you send the speed, accel, jerk, etc commands while a print is in progress to see if the values are what you'd expect them to be?

                      Z-Bot CoreXY Build | Thingiverse Profile

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

                        @Phaedrux said in Time estimates from PrusaSlicer:

                        Can you send the speed, accel, jerk, etc commands while a print is in progress to see if the values are what you'd expect them to be?

                        Sorry for the slow reply, but covid paid a visit so i haven't had the energy to deal with this lol.

                        But i just managed to check the numbers during print, and apparently the printing accelerations are at 500 for some reason.

                        alt text

                        So i need to track down what the f**k sends that M204 P500.

                        EDIT:

                        I found the issue, when redoing print_level_bed.g i had forgot to turn up both speeds AND currents and the end.

                        Fixed print_level_bed.g:

                        ; /sys/lib/print/print_level_bed.g  v2.1
                        ; Called as part of print_start.g	
                        ; Used to make sure the bed is leveled
                        
                        ; ====================---------------------------------------------------------
                        ; Homing check
                        ; ====================
                        
                        ; Lower currents, speed & accel
                        M98 P"/sys/lib/current/xy_current_low.g"                                       ; Set low XY currents
                        M98 P"/sys/lib/current/z_current_low.g"                                        ; Set low Z currents
                        M98 P"/sys/lib/speed/speed_probing.g"                                          ; Set low speed & accel
                        
                        ; LED status
                        set global.sb_leds = "homing"
                        
                        ; Make sure all axes are Homed
                        if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed           ; If axes aren't homed
                          ; Home all axis
                          G91                                                                          ; Relative positioning
                        
                          ; Lower Z relative to current position if needed
                          if !move.axes[2].homed                                                       ; If Z ain't homed
                            G1 Z20 F9000 H1                                                            ; Lower Z(bed) relative to current position	
                          elif move.axes[2].userPosition < 10                                          ; If Z is homed and less than 10
                            G1 Z20 F9000                                                               ; Move to Z 10
                        
                          ; Coarse home X or Y
                          G1 X600 Y600 F2400 H1                                                        ; Move quickly to X or Y endstop(first pass)
                        
                          ; Coarse home X
                          G1 X600 H1                                                                   ; Move quickly to X endstop(first pass)
                        
                          ; Coarse home Y
                          G1 Y600 H1                                                                   ; Move quickly to Y endstop(first pass)
                        
                          ; Move away from the endstops
                          G1 X-5 Y-5 F9000                                                             ; Go back a few mm
                        
                          ; Fine home X
                          G1 X600 F360 H1                                                              ; Move slowly to X axis endstop(second pass)
                        
                          ; Fine home Y
                          G1 Y600 H1                                                                   ; move slowly to Y axis endstop(second pass)
                        
                          ; Absolute positioning
                          G90                                                                          ; Absolute positioning
                        
                        ; Home Z
                        ; Load the probe
                        M401 P0                                                                        ; Load the klicky probe
                        M400                                                                           ; Wait for moves to finish
                        M98 P"/sys/lib/klicky/klicky_status.g"                                         ; Refresh klicky status
                        
                        ; Last check to ensure klicky is attached
                        if global.klicky_status = "Attached"
                          echo "Probe ATTACHED"
                        else
                          echo "Error probe not attached - aborting"
                          M291 T5 R"Z Homing Aborted!" P"Z haven't been homed - check probe" 
                          abort
                        
                        ; Move to bed center and home Z
                        M98 P"/sys/lib/goto/bed_center.g"                                              ; Move to bed center
                        M98 P"/sys/lib/speed/speed_probing.g"                                          ; Set low speed & accel
                        G30 K0 Z-99999                                                                 ; Probe the center of the bed
                        
                        ; ====================---------------------------------------------------------
                        ; Check if bed is leveled
                        ; ====================
                        
                        ; If the bed isn't leveled
                        if global.bed_leveled = false
                        
                          ; LED status
                          set global.sb_leds = "leveling"
                        
                         ; ====================---------------------------------------------------------
                          ; Prepare to probe
                          ; ====================
                        
                          ; Report whats going on
                          M291 R"Bed leveling" P"Please wait..." T0                                    ; Leveling bed message
                        
                          M561                                                                         ; Clear any bed transform
                          M290 R0 S0                                                                   ; Reset baby stepping
                          M84 E0                                                                       ; Disable extruder stepper
                        
                          ; ====================---------------------------------------------------------
                          ; Probing code
                          ; ====================
                        
                          ; Coarse leveling pass  
                          M558 K0 H15 F600 A1                                                          ; Increase the depth range, gets the bed mostly level immediately
                          M98 P"/sys/bed_probe_points.g"                                               ; Probe the bed
                        
                          ; Probe the bed
                          while true
                            ; Probe near lead screws
                            M558 K0 H3 F240:120 A30                                                    ; Reduce depth range, probe slower for better repeatability 
                            M98 P"/sys/bed_probe_points.g"                                             ; Probe the bed
                        
                            ; Check results - exit loop if results are good
                            if move.calibration.initial.deviation < 0.02                               ; If probing result is less than 0.02mm
                              break                                                                    ; Stop probing 
                        
                            ; Check pass limit - abort if pass limit reached
                            if iterations = 5                                                          ; If probed more than 5 times
                              M291 P"Bed Leveling Aborted" R"Pass Limit Reached"                       ; Abort probing, something wrong
                              set global.bed_leveled = false                                           ; Set global state
                              abort "Bed Leveling Aborted - Pass Limit Reached"                        ; Abort probing, something wrong
                        
                          ; ====================---------------------------------------------------------
                          ; Finish up
                          ; ====================
                        
                          ; Home Z
                          ; Move to bed center and home Z
                          M98 P"/sys/lib/goto/bed_center.g"                                            ; Move to bed center
                          M98 P"/sys/lib/speed/speed_probing.g"                                        ; Set low speed & accel
                          G30 K0 Z-99999                                                               ; Probe the center of the bed
                        
                          ; Dock the probe
                          M402 P0                                                                      ; Dock the klicky probe
                          M400                                                                         ; Wait for moves to finish
                        
                          set global.bed_leveled = true                                                ; set global state
                        
                          ;echo "global.bed_leveled. Value : " , global.bed_leveled
                          M291 R"Bed leveling" P"Done" T5                                              ; bed leveling done message
                        
                        else
                          ; ====================---------------------------------------------------------
                          ; Response if leveled
                          ; ====================
                        
                          ; Dock the probe
                          M402 P0                                                                      ; Dock the klicky probe
                          M400                                                                         ; Wait for moves to finish
                          M98 P"/sys/lib/klicky/klicky_status.g"                                       ; Refresh klicky status
                        
                          ; Full currents, speed & accel
                          M98 P"/sys/lib/current/z_current_high.g"                                     ; Restore normal Z currents
                          M98 P"/sys/lib/current/xy_current_high.g"                                    ; Set high XY currents
                          M98 P"/sys/lib/speed/speed_printing.g"                                       ; Restore normal speed & accels
                        
                        
                          ; Bed already leveled, no need to probe  
                          M291 S1 R"Bed leveling" P"Bed allready leveled" T1
                        
                          M561                                                                         ; Clear any bed transform
                          M290 R0 S0                                                                   ; Reset baby stepping
                        
                        ; LED status
                        set global.sb_leds = "ready"
                        
                        1 Reply Last reply Reply Quote 2
                        • Exerqtorundefined Exerqtor marked this topic as a question
                        • Exerqtorundefined Exerqtor has marked this topic as solved
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA