commit bbd471e40264c8f56df2e6e4d6b0e25460034b9f Author: Dmitry Chumak Date: Sat Jan 6 20:35:52 2024 +0800 first commit diff --git a/.moonraker.conf.bkp b/.moonraker.conf.bkp new file mode 100644 index 0000000..a240cde --- /dev/null +++ b/.moonraker.conf.bkp @@ -0,0 +1,48 @@ +[server] +host = 0.0.0.0 +port = 7125 +klippy_uds_address = /tmp/klippy_uds +max_upload_size = 1024 + +[file_manager] +queue_gcode_uploads = False +enable_object_processing = False + +[database] + +[data_store] +temperature_store_size = 600 +gcode_store_size = 1000 + +[machine] +provider = none +validate_service = False +validate_config = False + +[authorization] +force_logins = False +cors_domains = + *.lan + *.local + *://localhost + *://localhost:* + *://my.mainsail.xyz + *://app.fluidd.xyz +trusted_clients = + 10.0.0.0/8 + 127.0.0.0/8 + 169.254.0.0/16 + 172.16.0.0/12 + 192.168.0.0/16 + FE80::/10 + ::1/128 + +[octoprint_compat] + +[history] + +[update_manager] +enable_auto_refresh = True +refresh_interval = 24 +enable_system_updates = False + diff --git a/.printer.cfg b/.printer.cfg new file mode 100644 index 0000000..2bf6cd6 --- /dev/null +++ b/.printer.cfg @@ -0,0 +1,358 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.23 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 70.6 +#*# shaper_type_x = ei +#*# shaper_freq_x = 70.6 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.750375, 0.683438, 0.618375, 0.554406, 0.549500 +#*# 0.494406, 0.396906, 0.336531, 0.254031, 0.208813 +#*# 0.241094, 0.138281, 0.050000, -0.016094, -0.067906 +#*# 0.047000, -0.061844, -0.160844, -0.261625, -0.368750 +#*# -0.049375, -0.189781, -0.326906, -0.456375, -0.529906 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 diff --git a/factory_printer.cfg b/factory_printer.cfg new file mode 100644 index 0000000..966b757 --- /dev/null +++ b/factory_printer.cfg @@ -0,0 +1,337 @@ +# K1-MAX +# Printer_size: 300x300x300 +# Version: v1.0.1 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: K1-NOZZLE-M_V12 +# Leveling_mcu: chip: GD32E230F8P6 +# version: K1-MAX-L-V11 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 306.5 +position_min: -2 +position_max: 306.5 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -2 +position_min: -2 +position_max: 306 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 305 +position_min: -10 +homing_speed: 10 +second_homing_speed: 1 +homing_retract_dist: 2.0 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu: PB11 +tx_pin: nozzle_mcu: PB10 +uart_address: 3 +run_current: 0.5 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PC12 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: pid +pid_Kp: 54.901 +pid_Ki: 1.142 +pid_Kd: 375.483 +min_temp: 0 +max_temp: 140 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: ^!PC15 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 + +[output_pin PA0] +pin:PA0 +pwm: True +cycle_time: 0.010 + +[output_pin PB2] +pin:PB2 +pwm: True +cycle_time: 0.010 + +[output_pin PB10] +pin:PB10 +pwm: True +cycle_time: 0.010 + +[output_pin PC8] +pin:PC8 +pwm: True +cycle_time: 0.010 + +[output_pin PC9] +pin:PC9 +pwm: True +cycle_time: 0.010 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 50 +probe_points: + 150,150,10 + +[prtouch_v2] +step_base: 2 +z_offset: 0 +noz_ex_com: 0.06 +tilt_corr_dis: 0.05 +tri_min_hold: 3000 +tri_max_hold: 8000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA7 +pres0_sdo_pins: leveling_mcu:PA4 +pres1_clk_pins: leveling_mcu:PA6 +pres1_sdo_pins: leveling_mcu:PA3 +pres2_clk_pins: leveling_mcu:PA2 +pres2_sdo_pins: leveling_mcu:PA0 +pres3_clk_pins: leveling_mcu:PA5 +pres3_sdo_pins: leveling_mcu:PA1 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 295,295 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + + + +[pause_resume] diff --git a/gcode_macro.cfg b/gcode_macro.cfg new file mode 100644 index 0000000..b81ca47 --- /dev/null +++ b/gcode_macro.cfg @@ -0,0 +1,618 @@ +# K1 +# CreateDate: 2023/03/21 + +[gcode_macro PRINTER_PARAM] +variable_z_safe_pause: 0.0 +variable_z_safe_g28: 3.0 +variable_max_x_position: 220.0 +variable_max_y_position: 220.0 +variable_max_z_position: 250.0 +variable_fans: 3 +variable_auto_g29: 0 +variable_fan0_min: 25 +variable_fan1_min: 50 +variable_fan2_min: 180 +variable_fan2_speed: 0 +variable_hotend_temp: 0 +variable_e_min_current: 0.27 +gcode: + +[gcode_macro AUTOTUNE_SHAPERS] +variable_autotune_shapers: 'ei' +gcode: + +[gcode_macro LOAD_MATERIAL_CLOSE_FAN2] +variable_fan2_value: 0 +gcode: + SAVE_GCODE_STATE NAME=myMoveState + {% if printer['output_pin fan2'].value > 0.0 %} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + M107 P2 + {% endif %} + RESTORE_E_CURRENT + +[gcode_macro LOAD_MATERIAL_RESTORE_FAN2] +gcode: + {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %} + RESTORE_GCODE_STATE NAME=myMoveState + {% if fan2_value > 0.0 %} + {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %} + M106 P2 S{s_value} + SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0 + {% endif %} + SET_E_MIN_CURRENT + +[gcode_macro SET_E_MIN_CURRENT] +gcode: + {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro RESTORE_E_CURRENT] +gcode: + {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %} + M400 + SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current} + G4 P2000 + +[gcode_macro LOAD_MATERIAL] +gcode: + LOAD_MATERIAL_CLOSE_FAN2 + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E80 F180 + LOAD_MATERIAL_RESTORE_FAN2 + +[gcode_macro QUIT_MATERIAL] +gcode: + SAVE_GCODE_STATE NAME=myMoveState + M109 S{printer.custom_macro.default_extruder_temp} + G91 + G1 E20 F180 + G1 E-30 F180 + G1 E-50 F2000 + RESTORE_GCODE_STATE NAME=myMoveState + +[gcode_macro Qmode] +variable_flag: 0 +variable_accel: 0 +variable_accel_to_decel: 0 +variable_velocity: 0 +variable_square_corner_velocity: 0 +variable_pressure_advance:0.0 +variable_fan0_value: 0.00 +variable_fan1_value: 0.00 +variable_fan2_value: 0.00 +variable_speed_factor: 0 +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + + # Set Motion Parameters + SET_VELOCITY_LIMIT ACCEL=5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500 + SET_VELOCITY_LIMIT VELOCITY=200 + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 + SET_PRESSURE_ADVANCE ADVANCE=0.05 + M220 S50 + M106 P0 S80 + M106 P1 S0 + M106 P2 S0 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro Qmode_exit] +gcode: + {% set printer_state = printer.print_stats.state %} + {% if printer['gcode_macro Qmode'].flag|int == 1 %} + {% if printer_state == "printing" or printer_state == "paused" %} + SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel} + SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel} + SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity} + SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance} + M220 S{printer['gcode_macro Qmode'].speed_factor * 100} + M106 P0 S{(printer['gcode_macro Qmode'].fan0_value * 255 + 0.5)|int} + M106 P1 S{(printer['gcode_macro Qmode'].fan1_value * 255 + 0.5)|int} + M106 P2 S{(printer['gcode_macro Qmode'].fan2_value * 255 + 0.5)|int} + SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0 + {% endif %} + {% endif %} + +[gcode_macro M204] +rename_existing: M204.1 +gcode: + {% if printer['gcode_macro Qmode'].flag|int == 0 %} + {% set get_params = "" %} + {% if 'S' in params|upper %} + {% set get_params = (get_params + ' ' + 'S' + params.S) %} + {% endif %} + {% if 'P' in params|upper %} + {% set get_params = (get_params + ' ' + 'P' + params.P) %} + {% endif %} + {% if 'T' in params|upper %} + {% set get_params = (get_params + ' ' + 'T' + params.T) %} + {% endif %} + M204.1 {get_params} + {% endif %} + +[gcode_macro M205] +gcode: + {% if 'X' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X} + {% elif 'Y' in params %} + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y} + {% endif %} + +[gcode_macro M106] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% set fan = 0 %} + {% set value = 0 %} + {% if params.P is defined %} + {% set tmp = params.P|int %} + {% if tmp < fans %} + {% set fan = tmp %} + {% endif %} + {% endif %} + {% if params.S is defined %} + {% set tmp = params.S|float %} + {% else %} + {% set tmp = 255 %} + {% endif %} + {% if tmp > 0 %} + {% if fan == 0 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} + {% endif %} + {% if fan == 1 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} + {% endif %} + {% if fan == 2 %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} + {% endif %} + {% endif %} + {% if value >= 255 %} + {% set value = 255 %} + {% endif %} + SET_PIN PIN=fan{fan} VALUE={value} + +[gcode_macro M107] +gcode: + {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %} + {% if params.P is defined %} + {% if params.P|int < fans %} + SET_PIN PIN=fan{params.P|int} VALUE=0 + {% else %} + SET_PIN PIN=fan0 VALUE=0 + {% endif %} + {% else %} + SET_PIN PIN=fan0 VALUE=0 + SET_PIN PIN=fan2 VALUE=0 + {% endif %} + +[gcode_macro M900] +gcode: + {% if 'K' in params %} + {% if 'E' in params %} + SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K} + {% else %} + SET_PRESSURE_ADVANCE ADVANCE={params.K} + {% endif %} + {% endif %} + +[delayed_gcode wait_temp] +# initial_duration: 2. +gcode: + {% set cur_temp = printer.extruder.temperature %} + {% if cur_temp|int < 40 %} + {action_respond_info("end_temp!\n")} + WAIT_TEMP_END + {% else %} + {action_respond_info("cur_temp = %s \n" % (cur_temp))} + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5 + {% endif %} + +[gcode_macro WAIT_TEMP_START] +gcode: + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1 + M106 P0 S255 + # M106 P2 S255 + +[gcode_macro WAIT_TEMP_END] +gcode: + UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0 + M106 P0 S0 + # M106 P2 S0 + +[gcode_macro PRINT_CALIBRATION] +# This part of the command is replaced by the application side without passing parameters +gcode: + CX_PRINT_LEVELING_CALIBRATION + +[gcode_macro FIRST_FLOOR_PAUSE_POSITION] +gcode: + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + M104 S{extruder_temp} + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer['gcode_macro PRINTER_PARAM'].max_x_position|float + 1 %} + G90 + G1 Z2 F600 + G1 X{x_park} Y{y_park} F6000 + G1 Z0.2 F600 + +[gcode_macro ACCURATE_G28] +gcode: + ACCURATE_HOME_Z + +[gcode_macro START_PRINT] +variable_prepare: 0 +gcode: + WAIT_TEMP_END + CLEAR_PAUSE + {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %} + {% set extruder_temp = params.EXTRUDER_TEMP %} + {% endif %} + + {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %} + {action_respond_info("not prepare.\n")} + PRINT_PREPARE_CLEAR + CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp} + CX_NOZZLE_CLEAR + ACCURATE_G28 + CX_PRINT_LEVELING_CALIBRATION + {% else %} + PRINT_PREPARE_CLEAR + {% endif %} + + CX_PRINT_DRAW_ONE_LINE + + +[gcode_macro PRINT_PREPARED] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1 + {action_respond_info("print prepared")} + +[gcode_macro PRINT_PREPARE_CLEAR] +gcode: + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0 + +[gcode_macro END_PRINT_POINT_WITHOUT_LIFTING] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT_POINT] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z / 2) %} + {% set z_safe = (max_z / 2) - act_z %} + {% elif act_z < max_z %} + {% set z_safe = 2.0 %} + {% endif %} + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z2.0 F600 + G90 + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F30000 + {% if z_safe > 2.0 %} + G91 + {% set z_safe = z_safe - 2.0 %} + G1 Z{z_safe} F600 + G90 + {% endif %} + {% else %} + {action_respond_info("end print xyz_axes is NULL\n")} + {% endif %} + +[gcode_macro END_PRINT] +gcode: + # Qmode_exit + PRINT_PREPARE_CLEAR + M220 S100 + M204 S500 + TURN_OFF_HEATERS + M107 P1 + M107 P2 + END_PRINT_POINT + WAIT_TEMP_START + M84 + +[gcode_macro FIRST_FLOOR_PAUSE] +description: Pause the first floor print +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro FIRST_FLOOR_RESUME] +description: Resume the first floor print +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 2.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + ##### calculate save lift position ##### + {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_safe = 0.0 %} + {% if act_z < 48.0 %} + {% set z_safe = 50.0 - act_z %} + {% elif act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% elif act_z < max_z %} + {% set z_safe = max_z - act_z %} + {% endif %} + {action_respond_info("z_safe = %s"% (z_safe))} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float} + PAUSE_BASE + G91 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target} + M104 S140 + {% if "xyz" in printer.toolhead.homed_axes %} + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-1.0 F180 + G1 E-{E} F4000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + G1 Z{z_safe} F600 + M400 + G90 + G1 X{x_park} Y{y_park} F30000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + # save fan2 value and turn off fan2 + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value} + {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + {action_respond_info("fan2_value = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE=0 + M106 P2 S0 + SET_E_MIN_CURRENT + +[gcode_macro INPUTSHAPER] +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + G90 + G28 + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + G1 X{POSITION_X} Y{POSITION_Y} F6000 + G1 Z10 F600 + SHAPER_CALIBRATE AXIS=y + CXSAVE_CONFIG + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +[gcode_macro BEDPID] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + SAVE_CONFIG + +[gcode_macro TUNOFFINPUTSHAPER] +gcode: + SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + RESTORE_E_CURRENT + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %} + {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %} + M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% else %} + M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int} + {% endif %} + SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0 + {% endif %} + {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %} + # {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %} + # {action_respond_info("fan2_value2 = %s \n" % (fspeed))} + # SET_PIN PIN=fan2 VALUE={(printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 + 0.5)|int} + {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %} + M106 P2 S{s_value} + {% endif %} + {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %} + {% if z_resume_move > 2 %} + {% set z_resume_move = z_resume_move - 2 %} + G91 + G1 Z-{z_resume_move} F600 + M400 + {% endif %} + {action_respond_info("z_resume_move = %s"% (z_resume_move))} + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + M400 + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + CANCEL_PRINT_BASE + +[gcode_macro G29] +gcode: + {% if 'PROBE_COUNT' in params|upper %} + {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %} + {%else %} + {% set get_count = "" %} + {% endif %} + + {% set bed_temp = printer.custom_macro.default_bed_temp %} + {% set extruder_temp = printer.custom_macro.g28_ext_temp %} + {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %} + + {% if 'BED_TEMP' in params|upper %} + {% set bed_temp = params.BED_TEMP %} + {% endif %} + + {% if 'EXTRUDER_TEMP' in params|upper %} + {% set nozzle_clear_temp = params.EXTRUDER_TEMP %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=0 + + G28 + BED_MESH_CLEAR + NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp} + ACCURATE_G28 + M204 S5000 + SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000 + BED_MESH_CALIBRATE {get_count} + BED_MESH_OUTPUT + {% set y_park = printer.toolhead.axis_maximum.y/2 %} + {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %} + G1 X{x_park} Y{y_park} F2000 + CXSAVE_CONFIG + TURN_OFF_HEATERS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor_2 ENABLE=1 + +# [gcode_macro G299] +# gcode: +# BED_MESH_CLEAR +# G28 +# PRTOUCH_READY +# BED_MESH_CALIBRATE +# BED_MESH_OUTPUT diff --git a/moonraker.conf b/moonraker.conf new file mode 100644 index 0000000..478204e --- /dev/null +++ b/moonraker.conf @@ -0,0 +1,92 @@ +[server] +host: 0.0.0.0 +port: 7125 +klippy_uds_address: /tmp/klippy_uds +max_upload_size: 1024 + +[file_manager] +queue_gcode_uploads: False +# Set to 'True' if you use KAMP +enable_object_processing: False + +[database] + +[data_store] +temperature_store_size: 600 +gcode_store_size: 1000 + +[machine] +provider: none +validate_service: False +validate_config: False + +[authorization] +force_logins: False +cors_domains: + *.lan + *.local + *://localhost + *://localhost:* + *://my.mainsail.xyz + *://app.fluidd.xyz + +trusted_clients: + 10.0.0.0/8 + 127.0.0.0/8 + 169.254.0.0/16 + 172.16.0.0/12 + 192.168.0.0/16 + FE80::/10 + ::1/128 + +[octoprint_compat] + +[history] + +[update_manager] +enable_auto_refresh: True +refresh_interval: 24 +enable_system_updates: False + +# Remove '#' from the lines below to enable camera configuration with Moonraker and replace 'xxx.xxx.xxx.xxx' by your IP addresses +#[webcam Camera] +#location: printer +#enabled: True +#service: mjpegstreamer +#target_fps: 15 +#target_fps_idle: 5 +#stream_url: http://xxx.xxx.xxx.xxx:8080/?action=stream +#snapshot_url: http://xxx.xxx.xxx.xxx:8080/?action=snapshot +#flip_horizontal: False +#flip_vertical: False +#rotation: 0 +#aspect_ratio: 4:3 + +# Remove '#' from the lines below if you use Timelapse function and replace port '4408' by '4409' in snapshoturl if you use Mainsail +#[timelapse] +#output_path: /usr/data/printer_data/timelapse/ +#frame_path: /usr/data/printer_data/frames/ +#snapshoturl: http://localhost:4408/webcam/?action=snapshot + +# Remove '#' from the lines below if you use Fluidd +#[update_manager fluidd] +#type: web +#channel: beta +#repo: fluidd-core/fluidd +#path: /usr/data/fluidd + +# Remove '#' from the lines below if you use Mainsail +#[update_manager mainsail] +#type: web +#channel: beta +#repo: mainsail-crew/mainsail +#path: /usr/data/mainsail + +# Remove '#' from the lines below if you use KAMP +#[update_manager KAMP-for-K1-Series] +#type: git_repo +#channel: dev +#path: /usr/data/KAMP-for-K1-Series +#origin: https://github.com/Guilouz/KAMP-for-K1-Series.git +#primary_branch: main +#is_system_service: False diff --git a/printer-20240104_213147.cfg b/printer-20240104_213147.cfg new file mode 100644 index 0000000..2bf6cd6 --- /dev/null +++ b/printer-20240104_213147.cfg @@ -0,0 +1,358 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.23 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 70.6 +#*# shaper_type_x = ei +#*# shaper_freq_x = 70.6 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.750375, 0.683438, 0.618375, 0.554406, 0.549500 +#*# 0.494406, 0.396906, 0.336531, 0.254031, 0.208813 +#*# 0.241094, 0.138281, 0.050000, -0.016094, -0.067906 +#*# 0.047000, -0.061844, -0.160844, -0.261625, -0.368750 +#*# -0.049375, -0.189781, -0.326906, -0.456375, -0.529906 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 diff --git a/printer-20240104_213148.cfg b/printer-20240104_213148.cfg new file mode 100644 index 0000000..409d290 --- /dev/null +++ b/printer-20240104_213148.cfg @@ -0,0 +1,358 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.23 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 69.0 +#*# shaper_type_x = ei +#*# shaper_freq_x = 69.0 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.750375, 0.683438, 0.618375, 0.554406, 0.549500 +#*# 0.494406, 0.396906, 0.336531, 0.254031, 0.208813 +#*# 0.241094, 0.138281, 0.050000, -0.016094, -0.067906 +#*# 0.047000, -0.061844, -0.160844, -0.261625, -0.368750 +#*# -0.049375, -0.189781, -0.326906, -0.456375, -0.529906 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 diff --git a/printer-20240104_213842.cfg b/printer-20240104_213842.cfg new file mode 100644 index 0000000..409d290 --- /dev/null +++ b/printer-20240104_213842.cfg @@ -0,0 +1,358 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.23 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 69.0 +#*# shaper_type_x = ei +#*# shaper_freq_x = 69.0 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.750375, 0.683438, 0.618375, 0.554406, 0.549500 +#*# 0.494406, 0.396906, 0.336531, 0.254031, 0.208813 +#*# 0.241094, 0.138281, 0.050000, -0.016094, -0.067906 +#*# 0.047000, -0.061844, -0.160844, -0.261625, -0.368750 +#*# -0.049375, -0.189781, -0.326906, -0.456375, -0.529906 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 diff --git a/printer-20240104_214526.cfg b/printer-20240104_214526.cfg new file mode 100644 index 0000000..b5d7e0b --- /dev/null +++ b/printer-20240104_214526.cfg @@ -0,0 +1,358 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.23 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 69.0 +#*# shaper_type_x = ei +#*# shaper_freq_x = 69.0 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.797312, 0.692812, 0.627469, 0.571812, 0.544437 +#*# 0.491687, 0.413994, 0.333219, 0.266250, 0.210687 +#*# 0.251677, 0.145469, 0.050000, -0.031563, -0.119219 +#*# 0.066094, -0.106219, -0.174349, -0.269156, -0.404063 +#*# -0.057250, -0.210406, -0.325787, -0.465969, -0.543125 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 diff --git a/printer.cfg b/printer.cfg new file mode 100644 index 0000000..6ab1339 --- /dev/null +++ b/printer.cfg @@ -0,0 +1,361 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.23 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_try_max_times: 10 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 5.0 +fade_end: 50.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 800 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +square_corner_max_velocity: 200.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 69.0 +#*# shaper_type_x = ei +#*# shaper_freq_x = 69.0 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.777656, 0.707219, 0.650625, 0.573156, 0.576562 +#*# 0.502753, 0.429594, 0.356250, 0.354781, 0.202844 +#*# 0.288693, 0.157656, 0.050000, -0.006500, -0.096813 +#*# 0.036375, -0.050062, -0.155875, -0.307167, -0.389594 +#*# -0.061563, -0.210438, -0.349781, -0.486781, -0.545415 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 +#*# +#*# [prtouch default] +#*# version = 307 diff --git a/printer.cfg.1 b/printer.cfg.1 new file mode 100644 index 0000000..a3fa151 --- /dev/null +++ b/printer.cfg.1 @@ -0,0 +1,435 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.18 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[include sensorless.cfg] +[include gcode_macro.cfg] +[include printer_params.cfg] + +[mcu] +serial: /dev/ttyS7 +baud: 230400 +restart_method: command + +[mcu nozzle_mcu] +serial: /dev/ttyS1 +baud: 230400 +restart_method: command + +[mcu leveling_mcu] +serial: /dev/ttyS9 +baud: 230400 +restart_method: command + +[verify_heater extruder] +[verify_heater heater_bed] +check_gain_time: 120 +heating_gain: 1.0 +hysteresis: 10 + +[mcu rpi] +serial: /tmp/klipper_host_mcu + +[bl24c16f] +i2c_mcu: rpi +i2c_bus: i2c.2 +i2c_speed: 400000 + +[idle_timeout] +timeout: 99999999 + +[virtual_sdcard] +path: /usr/data/printer_data/gcodes + +[gcode_arcs] +resolution: 1.0 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber_temp] +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC5 +min_temp: 0 +max_temp: 125 + +[stepper_x] +step_pin: PC2 +dir_pin: !PB9 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 229 +position_min: -5 +position_max: 229 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_x] +uart_pin:PA9 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB12 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_y] +step_pin: PB8 +dir_pin: !PB7 +enable_pin: !PC3 +microsteps: 32 +rotation_distance: 72 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -0.5 +position_min: -0.5 +position_max: 226 +homing_speed: 36 +homing_retract_dist:0 + +[tmc2209 stepper_y] +uart_pin:PA10 +interpolate: True +run_current:1.5 +hold_current:1.0 +sense_resistor: 0.100 +stealthchop_threshold: 0 +uart_address:3 +diag_pin: ^PB13 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 0 +# driver_HSTRT: 7 +driver_SGTHRS: 65 + +[stepper_z] +step_pin: PB6 +dir_pin: !PB5 +enable_pin: !PC3 +microsteps: 16 +rotation_distance:8 +gear_ratio: 64:20 +endstop_pin: tmc2209_stepper_z:virtual_endstop# PA15 #probe:z_virtual_endstop +position_endstop: 0 +position_max: 255 +position_min: -5 + +[tmc2209 stepper_z] +uart_pin: PA11 +uart_address: 3 +run_current: 0.8 +diag_pin: ^PB14 +stealthchop_threshold: 0 +sense_resistor: 0.100 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 1 +# driver_TOFF: 1 +# driver_HEND: 2 +# driver_HSTRT: 2 +driver_SGTHRS: 0 + +[extruder] +max_extrude_only_distance: 1000.0 +max_extrude_cross_section: 80 +step_pin: nozzle_mcu:PB1 +dir_pin: nozzle_mcu:PB0 +enable_pin: !nozzle_mcu:PB2 +microsteps: 16 +rotation_distance: 6.9 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: nozzle_mcu:PB7 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: nozzle_mcu:PA0 +pressure_advance: 0.04 +pressure_advance_smooth_time: 0.040 +control: pid +pid_Kp: 25.013 +pid_Ki: 2.566 +pid_Kd: 60.966 +min_temp: 0 +max_temp: 320 + +[tmc2209 extruder] +uart_pin: nozzle_mcu:PB11 +tx_pin: nozzle_mcu:PB10 +uart_address: 3 +run_current: 0.55 +sense_resistor: 0.150 +stealthchop_threshold: 0 +# driver_IHOLDDELAY: 8 +# driver_TPOWERDOWN: 20 +# driver_TBL: 2 +# driver_TOFF: 3 +# driver_HEND: 0 +# driver_HSTRT: 5 + +[heater_bed] +heater_pin: PB10 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PC4 +control: watermark +# control: pid +# pid_kp: 27 +# pid_ki: 0.08 +# pid_kd: 0 +min_temp: 0 +max_temp: 120 + +[filament_switch_sensor filament_sensor] +pause_on_runout: true +switch_pin: !PC15 +runout_gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G0 E30 F600 + G90 + {% endif %} + +[filament_switch_sensor filament_sensor_2] +pause_on_runout: true +switch_pin: !nozzle_mcu:PA10 + +[multi_pin heater_fans] +pins:nozzle_mcu:PB5,PB2 + +[heater_fan hotend_fan] +pin: multi_pin:heater_fans +heater: extruder +heater_temp: 40 + +[static_digital_output my_fan_output_pins] +pins: nozzle_mcu: PB6 + +[output_pin fan0] +pin: !nozzle_mcu: PB8 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan1] +pin: PC0 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin fan2] +pin: PB1 +pwm: True +cycle_time: 0.0100 +hardware_pwm: false +value: 0.00 +scale: 255 +shutdown_value: 0.0 + +[output_pin LED] +pin:PB0 +pwm: True +cycle_time: 0.010 +value: 1 + +[adxl345] +cs_pin: nozzle_mcu:PA4 +spi_speed: 5000000 +axes_map: x,-z,y +spi_software_sclk_pin: nozzle_mcu:PA5 +spi_software_mosi_pin: nozzle_mcu:PA7 +spi_software_miso_pin: nozzle_mcu:PA6 + +[resonance_tester] +accel_chip: adxl345 +accel_per_hz: 75 +# min_freq: 30 +# max_freq: 100 +probe_points: + 110,110,10 + +[prtouch_v2] # K1 +pr_version: 1 +step_base: 2 +z_offset: 0 +noz_ex_com: 0.05 +tilt_corr_dis: 0.03 +tri_min_hold: 2000 +tri_max_hold: 6000 +pres_cnt: 4 +pres0_clk_pins: leveling_mcu:PA5 +pres0_sdo_pins: leveling_mcu:PA1 +pres1_clk_pins: leveling_mcu:PA2 +pres1_sdo_pins: leveling_mcu:PA0 +pres2_clk_pins: leveling_mcu:PA6 +pres2_sdo_pins: leveling_mcu:PA3 +pres3_clk_pins: leveling_mcu:PA7 +pres3_sdo_pins: leveling_mcu:PA4 +show_msg: False +step_swap_pin: PC10 +pres_swap_pin: leveling_mcu:PB1 +g28_wait_cool_down: true +pa_clr_down_mm: -0.15 +clr_noz_start_x: 95 +clr_noz_start_y: 221 +clr_noz_len_x: 40 +clr_noz_len_y: 2 +speeds: 2.5,1.0 +tri_hftr_cut: 2,1 +tri_lftr_k1: 0.70,0.30 +tri_min_hold: 2000,20000 +tri_max_hold: 6000,60000 +#进入调平状态用到的参数 +tri_min_hold_1:3000,10000 +tri_min_hold_2:3000,10000 +tri_min_hold_3:3000,10000 +tri_min_hold_4:3000,10000 +tri_min_hold_5:3000,10000 +tri_min_hold_6:3000,10000 + +tri_min_hold_7:3000,10000 +tri_min_hold_8:3000,10000 +tri_min_hold_9:3000,10000 +tri_min_hold_10:3000,10000 +tri_min_hold_11:3000,10000 +tri_min_hold_12:3000,10000 + +tri_min_hold_13:3000,10000 +tri_min_hold_14:3000,10000 +tri_min_hold_15:3000,10000 +tri_min_hold_16:3000,10000 +tri_min_hold_17:3000,10000 +tri_min_hold_18:3000,10000 + +tri_min_hold_19:3000,10000 +tri_min_hold_20:3000,10000 +tri_min_hold_21:3000,10000 +tri_min_hold_22:3000,10000 +tri_min_hold_23:3000,10000 +tri_min_hold_24:3000,10000 + +tri_min_hold_25:3000,10000 +tri_min_hold_26:3000,10000 +tri_min_hold_27:3000,10000 +tri_min_hold_28:3000,10000 +tri_min_hold_29:3000,10000 +tri_min_hold_30:3000,10000 + +tri_min_hold_31:3000,10000 +tri_min_hold_32:3000,10000 +tri_min_hold_33:3000,10000 +tri_min_hold_34:3000,10000 +tri_min_hold_35:3000,10000 +tri_min_hold_36:3000,10000 + +tri_max_hold_1:13000,60000 +tri_max_hold_2:13000,60000 +tri_max_hold_3:13000,60000 +tri_max_hold_4:13000,60000 +tri_max_hold_5:13000,60000 +tri_max_hold_6:13000,60000 +tri_max_hold_7:13000,60000 +tri_max_hold_8:13000,60000 +tri_max_hold_9:13000,60000 +tri_max_hold_10:13000,60000 +tri_max_hold_11:13000,60000 +tri_max_hold_12:13000,60000 +tri_max_hold_13:13000,60000 +tri_max_hold_14:13000,60000 +tri_max_hold_15:13000,60000 +tri_max_hold_16:13000,60000 +tri_max_hold_17:13000,60000 +tri_max_hold_18:13000,60000 +tri_max_hold_19:13000,60000 +tri_max_hold_20:13000,60000 +tri_max_hold_21:13000,60000 +tri_max_hold_22:13000,60000 +tri_max_hold_23:13000,60000 +tri_max_hold_24:13000,60000 +tri_max_hold_25:13000,60000 +tri_max_hold_26:13000,60000 +tri_max_hold_27:13000,60000 +tri_max_hold_28:13000,60000 +tri_max_hold_29:13000,60000 +tri_max_hold_30:13000,60000 +tri_max_hold_31:13000,60000 +tri_max_hold_32:13000,60000 +tri_max_hold_33:13000,60000 +tri_max_hold_34:13000,60000 +tri_max_hold_35:13000,60000 +tri_max_hold_36:13000,60000 + +[bed_mesh] +speed: 150 +mesh_min: 5,5 +mesh_max: 215,215 +probe_count: 5,5 +fade_start: 3.0 +fade_end: 10.0 + +[display_status] + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 10000 +max_z_velocity: 20 +square_corner_velocity: 5.0 +max_z_accel: 300 + +[pause_resume] +# recover_velocity: 500. + +[exclude_object] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [input_shaper] +#*# shaper_type_y = ei +#*# shaper_freq_y = 70.6 +#*# shaper_type_x = ei +#*# shaper_freq_x = 70.6 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.750375, 0.683438, 0.618375, 0.554406, 0.549500 +#*# 0.494406, 0.396906, 0.336531, 0.254031, 0.208813 +#*# 0.241094, 0.138281, 0.050000, -0.016094, -0.067906 +#*# 0.047000, -0.061844, -0.160844, -0.261625, -0.368750 +#*# -0.049375, -0.189781, -0.326906, -0.456375, -0.529906 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 5.0 +#*# max_x = 215.0 +#*# min_y = 5.0 +#*# max_y = 215.0 diff --git a/printer_params.cfg b/printer_params.cfg new file mode 100644 index 0000000..6e05fe5 --- /dev/null +++ b/printer_params.cfg @@ -0,0 +1,23 @@ +# K1 +# Printer_size: 220x220x250 +# Version: v1.0.0 +# CreateDate: 2023/03/21 +# Nozzle_mcu: chip: GD32F303CBT6 +# version: CR-K1-MAX-NOZZLE-V1.0.0 +# Leveling_mcu: chip: GD32E230F8P6 +# version: CR-K1-MAX-LEVELING-V1.0.0 +# mcu: chip: GD32F303RET6 +# version: CR4CU220812S12 + +[fan_feedback] +# fan0_pin: nozzle_mcu:PB3 # model fan +fan0_pin: nozzle_mcu:PB4 # throat fan +fan1_pin: PC6 # backplane fan +print_delay_time: 5 +current_delay_time: 2 + +[custom_macro] +default_bed_temp: 50 +default_extruder_temp: 240 +g28_ext_temp: 140 + diff --git a/sensorless.cfg b/sensorless.cfg new file mode 100644 index 0000000..2c4f1d9 --- /dev/null +++ b/sensorless.cfg @@ -0,0 +1,197 @@ +# Createdate: 2023/03/08 + +[force_move] + enable_force_move: true + +[gcode_macro xyz_ready] +variable_x_ready: 0 +variable_y_ready: 0 +variable_z_ready: 0 +variable_xy_moved: 0 +variable_z_moved: 0 +variable_safe_z: 3 +gcode: + +[gcode_macro _IF_HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %} + {% if printer.toolhead.position.z|int < 5 %} + {% set z_park = 5.0 - printer.toolhead.position.z|int %} + G91 + G1 z{z_park} F600 + G90 + {% endif %} + {% else %} + {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %} + {% if printer.print_stats.z_pos|float <= 20.0 or printer.print_stats.power_loss == 1 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE={printer["gcode_macro PRINTER_PARAM"].z_safe_g28} VELOCITY=10 + {% else %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=0.1 VELOCITY=10 + {% endif %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1 + {% endif %} + {% endif %} + +[gcode_macro _IF_MOVE_XY] +gcode: + _IF_HOME_Z + {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %} + {action_respond_info("move xy\n")} + # FORCE_MOVE STEPPER=stepper_x DISTANCE=14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=-14 VELOCITY=50 + FORCE_MOVE STEPPER=stepper_y DISTANCE=7 VELOCITY=50 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1 + G4 P1000 + {% endif %} + +[gcode_macro _HOME_X] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + {% if (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x)|round < 10 %} + {% set x_park = (10 - (printer.configfile.settings['stepper_x'].position_max - printer.toolhead.position.x))|round %} + {% if x_park > 0 %} + G91 + G1 x-{x_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=70 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=70 + # Home + G28 X + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1 + # Move away + G91 + G1 x-10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Y] +gcode: + _IF_MOVE_XY + + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer.toolhead.position.y|round < 9 %} + {% set y_park = 9 - printer.toolhead.position.y|round %} + {% if y_park > 0 %} + G91 + G1 y{y_park} F3600 + G90 + G4 P1000 + {% endif %} + {% endif %} + {% endif %} + + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=60 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=60 + # Home + G28 Y + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1 + # Move away + G91 + G1 y10 F3600 + G90 + # Wait just a second (give StallGuard registers time to clear) + G4 P2000 + +[gcode_macro _HOME_Z] +gcode: + {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %} + {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %} + _IF_HOME_Z + {% endif %} + {% endif %} + {% if printer.print_stats.z_pos|float >= 210.0 %} + FORCE_MOVE STEPPER=stepper_z DISTANCE=-8 VELOCITY=10 + {% endif %} + + {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %} + {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %} + # BED_MESH_SET_DISABLE + G91 + {% set x_park = POSITION_X - printer.toolhead.position.x|int %} + {% set y_park = POSITION_Y - printer.toolhead.position.y|int %} + {action_respond_info("x_park = %s \n" % (x_park))} + {action_respond_info("y_park = %s \n" % (y_park))} + G1 x{x_park} y{y_park} F3600 + G90 + # G4 P500 + + G28 Z + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1 + # BED_MESH_SET_ENABLE + +[homing_override] +axes: xyz +# set_position_x: 0 +# set_position_y: 0 +# set_position_z:0 +gcode: + M220 S100 + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0 + BED_MESH_CLEAR + {% set x_axes = printer.toolhead.homed_axes %} + {% if x_axes is defined and x_axes[0] is defined %} + {action_respond_info( + "x_axes: %s \n" + % (x_axes))} + {% else %} + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0 + SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0 + {action_respond_info( + "x_axes is NULL\n")} + {% endif %} + + {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %} + {action_respond_info("x_axes: %s \n"% (x_axes))} + {% set position_y = printer.toolhead.position.y|int %} + {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %} + {% if position_y >= max_y_position %} + G91 + G0 Y-10 F3600 + G90 + {% endif %} + {% endif %} + + {% set home_all = 'X' not in params and 'Y' not in params %} + {% if 'Z' in params and 'X' not in params and 'Y' not in params %} + {% if x_axes[0] is defined and x_axes[1] is defined %} + {% set home_all = 0 %} + {% endif %} + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'X' in params %} + _HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + _HOME_Y + {% endif %} + + {% if home_all or 'Z' in params %} + _HOME_Z + BED_MESH_PROFILE LOAD="default" + {% endif %} + # SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=0 + # SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_y VALUE=0 + G4 P500