Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #____________________________________________INSTRUCTIONS AND SNIPPETS TO PASTE________________________________________________
- #paste [include custom.cfg] at THE END of "printer.cfg" just above ## <--------------------- SA\/E_CONFIG --------------------->
- #paste [skew_correction] anywhere in "printer.cfg" (for Calilantern or other skew correction; not absolutely necessary)
- ##paste and uncomment in "moonraker.conf":
- #[timelapse]
- #output_path: ~/printer_data/timelapse/
- #frame_path: /tmp/timelapse/printer
- #autorender: False #auto-rendering crashes klipper during gradual bed cooldown macro, but TIMELAPSE_RENDER is performed automatically at times it won't cause a crash at end of cooling or in PRINT_END if not cooling
- ##if you have a Nebula for a second camera and it stops working:
- ##Nebula camera ID in case Qidi overwrites it in "crowsnest.conf" again:
- #device:/dev/v4l/by-id/usb-UnionImage_Co._Ltd_CCX2F3298_1234567890-video-index0
- ##linux commands to disable unused processes during an SSH session:
- #default username is mks
- #default password is makerbase
- ##you could just disable algo_app (the AI spaghetti detection service); it uses the most resources of anything listed here by FAR
- #sudo systemctl disable --now algo_app.service
- #sudo systemctl disable --now QIDILink-client.service
- #sudo systemctl disable --now strongswan-starter.service
- #sudo systemctl disable --now openvpn.service
- #sudo systemctl disable --now triggerhappy.service
- #systemctl --user disable --now pulseaudio.service
- #systemctl --user disable --now pulseaudio.socket
- #sudo systemctl disable --now bluetooth
- #sudo systemctl disable --now lightdm
- #sudo systemctl disable --now xl2tpd
- #_________________________________________CONFIGS_____________________________________________________
- [include ./KAMP/Adaptive_Meshing.cfg] #this should fix the broken stock KAMP implementation Qidi used
- [include ./KAMP/Line_Purge.cfg] # Include to enable adaptive line purging configuration.
- # [include ./KAMP/Smart_Park.cfg] # Include to enable the Smart Park function, which parks the printhead near the print area for final heating.
- #fan config for 2-3 wire hotend fan DO NOT USE THIS WITH 4 PIN / STOCK FAN
- [heater_fan hotend_fan]
- pin:THR:PB10#FAN2 pins
- max_power: 1.0
- shutdown_speed:0
- cycle_time: 0.010
- hardware_pwm: False
- kick_start_time: 0.100
- heater: extruder
- heater_temp: 50.0
- fan_speed: 1.0
- off_below: 0
- #comment out tach pins both here AND in printer.cfg if using a 2 wire fan:
- tachometer_pin:THR:PA12 #stock hotend fan tach pin
- tachometer_ppr: 2
- tachometer_poll_interval: 0.00050#0.0015 default
- #requires Klipper Maintenance addon; delete or comment out if not using that
- # [maintain]
- # interval: 600 # optional, time (in seconds) between checking if maintenance needs to be done (default is 60)
- #requires Klipper Maintenance addon; delete or comment out if not using that
- # Lubricate XY rods
- # [maintain xyrods]
- # label: XY smooth rods
- # trigger: print_time
- # threshold: 100 #this is a conservative time interval
- # message: Lubricate XY smooth rods
- #requires Klipper Maintenance addon; delete or comment out if not using that
- # Lubricate Z rods and screws
- # [maintain zrodsandscrews]
- # label: Z rods and screws
- # trigger: print_time
- # threshold: 250 #this is a conservative time interval
- # message: Lubricate Z smooth rods and lead screws
- [verify_heater heater_bed]
- max_error: 700 #default 400; hopefully stops crashing when putting a cold plate on bed
- check_gain_time:120
- hysteresis: 2
- heating_gain: 1
- #[resonance_tester] #trying to get sweeping to work with shaketune but it won't
- #sweeping_accel: 400
- # An acceleration of slow sweeping moves. The default is 400 mm/sec^2.
- #sweeping_accel_z: 50
- # Same as sweeping_accel above, but for Z axis. The default is 50 mm/sec^2.
- #sweeping_period: 1.2
- [shaketune]
- # result_folder: ~/printer_data/config/ShakeTune_results
- # Path where the processed results will be stored. If the folder doesn't exist,
- # it will be automatically created. You can change this if you'd like to store
- # results in a different location.
- # number_of_results_to_keep: 10
- # This setting defines how many results you want to keep in the result folder.
- # Once the specified number is exceeded, older results will be automatically deleted
- # to free up space on the SD card and avoid cluttering the results folder.
- # keep_raw_data: False
- # If set to True, Shake&Tune will store both the processed graphs and the raw accelerometer
- # .stdata files in the results folder. This can be useful for debugging or archiving purposes.
- # Please always attach them when reporting any issues on GitHub or Discord.
- # show_macros_in_webui: True
- # Mainsail and Fluidd doesn't create buttons for system commands (macros that are not part
- # of the printer.cfg file). This option allow Shake&Tune to inject them into the webui at runtime.
- # If set to False, the macros will be hidden but still accessible from the console by typing
- # their names manually, which can be useful if you prefer to encapsulate them into your own macros.
- # timeout: 600
- # This defines the maximum processing time (in seconds) to allows to Shake&Tune for generating
- # graphs from a .stdata file. 10 minutes should be more than enough in most cases, but if you have
- # slower hardware (e.g., older SD cards or low-performance devices), increase it to prevent timeouts.
- # measurements_chunk_size: 2
- # Each Shake&Tune command uses the accelerometer to take multiple measurements. By default,
- # Shake&Tune will write a chunk of data to disk every two measurements, and at the end of the
- # command will merge these chunks into the final .stdata file for processing. "2" is a very
- # conservative setting to avoid Klipper Timer Too Close errors on lower end devices with little
- # RAM, and should work for everyone. However, if you are using a powerful computer, you may
- # wish to increase this value to keep more measurements in memory (e.g., 15-20) before writing
- # the chunk and avoid stressing the filesystem too much.
- # max_freq: 200
- # This setting defines the maximum frequency at which the calculation of the power spectral density
- # is cutoff. The default value should be fine for most machines and accelerometer combinations and
- # avoid touching it unless you know what you're doing.
- # dpi: 300
- # Controls the resolution of the generated graphs. The default value of 300 dpi was optimized
- # and strikes a balance between performance and readability, ensuring that graphs are clear
- # without using too much RAM to generate them. Usually, you shouldn't need to change this value.
- #this makes large area bed meshes (automatic bed leveling) more accurate but slower. Reduce 9,9 to something smaller if it's too slow.
- [bed_mesh]
- speed: 300 #100
- horizontal_move_z:2 #stock 5; this should be fine unless I am tramming the bed badly
- mesh_min:10,10 #probably can't go lower without removing the filament cutter
- mesh_max:270,270#stock260,260 #don't know why they skipped that corner
- probe_count:9,9#stock: 6,6
- algorithm:bicubic#stock: lagrange#bicubic
- bicubic_tension:0.2#stock: commented out
- mesh_pps: 2, 2
- #fade_target:0
- [probe_air]
- delta_v: 0.08
- #z_offset:-0.07
- speed: 5
- lift_speed:10#5
- samples: 2
- sample_retract_dist:2#3
- samples_result: average
- samples_tolerance: 0.02
- samples_tolerance_retries: 10
- [fan_generic cooling_fan]
- tachometer_poll_interval: 0.00075#0.001 pre-CFD shroud #poll fan tach more often for accurate RPM of upgraded fan#0.0015 default
- [temperature_sensor Host_CPU]#adds new temp sensor to graph in fluidd
- sensor_type: temperature_host
- min_temp: 10
- max_temp: 100
- [temperature_sensor toolhead]#adds new temp sensor to graph in fluidd
- sensor_type: temperature_mcu
- sensor_mcu: THR
- min_temp: 0
- max_temp: 100
- [gcode_macro _KAMP_Settings]
- description: This macro contains all adjustable settings for KAMP
- # The following variables are settings for KAMP as a whole.
- variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging.
- # The following variables are for adjusting adaptive mesh settings for KAMP.
- variable_mesh_margin: 10 # Expands the mesh size in millimeters if desired. Leave at 0 to disable.
- variable_fuzz_amount: 4 #default 0 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Leave at 0 to disable.
- # The following variables are for those with a dockable probe like Klicky, Euclid, etc. # ---------------- Attach Macro | Detach Macro
- variable_probe_dock_enable: False # Set to True to enable the usage of a dockable probe. # ---------------------------------------------
- variable_attach_macro: 'Attach_Probe' # The macro that is used to attach the probe. # Klicky Probe: 'Attach_Probe' | 'Dock_Probe'
- variable_detach_macro: 'Dock_Probe' # The macro that is used to store the probe. # Euclid Probe: 'Deploy_Probe' | 'Stow_Probe'
- # Legacy Gcode: 'M401' | 'M402'
- # The following variables are for adjusting adaptive purge settings for KAMP.
- variable_purge_height: 0.8 # Z position of nozzle during purge, default is 0.8.
- variable_tip_distance: 0 # Distance between tip of filament and nozzle before purge. Should be similar to PRINT_END final retract amount.
- variable_purge_margin: 30 #keep purge outside of brims # Distance the purge will be in front of the print area, default is 10.
- variable_purge_amount: 2 # Amount of filament to be purged prior to printing.
- variable_flow_rate: 7.5 # Flow rate of purge in mm3/s. Default is 12.
- # The following variables are for adjusting the Smart Park feature for KAMP, which will park the printhead near the print area at a specified height.
- variable_smart_park_height: 10 # Z position for Smart Park, default is 10.
- gcode: # Gcode section left intentionally blank. Do not disturb.
- {action_respond_info(" Running the KAMP_Settings macro does nothing, it is only used for storing KAMP settings. ")}
- [screws_tilt_adjust]
- screw1:30,30
- screw1_name: front left screw
- screw2: 240,30
- screw2_name: front right screw
- screw3: 240,240
- screw3_name: rear right screw
- screw4: 30,240
- screw4_name: rear left screw
- horizontal_move_z: 10
- speed: 50
- screw_thread: CW-M4
- [gcode_macro SCREWS_TILT_CALCULATE]
- rename_existing: _SCREWS_TILT_CALCULATE_BASE
- gcode:
- { action_respond_info("starting screw rotation calculation...") }
- _SCREWS_TILT_CALCULATE_BASE
- [tmc2240 stepper_x]
- driver_SLOPE_CONTROL:2 #keeps drivers much cooler, commented out by default
- [tmc2240 stepper_y]
- driver_SLOPE_CONTROL:2 #keeps drivers much cooler, commented out by default
- [controller_fan chamber_fan]
- shutdown_speed: 1 #keep fan running to cool chamber heater if klipper crashes
- #__________________________________________________MACROS___________________________________________________
- #_____Stock macro overrides; delete these to go back to stock versions or make modifications here:_____
- # [gcode_macro CANCEL_PRINT]#adds smart plug shut off
- # rename_existing: BASE_CANCEL_PRINT
- # gcode:
- # {% if "xyz" in printer.toolhead.homed_axes %}
- # M204 S10000
- # G90
- # {% if (printer.gcode_move.position.z) < 100 %}
- # G1 Z100 F600
- # {% endif %}
- # {% if (printer.gcode_move.position.y) > printer['gcode_macro PRINTER_PARAM'].max_y_position %}
- # G1 Y{printer['gcode_macro PRINTER_PARAM'].max_y_position - 50} F6000
- # {% endif %}
- # G1 X265 Y5 F7800
- # {% endif %}
- # {% if printer.save_variables.variables.box_count >= 1 and printer.save_variables.variables.enable_box == 1 and printer["box_extras"]%}
- # BUFFER_MONITORING ENABLE=0
- # {% endif %}
- # M400
- # save_zoffset
- # SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
- # M106 P2 S0
- # M106 P0 S0
- # M106 P3 S0
- # M106 P4 S0 # 关闭空调
- # M104 S0
- # M140 S0
- # M141 S0
- # DISABLE_BOX_HEATER
- # M220 S100
- # M221 S100
- # M84
- # DISABLE_ALL_SENSOR
- # SET_GCODE_OFFSET Z=0 MOVE=0
- # BED_MESH_CLEAR
- # G31
- # BEEP I=2 DUR=500
- # BASE_CANCEL_PRINT
- # CLEAR_LAST_FILE
- # M118 Canceled print!
- # M118 Turn off hood in 5 minutes
- # UPDATE_DELAYED_GCODE ID=DELAYED_HOOD_OFF DURATION=300
- [gcode_macro RESUME_PRINT]#fixed a problem that caused layer shifts sometimes
- variable_zhop: 0
- variable_etemp: 0
- variable_efan: 0
- variable_echambertemp: 0
- gcode:
- {% set e = params.E|default(30)|int %}
- {% set tool_change = params.TOOL_CHANGE|default(0)|int %}
- {% if printer['pause_resume'].is_paused|int == 1 %}
- {% if printer.save_variables.variables.box_count >= 1 and printer.save_variables.variables.enable_box == 1 and printer.save_variables.variables.is_tool_change == 1 and printer["box_extras"]%}
- SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
- MOVE_TO_TRASH
- {% if etemp > 0 %}
- M109 S{etemp|int}
- {% endif %}
- M83
- G1 Y265 F10000 #move straight out of trash chute without causing layer shift
- RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=200
- RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=15
- BASE_RESUME
- {% else %}
- SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
- {% if etemp > 0 %}
- M109 S{etemp|int}
- {% endif %}
- {% if printer.save_variables.variables.box_count >= 1 and printer["box_extras"] %}
- SAVE_VARIABLE VARIABLE=retry_step VALUE=None
- {% endif %}
- M83
- M106 S{efan}
- {% if echambertemp > 0 %}
- M141 S{echambertemp|int}
- {% endif %}
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F9000
- G1 Y{printer['gcode_macro PRINTER_PARAM'].clear_y_position} F9000
- {% if printer.extruder.can_extrude %}
- G91
- G1 E{e} F300
- G90
- {% endif %}
- {% if printer.save_variables.variables.box_count >= 1 and printer.save_variables.variables.enable_box == 1 %}
- BUFFER_MONITORING ENABLE=1
- {% endif %}
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 Y{printer['gcode_macro PRINTER_PARAM'].clear_y_position - 50} F9000
- G1 Y265 F10000 #move straight out of trash chute without causing layer shift
- RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=200
- RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=15
- BASE_RESUME
- {% if tool_change == 0 %}
- ENABLE_ALL_SENSOR
- {% endif %}
- {% endif %}
- {% endif %}
- [gcode_macro M603]#unload filament; made it waste less time, only home XY, and made the heating/cooling minimal
- description: filament unlode
- gcode:
- DISABLE_ALL_SENSOR
- {% set hotendtemp = params.S|default(250)|int %}#this seems to always set to 250 no matter what but I'm leaving it
- {% if printer.extruder.temperature < 200 %} #heat nozzle to 200 if it's too cold to operate extruder
- {% set hotendtemp = 200|int %}
- {% endif %}
- M104 S{hotendtemp}
- {% if "xy" not in printer.toolhead.homed_axes %}#home XY if not homed already
- G28 X Y
- {% endif %}
- G92 E0
- {% if printer.save_variables.variables.box_count > 0 and printer["box_extras"]%}
- E_UNLOAD SLOT=16
- {% else %}
- CUT_FILAMENT_1
- M118 Cut filament
- MOVE_TO_TRASH
- M109 S{hotendtemp}
- M118 Heat up complete
- M118 Retracting
- G1 E-60 F300 #退料60mm
- {% endif %}
- M104 S0
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position + 20} F15000
- G1 X{printer['gcode_macro PRINTER_PARAM'].clear_x_position} F5000
- M106 S0
- M400
- M118 Unload finish
- [gcode_macro PRINT_START]#much faster print start with toggleable waits
- gcode:
- DISABLE_ALL_SENSOR
- CLEAR_PAUSE
- {% set vars = printer['gcode_macro END_Vars'] %}
- {% set bedtemp = params.get('BED') | int %}
- {% set hotendtemp = params.get('HOTEND') | int %}
- {% set chambertemp = params.get('CHAMBER', 0) | int %}
- {% set extruder = params.EXTRUDER|default(0)|int %}
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=printing VALUE=True
- M118 Heat hotend to 140C
- M104 S140
- M118 Heat bed to {bedtemp}C
- M140 S{bedtemp}
- M118 Heat chamber to {chambertemp}C
- M141 S{chambertemp}
- SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=0
- M118 Exhaust fan stopped
- {% if chambertemp == 0 %}
- M106 P3 S255
- {% endif %}
- ;HOOD_ON #power ventilation hood
- M118 Homing...
- G28
- SET_GCODE_OFFSET Z=0 MOVE=0
- BUFFER_MONITORING ENABLE=0
- {% if printer.save_variables.variables.box_count >= 1 and printer["box_extras"] %}
- SAVE_VARIABLE VARIABLE=load_retry_num VALUE=0
- SAVE_VARIABLE VARIABLE=retry_step VALUE=None
- CLEAR_TOOLCHANGE_STATE
- {% for i in range(16) %}
- SAVE_VARIABLE VARIABLE=runout_{i} VALUE=0
- G4 P100
- {% endfor %}
- {% if printer.save_variables.variables.enable_box == 1 %}
- BOX_PRINT_START EXTRUDER={extruder} HOTENDTEMP={hotendtemp}
- M400
- EXTRUSION_AND_FLUSH HOTEND={hotendtemp}
- {% endif %}
- {% endif %}
- M118 Clear nozzle
- CLEAR_NOZZLE HOTEND={hotendtemp}
- {% if vars.heat_soak_bed == True %}
- M118 Wait for bed to heat up for soaking
- M190 S{bedtemp}
- M118 Wait for chamber to heat up for soaking
- M191 S{chambertemp}
- M118 Wait 20 minutes to heat soak #10 #30
- G4 P1200000 #P600000 #P1800000
- {% else %}
- M118 Skip heat soaking
- {% endif %}
- M118 Z tilt
- Z_TILT_ADJUST
- M400
- ;SET_GCODE_OFFSET Z=0 MOVE=0
- M118 Wait for bed to heat up
- M190 S{bedtemp}
- M118 re-home Z #someone told me it's best practice to re-home Z after adjusting Z tilt
- G28 Z #home Z
- M118 Mesh probing...
- BED_MESH_CALIBRATE
- G0 Z50 F600
- G0 X260 Y5 F6000
- {% if printer.save_variables.variables.box_count >= 1 and printer["box_extras"] and printer.save_variables.variables.enable_box == 1 %}
- BUFFER_MONITORING ENABLE=1
- {% endif %}
- {% if vars.heatup_chamber == True %}
- M118 Wait for chamber to heat up
- M191 S{chambertemp}
- {% else %}
- M118 Skip waiting for chamber to heat up
- {% endif %}
- M118 Heat hotend to {hotendtemp}C
- M104 S{hotendtemp}
- M118 Wait for hotend to heat up
- M109 S{hotendtemp}
- M204 S10000
- set_zoffset
- ENABLE_ALL_SENSOR
- save_last_file
- M118 SKEW_PROFILE LOAD=calilantern_skew_profile
- #center toolhead
- G1 Y135 F6000
- G1 X135 F6000
- SKEW_PROFILE LOAD=calilantern_skew_profile
- M118 Start printing
- [homing_override]#randomizes location of Z homing to reduce wear on plate
- axes:xyz
- gcode:
- {% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %} #
- {% set z_hop_speed = (printer.configfile.settings['stepper_z'].homing_speed * 60) | float %} #
- {% set travel_speed = (printer.toolhead.max_velocity * 60 / 2) | float %} #cut travel speed in half
- {% set sensorless_variables = printer["gcode_macro _Sensorless_Homing_Variables"] %} #
- {% set z_hop_distance = sensorless_variables.z_hop_distance | float %} # Collect all variables needed for sensorless homing
- {% set first_homed_axis = sensorless_variables.first_homed_axis | string %} # from machine config file and _Sensorless_Homing_Variables
- {% set safe_x = sensorless_variables.safe_x | float %} #
- {% set safe_y = sensorless_variables.safe_y | float %} #
- {% set safe_z = sensorless_variables.safe_z_enable | abs %} #
- {% set chamber = printer["heater_generic chamber"].target|int %}
- #
- {% if safe_x == -128 %} #
- {% set safe_x = (printer.configfile.settings.stepper_x.position_max) /2 %} # If safe_x is '-128', set safe_x to the center of the X axis
- {% endif %} #
- #
- {% if safe_y == -128 %} #
- {% set safe_y = (printer.configfile.settings.stepper_y.position_max) /2 %} # If safe_y is '-128', set safe_y to the center of the Y axis
- {% endif %} #
- #
- {% if z_hop_distance > 0 %} # Check if z_hop_distance is greater than zero
- {% if 'x' not in printer.toolhead.homed_axes and 'y' not in printer.toolhead.homed_axes %} # If X and Y are not homed, move Z to z_hop_distance
- SET_KINEMATIC_POSITION Z=0
- G0 Z{z_hop_distance} F{z_hop_speed} #
- {% endif %} #
- {% endif %} #
- {% if first_homed_axis == 'X' %} # If first_homed_axis is 'X', begin G28 param check
- {% if home_all or 'X' in params %} #
- _HOME_X # If home_all or 'X' is in params, home X
- {% endif %} #
- {% if home_all or 'Y' in params %} # If home_all or 'Y' in params, home Y
- _HOME_Y #
- {% endif %} #
- {% endif %} #
- {% if first_homed_axis == 'Y' %} # If first_homed_axis is 'Y', begin G28 param check
- {% if home_all or 'Y' in params %} #
- _HOME_Y # if home_all or 'Y' is in params, home Y
- {% endif %} #
- {% if home_all or 'X' in params %} # If home_all or 'X' in params, home X
- _HOME_X #
- {% endif %} #
- {% endif %} #
- {% if safe_z == 1 and (('Z' in params) or home_all) and ('Z' not in printer.toolhead.homed_axes) %} # If safe_z is enabled, Z is to be homed, and Z is not homed
- {% if (printer.toolhead.position.z|float < 10) %}
- SET_KINEMATIC_POSITION Z=0
- G1 Z{z_hop_distance} F{z_hop_speed}
- {% endif %}
- G0 X{safe_x} Y{safe_y} F{travel_speed} # Move to safe XY position at travel speed
- {% endif %} #
- {% if home_all or 'Z' in params %}
- G90
- {% if printer.extruder.temperature > 145 %} #don't heat nozzle if it's cold
- M106 S255 #Turn on part cooling fan to help cooldown nozzle
- M109 S140 #cooldown nozzle to 140c, prevents any filament from sticking to bed
- {% endif %}
- M106 S0 #Turn off part cooling fan, maybe helps remove noise from load cell
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET=0 #Turn off chamber heater, maybe helps reduce electrical noise from load cell
- SET_GCODE_OFFSET Z=0 MOVE=0
- {% set base_x = printer['gcode_macro PRINTER_PARAM'].max_x_position/2 | float %} #Randomize probe point
- {% set base_y = printer['gcode_macro PRINTER_PARAM'].max_y_position/2 | float %}
- {% set safe_x = range((base_x - 10)|int, (base_x + 10)|int + 1) | random %}
- {% set safe_y = range((base_y - 10)|int, (base_y + 10)|int + 1) | random %}
- G0 X{safe_x} Y{safe_y} F7800
- G28 Z
- G1 Z20 F2000
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET={chamber} #Restore chamber heater
- {% endif %}
- [gcode_macro PRINT_END]#triggers slow cooldown macros if enabled, clears skew, and renders timelapse
- gcode:
- {% set vars = printer['gcode_macro END_Vars'] %}
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=printing VALUE=False
- {% if vars.skip_print_end == False %}
- SET_SKEW CLEAR=1 #clear skew
- M400
- save_zoffset
- SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
- CLEAR_PAUSE
- M106 P2 S0
- M106 P0 S0
- M106 P3 S0
- DISABLE_BOX_HEATER
- M104 S0
- M140 S0
- M141 S0
- M220 S100
- M221 S100
- M84
- DISABLE_ALL_SENSOR
- BED_MESH_CLEAR
- G31
- CLEAR_LAST_FILE
- BEEP I=2 DUR=500
- SDCARD_RESET_FILE
- {% if vars.cooldown_bed == True %}
- Cooldown_Bed
- {% else %}
- # M118 Turn off hood in 5 minutes
- # UPDATE_DELAYED_GCODE ID=DELAYED_HOOD_OFF DURATION=300
- M118 Bed cooling disabled
- M118 Rendering timelapse...
- TIMELAPSE_RENDER
- {% endif %}
- {% else %}
- CLEAR_LAST_FILE
- SDCARD_RESET_FILE
- {% endif %}
- [gcode_macro CLEAR_NOZZLE]#extrudes 20mm of filament instead of default 80mm
- gcode:
- {% set hotendtemp = params.HOTEND|default(250)|int %}
- MOVE_TO_TRASH
- M400
- M109 S{hotendtemp}
- G92 E0
- G1 E5 F80
- G92 E0
- G1 E20 F300 #default E80
- G92 E0
- G1 E-2 F200
- M400
- M106 S255
- G4 P1000
- M104 S140
- TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={hotendtemp-30}
- M204 S5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X114 F5000
- G1 X100 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X103 F5000
- G1 X90 F5000
- G1 X125 F15000
- G1 X130 Y280 F6000
- G1 Z-0.2 F600
- TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=150
- M106 S255
- G2 I0.5 J0.5 F600
- G2 I0.5 J0.5 F600
- G2 I0.5 J0.5 F600
- G1 X140 F200
- G1 Y281 F200
- G1 X130 F200
- G1 Y283 F200
- G1 X140 F200
- G2 I0.5 J0.5 F600
- G2 I0.5 J0.5 F600
- G2 I0.5 J0.5 F600
- G1 Z0.2
- G1 X180 F12000
- G1 Z-1.5
- G1 X164 F12000
- G1 X180 F12000
- G1 X164 F12000
- G1 X180 F12000
- G1 X164 F12000
- G1 X180 F12000
- G1 X164 F12000
- M400
- M118 Nozzle cleared
- G1 Z30 F900
- G1 Y10 F18000
- G1 X260 F18000
- M106 S0
- #_____Custom macros:_____
- # [gcode_macro TEST_PLUG_OFF]
- # gcode:
- # RUN_SHELL_COMMAND CMD=shell_test_plug_off
- # #{action_call_remote_method(
- # # "set_device_power", device="test_plug", state="off"
- # #)}
- # [gcode_macro TEST_PLUG_ON]
- # gcode:
- # RUN_SHELL_COMMAND CMD=shell_test_plug_on
- # #{action_call_remote_method(
- # # "set_device_power", device="test_plug", state="on"
- # #)}
- # [gcode_macro HOOD_OFF]
- # gcode:
- # RUN_SHELL_COMMAND CMD=shell_hood_plug_off
- # M118 Hood turned off
- # #{action_call_remote_method(
- # # "set_device_power", device="hood_plug", state="off"
- # #)}
- # [gcode_macro HOOD_ON]
- # gcode:
- # RUN_SHELL_COMMAND CMD=shell_hood_plug_on
- # M118 Hood turned on
- # #{action_call_remote_method(
- # # "set_device_power", device="hood_plug", state="on"
- # #)}
- # [delayed_gcode DELAYED_HOOD_OFF]
- # gcode:
- # {% set vars = printer['gcode_macro END_Vars'] %}
- # {% if vars.printing == False %}
- # HOOD_OFF
- # {% else %}
- # M118 Leaving hood on because print in progress
- # {% endif %}
- # [gcode_shell_command shell_test_plug_on]
- # command: /home/mks/.local/bin/kasa --type plug --host 192.168.88.44 on
- # timeout: 30.
- # verbose: True
- # [gcode_shell_command shell_test_plug_off]
- # command: /home/mks/.local/bin/kasa --type plug --host 192.168.88.44 off
- # timeout: 30.
- # verbose: True
- # [gcode_shell_command shell_hood_plug_on]
- # command: /home/mks/.local/bin/kasa --type plug --host 192.168.88.31 on
- # timeout: 30.
- # verbose: True
- # [gcode_shell_command shell_hood_plug_off]
- # command: /home/mks/.local/bin/kasa --type plug --host 192.168.88.31 off
- # timeout: 30.
- # verbose: True
- [gcode_macro spread_lube_XY]
- gcode:
- {% set i = 10 %} #set toolhead movement cycles to 10
- G28 X Y #home XY
- G90 #absolute coords
- M204 S5000 #5k accels
- G1 X135 Y135 F10000 #move to center
- {% for _ in range(i) %} #sweep X i times
- G1 X0 F10000
- G1 X270 F10000
- {% endfor %}
- G1 X165 F10000 #move X to middle of trash chute wall cutout
- {% for _ in range(i) %} #sweep Y i times
- G1 Y287.5 F10000
- G1 Y0 F10000
- {% endfor %}
- G1 X135 Y135 F10000 #return to center
- [gcode_macro _Sensorless_Homing_Variables]#needed for custom homing_override to function
- description: Variables for sensorless homing
- variable_z_hop_distance: 10 # Distance to move Z axis prior to homing, and after homing.
- variable_first_homed_axis: 'Y' # First axis to home when 'G28' is called. Some prefer homing Y before X.
- ## The following variables are used for moving the printhead to a certain part of the bed before homing the Z axis:
- variable_safe_z_enable: True # Enables/disables moving the printhead before homing the Z axis.
- variable_safe_x: -128 # Safe X position to home the Z axis, leave at -128 to home to the center of the X axis.
- variable_safe_y: -128 # Safe Y position to home the Z axis, leave at -128 to home to the center of the Y axis.
- # Do not modify below
- gcode:
- [gcode_macro END_Vars] #once upon a time these were all related to print_end
- variable_cooldown_chamber: True #this is only ever triggered at the end of cooldown_bed so it's fine to be enabled if cooldown_bed is disabled
- variable_cooldown_bed: False
- variable_heatup_chamber: False
- variable_heat_soak_bed: False
- variable_skip_print_end: False
- variable_printing: False
- gcode:
- #including the next 8 macros as buttons in fluidd's web UI is convenient
- [gcode_macro ENABLE_SKIP_PRINT_END]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=skip_print_end VALUE=True
- M118 will skip PRINT_END
- [gcode_macro DISABLE_SKIP_PRINT_END]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=skip_print_end VALUE=False
- M118 will NOT skip PRINT_END
- [gcode_macro DISABLE_BED_COOLDOWN]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=cooldown_bed VALUE=False
- M118 bed cooldown disabled
- [gcode_macro ENABLE_BED_COOLDOWN]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=cooldown_bed VALUE=True
- M118 bed cooldown enabled
- [gcode_macro DISABLE_CHAMBER_COOLDOWN]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=cooldown_chamber VALUE=False
- M118 chamber cooldown disabled
- [gcode_macro ENABLE_CHAMBER_COOLDOWN]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=cooldown_chamber VALUE=True
- M118 chamber cooldown enabled
- [gcode_macro DISABLE_WAIT_FOR_CHAMBER_HEAT]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=heatup_chamber VALUE=False
- M118 chamber heat waiting disabled
- [gcode_macro ENABLE_WAIT_FOR_CHAMBER_HEAT]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=heatup_chamber VALUE=True
- M118 chamber heat waiting enabled
- [gcode_macro ENABLE_HEAT_SOAK] #heat soak bed for 10 minutes during print_start
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=heat_soak_bed VALUE=True
- M118 bed heat soaking enabled
- [gcode_macro DISABLE_HEAT_SOAK]
- gcode:
- SET_GCODE_VARIABLE MACRO=END_Vars VARIABLE=heat_soak_bed VALUE=False
- M118 bed heat soaking disabled
- [gcode_macro Cooldown_Bed]
- gcode:
- {% set vars = printer['gcode_macro END_Vars'] %}
- {% if printer.heater_bed.temperature > 70 and vars.cooldown_bed == True %} #If the bed temp is above this number, do cooldown, if bed temp is less than this don't cooldown.
- M118 Maintain chamber temperature at ({printer['heater_generic chamber'].temperature}C�).
- M118 Start gradual bed cooling ({printer.heater_bed.temperature}C�).
- M118 Reduce bed temp to ({printer.heater_bed.temperature - 2|int }C�).
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET={printer['heater_generic chamber'].temperature}
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={printer.heater_bed.temperature - 2|int}
- SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=0.03 #chamber exhaust fan.
- UPDATE_DELAYED_GCODE ID=gradual_cooldown_bed DURATION=120 #How long to wait in seconds to run the loop
- {% else %}
- M118 Gradual bed cooling unnecesary ({printer.heater_bed.temperature}C�).
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=0 ; turn off bed
- Cooldown_Chamber#necessary in order to trigger timelapse render
- {% endif %}
- [delayed_gcode gradual_cooldown_bed]
- gcode:
- {% set vars = printer['gcode_macro END_Vars'] %}
- {% if printer.heater_bed.temperature > 70 and vars.cooldown_bed == True %} #If bed temp is above this number, run loop and continue cooldown. If it's less than this number cooldown will end.
- M118 Reduce bed temp to ({printer.heater_bed.temperature - 2|int }C�).
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={printer.heater_bed.temperature - 2|int}
- UPDATE_DELAYED_GCODE ID=gradual_cooldown_bed DURATION=120
- {% else %}
- M118 Gradual bed cooling finished or disabled ({printer.heater_bed.temperature}C�).
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=0 ; turn off bed
- SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=0.0
- Cooldown_Chamber#necessary in order to trigger timelapse render
- {% endif %}
- [gcode_macro Cooldown_Chamber]
- gcode:
- {% set vars = printer['gcode_macro END_Vars'] %}
- {% if printer['heater_generic chamber'].temperature > 45 and vars.cooldown_chamber == True %}
- M118 Start gradual chamber cooling ({printer['heater_generic chamber'].temperature}C�).
- M118 Reduce chamber temp to ({printer['heater_generic chamber'].temperature - 1|int }C�).
- SET_FAN_SPEED FAN=auxiliary_cooling_fan SPEED=0.08
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET={printer['heater_generic chamber'].temperature - 1|int}
- SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=0.03
- UPDATE_DELAYED_GCODE ID=gradual_cooldown_chamber DURATION=150
- {% else %}
- M118 No gradual chamber cooling necessary or cooling disabled ({printer['heater_generic chamber'].temperature}C�).
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET=0 ; turn off chamber heater
- # M118 Turn off hood in 5 minutes
- # UPDATE_DELAYED_GCODE ID=DELAYED_HOOD_OFF DURATION=300
- M118 Rendering timelapse...
- TIMELAPSE_RENDER#render must happen here because auto-render will crash klipper if heaters are on
- {% endif %}
- [delayed_gcode gradual_cooldown_chamber]
- gcode:
- {% set vars = printer['gcode_macro END_Vars'] %}
- {% if printer['heater_generic chamber'].temperature > 45 and vars.cooldown_chamber == True %}
- M118 Reduce chamber temp to ({printer['heater_generic chamber'].temperature - 1|int }C�).
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET={printer['heater_generic chamber'].temperature - 1|int}
- UPDATE_DELAYED_GCODE ID=gradual_cooldown_chamber DURATION=150
- {% else %}
- M118 Gradual chamber cooling finished or disabled ({printer['heater_generic chamber'].temperature}C�).
- SET_HEATER_TEMPERATURE HEATER=chamber TARGET=0 ; turn off chamber heater
- SET_FAN_SPEED FAN=auxiliary_cooling_fan SPEED=0
- SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=0.0
- # M118 Turn off hood in 5 minutes
- # UPDATE_DELAYED_GCODE ID=DELAYED_HOOD_OFF DURATION=300
- M118 Rendering timelapse...
- TIMELAPSE_RENDER#render must happen here because auto-render will crash klipper if heaters are on
- {% endif %}
- [gcode_macro BOX_TOGGLE] #weav added box enable/disable toggle
- gcode:
- {% if printer.save_variables.variables.box_count >= 1 %}
- {% if printer.save_variables.variables.enable_box == 0 %}
- SAVE_VARIABLE VARIABLE=enable_box VALUE=1
- {action_respond_info("Box is Enabled")}
- {% else %}
- SAVE_VARIABLE VARIABLE=enable_box VALUE=0
- {action_respond_info("Box is Disabled")}
- {% endif %}
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment