# Active mainboard: BigTreeTech Octopus family with STM32F407xx (PCB revision not confirmed). # Firmware profile: 32KiB factory SD bootloader, 8MHz crystal, USB on PA11/PA12. # Do not substitute the STM32F446/12MHz profile; runtime hardware was verified on 2026-09-06. # after running "make", copy the generated "klipper/out/klipper.bin" file to a # file named "firmware.bin" on an SD card and then restart the Octopus with that SD card. # See docs/Config_Reference.md for a description of parameters. ## Voron Design VORON2 250mm; BigTreeTech Octopus-family STM32F407; TMC2209 UART. ## *** THINGS TO CHANGE/CHECK: *** ## MCU paths [mcu] section ## Thermistor types [extruder] and [heater_bed] sections - See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types ## Hotend heater pin [extruder] section ## Z Endstop Switch location [safe_z_home] section ## Homing end position [gcode_macro G32] section ## Z Endstop Switch offset for Z0 [stepper_z] section ## Stepper Z1 enable pin [stepper_z1] section ## Probe points [quad_gantry_level] section ## Min & Max gantry corner postions [quad_gantry_level] section ## PID tune [extruder] and [heater_bed] sections ## Probe pin [probe] section ## Fine tune E steps [extruder] section [include stealthburner_leds.cfg] [include KAMP_Settings.cfg] #[include inputShaper.cfg] [include motorsCalibrate.cfg] [include cartographer.cfg] [include ebb36.cfg] [include homing.cfg] [exclude_object] [force_move] enable_force_move: true [mcu] ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify ##-------------------------------------------------------------------- serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2B0024001150304235343520-if00 restart_method: command ##-------------------------------------------------------------------- [printer] kinematics: corexy max_velocity: 750 max_accel: 12000 #Max 4000 max_z_velocity: 30 #Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 350 square_corner_velocity: 5.0 [input_shaper] #shaper_freq_x: 58.8 #shaper_type_x: mzv #shaper_freq_y: 52.6 #shaper_type_y: mzv ##################################################################### # X/Y Stepper Settings ##################################################################### ## B Stepper - Left ## Connected to MOTOR_0 ## Endstop connected to DIAG_0 [stepper_x] step_pin: PF13 dir_pin: PF12 enable_pin: !PF14 rotation_distance: 40 microsteps: 32 full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper endstop_pin: tmc2209_stepper_x:virtual_endstop position_min: 0 ##-------------------------------------------------------------------- ##Uncomment below for 250mm build position_endstop: 0 position_max: 254 ## Uncomment for 300mm build #position_endstop: 300 #position_max: 300 ## Uncomment for 350mm build #position_endstop: 350 #position_max: 350 ##-------------------------------------------------------------------- homing_speed: 80 #Max 100 homing_retract_dist: 0 homing_positive_dir: false ## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_x] diag_pin: ^PG6 uart_pin: PC4 interpolate: true run_current: 1.4 sense_resistor: 0.110 driver_SGTHRS: 150 ## A Stepper - Right ## Connected to MOTOR_1 ## Endstop connected to DIAG_1 [stepper_y] step_pin: PG0 dir_pin: PG1 enable_pin: !PF15 rotation_distance: 40 microsteps: 32 full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper endstop_pin: PG9 position_min: 0 ##-------------------------------------------------------------------- ## Uncomment for 250mm build position_endstop: 253 position_max: 253 ## Uncomment for 300mm build #position_endstop: 300 #position_max: 300 ## Uncomment for 350mm build #position_endstop: 350 #position_max: 350 ##-------------------------------------------------------------------- homing_speed: 100 #Max 100 homing_retract_dist: 0 homing_positive_dir: true ## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_y] uart_pin: PD11 interpolate: true run_current: 1.4 sense_resistor: 0.110 stealthchop_threshold: 0 ##################################################################### # Z Stepper Settings ##################################################################### ## Z0 Stepper - Front Left ## Connected to MOTOR_2 ## Endstop connected to DIAG_2 [stepper_z] step_pin: PF11 dir_pin: PG3 enable_pin: !PG5 rotation_distance: 40 gear_ratio: 80:16 microsteps: 32 endstop_pin: probe:z_virtual_endstop ## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0) ## (+) value = endstop above Z0, (-) value = endstop below ## Increasing position_endstop brings nozzle closer to the bed ## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config # position_endstop: -0.5 ##-------------------------------------------------------------------- ## Uncomment below for 250mm build position_max: 230 ## Uncomment below for 300mm build #position_max: 260 ## Uncomment below for 350mm build #position_max: 310 ##-------------------------------------------------------------------- position_min: -1 homing_speed: 100 second_homing_speed: 2 homing_retract_dist: 0 ## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z] uart_pin: PC6 interpolate: true run_current: 1.4 sense_resistor: 0.110 ## Z1 Stepper - Rear Left ## Connected to MOTOR_3 [stepper_z1] step_pin: PG4 dir_pin: !PC1 ## Octopus 1.0 & 1.1. Octopus PRO 1.0 enable_pin: !PA0 ## Octopus PRO 1.1 #enable_pin: !PA2 rotation_distance: 40 gear_ratio: 80:16 microsteps: 32 ## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z1] uart_pin: PC7 interpolate: true run_current: 1.4 sense_resistor: 0.110 ## Z2 Stepper - Rear Right ## Connected to MOTOR_4 [stepper_z2] step_pin: PF9 dir_pin: PF10 enable_pin: !PG2 rotation_distance: 40 gear_ratio: 80:16 microsteps: 32 ## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z2] uart_pin: PF2 interpolate: true run_current: 1.4 sense_resistor: 0.110 ## Z3 Stepper - Front Right ## Connected to MOTOR_5 [stepper_z3] step_pin: PC13 dir_pin: !PF0 enable_pin: !PF1 rotation_distance: 40 gear_ratio: 80:16 microsteps: 32 ## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z3] uart_pin: PE4 interpolate: true run_current:1.4 sense_resistor: 0.110 [filament_switch_sensor switch_sensor] switch_pin: ^PG12 pause_on_runout: True runout_gcode: PAUSE # [pause_resume] is required in printer.cfg M117 Filament switch runout insert_gcode: M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin: ^PG13 detection_length: 4.5 # accuracy of motion sensor 2.88mm extruder: extruder pause_on_runout: False runout_gcode: PAUSE # [pause_resume] is required in printer.cfg M117 Filament encoder runout insert_gcode: M117 Filament encoder inserted ##################################################################### # Bed Heater ##################################################################### ## SSR Pin - HE1 ## Thermistor - TB [heater_bed] ## Uncomment the following line if using the default SSR wiring from the docs site heater_pin: PA3 ## Other wiring guides may use BED_OUT to control the SSR. Uncomment the following line for those cases #heater_pin: PA1 ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types. ## Use "Generic 3950" for Keenovo heaters sensor_type: Generic 3950 sensor_pin: PF3 ## Adjust max_power so it doesn't exceed the SSR rating. The Omron G3NA-210B-DC5 SSR is rated at 4 amps without a heatsink. ## The formula is "4 / (Wattage_of_bed_heater / Mains_voltage) = max_power" ## If max_power is greater than 1.0, use 1.0 max_power: 0.8 min_temp: 0 max_temp: 120 control: pid pid_kp: 58.437 pid_ki: 2.347 pid_kd: 363.769 [bed_mesh] zero_reference_position: 125, 125 # center of your bed speed: 400 horizontal_move_z: 5 mesh_min: 35, 30 mesh_max: 215, 200 probe_count: 30,30 algorithm: bicubic adaptive_margin: 5 ##################################################################### # Fan Control ##################################################################### ## Print Cooling Fan - FAN0 # [fan] # pin: PA8 # kick_start_time: 0.5 # ## Depending on your fan, you may need to increase this value # ## if your fan will not start. Can change cycle_time (increase) # ## if your fan is not able to slow down effectively # off_below: 0.10 ## Hotend Fan - FAN1 # [heater_fan hotend_fan] # pin: PE5 # max_power: 1.0 # kick_start_time: 0.5 # heater: extruder # heater_temp: 50.0 ## If you are experiencing back flow, you can reduce fan_speed #fan_speed: 1.0 ## Controller fan - FAN2 [controller_fan controller_fan_1] pin: PD12 kick_start_time: 0.5 idle_speed: 0.6 max_power: 1 heater: heater_bed [fan_generic front] pin: PE5 [temperature_fan ebb36_fan] pin: PD14 sensor_type: temperature_mcu sensor_mcu: EBBCan control: pid pid_Kp: 2.0 pid_Ki: 5.0 pid_Kd: 0.5 pid_deriv_time: 2.0 # target_temp: 50.0 min_temp: 0.0 max_temp: 90.0 min_speed: 0.0 max_speed: 1.0 kick_start_time: 0.1 cycle_time: 0.001 shutdown_speed: 0.0 gcode_id: C [temperature_sensor raspberry_pi] sensor_type: temperature_host max_temp: 100 [temperature_sensor mcu_temp] sensor_type: temperature_mcu max_temp: 100 [fan_generic nevermore] ## Nevermore - FAN5 on Octopus ## Adjust if you use a different board or a different terminal. pin: PD13 ##################################################################### # Homing and Gantry Adjustment Routines ##################################################################### [idle_timeout] timeout: 1800 # [safe_z_home] # ## XY Location of the Z Endstop Switch # ## Update -10,-10 to the XY coordinates of your endstop pin # ## (such as 157,305) after going through Z Endstop Pin # ## Location Definition step. # home_xy_position: 125, 125 # speed:100 # z_hop:10 # Use QUAD_GANTRY_LEVEL to level a gantry. # Min & Max gantry corners - measure from nozzle at MIN (0,0) and # MAX (250, 250), (300,300), or (350,350) depending on your printer size # to respective belt positions [quad_gantry_level] #-------------------------------------------------------------------- ## Gantry Corners for 250mm Build ## Uncomment for 250mm build gantry_corners: -60,-10 310, 320 ## Probe points points: 50,25 50,210 220,210 220,25 ## Gantry Corners for 300mm Build ## Uncomment for 300mm build #gantry_corners: # -60,-10 # 360,370 ## Probe points #points: # 50,25 # 50,225 # 250,225 # 250,25 ## Gantry Corners for 350mm Build ## Uncomment for 350mm build #gantry_corners: # -60,-10 # 410,420 ## Probe points #points: # 50,25 # 50,275 # 300,275 # 300,25 #-------------------------------------------------------------------- speed: 300 horizontal_move_z: 10 retries: 5 retry_tolerance: 0.0075 max_adjust: 10 ######################################## # EXP1 / EXP2 (display) pins ######################################## [board_pins] aliases: # EXP1 header EXP1_1=PE8, EXP1_2=PE7, EXP1_3=PE9, EXP1_4=PE10, EXP1_5=PE12, EXP1_6=PE13, # Slot in the socket on this side EXP1_7=PE14, EXP1_8=PE15, EXP1_9=, EXP1_10=<5V>, # EXP2 header EXP2_1=PA6, EXP2_2=PA5, EXP2_3=PB1, EXP2_4=PA4, EXP2_5=PB2, EXP2_6=PA7, # Slot in the socket on this side EXP2_7=PC15, EXP2_8=, EXP2_9=, EXP2_10=<5V> ##################################################################### # Displays ##################################################################### ## Uncomment the display that you have #-------------------------------------------------------------------- ## RepRapDiscount 128x64 Full Graphic Smart Controller #[display] #lcd_type: st7920 #cs_pin: EXP1_4 #sclk_pin: EXP1_5 #sid_pin: EXP1_3 #menu_timeout: 40 #encoder_pins: ^EXP2_5, ^EXP2_3 #click_pin: ^!EXP1_2 #[output_pin beeper] #pin: EXP1_1 #-------------------------------------------------------------------- ## mini12864 LCD Display #[display] #lcd_type: uc1701 #cs_pin: EXP1_3 #a0_pin: EXP1_4 #rst_pin: EXP1_5 #encoder_pins: ^EXP2_5, ^EXP2_3 #click_pin: ^!EXP1_2 #contrast: 63 #spi_software_miso_pin: EXP2_1 #spi_software_mosi_pin: EXP2_6 #spi_software_sclk_pin: EXP2_2 ## To control Neopixel RGB in mini12864 display #[neopixel btt_mini12864] #pin: EXP1_6 #chain_count: 3 #initial_RED: 0.1 #initial_GREEN: 0.5 #initial_BLUE: 0.0 #color_order: RGB ## Set RGB values on boot up for each Neopixel. ## Index 1 = display, Index 2 and 3 = Knob #[delayed_gcode setdisplayneopixel] #initial_duration: 1 #gcode: # SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0 # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0 # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3 #-------------------------------------------------------------------- [virtual_sdcard] path: ~/printer_data/gcodes [display_status] [pause_resume] ##################################################################### # Macros ##################################################################### [gcode_macro LOAD_FILAMENT] variable_load_distance: 50 variable_purge_distance: 25 gcode: {% set speed = params.SPEED|default(300) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} # fast-load G1 E{purge_distance} F{speed} # purge RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance: 50 variable_purge_distance: 25 gcode: {% set speed = params.SPEED|default(300) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} # purge G1 E-{unload_distance} F{max_velocity} # fast-unload RESTORE_GCODE_STATE NAME=unload_state [gcode_macro start_heating] description: Home, lift the toolhead, then manually preheat; use STOP_HEATING to finish gcode: {% set bed = params.BED|default(115)|float %} {% set hotend = params.HOTEND|default(50)|float %} {% set lift = params.LIFT|default(50)|float %} {% set front = params.FRONT|default(0.55)|float %} {% set filter = params.FILTER|default(1.0)|float %} {% set part = params.PART|default(0.31)|float %} {% set timeout = params.TIMEOUT|default(printer.configfile.settings.idle_timeout.timeout)|int %} {% set bed_max = printer.configfile.settings.heater_bed.max_temp|float %} {% set hotend_max = printer.configfile.settings.extruder.max_temp|float %} {% set print_state = printer.print_stats.state|string|lower %} {% if print_state in ["printing", "paused"] %} { action_raise_error("START_HEATING is only for manual preheat while no print is active") } {% elif bed < 0 or bed >= bed_max %} { action_raise_error("BED must be at least 0 and below %.0f C" % (bed_max)) } {% elif hotend < 0 or hotend >= hotend_max %} { action_raise_error("HOTEND must be at least 0 and below %.0f C" % (hotend_max)) } {% elif lift < printer.toolhead.axis_minimum.z|float or lift > printer.toolhead.axis_maximum.z|float %} { action_raise_error("LIFT is outside the configured Z travel") } {% elif front < 0 or front > 1 or filter < 0 or filter > 1 or part < 0 or part > 1 %} { action_raise_error("FRONT, FILTER and PART must be between 0.0 and 1.0") } {% elif timeout < 300 or timeout > 7200 %} { action_raise_error("TIMEOUT must be between 300 and 7200 seconds") } {% else %} SAVE_GCODE_STATE NAME=START_HEATING_STATE STATUS_HOMING {% if "xyz" not in printer.toolhead.homed_axes %} G28 {% endif %} G90 G0 Z{lift} F900 STATUS_HEATING SET_IDLE_TIMEOUT TIMEOUT={timeout} SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bed} SET_HEATER_TEMPERATURE HEATER=extruder TARGET={hotend} SET_FAN_SPEED FAN=nevermore SPEED={filter} SET_FAN_SPEED FAN=front SPEED={front} M106 S{(part * 255)|int} RESTORE_GCODE_STATE NAME=START_HEATING_STATE MOVE=0 { action_respond_info("Manual preheat: Z %.1f mm, bed %.0f C, hotend %.0f C, timeout %d min. No chamber sensor is configured." % (lift, bed, hotend, timeout // 60)) } {% endif %} [gcode_macro STOP_HEATING] description: Stop manual preheat and restore the configured idle timeout gcode: {% set print_state = printer.print_stats.state|string|lower %} {% if print_state in ["printing", "paused"] %} { action_raise_error("STOP_HEATING is only for manual preheat; use print controls during a print") } {% else %} TURN_OFF_HEATERS SET_FAN_SPEED FAN=nevermore SPEED=0 SET_FAN_SPEED FAN=front SPEED=0 M107 SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout|int} STATUS_READY { action_respond_info("Manual preheat stopped; heaters and preheat fans are off") } {% endif %} [gcode_macro nvmOn] gcode: SET_FAN_SPEED FAN=nevermore SPEED=1 [gcode_macro nvmOff] gcode: SET_FAN_SPEED FAN=nevermore SPEED=0 [gcode_macro PARK] gcode: {% set th = printer.toolhead %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y//2} Z30 [gcode_macro G32] gcode: SAVE_GCODE_STATE NAME=STATE_G32 G90 G28 QUAD_GANTRY_LEVEL G28 PARK RESTORE_GCODE_STATE NAME=STATE_G32 [gcode_macro PRINT_START] # Use PRINT_START for the slicer starting script - please customise for your slicer of choice gcode: # Parameters {% set bedtemp = params.BED|int %} {% set hotendtemp = params.EXTRUDER|int %} {% set chambertemp = params.CHAMBER|default(0)|int %} # Start every print from absolute positioning and no stale babystep offset. G90 SET_GCODE_OFFSET Z=0 SET_FAN_SPEED FAN=front SPEED=0.55 STATUS_HOMING G28 # Soften residue while the bed heats; Touch is limited to at most 150 C. M104 S150 STATUS_HEATING M190 S{bedtemp} ; wait for bed temp {% if bedtemp > 95 %} nvmOn #TEMPERATURE_WAIT SENSOR="temperature_fan chamber" MINIMUM={chambertemp} ; wait for chamber temp {% endif %} STATUS_MESHING QUAD_GANTRY_LEVEL M109 S150 CLEAN_NOZZLE CARTOGRAPHER_TOUCH_HOME # Touch establishes the true Z origin before the fresh per-print scan mesh. BED_MESH_CALIBRATE M109 S{hotendtemp} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} ; move nozzle away from bed #LINE_PURGE [gcode_macro PRINT_END] # Use PRINT_END for the slicer ending script - please customise for your slicer of choice gcode: # safe anti-stringing move coords {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} SAVE_GCODE_STATE NAME=STATE_PRINT_END M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-8.0 F1800 ; retract filament # STATUS_CLEANING # clean_nozzle TURN_OFF_HEATERS nvmOff SET_FAN_SPEED FAN=front SPEED=0 G90 ; absolute positioning G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear M107 ; turn off fan BED_MESH_CLEAR # The purpose of the SAVE_GCODE_STATE/RESTORE_GCODE_STATE # command pair is to restore the printer's coordinate system # and speed settings since the commands above change them. # However, to prevent any accidental, unintentional toolhead # moves when restoring the state, explicitly set MOVE=0. RESTORE_GCODE_STATE NAME=STATE_PRINT_END MOVE=0 # Home, get position, throw around toolhead, home again. # If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. # We only measure to a full step to accomodate for endstop variance. # Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 [gcode_macro TEST_SPEED] description: Motion test; blocked until homing and sensorless X are physically validated gcode: # Speed {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} # Iterations {% set iterations = params.ITERATIONS|default(5)|int %} # Acceleration {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} # Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions) {% set bound = params.BOUND|default(20)|int %} # Size for small pattern box {% set smallpatternsize = params.SMALLPATTERNSIZE|default(20)|int %} # Large pattern # Max positions, inset by BOUND {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} # Small pattern at center # Find X/Y center point {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} # Set small pattern box around center point {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} # Save current gcode state (absolute/relative, etc) SAVE_GCODE_STATE NAME=TEST_SPEED # Output parameters to g-code terminal { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } # Home and get position for comparison later: M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 G28 # QGL if not already QGLd (only if QGL section exists in config) {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION # Go to starting position G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} # Set new limits SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} MINIMUM_CRUISE_RATIO=0.5 {% for i in range(iterations) %} # Large pattern diagonals G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} # Large pattern box G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} # Small pattern diagonals G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} # Small patternbox G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} # Restore max speed/accel/minimum_cruise_ratio to their configured values SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} MINIMUM_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio} # Re-home and get position again for comparison: M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 # Go to XY home positions (in case your homing override leaves it elsewhere) G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION # Restore previous gcode state (absolute/relative, etc) RESTORE_GCODE_STATE NAME=TEST_SPEED # Unsafe experimental CLEAN_NOZZLE_TEST was removed. The physical brush # positions in CLEAN_NOZZLE still require operator validation before use. [gcode_macro CLEAN_NOZZLE] variable_start_x: 110 variable_start_y: 250.5 variable_start_z: 0.3 variable_wipe_dist: -45 variable_wipe_qty: 10 variable_wipe_spd: 400 variable_raise_distance: 15 gcode: {% if "xyz" not in printer.toolhead.homed_axes %} G28 {% endif %} G90 ; absolute positioning ## Move nozzle to start position G1 X{start_x} Y{start_y} F6000 G1 Z{start_z} F1500 ## Wipe nozzle {% for wipes in range(1, (wipe_qty + 1)) %} G1 X{start_x + wipe_dist} F{wipe_spd * 60} G1 X{start_x} F{wipe_spd * 60} {% endfor %} ## Raise nozzle G1 Z{raise_distance} [gcode_macro PAUSE] rename_existing: BASE_PAUSE gcode: # Parameters {% set z = params.Z|default(10)|int %} ; z hop amount {% if printer['pause_resume'].is_paused|int == 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 ; disable filament sensor SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume BASE_PAUSE ; pause print {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max G91 ; relative positioning G1 Z{z} F900 ; raise Z up by z hop amount {% else %} { action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0 SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0 {% endif %} G90 ; absolute positioning G1 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_minimum.y+5} F6000 ; park toolhead at front center SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error) M104 S0 ; turn off hotend SET_IDLE_TIMEOUT TIMEOUT=43200 ; set timeout to 12 hours {% endif %} # LINE_PURGE is provided by KAMP/Line_Purge.cfg via KAMP_Settings.cfg. # Keep a single definition; its parameters live in _KAMP_Settings. [gcode_macro RESUME] rename_existing: BASE_RESUME variable_zhop: 0 variable_etemp: 0 gcode: # Parameters {% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm) {% if printer['pause_resume'].is_paused|int == 1 %} SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 ; enable filament sensor #INITIAL_RGB ; reset LCD color SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value {% if etemp > 0 %} M109 S{etemp|int} ; wait for hotend to heat back up {% endif %} RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100 ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error) G91 ; relative positioning M83 ; relative extruder positioning {% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %} G1 Z{zhop * -1} E{e} F900 ; prime nozzle by E, lower Z back down {% else %} G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend) {% endif %} RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60 ; restore position BASE_RESUME ; resume print {% endif %} #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# #*# [bed_mesh default] #*# version = 1 #*# points = #*# 0.073532, 0.073532, 0.070574, 0.070512, 0.067493, 0.064465, 0.064465, 0.061440, 0.058433, 0.056944, 0.058404, 0.058461, 0.056913, 0.058433, 0.064465, 0.067550, 0.070512, 0.072053, 0.073532, 0.079555, 0.079555, 0.078052, 0.081032, 0.079555, 0.076549, 0.076549, 0.075040, 0.073532, 0.073595, 0.073532 #*# 0.061440, 0.058433, 0.056944, 0.055396, 0.055428, 0.052385, 0.050861, 0.046322, 0.046293, 0.043295, 0.043268, 0.041741, 0.043238, 0.046350, 0.049338, 0.052385, 0.055428, 0.061440, 0.059950, 0.063012, 0.064497, 0.064465, 0.064528, 0.064497, 0.061440, 0.061497, 0.061440, 0.061468, 0.061440, 0.058404 #*# 0.058461, 0.055428, 0.053875, 0.052385, 0.050861, 0.049338, 0.046293, 0.040215, 0.038683, 0.037123, 0.037123, 0.035622, 0.037152, 0.037181, 0.043238, 0.046322, 0.046293, 0.052385, 0.055428, 0.055428, 0.053878, 0.055428, 0.058461, 0.056916, 0.056944, 0.055365, 0.052385, 0.050861, 0.049338, 0.049338 #*# 0.049338, 0.046293, 0.043295, 0.040186, 0.037123, 0.035651, 0.034092, 0.031051, 0.027977, 0.026415, 0.027977, 0.026441, 0.027926, 0.027977, 0.032586, 0.034063, 0.040186, 0.040186, 0.040215, 0.044794, 0.043238, 0.043238, 0.046293, 0.046293, 0.046293, 0.043238, 0.041741, 0.043238, 0.041712, 0.037181 #*# 0.046293, 0.043295, 0.040186, 0.040215, 0.038683, 0.034121, 0.031051, 0.027977, 0.024905, 0.021823, 0.021823, 0.021823, 0.024905, 0.023364, 0.024905, 0.031051, 0.032557, 0.037152, 0.040186, 0.040186, 0.040186, 0.041712, 0.043238, 0.043238, 0.041741, 0.040243, 0.037123, 0.034063, 0.031051, 0.031051 #*# 0.034063, 0.031051, 0.027977, 0.026441, 0.024905, 0.018744, 0.015712, 0.014136, 0.012619, 0.012567, 0.009528, 0.011044, 0.012593, 0.012619, 0.015712, 0.020309, 0.024905, 0.027977, 0.024905, 0.027978, 0.029488, 0.027977, 0.031051, 0.031022, 0.029514, 0.027977, 0.024905, 0.024905, 0.021823, 0.015712 #*# 0.024905, 0.026441, 0.024900, 0.021823, 0.021823, 0.015654, 0.012593, 0.009528, 0.009470, 0.009528, 0.006375, 0.006426, 0.003327, 0.006426, 0.009499, 0.012567, 0.015712, 0.015654, 0.018744, 0.021852, 0.018795, 0.021823, 0.021852, 0.021852, 0.020284, 0.018744, 0.012619, 0.012593, 0.009499, 0.006426 #*# 0.021823, 0.018744, 0.018744, 0.015654, 0.011073, 0.009528, 0.006426, 0.003327, 0.003322, 0.001744, 0.000218, 0.000218, 0.000218, 0.000218, 0.003298, 0.006426, 0.009470, 0.012593, 0.011018, 0.012619, 0.009528, 0.012593, 0.012619, 0.009528, 0.012567, 0.011073, 0.006426, 0.006426, 0.003327, -0.002889 #*# 0.021823, 0.018744, 0.015654, 0.012619, 0.009528, 0.009528, 0.009528, 0.007951, 0.003327, 0.003327, 0.000270, 0.003327, 0.000218, 0.000218, 0.003327, 0.001747, 0.004877, 0.006426, 0.009528, 0.011044, 0.009497, 0.006426, 0.012619, 0.006426, 0.007977, 0.006426, 0.003327, 0.001747, -0.002889, -0.005954 #*# 0.015654, 0.009528, 0.009528, 0.007977, 0.003327, 0.003327, 0.003327, 0.003327, 0.000218, -0.002889, -0.002889, -0.002889, -0.004447, -0.002889, -0.002889, 0.000218, 0.000218, 0.000218, 0.000166, 0.006375, 0.003327, 0.004877, 0.003327, 0.003327, 0.001773, 0.000218, -0.002889, -0.005954, -0.009121, -0.012194 #*# 0.012619, 0.009528, 0.007951, 0.006375, 0.003327, 0.004822, 0.006426, 0.003327, 0.003327, 0.000218, -0.001310, -0.002889, -0.002837, -0.004422, -0.001335, -0.002889, -0.002889, 0.000218, 0.000244, 0.001773, 0.000218, -0.002889, 0.003327, 0.003327, -0.002889, -0.002889, -0.004447, -0.009121, -0.012194, -0.015369 #*# 0.009528, 0.006426, 0.001773, 0.003327, -0.002889, -0.001335, 0.000218, -0.002889, -0.005954, -0.006006, -0.005980, -0.009069, -0.006006, -0.007512, -0.007563, -0.009121, -0.009121, -0.004422, -0.005954, -0.005954, -0.005954, -0.007512, -0.006006, -0.005980, -0.006006, -0.009069, -0.010683, -0.015343, -0.015369, -0.021581 #*# 0.009528, 0.009528, 0.006426, 0.006426, 0.004851, 0.001773, 0.006426, 0.000218, 0.000218, -0.004447, -0.002837, -0.002889, -0.004447, -0.006006, -0.006006, -0.002889, -0.002863, 0.000218, -0.002837, 0.000218, -0.001335, -0.001335, 0.000218, -0.002889, -0.006006, -0.006006, -0.009121, -0.012246, -0.018496, -0.021581 #*# 0.009528, 0.009528, 0.003327, 0.003327, 0.003327, 0.000218, 0.000270, 0.000218, 0.000218, -0.001335, -0.002889, -0.002889, -0.002889, -0.002889, -0.002889, 0.000218, -0.002889, 0.000218, -0.001310, 0.000218, 0.000218, -0.001335, -0.002889, -0.002889, -0.002889, -0.006006, -0.010632, -0.012194, -0.018450, -0.021581 #*# 0.012567, 0.012619, 0.009528, 0.009528, 0.006426, 0.006426, 0.006426, 0.006426, 0.003327, 0.001773, 0.000218, -0.002889, 0.000218, -0.001335, 0.001747, 0.000218, 0.003327, 0.000218, 0.001773, 0.003327, 0.003327, -0.001335, 0.000192, 0.000218, -0.002837, -0.005954, -0.006006, -0.012194, -0.021581, -0.021633 #*# 0.009499, 0.007922, 0.006400, 0.004877, 0.003327, 0.003327, 0.003327, 0.000218, -0.002889, -0.002837, -0.004447, -0.002863, 0.000218, 0.000218, -0.002863, 0.000218, 0.003269, 0.003327, 0.000218, 0.000192, 0.000218, -0.002837, -0.002894, -0.004447, -0.002889, -0.009069, -0.010632, -0.013755, -0.021581, -0.029409 #*# 0.009528, 0.006426, 0.009470, 0.007977, 0.006426, 0.003269, 0.003327, 0.001773, -0.002889, -0.002889, -0.002889, -0.002889, -0.001335, 0.000218, 0.000218, 0.001773, 0.000218, 0.000218, 0.003269, 0.003327, 0.000244, -0.002889, -0.002889, -0.002889, -0.002863, -0.007563, -0.012246, -0.015317, -0.021581, -0.027861 #*# 0.006426, 0.006375, 0.004851, 0.000218, 0.000218, -0.004422, -0.002889, -0.002889, -0.006006, -0.009069, -0.007563, -0.006006, -0.006006, -0.002889, -0.004422, -0.002889, -0.002889, -0.001335, 0.001773, -0.002889, -0.006006, -0.006006, -0.006006, -0.009069, -0.009069, -0.012194, -0.015317, -0.018450, -0.024715, -0.031003 #*# 0.003327, 0.003327, 0.003269, 0.000218, -0.002863, -0.006006, -0.006006, -0.009069, -0.010683, -0.010657, -0.012194, -0.009069, -0.007563, -0.004422, -0.005954, -0.006006, -0.006006, -0.004422, -0.002889, 0.000218, -0.004447, -0.007563, -0.009121, -0.012246, -0.012220, -0.016883, -0.021581, -0.021633, -0.027808, -0.034157 #*# -0.005954, -0.006006, -0.007563, -0.012246, -0.015369, -0.018450, -0.018473, -0.021581, -0.021581, -0.021581, -0.021581, -0.020038, -0.015343, -0.015317, -0.015317, -0.018473, -0.013781, -0.009121, -0.009069, -0.012194, -0.015343, -0.018450, -0.018450, -0.021581, -0.023148, -0.024715, -0.031003, -0.031003, -0.037308, -0.046791 #*# -0.012246, -0.012194, -0.012246, -0.016883, -0.021581, -0.027808, -0.027834, -0.029432, -0.031003, -0.027861, -0.031003, -0.029432, -0.027861, -0.021581, -0.021581, -0.021581, -0.020015, -0.018450, -0.015317, -0.020015, -0.023174, -0.027861, -0.027861, -0.030981, -0.030981, -0.034157, -0.037308, -0.042019, -0.046745, -0.049912 #*# -0.015369, -0.018496, -0.021581, -0.024715, -0.029406, -0.034104, -0.034104, -0.034157, -0.035732, -0.037281, -0.037255, -0.037255, -0.032580, -0.030981, -0.027861, -0.027861, -0.026288, -0.026288, -0.024715, -0.027861, -0.031003, -0.030981, -0.031003, -0.034157, -0.037308, -0.037281, -0.043576, -0.046745, -0.049912, -0.062628 #*# -0.018496, -0.018450, -0.021581, -0.026288, -0.031003, -0.037255, -0.037308, -0.037308, -0.040440, -0.040417, -0.040417, -0.045183, -0.042019, -0.037308, -0.030958, -0.032580, -0.034104, -0.029409, -0.031003, -0.034157, -0.034104, -0.035706, -0.037255, -0.037308, -0.037281, -0.040440, -0.046745, -0.053083, -0.053083, -0.062582 #*# -0.021581, -0.024715, -0.027861, -0.032531, -0.037281, -0.043576, -0.043576, -0.046745, -0.048329, -0.046745, -0.049912, -0.054674, -0.048329, -0.043576, -0.037255, -0.038885, -0.037281, -0.037255, -0.037308, -0.037281, -0.038859, -0.040417, -0.040463, -0.043576, -0.043602, -0.045183, -0.049912, -0.056265, -0.059398, -0.068968 #*# -0.024715, -0.026288, -0.029432, -0.034131, -0.037255, -0.043576, -0.046745, -0.049935, -0.049912, -0.053083, -0.053060, -0.056265, -0.056212, -0.049912, -0.042022, -0.042022, -0.043576, -0.043576, -0.043576, -0.043602, -0.043576, -0.043628, -0.045160, -0.046745, -0.046791, -0.049912, -0.053037, -0.059398, -0.065800, -0.070589 #*# -0.027861, -0.031003, -0.034157, -0.037255, -0.043602, -0.049912, -0.049912, -0.053083, -0.056212, -0.051498, -0.059422, -0.062582, -0.053083, -0.049912, -0.048352, -0.049912, -0.046745, -0.046768, -0.046745, -0.043576, -0.046745, -0.049889, -0.045160, -0.046745, -0.049912, -0.053037, -0.061037, -0.065776, -0.068968, -0.075371 #*# -0.024715, -0.024715, -0.027861, -0.034104, -0.038862, -0.045187, -0.046745, -0.046745, -0.053083, -0.053083, -0.059398, -0.062628, -0.059445, -0.051498, -0.049935, -0.049912, -0.049912, -0.049935, -0.049912, -0.049912, -0.049912, -0.049912, -0.049912, -0.053083, -0.053083, -0.057855, -0.062628, -0.065823, -0.072164, -0.075371 #*# -0.018450, -0.027861, -0.030958, -0.037255, -0.042045, -0.045160, -0.049912, -0.056265, -0.054674, -0.054625, -0.059445, -0.059445, -0.059398, -0.057855, -0.056265, -0.056212, -0.051498, -0.049912, -0.053083, -0.049912, -0.053083, -0.054674, -0.053083, -0.056212, -0.057805, -0.059398, -0.065776, -0.065823, -0.072164, -0.075371 #*# -0.015317, -0.012246, -0.021581, -0.027861, -0.034157, -0.040463, -0.043602, -0.046745, -0.049912, -0.053083, -0.054674, -0.059445, -0.056265, -0.054648, -0.054648, -0.056265, -0.056212, -0.053060, -0.051498, -0.053083, -0.056265, -0.054648, -0.053060, -0.051498, -0.053083, -0.059398, -0.062605, -0.064226, -0.068968, -0.068968 #*# -0.006006, -0.009121, -0.013781, -0.021581, -0.030958, -0.034157, -0.038862, -0.043576, -0.043628, -0.046745, -0.049935, -0.049912, -0.049912, -0.049912, -0.049912, -0.049912, -0.046745, -0.043576, -0.045160, -0.048329, -0.046745, -0.046791, -0.046768, -0.049912, -0.049912, -0.053083, -0.057855, -0.057805, -0.059445, -0.065823 #*# x_count = 30 #*# y_count = 30 #*# mesh_x_pps = 0 #*# mesh_y_pps = 0 #*# algo = bicubic #*# tension = 0.2 #*# min_x = 35.0 #*# max_x = 215.0 #*# min_y = 30.0 #*# max_y = 200.0 #*# #*# [extruder] #*# control = pid #*# pid_kp = 26.908 #*# pid_ki = 2.360 #*# pid_kd = 76.690 #*# #*# [input_shaper] #*# shaper_type_x = mzv #*# shaper_freq_x = 60.8 #*# shaper_type_y = mzv #*# shaper_freq_y = 43.4 #*# #*# [cartographer scan_model default] #*# coefficients = 1.5077021654307656,1.982925374522947,0.8069624702177761,0.44075023484388876,0.5125827502492211,0.2069086470851544,-0.3443498114430992,-0.00819725951495316,0.31856943991554365,0.08027243835900834 #*# domain = 3.238062151773355e-07,3.3502316466550964e-07 #*# z_offset = 0 #*# reference_temperature = 29.33 #*# software_version = 1.9.0 #*# mcu_version = CARTOGRAPHER V3 6.1.0 #*# #*# [cartographer touch_model default] #*# threshold = 1045 #*# speed = 2 #*# z_offset = -0.05 #*# software_version = 1.9.0 #*# mcu_version = CARTOGRAPHER V3 6.1.0