From 633b62d3f502e372e2ad598f6494efc67fe8d373 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 1 Aug 2021 09:56:57 +0100 Subject: [PATCH 001/131] initial commit --- moonraker.conf | 35 +++++ printer.cfg | 405 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 440 insertions(+) create mode 100644 moonraker.conf create mode 100644 printer.cfg diff --git a/moonraker.conf b/moonraker.conf new file mode 100644 index 0000000..25f4ea7 --- /dev/null +++ b/moonraker.conf @@ -0,0 +1,35 @@ +[server] +host: 0.0.0.0 +port: 7125 +enable_debug_logging: False +config_path: ~/klipper_config + +[authorization] +enabled: True +cors_domains: + https://my.mainsail.xyz + http://my.mainsail.xyz + http://*.local + http://*.lan +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 + +# enables partial support of Octoprint API +[octoprint_compat] + +# enables moonraker to track and store print history. +[history] + +# this enables moonraker's update manager +[update_manager] + +[update_manager client mainsail] +type: web +repo: meteyou/mainsail +path: ~/mainsail \ No newline at end of file diff --git a/printer.cfg b/printer.cfg new file mode 100644 index 0000000..bf177c8 --- /dev/null +++ b/printer.cfg @@ -0,0 +1,405 @@ +# This file contains common configurations and pin mappings for the Prusa +# Mini+, which uses the Prusa Buddy board. + +# To use this config, the firmware should be compiled for the STM32F407. When +# running "make menuconfig", enable "extra low-level configuration setup", +# select the "128KiB + 512 byte offset" bootloader, and USB communication. +# Connect the printer to your Raspberry Pi using the printer's micro-USB port. +# If you prefer to remove Prusa's stock bootloader entirely, select the +# "No bootloader" option. + +# When flashing for the first time, you will need to break the "appendix" +# on the Buddy board, then put the device into DFU mode by moving the jumper +# on the 3-pin header (older boards) or shorting the 2-pin header (newer boards) +# and resetting, and finally use "make flash" to install Klipper. Once Klipper is +# installed, you no longer need the jumper - just use "make flash" which will +# automatically put the device into DFU mode. + +# Note that if you were previously running Prusa firmware, you must fully +# power cycle the board after flashing. Otherwise, Klipper will be unable to +# communicate with the TMC2209s due to the abrupt change in the baud rate, +# and will show this error: "Unable to read tmc uart register IFCNT". + +# See docs/Config_Reference.md for a description of parameters. + +[pause_resume] + +[display_status] + +[virtual_sdcard] +path: ~/gcode_files + +###################################################################### +# Macros +###################################################################### + +# custom slicer START_PRINT and END_PRINT macros +[gcode_macro START_PRINT] +description: start printing +gcode: + {% set BED_TEMP = params.BED_TEMP|default(60)|float %} + {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} + M140 S{BED_TEMP} # Start bed heating + M109 S{EXTRUDER_TEMP} # Start extruder heating + G90 # Use absolute coordinates + SET_GCODE_OFFSET Z=0.0 # Reset the G-Code Z offset (adjust Z offset if needed) + G28 # Home the printer + G1 Z5 F3000 # Move the nozzle near the bed + G1 Z0.15 F300 # Move the nozzle very close to the bed + M190 S{BED_TEMP} # Wait for bed to reach temperature + M109 S{EXTRUDER_TEMP} # Set and wait for nozzle to reach temperature + CLEAN_NOZZLE # clean the nozzle + +[gcode_macro END_PRINT] +description: end printing +gcode: + M140 S0 # Turn off bed + M104 S0 # Turn off extruder + M106 S0 # Turn off fan + G91 # Use relativ coordinates + G1 X-2 Y-2 E-3 F300 # Move nozzle away from print while retracting + G1 Z10 F3000 # Raise nozzle by 10mm + G90 # Use absolute coordinates + M84 # Disable steppers + +# [gcode_macro PARK] +# description: park the print head +# rename_existing: G27 +# gcode: +# {% set x = params.X|default(140) %} #edit to your park position +# {% set y = params.Y|default(20) %} #edit to your park position +# {% set z = params.Z|default(10)|float %} #edit to your park position +# {% set e = params.E|default(1) %} #edit to your retract length + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +gcode: + ##### set defaults ##### + {% set x = params.X|default(140) %} #edit to your park position + {% set y = params.Y|default(20) %} #edit to your park position + {% set z = params.Z|default(10)|float %} #edit to your park position + {% set e = params.E|default(1) %} #edit to your retract length + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set lift_z = z|abs %} + {% if act_z < (max_z - lift_z) %} + {% set z_safe = lift_z %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + PAUSE_BASE + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{e} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} + G90 + G1 X{x} Y{y} F6000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### set defaults ##### + {% set e = params.E|default(1) %} #edit to your retract length + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E{e} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + TURN_OFF_HEATERS + CANCEL_PRINT_BASE + +[gcode_macro CLEAN_NOZZLE]] +description: clean the nozzle +gcode: + {% set BED_TEMP = params.BED_TEMP|default(60)|float %} + {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} + {% set X1 = params.X1|default(120)|float %} + {% set X2 = params.X2|default(40)|float %} + {% set MANUAL = params.MANUAL|default(0) %} + SAVE_GCODE_STATE NAME=clean_nozzle_state + {% if MANUAL %} + G28 # home + M104 S{EXTRUDER_TEMP} # start heating extruder + M140 S{BED_TEMP} # start heating bed + M109 S{EXTRUDER_TEMP} # wait for extruder to reach temperature + M190 S{BED_TEMP} # wait for bed to reach temperature + {% endif %} + G90 # absolute positioning + G92 E0 + G0 F1500 + G0 X{X1} Y0 Z5 + G0 X{X1} Y0 Z0 + G0 X{X2} Y0 Z0 E10 + RESTORE_GCODE_STATE NAME=clean_nozzle_state + +[gcode_macro M600] +description: Change filament +gcode: + {% set X = params.X|default(50)|float %} + {% set Y = params.Y|default(0)|float %} + {% set Z = params.Z|default(10)|float %} + SAVE_GCODE_STATE NAME=M600_state + PAUSE + G91 + G1 E-.8 F2700 + G1 Z{Z} + G90 + G1 X{X} Y{Y} F3000 + G91 + G1 E-50 F1000 + RESTORE_GCODE_STATE NAME=M600_state + +## Remove unused gcodes +[gcode_macro G29] +description: Bed Leveling +gcode: + G4 + +[gcode_macro M201] +description: Set Print Max Acceleration +gcode: + G4 + +[gcode_macro M203] +description: Set Max Feedrate +gcode: + G4 + +[gcode_macro M205] +description: Set Advanced Settings +gcode: + G4 + +[gcode_macro M900] +description: Linear Advance Factor +gcode: + G4 + +[stepper_x] +step_pin: PD1 +dir_pin: PD0 +enable_pin: !PD3 +microsteps: 16 +rotation_distance: 32 # 200 * 16 / 100 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 180.4 +position_min: -2 +position_max: 180.4 +homing_speed: 50 +homing_retract_dist: 0 + +[stepper_y] +step_pin: PD13 +dir_pin: PD12 +enable_pin: !PD14 +microsteps: 16 +rotation_distance: 32 # 200 * 16 / 100 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: -3 +position_min: -3 +position_max: 180 +homing_speed: 50 +homing_retract_dist: 0 + +[stepper_z] +step_pin: PD4 +dir_pin: !PD15 +enable_pin: !PD2 +microsteps: 16 +rotation_distance: 4 +endstop_pin: probe:z_virtual_endstop +position_min: -3 +position_max: 185 + +[extruder] +step_pin: PD9 +dir_pin: !PD8 +enable_pin: !PD10 +microsteps: 16 +rotation_distance: 26.2564 # (200 * 16 * 48/18) / 325 +gear_ratio: 48:18 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: PB1 +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PC0 +#control: pid +# Prusa's firmware defaults. +#pid_Kp: 7 +#pid_Ki: 0.5 +#pid_Kd: 45 +min_temp: 10 +max_temp: 305 + +[tmc2209 stepper_x] +uart_pin: PD5 +uart_address: 1 +diag_pin: ^PE2 +driver_SGTHRS: 130 +run_current: 0.35 +sense_resistor: 0.22 +stealthchop_threshold: 999999 + +[tmc2209 stepper_y] +uart_pin: PD5 +uart_address: 3 +diag_pin: ^PE1 +driver_SGTHRS: 130 +run_current: 0.35 +sense_resistor: 0.22 +stealthchop_threshold: 999999 + +[tmc2209 stepper_z] +uart_pin: PD5 +uart_address: 0 +diag_pin: ^PE3 +driver_SGTHRS: 100 +run_current: 0.35 +sense_resistor: 0.22 +stealthchop_threshold: 999999 + +[tmc2209 extruder] +uart_pin: PD5 +uart_address: 2 +diag_pin: ^PA15 +driver_SGTHRS: 100 +run_current: 0.4 +sense_resistor: 0.22 + +[heater_bed] +heater_pin: PB0 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PA4 +#control: pid +# Prusa's firmware defaults. +#pid_Kp: 120 +#pid_Ki: 1.5 +#pid_Kd: 600 +min_temp: 10 +max_temp: 110 + +# Hotend fan. +# The stock firmware uses control ranges of PWM 0-50%, RPM 1000-8000. +# Change fan_speed below to match your preference. Measured speeds: +# fan_speed 0.5: 50% PWM = 4000RPM (Prusa stock default speed) +# fan_speed 1.0: 100% PWM = 8000RPM (safe but loud) +[heater_fan hotend_fan] +pin: PE9 +tachometer_pin: PE14 +fan_speed: 0.5 + +# Part cooling fan. +# The stock firmware uses control ranges of PWM 10-50%, RPM 500-5000. +# To match stock firmware, set the Klipper fan speed to 50%. This speed +# can be safely increased to 100% for better part cooling. Measured speeds: +# 50% PWM = 2500RPM (Prusa stock default speed) +# 100% PWM = 5000RPM (better cooling, still quiet) +[fan] +pin: PE11 +tachometer_pin: PE10 + +# The SuperPINDA has built-in temperature compensation and no thermistor output, +# so no compensation table is needed here. +[probe] +pin: PA8 +x_offset: -29 +y_offset: -3 +#z_offset: 0 # set this to your Live Z Offset, but negated (invert the sign) +speed: 6.0 + +[safe_z_home] +home_xy_position: 147.4,21.1 +z_hop: 4 + +[bed_mesh] +speed: 100 +horizontal_move_z: 5 +mesh_min: 10,10 +mesh_max: 141,167 +probe_count: 4,4 + +[filament_switch_sensor filament_sensor] +switch_pin: ^PB4 +pause_on_runout: True + +[mcu] +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2B0024001547393432343038-if00 +restart_method: command + +[printer] +kinematics: cartesian +# Prusa firmware defaults. +max_velocity: 180 +max_accel: 1250 +max_z_velocity: 12 +max_z_accel: 400 + +[display] +lcd_type: st7789v +spi_bus: spi2a +rst_pin: PC8 +cs_pin: PC9 +rs_pin: PD11 +encoder_pins: ^PE13, ^PE15 +click_pin: ^!PE12 + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 21.307 +#*# pid_ki = 0.911 +#*# pid_kd = 124.644 +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 57.528 +#*# pid_ki = 1.059 +#*# pid_kd = 780.942 +#*# +#*# [probe] +#*# z_offset = 1.480 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# -0.058750, -0.003750, 0.102500, 0.057500 +#*# -0.086250, -0.037500, -0.027500, 0.007500 +#*# -0.022500, -0.057500, -0.070000, -0.011250 +#*# -0.066250, -0.102500, -0.045000, -0.071250 +#*# tension = 0.2 +#*# min_x = 10.0 +#*# algo = lagrange +#*# y_count = 4 +#*# mesh_y_pps = 2 +#*# min_y = 10.0 +#*# x_count = 4 +#*# max_y = 166.99 +#*# mesh_x_pps = 2 +#*# max_x = 140.98 From 9a1adc99ef4caf32475e38e42923db428b42eaae Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 20 Sep 2021 23:15:31 +0200 Subject: [PATCH 002/131] v2.4: add config, wip --- fluidd.cfg | 70 +++++++ moonraker.conf | 40 ++++ printer.cfg | 557 +++++++++++++++++++++++++++++++++++++++++++++++++ webcam.txt | 79 +++++++ 4 files changed, 746 insertions(+) create mode 100644 fluidd.cfg create mode 100644 moonraker.conf create mode 100644 printer.cfg create mode 100644 webcam.txt diff --git a/fluidd.cfg b/fluidd.cfg new file mode 100644 index 0000000..eee2dd9 --- /dev/null +++ b/fluidd.cfg @@ -0,0 +1,70 @@ +[virtual_sdcard] +path: /home/pi/gcode_files + +[pause_resume] + +[display_status] + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + TURN_OFF_HEATERS + CANCEL_PRINT_BASE + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 1.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 x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + PAUSE_BASE + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + #### 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 %} + RESUME_BASE {get_params} \ No newline at end of file diff --git a/moonraker.conf b/moonraker.conf new file mode 100644 index 0000000..10ddd21 --- /dev/null +++ b/moonraker.conf @@ -0,0 +1,40 @@ +[server] +host: 0.0.0.0 +port: 7125 +enable_debug_logging: False +config_path: ~/klipper_config +temperature_store_size: 600 +gcode_store_size: 1000 +log_path: ~/klipper_logs + +[authorization] +force_logins: True +cors_domains: + *.local + *.lan + *://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 + +# enables partial support of Octoprint API +[octoprint_compat] + +# enables moonraker to track and store print history. +[history] + +# this enables moonraker's update manager +[update_manager] +enable_auto_refresh: True + +# this enabled fluidd updates +[update_manager client fluidd] +type: web +repo: cadriel/fluidd +path: ~/fluidd \ No newline at end of file diff --git a/printer.cfg b/printer.cfg new file mode 100644 index 0000000..6ecc04a --- /dev/null +++ b/printer.cfg @@ -0,0 +1,557 @@ +# This file contains common pin mappings for the BigTreeTech OctoPus V1. +# To use this config, the firmware should be compiled for the STM32F446 with a "32KiB bootloader" +# Enable "extra low-level configuration options" and select the "12MHz crystal" as clock reference + +# 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 250/300/350mm BigTreeTech OctoPus V1 TMC2209 UART config + +## *** THINGS TO CHANGE/CHECK: *** +## MCU paths [mcu] section +## Thermistor types [extruder] and [heater_bed] sections - See 'sensor types' list at end of file +## Z Endstop Switch location [safe_z_home] section +## Homing end position [gcode_macro G32] section +## Z Endstop Switch offset for Z0 [stepper_z] section +## Probe points [quad_gantry_level] section +## Min & Max gantry corner postions [quad_gantry_level] section +## PID tune [extruder] and [heater_bed] sections +## Fine tune E steps [extruder] section + +[mcu] +## [X in MOTOR0] - B Motor +## [Y in MOTOR1] - A Motor +## [E in MOTOR6] - Extruder +## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 +#restart_method: command +##-------------------------------------------------------------------- + +[include fluidd.cfg] + +[printer] +kinematics: corexy +max_velocity: 300 +max_accel: 3000 #Max 4000 +max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V +max_z_accel: 350 +square_corner_velocity: 5.0 + +##################################################################### +# X/Y Stepper Settings +##################################################################### + +## X Stepper on MOTOR0(B Motor) +[stepper_x] +step_pin: PF13 +dir_pin: !PF12 +enable_pin: !PF14 +rotation_distance: 40 +microsteps: 16 +full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper +endstop_pin: PG6 +position_min: 0 +##-------------------------------------------------------------------- + +## Uncomment below for 250mm build +#position_endstop: 250 +#position_max: 250 + +## Uncomment for 300mm build +position_endstop: 300 +position_max: 300 + +## Uncomment for 350mm build +#position_endstop: 350 +#position_max: 350 + +##-------------------------------------------------------------------- +homing_speed: 25 #Max 100 +homing_retract_dist: 5 +homing_positive_dir: true + +## Make sure to update below for your relevant driver (2208 or 2209) +[tmc2209 stepper_x] +uart_pin: PC4 +interpolate: True +run_current: 0.8 +hold_current: 0.7 +sense_resistor: 0.110 +stealthchop_threshold: 0 + +## Y Stepper on MOTOR1 (A Motor) +[stepper_y] +step_pin: PG0 +dir_pin: !PG1 +enable_pin: !PF15 +rotation_distance: 40 +microsteps: 16 +full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper +endstop_pin: PG9 +position_min: 0 +##-------------------------------------------------------------------- + +## Uncomment for 250mm build +#position_endstop: 250 +#position_max: 250 + +## Uncomment for 300mm build +position_endstop: 305 +position_max: 305 + +## Uncomment for 350mm build +#position_endstop: 350 +#position_max: 350 + +##-------------------------------------------------------------------- +homing_speed: 25 #Max 100 +homing_retract_dist: 5 +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: 0.8 +hold_current: 0.7 +sense_resistor: 0.110 +stealthchop_threshold: 0 + +##################################################################### +# Z Stepper Settings +##################################################################### + +## Z0 Stepper - Front Left on MOTOR2_1 +[stepper_z] +step_pin: PF11 +# dir_pin: !PG3 +dir_pin: PG3 +enable_pin: !PG5 +rotation_distance: 40 +gear_ratio: 80:16 +microsteps: 16 +endstop_pin: PG10 +## 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: 240 + +## Uncomment below for 300mm build +position_max: 290 + +## Uncomment below for 350mm build +#position_max: 340 + +##-------------------------------------------------------------------- +position_min: -5 +homing_speed: 8 +second_homing_speed: 3 +homing_retract_dist: 3 + +## Make sure to update below for your relevant driver (2208 or 2209) +[tmc2209 stepper_z] +uart_pin: PC6 +interpolate: true +run_current: 0.8 +hold_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 + +## Z1 Stepper - Rear Left on MOTOR3 +[stepper_z1] +step_pin: PG4 +# dir_pin: PC1 +dir_pin: !PC1 +enable_pin: !PA0 +rotation_distance: 40 +gear_ratio: 80:16 +microsteps: 16 + +## Make sure to update below for your relevant driver (2208 or 2209) +[tmc2209 stepper_z1] +uart_pin: PC7 +interpolate: true +run_current: 0.8 +hold_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 + +## Z2 Stepper - Rear Right on MOTOR4 +[stepper_z2] +step_pin: PF9 +# dir_pin: !PF10 +dir_pin: PF10 +enable_pin: !PG2 +rotation_distance: 40 +gear_ratio: 80:16 +microsteps: 16 + +## Make sure to update below for your relevant driver (2208 or 2209) +[tmc2209 stepper_z2] +uart_pin: PF2 +interpolate: true +run_current: 0.8 +hold_current: 0.80 +sense_resistor: 0.110 +stealthchop_threshold: 0 + +## Z3 Stepper - Front Right on MOTOR5 +[stepper_z3] +step_pin: PC13 +# dir_pin: PF0 +dir_pin: !PF0 +enable_pin: !PF1 +rotation_distance: 40 +gear_ratio: 80:16 +microsteps: 16 + +## Make sure to update below for your relevant driver (2208 or 2209) +[tmc2209 stepper_z3] +uart_pin: PE4 +interpolate: true +run_current: 0.8 +hold_current: 0.80 +sense_resistor: 0.110 +stealthchop_threshold: 0 + + +##################################################################### +# Extruder +##################################################################### + +# E0 on MOTOR6 +[extruder] +step_pin: PE2 +dir_pin: PE3 +enable_pin: !PD4 +## Update value below when you perform extruder calibration +## If you ask for 100mm of filament, but in reality it is 98mm: +## rotation_distance = * / 100 +## 22.6789511 is a good starting point +rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears +## Update Gear Ratio depending on your Extruder Type +## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio) +## Use 80:20 for M4, M3.1 +gear_ratio: 50:17 #BMG Gear Ratio +microsteps: 16 +full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree +nozzle_diameter: 0.400 +filament_diameter: 1.75 +heater_pin: PA2 +## Validate the following thermistor type to make sure it is correct +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF4 +min_temp: 10 +max_temp: 270 +max_power: 1.0 +min_extrude_temp: 170 +control = pid +pid_kp = 26.213 +pid_ki = 1.304 +pid_kd = 131.721 +## Try to keep pressure_advance below 1.0 +pressure_advance: 0.05 +## Default is 0.040, leave stock +pressure_advance_smooth_time: 0.040 + +## E0 on MOTOR6 +## Make sure to update below for your relevant driver (2208 or 2209) +[tmc2209 extruder] +uart_pin: PE1 +interpolate: false +run_current: 0.5 +hold_current: 0.4 +sense_resistor: 0.110 +stealthchop_threshold: 0 + + +##################################################################### +# Bed Heater +##################################################################### + +[heater_bed] +## SSR Pin - BED_OUT +heater_pin: PA1 +sensor_type: NTC 100K beta 3950 +sensor_pin: PF3 +## Adjust Max Power so your heater doesn't warp your bed +max_power: 0.6 +min_temp: 0 +max_temp: 120 +control: pid +pid_kp: 58.437 +pid_ki: 2.347 +pid_kd: 363.769 + +##################################################################### +# Probe +##################################################################### + +[probe] +## Inductive Probe +## This probe is not used for Z height, only Quad Gantry Leveling +pin: ~!PB7 +x_offset: 0 +y_offset: 25.0 +z_offset: 0 +speed: 10.0 +samples: 3 +samples_result: median +sample_retract_dist: 3.0 +samples_tolerance: 0.006 +samples_tolerance_retries: 3 + +##################################################################### +# Fan Control +##################################################################### + +[fan] +## Print Cooling Fan - CNC_FAN0 +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 + +[heater_fan hotend_fan] +## Hotend Fan - CNC_FAN1 +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 + +[heater_fan controller_fan] +## Controller fan - CNC_FAN2 +pin: PD12 +kick_start_time: 0.5 +heater: heater_bed +heater_temp: 45.0 + +#[heater_fan exhaust_fan] +## Exhaust fan - CNC_FAN3 +#pin: PD13 +#max_power: 1.0 +#shutdown_speed: 0.0 +#kick_start_time: 5.0 +#heater: heater_bed +#heater_temp: 60 +#fan_speed: 1.0 + +##################################################################### +# LED Control +##################################################################### + +#[output_pin caselight] +# Chamber Lighting - HE1 Connector (Optional) +#pin: PA3 +#pwm:true +#shutdown_value: 0 +#value:1 +#cycle_time: 0.01 + +##################################################################### +# 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: 208, 305 +speed:100 +z_hop:10 + +[quad_gantry_level] +## 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 + +#-------------------------------------------------------------------- +## Gantry Corners for 250mm Build +## Uncomment for 250mm build +#gantry_corners: +# -60,-10 +# 310, 320 +## Probe points +#points: +# 50,25 +# 50,175 +# 200,175 +# 200,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: 100 +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 +#-------------------------------------------------------------------- + +#[display] +## RepRapDiscount 128x64 Full Graphic Smart Controller +#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 + +#-------------------------------------------------------------------- + +#[display] +## mini12864 LCD 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 + +#[neopixel btt_mini12864] +## To control Neopixel RGB in mini12864 display +#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 + +#-------------------------------------------------------------------- + + +##################################################################### +# Macros +##################################################################### + +[gcode_macro G32] +gcode: + BED_MESH_CLEAR + G28 + QUAD_GANTRY_LEVEL + G28 + ## Uncomment for for your size printer: + #-------------------------------------------------------------------- + ## Uncomment for 250mm build + #G0 X125 Y125 Z30 F3600 + + ## Uncomment for 300 build + G0 X150 Y150 Z30 F3600 + + ## Uncomment for 350mm build + #G0 X175 Y175 Z30 F3600 + #-------------------------------------------------------------------- + +[gcode_macro PRINT_START] +# Use PRINT_START for the slicer starting script - please customise for your slicer of choice +gcode: + G32 ; home all axes + G1 Z20 F3000 ; move nozzle away from bed + + +[gcode_macro PRINT_END] +# Use PRINT_END for the slicer ending script - please customise for your slicer of choice +gcode: + M400 ; wait for buffer to clear + G92 E0 ; zero the extruder + G1 E-10.0 F3600 ; retract filament + G91 ; relative positioning + G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing + TURN_OFF_HEATERS + M107 ; turn off fan + G1 Z2 F3000 ; move nozzle up 2mm + G90 ; absolute positioning + G0 X125 Y250 F3600 ; park nozzle at rear + BED_MESH_CLEAR + +## Thermistor Types +## "EPCOS 100K B57560G104F" +## "ATC Semitec 104GT-2" +## "NTC 100K beta 3950" +## "Honeywell 100K 135-104LAG-J01" +## "NTC 100K MGB18-104F39050L32" (Keenovo Heater Pad) +## "AD595" +## "PT100 INA826" diff --git a/webcam.txt b/webcam.txt new file mode 100644 index 0000000..8b7bb9c --- /dev/null +++ b/webcam.txt @@ -0,0 +1,79 @@ +### Windows users: To edit this file use Notepad++, VSCode, Atom or SublimeText. +### Do not use Notepad or WordPad. + +### MacOSX users: If you use Textedit to edit this file make sure to use +### "plain text format" and "disable smart quotes" in "Textedit > Preferences" + +### Configure which camera to use +# +# Available options are: +# - auto: tries first usb webcam, if that's not available tries raspi cam +# - usb: only tries usb webcam +# - raspi: only tries raspi cam +# +# Defaults to auto +# +#camera="auto" + +### Additional options to supply to MJPG Streamer for the USB camera +# +# See https://faq.octoprint.org/mjpg-streamer-config for available options +# +# Defaults to a resolution of 640x480 px and a framerate of 10 fps +# +#camera_usb_options="-r 640x480 -f 10" + +### Additional webcam devices known to cause problems with -f +# +# Apparently there a some devices out there that with the current +# mjpg_streamer release do not support the -f parameter (for specifying +# the capturing framerate) and will just refuse to output an image if it +# is supplied. +# +# The webcam daemon will detect those devices by their USB Vendor and Product +# ID and remove the -f parameter from the options provided to mjpg_streamer. +# +# By default, this is done for the following devices: +# Logitech C170 (046d:082b) +# GEMBIRD (1908:2310) +# Genius F100 (0458:708c) +# Cubeternet GL-UPC822 UVC WebCam (1e4e:0102) +# +# Using the following option it is possible to add additional devices. If +# your webcam happens to show above symptoms, try determining your cam's +# vendor and product id via lsusb, activating the line below by removing # and +# adding it, e.g. for two broken cameras "aabb:ccdd" and "aabb:eeff" +# +# additional_brokenfps_usb_devices=("aabb:ccdd" "aabb:eeff") +# +# +#additional_brokenfps_usb_devices=() + +### Additional options to supply to MJPG Streamer for the RasPi Cam +# +# See https://faq.octoprint.org/mjpg-streamer-config for available options +# +# Defaults to 10fps +# +#camera_raspi_options="-fps 10" + +### Configuration of camera HTTP output +# +# Usually you should NOT need to change this at all! Only touch if you +# know what you are doing and what the parameters mean. +# +# Below settings are used in the mjpg-streamer call like this: +# +# -o "output_http.so -w $camera_http_webroot $camera_http_options" +# +# Current working directory is the mjpg-streamer base directory. +# +#camera_http_webroot="./www-fluidd" +#camera_http_options="-n" + +### EXPERIMENTAL +# Support for different streamer types. +# +# Available options: +# mjpeg [default] - stable MJPG-streamer +#camera_streamer=mjpeg From fda0feede8f604b5d8625ae2aad4fd87a5c927c5 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 21:55:26 +0200 Subject: [PATCH 003/131] v2.4: fix movement directions --- printer.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/printer.cfg b/printer.cfg index 6ecc04a..b1c0ec5 100644 --- a/printer.cfg +++ b/printer.cfg @@ -36,7 +36,7 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 kinematics: corexy max_velocity: 300 max_accel: 3000 #Max 4000 -max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V +max_z_velocity: 25 #Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 350 square_corner_velocity: 5.0 @@ -230,7 +230,7 @@ stealthchop_threshold: 0 # E0 on MOTOR6 [extruder] step_pin: PE2 -dir_pin: PE3 +dir_pin: !PE3 enable_pin: !PD4 ## Update value below when you perform extruder calibration ## If you ask for 100mm of filament, but in reality it is 98mm: @@ -298,7 +298,7 @@ pid_kd: 363.769 [probe] ## Inductive Probe ## This probe is not used for Z height, only Quad Gantry Leveling -pin: ~!PB7 +pin: ~PB7 x_offset: 0 y_offset: 25.0 z_offset: 0 From 309d95a5e8f76007e6c4017f2e7998c592f9550e Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 21:56:09 +0200 Subject: [PATCH 004/131] v2.4: add chamber thermistor --- printer.cfg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/printer.cfg b/printer.cfg index b1c0ec5..19c45f9 100644 --- a/printer.cfg +++ b/printer.cfg @@ -365,6 +365,22 @@ heater_temp: 45.0 # Homing and Gantry Adjustment Routines ##################################################################### +##################################################################### +# Enclosure Temp Sensor Section +##################################################################### +[thermistor chamber_temp] +temperature1: 25 +resistance1: 10000 +beta: 3950 + + +[temperature_sensor enclosure_temp] +sensor_type: chamber_temp +sensor_pin: PF5 +min_temp: 0 +max_temp: 100 +gcode_id: C + [idle_timeout] timeout: 1800 From bc00eb71dab1d0319a5ac708ec06d8f627c35808 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 21:56:34 +0200 Subject: [PATCH 005/131] v2.4: add display --- printer.cfg | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/printer.cfg b/printer.cfg index 19c45f9..3867431 100644 --- a/printer.cfg +++ b/printer.cfg @@ -485,36 +485,36 @@ aliases: #-------------------------------------------------------------------- -#[display] -## mini12864 LCD 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 +[display] +# mini12864 LCD 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 -#[neopixel btt_mini12864] -## To control Neopixel RGB in mini12864 display -#pin: EXP1_6 -#chain_count: 3 -#initial_RED: 0.1 -#initial_GREEN: 0.5 -#initial_BLUE: 0.0 -#color_order: RGB +[neopixel btt_mini12864] +# To control Neopixel RGB in mini12864 display +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 +# 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 #-------------------------------------------------------------------- From ba43ebc29c714be3f9672f95c21170c205c745a8 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 22:17:36 +0200 Subject: [PATCH 006/131] v2.4: pid calibration --- printer.cfg | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/printer.cfg b/printer.cfg index 3867431..489a37c 100644 --- a/printer.cfg +++ b/printer.cfg @@ -253,10 +253,10 @@ min_temp: 10 max_temp: 270 max_power: 1.0 min_extrude_temp: 170 -control = pid -pid_kp = 26.213 -pid_ki = 1.304 -pid_kd = 131.721 +#control = pid +#pid_kp = 26.213 +#pid_ki = 1.304 +#pid_kd = 131.721 ## Try to keep pressure_advance below 1.0 pressure_advance: 0.05 ## Default is 0.040, leave stock @@ -286,10 +286,10 @@ sensor_pin: PF3 max_power: 0.6 min_temp: 0 max_temp: 120 -control: pid -pid_kp: 58.437 -pid_ki: 2.347 -pid_kd: 363.769 +#control: pid +#pid_kp: 58.437 +#pid_ki: 2.347 +#pid_kd: 363.769 ##################################################################### # Probe @@ -571,3 +571,18 @@ gcode: ## "NTC 100K MGB18-104F39050L32" (Keenovo Heater Pad) ## "AD595" ## "PT100 INA826" + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 37.870 +#*# pid_ki = 1.244 +#*# pid_kd = 288.283 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 27.483 +#*# pid_ki = 1.762 +#*# pid_kd = 107.182 From 175379eda22d054bd90164a3efd298db4030e4f5 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 22:23:14 +0200 Subject: [PATCH 007/131] v2.4: clean-up --- printer.cfg | 135 +++++----------------------------------------------- 1 file changed, 11 insertions(+), 124 deletions(-) diff --git a/printer.cfg b/printer.cfg index 489a37c..d661a38 100644 --- a/printer.cfg +++ b/printer.cfg @@ -40,6 +40,7 @@ max_z_velocity: 25 #Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 350 square_corner_velocity: 5.0 + ##################################################################### # X/Y Stepper Settings ##################################################################### @@ -54,26 +55,12 @@ microsteps: 16 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG6 position_min: 0 -##-------------------------------------------------------------------- - -## Uncomment below for 250mm build -#position_endstop: 250 -#position_max: 250 - -## Uncomment for 300mm build position_endstop: 300 position_max: 300 - -## Uncomment for 350mm build -#position_endstop: 350 -#position_max: 350 - -##-------------------------------------------------------------------- homing_speed: 25 #Max 100 homing_retract_dist: 5 homing_positive_dir: true -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_x] uart_pin: PC4 interpolate: True @@ -92,26 +79,12 @@ microsteps: 16 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 -##-------------------------------------------------------------------- - -## Uncomment for 250mm build -#position_endstop: 250 -#position_max: 250 - -## Uncomment for 300mm build position_endstop: 305 position_max: 305 - -## Uncomment for 350mm build -#position_endstop: 350 -#position_max: 350 - -##-------------------------------------------------------------------- homing_speed: 25 #Max 100 homing_retract_dist: 5 homing_positive_dir: true -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_y] uart_pin: PD11 interpolate: True @@ -120,6 +93,7 @@ hold_current: 0.7 sense_resistor: 0.110 stealthchop_threshold: 0 + ##################################################################### # Z Stepper Settings ##################################################################### @@ -127,7 +101,6 @@ stealthchop_threshold: 0 ## Z0 Stepper - Front Left on MOTOR2_1 [stepper_z] step_pin: PF11 -# dir_pin: !PG3 dir_pin: PG3 enable_pin: !PG5 rotation_distance: 40 @@ -139,24 +112,12 @@ endstop_pin: PG10 ## 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: 240 - -## Uncomment below for 300mm build position_max: 290 - -## Uncomment below for 350mm build -#position_max: 340 - -##-------------------------------------------------------------------- position_min: -5 homing_speed: 8 second_homing_speed: 3 homing_retract_dist: 3 -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z] uart_pin: PC6 interpolate: true @@ -168,14 +129,12 @@ stealthchop_threshold: 0 ## Z1 Stepper - Rear Left on MOTOR3 [stepper_z1] step_pin: PG4 -# dir_pin: PC1 dir_pin: !PC1 enable_pin: !PA0 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16 -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z1] uart_pin: PC7 interpolate: true @@ -187,14 +146,12 @@ stealthchop_threshold: 0 ## Z2 Stepper - Rear Right on MOTOR4 [stepper_z2] step_pin: PF9 -# dir_pin: !PF10 dir_pin: PF10 enable_pin: !PG2 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16 -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z2] uart_pin: PF2 interpolate: true @@ -206,14 +163,12 @@ stealthchop_threshold: 0 ## Z3 Stepper - Front Right on MOTOR5 [stepper_z3] step_pin: PC13 -# dir_pin: PF0 dir_pin: !PF0 enable_pin: !PF1 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16 -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 stepper_z3] uart_pin: PE4 interpolate: true @@ -263,7 +218,6 @@ pressure_advance: 0.05 pressure_advance_smooth_time: 0.040 ## E0 on MOTOR6 -## Make sure to update below for your relevant driver (2208 or 2209) [tmc2209 extruder] uart_pin: PE1 interpolate: false @@ -291,6 +245,7 @@ max_temp: 120 #pid_ki: 2.347 #pid_kd: 363.769 + ##################################################################### # Probe ##################################################################### @@ -309,6 +264,7 @@ sample_retract_dist: 3.0 samples_tolerance: 0.006 samples_tolerance_retries: 3 + ##################################################################### # Fan Control ##################################################################### @@ -349,6 +305,7 @@ heater_temp: 45.0 #heater_temp: 60 #fan_speed: 1.0 + ##################################################################### # LED Control ##################################################################### @@ -361,10 +318,12 @@ heater_temp: 45.0 #value:1 #cycle_time: 0.01 + ##################################################################### # Homing and Gantry Adjustment Routines ##################################################################### + ##################################################################### # Enclosure Temp Sensor Section ##################################################################### @@ -386,63 +345,27 @@ 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: 208, 305 speed:100 z_hop:10 [quad_gantry_level] ## 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 - -#-------------------------------------------------------------------- -## Gantry Corners for 250mm Build -## Uncomment for 250mm build -#gantry_corners: -# -60,-10 -# 310, 320 -## Probe points -#points: -# 50,25 -# 50,175 -# 200,175 -# 200,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: 100 horizontal_move_z: 10 retries: 5 retry_tolerance: 0.0075 max_adjust: 10 + ######################################## # EXP1 / EXP2 (display) pins ######################################## @@ -463,28 +386,11 @@ aliases: EXP2_7=PC15, EXP2_8=, EXP2_9=, EXP2_10=<5V> + ##################################################################### # Displays ##################################################################### -## Uncomment the display that you have -#-------------------------------------------------------------------- - -#[display] -## RepRapDiscount 128x64 Full Graphic Smart Controller -#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 - -#-------------------------------------------------------------------- - [display] # mini12864 LCD Display lcd_type: uc1701 @@ -516,8 +422,6 @@ gcode: 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 -#-------------------------------------------------------------------- - ##################################################################### # Macros @@ -529,18 +433,9 @@ gcode: G28 QUAD_GANTRY_LEVEL G28 - ## Uncomment for for your size printer: - #-------------------------------------------------------------------- - ## Uncomment for 250mm build - #G0 X125 Y125 Z30 F3600 - - ## Uncomment for 300 build G0 X150 Y150 Z30 F3600 - - ## Uncomment for 350mm build - #G0 X175 Y175 Z30 F3600 - #-------------------------------------------------------------------- + [gcode_macro PRINT_START] # Use PRINT_START for the slicer starting script - please customise for your slicer of choice gcode: @@ -562,15 +457,7 @@ gcode: G90 ; absolute positioning G0 X125 Y250 F3600 ; park nozzle at rear BED_MESH_CLEAR - -## Thermistor Types -## "EPCOS 100K B57560G104F" -## "ATC Semitec 104GT-2" -## "NTC 100K beta 3950" -## "Honeywell 100K 135-104LAG-J01" -## "NTC 100K MGB18-104F39050L32" (Keenovo Heater Pad) -## "AD595" -## "PT100 INA826" + #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. From e98212a2ae22957ec0331e151199344d49b6bd7d Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 22:43:46 +0200 Subject: [PATCH 008/131] v2.4: add bed_mesh --- printer.cfg | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index d661a38..e82f61a 100644 --- a/printer.cfg +++ b/printer.cfg @@ -349,6 +349,14 @@ home_xy_position: 208, 305 speed:100 z_hop:10 +[bed_mesh] +speed: 1000 +horizontal_move_z: 5 +mesh_min: 25,25 +mesh_max: 261,287 +probe_count: 5,5 +algorithm: bicubic + [quad_gantry_level] ## Use QUAD_GANTRY_LEVEL to level a gantry. gantry_corners: @@ -458,7 +466,6 @@ gcode: G0 X125 Y250 F3600 ; park nozzle at rear BED_MESH_CLEAR - #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# @@ -473,3 +480,22 @@ gcode: #*# pid_kp = 27.483 #*# pid_ki = 1.762 #*# pid_kd = 107.182 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.382500, 0.377500, 0.370000, 0.357500, 0.337500 +#*# 0.340000, 0.330000, 0.305000, 0.305000, 0.295000 +#*# 0.342500, 0.342500, 0.325000, 0.305000, 0.270000 +#*# 0.335000, 0.350000, 0.327500, 0.322500, 0.307500 +#*# 0.382500, 0.407500, 0.392500, 0.382500, 0.355000 +#*# tension = 0.2 +#*# min_x = 25.0 +#*# algo = bicubic +#*# y_count = 5 +#*# mesh_y_pps = 2 +#*# min_y = 25.0 +#*# x_count = 5 +#*# max_y = 287.0 +#*# mesh_x_pps = 2 +#*# max_x = 261.0 From cad78f9f0ccdbb72f01e5aecae439cae12c1ed6f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 21 Sep 2021 22:44:09 +0200 Subject: [PATCH 009/131] v2.4: z_endstop_calibrate --- printer.cfg | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/printer.cfg b/printer.cfg index e82f61a..2ae6fde 100644 --- a/printer.cfg +++ b/printer.cfg @@ -111,7 +111,7 @@ endstop_pin: PG10 ## (+) 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 +#position_endstop: -0.5 position_max: 290 position_min: -5 homing_speed: 8 @@ -484,11 +484,11 @@ gcode: #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.382500, 0.377500, 0.370000, 0.357500, 0.337500 -#*# 0.340000, 0.330000, 0.305000, 0.305000, 0.295000 -#*# 0.342500, 0.342500, 0.325000, 0.305000, 0.270000 -#*# 0.335000, 0.350000, 0.327500, 0.322500, 0.307500 -#*# 0.382500, 0.407500, 0.392500, 0.382500, 0.355000 +#*# 0.382500, 0.377500, 0.370000, 0.357500, 0.337500 +#*# 0.340000, 0.330000, 0.305000, 0.305000, 0.295000 +#*# 0.342500, 0.342500, 0.325000, 0.305000, 0.270000 +#*# 0.335000, 0.350000, 0.327500, 0.322500, 0.307500 +#*# 0.382500, 0.407500, 0.392500, 0.382500, 0.355000 #*# tension = 0.2 #*# min_x = 25.0 #*# algo = bicubic @@ -499,3 +499,6 @@ gcode: #*# max_y = 287.0 #*# mesh_x_pps = 2 #*# max_x = 261.0 +#*# +#*# [stepper_z] +#*# position_endstop = 0.542 From df9a64bd293204aa2640dedf98a753c843025501 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 22 Sep 2021 10:00:46 +0200 Subject: [PATCH 010/131] v2.4: move macros to separate file --- macros.cfg | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ printer.cfg | 51 ++++++++++++++------------------------------------- 2 files changed, 64 insertions(+), 37 deletions(-) create mode 100644 macros.cfg diff --git a/macros.cfg b/macros.cfg new file mode 100644 index 0000000..4a4911c --- /dev/null +++ b/macros.cfg @@ -0,0 +1,50 @@ + +[gcode_macro G32] +gcode: + BED_MESH_CLEAR + G28 + QUAD_GANTRY_LEVEL + G28 + G0 X150 Y150 Z30 F3600 + + +[gcode_macro PRINT_START] +# Use PRINT_START for the slicer starting script - please customise for your slicer of choice +gcode: + M140 S{BED} # start bed heating + M104 S{EXTRUDER} # start extruder heating + + M117 home + G32 ; home all axes + G1 Z20 F3000 ; move nozzle away from bed + + M117 wait for heating + G92 E0 # reset extruder + M190 S{BED} # set and wait for bed temperature + M109 S{EXTRUDER} # set and wait for nozzle temperature + + M117 clean nozzle + G0 Z5 F300 # move Z to travel height + G0 X75 Y0 F5000 # move to start position + G0 Z0.2 F1500 # lower Z + G0 X225 Y0 Z0.2 E30 # draw line + G0 X225 Y0.8 Z0.2 # move to the side little + G0 X75 Y0.8 Z0.2 E15 # draw fine line + + M117 starting + + +[gcode_macro PRINT_END] +# Use PRINT_END for the slicer ending script - please customise for your slicer of choice +gcode: + M400 ; wait for buffer to clear + G92 E0 ; zero the extruder + G1 E-10.0 F3600 ; retract filament + G91 ; relative positioning + G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing + TURN_OFF_HEATERS + M107 ; turn off fan + G1 Z2 F3000 ; move nozzle up 2mm + G90 ; absolute positioning + G0 X125 Y250 F3600 ; park nozzle at rear + BED_MESH_CLEAR diff --git a/printer.cfg b/printer.cfg index 2ae6fde..2d56be6 100644 --- a/printer.cfg +++ b/printer.cfg @@ -30,8 +30,6 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 #restart_method: command ##-------------------------------------------------------------------- -[include fluidd.cfg] - [printer] kinematics: corexy max_velocity: 300 @@ -41,6 +39,20 @@ max_z_accel: 350 square_corner_velocity: 5.0 +##################################################################### +# fluidd +##################################################################### + +[include fluidd.cfg] + + +##################################################################### +# Macros +##################################################################### + +[include macros.cfg] + + ##################################################################### # X/Y Stepper Settings ##################################################################### @@ -431,41 +443,6 @@ gcode: SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3 -##################################################################### -# Macros -##################################################################### - -[gcode_macro G32] -gcode: - BED_MESH_CLEAR - G28 - QUAD_GANTRY_LEVEL - G28 - G0 X150 Y150 Z30 F3600 - - -[gcode_macro PRINT_START] -# Use PRINT_START for the slicer starting script - please customise for your slicer of choice -gcode: - G32 ; home all axes - G1 Z20 F3000 ; move nozzle away from bed - - -[gcode_macro PRINT_END] -# Use PRINT_END for the slicer ending script - please customise for your slicer of choice -gcode: - M400 ; wait for buffer to clear - G92 E0 ; zero the extruder - G1 E-10.0 F3600 ; retract filament - G91 ; relative positioning - G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing - TURN_OFF_HEATERS - M107 ; turn off fan - G1 Z2 F3000 ; move nozzle up 2mm - G90 ; absolute positioning - G0 X125 Y250 F3600 ; park nozzle at rear - BED_MESH_CLEAR - #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# From 478b51d60523c5a16f727c9bfd51c4c0cc8c3c07 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 22 Sep 2021 12:08:25 +0200 Subject: [PATCH 011/131] v2.4: change max bed heater power to 0.8 -> 360W --- printer.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index 2d56be6..2728439 100644 --- a/printer.cfg +++ b/printer.cfg @@ -249,7 +249,7 @@ heater_pin: PA1 sensor_type: NTC 100K beta 3950 sensor_pin: PF3 ## Adjust Max Power so your heater doesn't warp your bed -max_power: 0.6 +max_power: 0.8 # 0.4W per cm2, 360W for 300 build min_temp: 0 max_temp: 120 #control: pid From f3e2e9bc3ddc94f50236241d345c6a16a4f04595 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 22 Sep 2021 12:08:45 +0200 Subject: [PATCH 012/131] v2.4: tweak bed_mesh --- printer.cfg | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/printer.cfg b/printer.cfg index 2728439..3fd32a2 100644 --- a/printer.cfg +++ b/printer.cfg @@ -362,12 +362,15 @@ speed:100 z_hop:10 [bed_mesh] -speed: 1000 -horizontal_move_z: 5 -mesh_min: 25,25 -mesh_max: 261,287 +speed: 300 +horizontal_move_z: 10 +mesh_min: 40,40 +mesh_max: 260,260 +fade_start: 0.6 +fade_end: 10 probe_count: 5,5 algorithm: bicubic +relative_reference_index: 12 [quad_gantry_level] ## Use QUAD_GANTRY_LEVEL to level a gantry. From 4b5981cbe3167dd0816252b2b709b3e1fa63f111 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 23 Sep 2021 10:48:50 +0200 Subject: [PATCH 013/131] v2.4: reformat file --- printer.cfg | 210 ++++++++++++++++++++++++++-------------------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/printer.cfg b/printer.cfg index 3fd32a2..8d9650d 100644 --- a/printer.cfg +++ b/printer.cfg @@ -10,21 +10,21 @@ ## Voron Design VORON2 250/300/350mm BigTreeTech OctoPus V1 TMC2209 UART config ## *** THINGS TO CHANGE/CHECK: *** -## MCU paths [mcu] section -## Thermistor types [extruder] and [heater_bed] sections - See 'sensor types' list at end of file -## Z Endstop Switch location [safe_z_home] section -## Homing end position [gcode_macro G32] section -## Z Endstop Switch offset for Z0 [stepper_z] section -## Probe points [quad_gantry_level] section -## Min & Max gantry corner postions [quad_gantry_level] section -## PID tune [extruder] and [heater_bed] sections -## Fine tune E steps [extruder] section +## MCU paths [mcu] section +## Thermistor types [extruder] and [heater_bed] sections - See 'sensor types' list at end of file +## Z Endstop Switch location [safe_z_home] section +## Homing end position [gcode_macro G32] section +## Z Endstop Switch offset for Z0 [stepper_z] section +## Probe points [quad_gantry_level] section +## Min & Max gantry corner postions [quad_gantry_level] section +## PID tune [extruder] and [heater_bed] sections +## Fine tune E steps [extruder] section [mcu] -## [X in MOTOR0] - B Motor -## [Y in MOTOR1] - A Motor -## [E in MOTOR6] - Extruder -## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify +## [X in MOTOR0] - B Motor +## [Y in MOTOR1] - A Motor +## [E in MOTOR6] - Extruder +## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify ##-------------------------------------------------------------------- serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 #restart_method: command @@ -32,29 +32,30 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 [printer] kinematics: corexy -max_velocity: 300 -max_accel: 3000 #Max 4000 -max_z_velocity: 25 #Max 15 for 12V TMC Drivers, can increase for 24V +max_velocity: 300 +max_accel: 3000 # Max 4000 +max_accel_to_decel: 1500 # default half of max_accel +max_z_velocity: 25 # Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 350 square_corner_velocity: 5.0 ##################################################################### -# fluidd +# fluidd ##################################################################### [include fluidd.cfg] ##################################################################### -# Macros +# Macros ##################################################################### [include macros.cfg] ##################################################################### -# X/Y Stepper Settings +# X/Y Stepper Settings ##################################################################### ## X Stepper on MOTOR0(B Motor) @@ -64,12 +65,12 @@ dir_pin: !PF12 enable_pin: !PF14 rotation_distance: 40 microsteps: 16 -full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper +full_steps_per_rotation: 400 # 1.8 deg stepper: 200, 0.9 deg stepper endstop_pin: PG6 position_min: 0 position_endstop: 300 position_max: 300 -homing_speed: 25 #Max 100 +homing_speed: 25 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -104,10 +105,10 @@ run_current: 0.8 hold_current: 0.7 sense_resistor: 0.110 stealthchop_threshold: 0 - + ##################################################################### -# Z Stepper Settings +# Z Stepper Settings ##################################################################### ## Z0 Stepper - Front Left on MOTOR2_1 @@ -119,10 +120,10 @@ rotation_distance: 40 gear_ratio: 80:16 microsteps: 16 endstop_pin: PG10 -## 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 +## 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 position_max: 290 position_min: -5 @@ -138,7 +139,7 @@ hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 -## Z1 Stepper - Rear Left on MOTOR3 +## Z1 Stepper - Rear Left on MOTOR3 [stepper_z1] step_pin: PG4 dir_pin: !PC1 @@ -155,7 +156,7 @@ hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 -## Z2 Stepper - Rear Right on MOTOR4 +## Z2 Stepper - Rear Right on MOTOR4 [stepper_z2] step_pin: PF9 dir_pin: PF10 @@ -172,7 +173,7 @@ hold_current: 0.80 sense_resistor: 0.110 stealthchop_threshold: 0 -## Z3 Stepper - Front Right on MOTOR5 +## Z3 Stepper - Front Right on MOTOR5 [stepper_z3] step_pin: PC13 dir_pin: !PF0 @@ -191,29 +192,29 @@ stealthchop_threshold: 0 ##################################################################### -# Extruder +# Extruder ##################################################################### -# E0 on MOTOR6 +# E0 on MOTOR6 [extruder] step_pin: PE2 dir_pin: !PE3 enable_pin: !PD4 -## Update value below when you perform extruder calibration -## If you ask for 100mm of filament, but in reality it is 98mm: -## rotation_distance = * / 100 -## 22.6789511 is a good starting point -rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears -## Update Gear Ratio depending on your Extruder Type -## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio) -## Use 80:20 for M4, M3.1 -gear_ratio: 50:17 #BMG Gear Ratio +## Update value below when you perform extruder calibration +## If you ask for 100mm of filament, but in reality it is 98mm: +## rotation_distance = * / 100 +## 22.6789511 is a good starting point +rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears +## Update Gear Ratio depending on your Extruder Type +## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio) +## Use 80:20 for M4, M3.1 +gear_ratio: 50:17 # BMG Gear Ratio microsteps: 16 -full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree +full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper nozzle_diameter: 0.400 filament_diameter: 1.75 heater_pin: PA2 -## Validate the following thermistor type to make sure it is correct +## Validate the following thermistor type to make sure it is correct sensor_type: ATC Semitec 104GT-2 sensor_pin: PF4 min_temp: 10 @@ -224,12 +225,12 @@ min_extrude_temp: 170 #pid_kp = 26.213 #pid_ki = 1.304 #pid_kd = 131.721 -## Try to keep pressure_advance below 1.0 +## Try to keep pressure_advance below 1.0 pressure_advance: 0.05 -## Default is 0.040, leave stock +## Default is 0.040, leave stock pressure_advance_smooth_time: 0.040 -## E0 on MOTOR6 +## E0 on MOTOR6 [tmc2209 extruder] uart_pin: PE1 interpolate: false @@ -240,16 +241,16 @@ stealthchop_threshold: 0 ##################################################################### -# Bed Heater +# Bed Heater ##################################################################### [heater_bed] -## SSR Pin - BED_OUT +## SSR Pin - BED_OUT heater_pin: PA1 sensor_type: NTC 100K beta 3950 sensor_pin: PF3 -## Adjust Max Power so your heater doesn't warp your bed -max_power: 0.8 # 0.4W per cm2, 360W for 300 build +## Adjust Max Power so your heater doesn't warp your bed +max_power: 0.8 # 0.4W per cm2, 360W for 300 build min_temp: 0 max_temp: 120 #control: pid @@ -259,12 +260,12 @@ max_temp: 120 ##################################################################### -# Probe +# Probe ##################################################################### [probe] -## Inductive Probe -## This probe is not used for Z height, only Quad Gantry Leveling +## Inductive Probe +## This probe is not used for Z height, only Quad Gantry Leveling pin: ~PB7 x_offset: 0 y_offset: 25.0 @@ -278,37 +279,37 @@ samples_tolerance_retries: 3 ##################################################################### -# Fan Control +# Fan Control ##################################################################### [fan] -## Print Cooling Fan - CNC_FAN0 +## Print Cooling Fan - CNC_FAN0 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 +## 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 [heater_fan hotend_fan] -## Hotend Fan - CNC_FAN1 +## Hotend Fan - CNC_FAN1 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 +## If you are experiencing back flow, you can reduce fan_speed #fan_speed: 1.0 [heater_fan controller_fan] -## Controller fan - CNC_FAN2 +## Controller fan - CNC_FAN2 pin: PD12 kick_start_time: 0.5 heater: heater_bed heater_temp: 45.0 #[heater_fan exhaust_fan] -## Exhaust fan - CNC_FAN3 +## Exhaust fan - CNC_FAN3 #pin: PD13 #max_power: 1.0 #shutdown_speed: 0.0 @@ -319,7 +320,7 @@ heater_temp: 45.0 ##################################################################### -# LED Control +# LED Control ##################################################################### #[output_pin caselight] @@ -332,12 +333,12 @@ heater_temp: 45.0 ##################################################################### -# Homing and Gantry Adjustment Routines +# Homing and Gantry Adjustment Routines ##################################################################### ##################################################################### -# Enclosure Temp Sensor Section +# Enclosure Temp Sensor Section ##################################################################### [thermistor chamber_temp] temperature1: 25 @@ -356,8 +357,8 @@ gcode_id: C timeout: 1800 [safe_z_home] -## XY Location of the Z Endstop Switch -home_xy_position: 208, 305 +## XY Location of the Z Endstop Switch +home_xy_position: 208, 305 speed:100 z_hop:10 @@ -373,15 +374,15 @@ algorithm: bicubic relative_reference_index: 12 [quad_gantry_level] -## Use QUAD_GANTRY_LEVEL to level a gantry. +## Use QUAD_GANTRY_LEVEL to level a gantry. gantry_corners: - -60,-10 - 360,370 + -60,-10 + 360,370 points: - 50,25 - 50,225 - 250,225 - 250,25 + 50,25 + 50,225 + 250,225 + 250,25 speed: 100 horizontal_move_z: 10 retries: 5 @@ -395,27 +396,27 @@ max_adjust: 10 [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>, + # 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> + # 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 +# Displays ##################################################################### [display] -# mini12864 LCD Display +# mini12864 LCD Display lcd_type: uc1701 cs_pin: EXP1_3 a0_pin: EXP1_4 @@ -428,7 +429,7 @@ spi_software_mosi_pin: EXP2_6 spi_software_sclk_pin: EXP2_2 [neopixel btt_mini12864] -# To control Neopixel RGB in mini12864 display +# To control Neopixel RGB in mini12864 display pin: EXP1_6 chain_count: 3 initial_RED: 0.1 @@ -436,15 +437,14 @@ 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 +# 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 - + 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 #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. @@ -464,21 +464,21 @@ gcode: #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.382500, 0.377500, 0.370000, 0.357500, 0.337500 -#*# 0.340000, 0.330000, 0.305000, 0.305000, 0.295000 -#*# 0.342500, 0.342500, 0.325000, 0.305000, 0.270000 -#*# 0.335000, 0.350000, 0.327500, 0.322500, 0.307500 -#*# 0.382500, 0.407500, 0.392500, 0.382500, 0.355000 +#*# 0.085000, 0.102500, 0.075000, 0.080000, 0.060000 +#*# 0.057500, 0.062500, 0.020000, 0.032500, 0.035000 +#*# 0.027500, 0.035000, 0.000000, 0.000000, -0.007500 +#*# 0.020000, 0.032500, -0.005000, 0.017500, 0.020000 +#*# 0.072500, 0.085000, 0.045000, 0.057500, 0.057500 #*# tension = 0.2 -#*# min_x = 25.0 +#*# min_x = 40.0 #*# algo = bicubic #*# y_count = 5 #*# mesh_y_pps = 2 -#*# min_y = 25.0 +#*# min_y = 40.0 #*# x_count = 5 -#*# max_y = 287.0 +#*# max_y = 260.0 #*# mesh_x_pps = 2 -#*# max_x = 261.0 +#*# max_x = 260.0 #*# #*# [stepper_z] -#*# position_endstop = 0.542 +#*# position_endstop = 0.642 From 8d22b53f50caa91e5b6fd089772201e2f04e0371 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 23 Sep 2021 13:49:06 +0200 Subject: [PATCH 014/131] v2.4: change default display color --- printer.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/printer.cfg b/printer.cfg index 8d9650d..fc933e7 100644 --- a/printer.cfg +++ b/printer.cfg @@ -442,9 +442,9 @@ color_order: RGB [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 + SET_LED LED=btt_mini12864 RED=0.50 GREEN=0.00 BLUE=0.00 INDEX=1 TRANSMIT=0 + SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=2 TRANSMIT=0 + SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=3 #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. From 2fa6572d790c63e92a93aa331693b83227c4c5f2 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 30 Sep 2021 23:56:07 +0200 Subject: [PATCH 015/131] v2.4: update speed for less vibrations --- printer.cfg | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/printer.cfg b/printer.cfg index fc933e7..6f5ffa9 100644 --- a/printer.cfg +++ b/printer.cfg @@ -35,8 +35,8 @@ kinematics: corexy max_velocity: 300 max_accel: 3000 # Max 4000 max_accel_to_decel: 1500 # default half of max_accel -max_z_velocity: 25 # Max 15 for 12V TMC Drivers, can increase for 24V -max_z_accel: 350 +max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V +max_z_accel: 500 square_corner_velocity: 5.0 @@ -70,7 +70,7 @@ endstop_pin: PG6 position_min: 0 position_endstop: 300 position_max: 300 -homing_speed: 25 # Max 100 +homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -91,10 +91,10 @@ rotation_distance: 40 microsteps: 16 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 -position_min: 0 +position_min: 15 # Camera position_endstop: 305 position_max: 305 -homing_speed: 25 #Max 100 +homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -127,7 +127,7 @@ endstop_pin: PG10 #position_endstop: -0.5 position_max: 290 position_min: -5 -homing_speed: 8 +homing_speed: 11.0 # speed: mm/sec, feedrate: mm/min second_homing_speed: 3 homing_retract_dist: 3 @@ -359,14 +359,15 @@ timeout: 1800 [safe_z_home] ## XY Location of the Z Endstop Switch home_xy_position: 208, 305 -speed:100 -z_hop:10 +speed: 100 +z_hop: 10 +z_hop_speed: 25 [bed_mesh] -speed: 300 +speed: 500 horizontal_move_z: 10 -mesh_min: 40,40 -mesh_max: 260,260 +mesh_min: 40,60 +mesh_max: 260,280 fade_start: 0.6 fade_end: 10 probe_count: 5,5 @@ -379,10 +380,10 @@ gantry_corners: -60,-10 360,370 points: - 50,25 + 50,40 50,225 250,225 - 250,25 + 250,40 speed: 100 horizontal_move_z: 10 retries: 5 From e8ba5dd5ab48084cfb2da762fafb744da5f61562 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 30 Sep 2021 23:57:43 +0200 Subject: [PATCH 016/131] v2.4: update moonraker --- moonraker.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/moonraker.conf b/moonraker.conf index 10ddd21..aaa2dea 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -12,6 +12,7 @@ force_logins: True cors_domains: *.local *.lan + *.nom *://app.fluidd.xyz trusted_clients: @@ -37,4 +38,8 @@ enable_auto_refresh: True [update_manager client fluidd] type: web repo: cadriel/fluidd -path: ~/fluidd \ No newline at end of file +path: ~/fluidd + +[power voron-v2.4] +type: tplink_smartplug +address: 192.168.11.91 From fe6f888b72ccedd7cbc575a91014f6629b68e009 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 30 Sep 2021 23:58:01 +0200 Subject: [PATCH 017/131] v2.4: update webcam --- webcam.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webcam.txt b/webcam.txt index 8b7bb9c..582de1c 100644 --- a/webcam.txt +++ b/webcam.txt @@ -22,6 +22,7 @@ # Defaults to a resolution of 640x480 px and a framerate of 10 fps # #camera_usb_options="-r 640x480 -f 10" +camera_usb_options="-r 800x600 -f 10" ### Additional webcam devices known to cause problems with -f # @@ -55,7 +56,8 @@ # # Defaults to 10fps # -#camera_raspi_options="-fps 10" +# camera_raspi_options="-fps 10" +camera_raspi_options="-r 800x600 -fps 10" ### Configuration of camera HTTP output # From ccaf28e909411deae63719c488827272b91baad7 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 1 Oct 2021 00:06:02 +0200 Subject: [PATCH 018/131] v2.4: split config for fans, neopixel and display --- display.cfg | 51 ++++++++++++++++++++ fans.cfg | 44 +++++++++++++++++ neopixel.cfg | 10 ++++ printer.cfg | 133 ++++++--------------------------------------------- 4 files changed, 119 insertions(+), 119 deletions(-) create mode 100644 display.cfg create mode 100644 fans.cfg create mode 100644 neopixel.cfg diff --git a/display.cfg b/display.cfg new file mode 100644 index 0000000..35f2540 --- /dev/null +++ b/display.cfg @@ -0,0 +1,51 @@ +##################################################################### +# Displays +##################################################################### + +[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> + +[display] +# mini12864 LCD 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 +# display_group: __voron_display + +[neopixel btt_mini12864] +# To control Neopixel RGB in mini12864 display +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=0.50 GREEN=0.00 BLUE=0.00 INDEX=1 TRANSMIT=0 + SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=2 TRANSMIT=0 + SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=3 diff --git a/fans.cfg b/fans.cfg new file mode 100644 index 0000000..e3ac7f0 --- /dev/null +++ b/fans.cfg @@ -0,0 +1,44 @@ +##################################################################### +# Fan Control +##################################################################### + +[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 + +[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 + +[heater_fan side_fan1] +pin: PD12 +kick_start_time: 0.5 +heater: heater_bed +heater_temp: 45.0 +fan_speed: 0.40 + +[heater_fan side_fan2] +pin: PD13 +kick_start_time: 0.5 +heater: heater_bed +heater_temp: 45.0 +fan_speed: 0.40 + +[heater_fan exhaust_fan] +pin: PD14 +max_power: 1.0 +shutdown_speed: 0.0 +kick_start_time: 5.0 +heater: heater_bed +heater_temp: 55 +fan_speed: 0.4 + diff --git a/neopixel.cfg b/neopixel.cfg new file mode 100644 index 0000000..0fc6332 --- /dev/null +++ b/neopixel.cfg @@ -0,0 +1,10 @@ +##################################################################### +# LED Control +##################################################################### + +[neopixel caselight] +pin: PB0 +chain_count: 44 +initial_RED: 0.25 +initial_GREEN: 0.25 +initial_BLUE: 0.25 diff --git a/printer.cfg b/printer.cfg index 6f5ffa9..46759ab 100644 --- a/printer.cfg +++ b/printer.cfg @@ -41,17 +41,14 @@ square_corner_velocity: 5.0 ##################################################################### -# fluidd +# includes ##################################################################### [include fluidd.cfg] - - -##################################################################### -# Macros -##################################################################### - [include macros.cfg] +[include display.cfg] +[include neopixel.cfg] +[include fans.cfg] ##################################################################### @@ -279,63 +276,18 @@ samples_tolerance_retries: 3 ##################################################################### -# Fan Control -##################################################################### - -[fan] -## Print Cooling Fan - CNC_FAN0 -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 - -[heater_fan hotend_fan] -## Hotend Fan - CNC_FAN1 -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 - -[heater_fan controller_fan] -## Controller fan - CNC_FAN2 -pin: PD12 -kick_start_time: 0.5 -heater: heater_bed -heater_temp: 45.0 - -#[heater_fan exhaust_fan] -## Exhaust fan - CNC_FAN3 -#pin: PD13 -#max_power: 1.0 -#shutdown_speed: 0.0 -#kick_start_time: 5.0 -#heater: heater_bed -#heater_temp: 60 -#fan_speed: 1.0 - - -##################################################################### -# LED Control -##################################################################### - -#[output_pin caselight] -# Chamber Lighting - HE1 Connector (Optional) -#pin: PA3 -#pwm:true -#shutdown_value: 0 -#value:1 -#cycle_time: 0.01 - - -##################################################################### -# Homing and Gantry Adjustment Routines +# Filament Sensor ##################################################################### +[filament_switch_sensor filament_switch] +switch_pin: ^!PG11 +pause_on_runout: True +runout_gcode: + M117 filament removed +insert_gcode: + M117 filament inserted +# event_delay: 3.0 +# pause_delay: 0.5 ##################################################################### # Enclosure Temp Sensor Section @@ -390,63 +342,6 @@ 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 -##################################################################### - -[display] -# mini12864 LCD 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 - -[neopixel btt_mini12864] -# To control Neopixel RGB in mini12864 display -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=0.50 GREEN=0.00 BLUE=0.00 INDEX=1 TRANSMIT=0 - SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=2 TRANSMIT=0 - SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=3 - #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# From 629452d3b98ffbdb599b91a2ef37c4716d4317d7 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sat, 2 Oct 2021 23:31:41 +0200 Subject: [PATCH 019/131] v2.4: format printer.cfg --- printer.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/printer.cfg b/printer.cfg index 46759ab..15f5e3b 100644 --- a/printer.cfg +++ b/printer.cfg @@ -282,6 +282,7 @@ samples_tolerance_retries: 3 [filament_switch_sensor filament_switch] switch_pin: ^!PG11 pause_on_runout: True +# runout_gcode is executed after pause_on_runout runout_gcode: M117 filament removed insert_gcode: @@ -289,6 +290,7 @@ insert_gcode: # event_delay: 3.0 # pause_delay: 0.5 + ##################################################################### # Enclosure Temp Sensor Section ##################################################################### From e6441f6ee490391b2f2546a8d4c598bdb335411a Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 3 Oct 2021 00:00:34 +0200 Subject: [PATCH 020/131] v2.4: customize display menu --- display_menu.cfg | 145 +++++++++++++++++++++++++++++++++++++++++++++++ macros.cfg | 113 +++++++++++++++++++++++------------- printer.cfg | 1 + 3 files changed, 221 insertions(+), 38 deletions(-) create mode 100644 display_menu.cfg diff --git a/display_menu.cfg b/display_menu.cfg new file mode 100644 index 0000000..1e4eef7 --- /dev/null +++ b/display_menu.cfg @@ -0,0 +1,145 @@ +##################################################################### +# Display Menu definition +##################################################################### + +# Removed items +[menu __main __octoprint] +type: disabled + +## PreHeat +[menu __main __temp __preheat_pla] +type: disabled + +[menu __main __temp __preheat_abs] +type: disabled + +## use own load and unload macro +[menu __main __filament __loadf] +type: disabled + +[menu __main __filament __loads] +type: disabled + +[menu __main __filament __unloadf] +type: disabled + +[menu __main __filament __unloads] +type: disabled + +## Delta Calibration +[menu __main __setup __calib __delta_calib_auto] +type: disabled + +[menu __main __setup __calib __delta_calib_man] +type: disabled + + +# Added Items to the Stock menu +[menu __main __filament __preheat_pla] +type: command +name: Preheat for PLA +gcode: + PREHEAT EXTRUDER_TEMP=190 + +[menu __main __filament __preheat_abs] +type: command +name: Preheat for ABS +gcode: + PREHEAT EXTRUDER_TEMP=210 + +[menu __main __filament __load] +type: command +name: Load Filament +gcode: + FILAMENT_LOAD + +[menu __main __filament __unload] +type: command +name: Unload Filament +gcode: + FILAMENT_UNLOAD + +[menu __main __filament __purge] +type: command +name: Purge Filament (10mm) +gcode: + FILAMENT_PURGE + +## Probe & Endstop Z-Offset calibration +[menu __main __setup __calib __Z_offset] +type: list +enable: {not printer.idle_timeout.state == "Printing"} +name: Z offset + +[menu __main __setup __calib __Z_offset __start] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Do {['None','Probe','Endstop'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 2 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + {menu.back()} + {%- if menu.input|int == 1 -%} + {action_respond_info("Start Probe calibration")} + PROBE_CALIBRATE + {%- elif menu.input|int == 2 -%} + {action_respond_info(" Start Z-Endstop calibration")} + Z_ENDSTOP_CALIBRATE + {%- endif -%} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __move_z] +type: input +name: Move Z: {'%03.2f' % menu.input} +input: {printer.gcode_move.gcode_position.z} +input_step: 1 +realtime: True +gcode: + {%- if menu.event == 'change' -%} + G1 Z{'%.2f' % menu.input} + {%- elif menu.event == 'long_click' -%} + G1 Z{'%.2f' % menu.input} + SAVE_GCODE_STATE NAME=__move__axis + G91 + G1 Z2 + G1 Z-2 + RESTORE_GCODE_STATE NAME=__move__axis + {%- endif -%} + +[menu __main __setup __calib __Z_offset __test_z] +type: input +name: Test Z: {['++','+','+.01','+.05','+.1','+.5','-.5','-.1','-.05','-.01','-','--'][menu.input|int]} +input: 5 +input_min: 0 +input_max: 11 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + TESTZ Z={['++','+','+.01','+.05','+.1','+.5','-.5','-.1','-.05','-.01','-','--'][menu.input|int]} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __test_z_live] +type: input +name: Test Z : {'%03.3f' % menu.input} +input: 0 +input_min: -5.0 +input_max: 5.0 +input_step: 0.01 +realtime: True +gcode: + {%- if menu.event == 'long_click' -%} + TESTZ Z={'%.3f' % menu.input} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __accept] +type: command +name: Accept +gcode: ACCEPT + +[menu __main __setup __calib __Z_offset __abort] +type: command +name: Abort +gcode: ABORT diff --git a/macros.cfg b/macros.cfg index 4a4911c..e6fed9e 100644 --- a/macros.cfg +++ b/macros.cfg @@ -1,50 +1,87 @@ - [gcode_macro G32] gcode: - BED_MESH_CLEAR - G28 - QUAD_GANTRY_LEVEL - G28 - G0 X150 Y150 Z30 F3600 - + BED_MESH_CLEAR + G28 + QUAD_GANTRY_LEVEL + G28 + G0 X150 Y150 Z30 F3600 + + +[gcode_macro FILAMENT_UNLOAD] +description: unload filament +gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 # e relative coordinates + G0 E-75 F3000 # unload + M82 # e absolute coordinates + {% else %} + {action_respond_info("extruder not hot enough")} + {% endif %} + + +[gcode_macro FILAMENT_LOAD] +description: load filament +gcode: + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 # e relative coordinates + G0 E75 F3000 + G0 E30 F300 + M82 # e absolute coordinates + {% else %} + {action_respond_info("extruder not hot enough")} + {% endif %} + + +[gcode_macro FILAMENT_PURGE] +description: purge filament +gcode: + {% set e = params.e|default(10)|float %} + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 # e relative coordinates + G1 E-{e} F300 + M82 # e absolute coordinates + {% else %} + {action_respond_info("extruder not hot enough")} + {% endif %} + [gcode_macro PRINT_START] -# Use PRINT_START for the slicer starting script - please customise for your slicer of choice gcode: - M140 S{BED} # start bed heating - M104 S{EXTRUDER} # start extruder heating + M117 >> configuring + SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 + M140 S{BED} # start bed heating + M104 S{EXTRUDER} # start extruder heating + G92 E0 # reset extruder + G21 # set units to millimeters + G90 # use absolute coordinates + M83 # use relative distances for extrusion + G4 P1000 - M117 home - G32 ; home all axes - G1 Z20 F3000 ; move nozzle away from bed + M117 >> homing + SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 + G32 # home all axes - M117 wait for heating - G92 E0 # reset extruder - M190 S{BED} # set and wait for bed temperature - M109 S{EXTRUDER} # set and wait for nozzle temperature + M117 >> heating + SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 + G92 E0 # reset extruder + M190 S{BED} # set and wait for bed temperature + M109 S{EXTRUDER} # set and wait for nozzle temperature - M117 clean nozzle - G0 Z5 F300 # move Z to travel height - G0 X75 Y0 F5000 # move to start position - G0 Z0.2 F1500 # lower Z - G0 X225 Y0 Z0.2 E30 # draw line - G0 X225 Y0.8 Z0.2 # move to the side little - G0 X75 Y0.8 Z0.2 E15 # draw fine line + M117 >> starting + SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 - M117 starting - [gcode_macro PRINT_END] -# Use PRINT_END for the slicer ending script - please customise for your slicer of choice gcode: - M400 ; wait for buffer to clear - G92 E0 ; zero the extruder - G1 E-10.0 F3600 ; retract filament - G91 ; relative positioning - G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing - TURN_OFF_HEATERS - M107 ; turn off fan - G1 Z2 F3000 ; move nozzle up 2mm - G90 ; absolute positioning - G0 X125 Y250 F3600 ; park nozzle at rear - BED_MESH_CLEAR + M117 >> finished + M400 ; wait for buffer to clear + G92 E0 ; zero the extruder + G1 E-10.0 F3600 ; retract filament + G91 ; relative positioning + G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing + TURN_OFF_HEATERS + M107 ; turn off fan + G1 Z2 F3000 ; move nozzle up 2mm + G90 ; absolute positioning + G0 X125 Y250 F3600 ; park nozzle at rear + BED_MESH_CLEAR diff --git a/printer.cfg b/printer.cfg index 15f5e3b..3b5a3af 100644 --- a/printer.cfg +++ b/printer.cfg @@ -47,6 +47,7 @@ square_corner_velocity: 5.0 [include fluidd.cfg] [include macros.cfg] [include display.cfg] +[include display_menu.cfg] [include neopixel.cfg] [include fans.cfg] From a264277df250569cec3fd1833cb5529f93d86534 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 3 Oct 2021 09:33:09 +0200 Subject: [PATCH 021/131] v2.4: move macros from fluidd.cfg to macros.cfg --- fluidd.cfg | 63 ----------------------------------------------------- macros.cfg | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/fluidd.cfg b/fluidd.cfg index eee2dd9..382e149 100644 --- a/fluidd.cfg +++ b/fluidd.cfg @@ -5,66 +5,3 @@ path: /home/pi/gcode_files [display_status] -[gcode_macro CANCEL_PRINT] -description: Cancel the actual running print -rename_existing: CANCEL_PRINT_BASE -gcode: - TURN_OFF_HEATERS - CANCEL_PRINT_BASE - -[gcode_macro PAUSE] -description: Pause the actual running print -rename_existing: PAUSE_BASE -# change this if you need more or less extrusion -variable_extrude: 1.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 x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} - ##### calculate save lift position ##### - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 2.0) %} - {% set z_safe = 2.0 %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} - ##### end of definitions ##### - PAUSE_BASE - G91 - {% if printer.extruder.can_extrude|lower == 'true' %} - G1 E-{E} F2100 - {% else %} - {action_respond_info("Extruder not hot enough")} - {% endif %} - {% if "xyz" in printer.toolhead.homed_axes %} - G1 Z{z_safe} F900 - G90 - G1 X{x_park} Y{y_park} F6000 - {% else %} - {action_respond_info("Printer not homed")} - {% endif %} - -[gcode_macro RESUME] -description: Resume the actual running print -rename_existing: RESUME_BASE -gcode: - ##### read E from pause macro ##### - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - #### 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 %} - RESUME_BASE {get_params} \ No newline at end of file diff --git a/macros.cfg b/macros.cfg index e6fed9e..d8050b1 100644 --- a/macros.cfg +++ b/macros.cfg @@ -7,6 +7,70 @@ gcode: G0 X150 Y150 Z30 F3600 +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + TURN_OFF_HEATERS + CANCEL_PRINT_BASE + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 1.0 +gcode: + # read E from pause macro + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # set park positon for x and y + {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + # calculate save lift position + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + # end of definitions + PAUSE_BASE + G91 + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + # read E from pause macro + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # 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 %} + RESUME_BASE {get_params} + + [gcode_macro FILAMENT_UNLOAD] description: unload filament gcode: From 8ef8f70661828fdd18c6d18c554ab651ff93584a Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 3 Oct 2021 11:55:03 +0200 Subject: [PATCH 022/131] v2.4: fix calibration in menu --- display_menu.cfg | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/display_menu.cfg b/display_menu.cfg index 1e4eef7..82a3eef 100644 --- a/display_menu.cfg +++ b/display_menu.cfg @@ -74,23 +74,37 @@ name: Z offset [menu __main __setup __calib __Z_offset __start] type: input enable: {not printer.idle_timeout.state == "Printing"} -name: Do {['None','Probe','Endstop'][menu.input|int]} +name: Do {['None','Home','Probe','Endstop'][menu.input|int]} input: 0 input_min: 0 -input_max: 2 +input_max: 3 input_step: 1 gcode: {%- if menu.event == 'long_click' -%} {menu.back()} - {%- if menu.input|int == 1 -%} - {action_respond_info("Start Probe calibration")} - PROBE_CALIBRATE - {%- elif menu.input|int == 2 -%} - {action_respond_info(" Start Z-Endstop calibration")} - Z_ENDSTOP_CALIBRATE + {%- endif -%} + {%- if menu.input|int == 1 -%} + {action_respond_info("Start Homing")} + G28 + {%- elif menu.input|int == 2 -%} + {% if "xyz" in printer.toolhead.homed_axes %} + {action_respond_info("Start Probe calibration")} + G0 X150 Y150 F10000 + PROBE_CALIBRATE + {%- else -%} + {action_respond_info("Printer not homed")} + {%- endif -%} + {%- elif menu.input|int == 3 -%} + {% if "xyz" in printer.toolhead.homed_axes %} + {action_respond_info(" Start Z-Endstop calibration")} + G0 X150 Y150 F10000 + Z_ENDSTOP_CALIBRATE + {%- else -%} + {action_respond_info("Printer not homed")} {%- endif -%} {%- endif -%} + [menu __main __setup __calib __Z_offset __move_z] type: input name: Move Z: {'%03.2f' % menu.input} @@ -143,3 +157,8 @@ gcode: ACCEPT type: command name: Abort gcode: ABORT + +[menu __main __setup __calib __Z_offset __saveconfig] +type: command +name: Save config +gcode: SAVE_CONFIG From 1d9aab9cdf7f44f212f1070551a65cbe2ba0c131 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 3 Oct 2021 12:12:31 +0200 Subject: [PATCH 023/131] v2.4: update macros --- macros.cfg | 61 +++++++++++++++++++++++++++++++++++++++++++++++------ printer.cfg | 3 +++ 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/macros.cfg b/macros.cfg index d8050b1..54ddd3f 100644 --- a/macros.cfg +++ b/macros.cfg @@ -7,6 +7,16 @@ gcode: G0 X150 Y150 Z30 F3600 +[gcode_macro M600] +description: Change filament +gcode: + SAVE_GCODE_STATE NAME=M600_state + PAUSE + FILAMENT_UNLOAD + M117 >> change filament + RESTORE_GCODE_STATE NAME=M600_state + + [gcode_macro CANCEL_PRINT] description: Cancel the actual running print rename_existing: CANCEL_PRINT_BASE @@ -14,6 +24,16 @@ gcode: TURN_OFF_HEATERS CANCEL_PRINT_BASE + +[gcode_macro CENTER] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + G0 X150 Y150 F10000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + + [gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE @@ -23,8 +43,10 @@ gcode: # read E from pause macro {% set E = printer["gcode_macro PAUSE"].extrude|float %} # set park positon for x and y + ## close to max {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + ## close to min + {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} # calculate save lift position {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} @@ -34,6 +56,7 @@ gcode: {% set z_safe = max_z - act_z %} {% endif %} # end of definitions + M117 >> pause PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} @@ -62,9 +85,10 @@ gcode: {% set get_params = "" %} {% endif %} # end of definitions + M117 >> resume {% if printer.extruder.can_extrude|lower == 'true' %} G91 - G1 E{E} F2100 + G1 E{E} F6000 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} @@ -76,7 +100,7 @@ description: unload filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates - G0 E-75 F3000 # unload + G0 E-75 F3000 # unload M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} @@ -88,8 +112,9 @@ description: load filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates - G0 E75 F3000 - G0 E30 F300 + G0 E50 F3000 # load fast + G4 P1000 # wait 1s + G0 E35 F300 # load slow M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} @@ -102,13 +127,22 @@ gcode: {% set e = params.e|default(10)|float %} {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates - G1 E-{e} F300 + G1 E{e} F300 M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} {% endif %} +[gcode_macro HOME] +gcode: + M117 >> homing + G28 + M117 >> moving + G0 X150 Y25 Z30 F10000 + M117 >> homing done + + [gcode_macro PRINT_START] gcode: M117 >> configuring @@ -135,6 +169,21 @@ gcode: SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 +[gcode_macro CLEAN_NOZZLE] +gcode: + {% set y0=params.y0|default(15) %} + {% set y1=params.y1|default(15.8) %} + {% set x0=params.x0|default(75) %} + {% set x1=params.x1|default(225) %} + M117 >> clean nozzle + G0 Z5 F300 # move Z to travel height + G0 X{x0} Y{y0} F5000 # move to x0/y0 + G0 Z0.2 F1500 # lower Z + G0 X{x1} E30 # draw line + G0 Y{y1} # move to y1 + G0 X{y0} E15 # draw fine line + + [gcode_macro PRINT_END] gcode: M117 >> finished diff --git a/printer.cfg b/printer.cfg index 3b5a3af..c1144b0 100644 --- a/printer.cfg +++ b/printer.cfg @@ -227,6 +227,9 @@ min_extrude_temp: 170 pressure_advance: 0.05 ## Default is 0.040, leave stock pressure_advance_smooth_time: 0.040 +# Maximum length (in mm of raw filament) that a retraction or +# extrude-only move may have, default: 50 +max_extrude_only_distance: 100 ## E0 on MOTOR6 [tmc2209 extruder] From 2671986e614d3f8d6bbb386a9966eb85b9772f6f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 5 Oct 2021 19:14:22 +0200 Subject: [PATCH 024/131] v2.4: update display_menu, minor fixes --- display_menu.cfg | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/display_menu.cfg b/display_menu.cfg index 82a3eef..cb16ad5 100644 --- a/display_menu.cfg +++ b/display_menu.cfg @@ -26,6 +26,10 @@ type: disabled [menu __main __filament __unloads] type: disabled +# Bed Probe +[menu __main __setup __calib __bedprobe] +type: disabled + ## Delta Calibration [menu __main __setup __calib __delta_calib_auto] type: disabled @@ -65,6 +69,27 @@ name: Purge Filament (10mm) gcode: FILAMENT_PURGE +[menu __main __setup __calib __home] +type: command +enable: {not printer.idle_timeout.state == "Printing"} +name: Home +gcode: + G28 + +[menu __main __setup __calib __center] +type: command +enable: {not printer.idle_timeout.state == "Printing"} +name: Center +gcode: + CENTER + +[menu __main __setup __calib __bedprobe] +type: command +enable: {not printer.idle_timeout.state == "Printing"} +name: Bed probe +gcode: + PROBE + ## Probe & Endstop Z-Offset calibration [menu __main __setup __calib __Z_offset] type: list @@ -86,10 +111,11 @@ gcode: {%- if menu.input|int == 1 -%} {action_respond_info("Start Homing")} G28 + CENTER {%- elif menu.input|int == 2 -%} {% if "xyz" in printer.toolhead.homed_axes %} {action_respond_info("Start Probe calibration")} - G0 X150 Y150 F10000 + CENTER PROBE_CALIBRATE {%- else -%} {action_respond_info("Printer not homed")} @@ -97,7 +123,7 @@ gcode: {%- elif menu.input|int == 3 -%} {% if "xyz" in printer.toolhead.homed_axes %} {action_respond_info(" Start Z-Endstop calibration")} - G0 X150 Y150 F10000 + CENTER Z_ENDSTOP_CALIBRATE {%- else -%} {action_respond_info("Printer not homed")} From b4b6ffbb405416cead638b3949d563c6d2c0d7e5 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 5 Oct 2021 19:15:25 +0200 Subject: [PATCH 025/131] v2.4: change output add layer_change macro to be called from sliced gcode --- macros.cfg | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/macros.cfg b/macros.cfg index 54ddd3f..7c0438a 100644 --- a/macros.cfg +++ b/macros.cfg @@ -13,7 +13,7 @@ gcode: SAVE_GCODE_STATE NAME=M600_state PAUSE FILAMENT_UNLOAD - M117 >> change filament + M117 > change filament RESTORE_GCODE_STATE NAME=M600_state @@ -56,7 +56,7 @@ gcode: {% set z_safe = max_z - act_z %} {% endif %} # end of definitions - M117 >> pause + M117 > pause PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} @@ -85,7 +85,7 @@ gcode: {% set get_params = "" %} {% endif %} # end of definitions - M117 >> resume + M117 > resume {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F6000 @@ -136,16 +136,16 @@ gcode: [gcode_macro HOME] gcode: - M117 >> homing + M117 > homing G28 - M117 >> moving + M117 > moving G0 X150 Y25 Z30 F10000 - M117 >> homing done + M117 > homing done [gcode_macro PRINT_START] gcode: - M117 >> configuring + M117 > configuring SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 M140 S{BED} # start bed heating M104 S{EXTRUDER} # start extruder heating @@ -155,19 +155,25 @@ gcode: M83 # use relative distances for extrusion G4 P1000 - M117 >> homing + M117 > homing SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 - G32 # home all axes + G32 # home all axes - M117 >> heating + M117 > heating SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature M109 S{EXTRUDER} # set and wait for nozzle temperature - M117 >> starting + M117 > starting SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 +[gcode_macro PRINT_LAYER_CHANGE] +gcode: + {% set layer=params.LAYER|default(0) %} + {% set layer_z=params.LAYER_Z|default(0) %} + M117 > layer {layer}/{layer_z}mm + [gcode_macro CLEAN_NOZZLE] gcode: @@ -175,7 +181,7 @@ gcode: {% set y1=params.y1|default(15.8) %} {% set x0=params.x0|default(75) %} {% set x1=params.x1|default(225) %} - M117 >> clean nozzle + M117 > clean nozzle G0 Z5 F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 G0 Z0.2 F1500 # lower Z @@ -186,7 +192,7 @@ gcode: [gcode_macro PRINT_END] gcode: - M117 >> finished + M117 > finished M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-10.0 F3600 ; retract filament From b061aa0f6252567f13c75e018b6bc8568c732137 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 7 Oct 2021 11:12:20 +0200 Subject: [PATCH 026/131] v2.4: update printer variables --- printer.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/printer.cfg b/printer.cfg index c1144b0..0d3729a 100644 --- a/printer.cfg +++ b/printer.cfg @@ -366,21 +366,21 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.085000, 0.102500, 0.075000, 0.080000, 0.060000 -#*# 0.057500, 0.062500, 0.020000, 0.032500, 0.035000 -#*# 0.027500, 0.035000, 0.000000, 0.000000, -0.007500 -#*# 0.020000, 0.032500, -0.005000, 0.017500, 0.020000 -#*# 0.072500, 0.085000, 0.045000, 0.057500, 0.057500 +#*# 0.005000, 0.050000, 0.017500, 0.007500, 0.002500 +#*# -0.005000, 0.037500, -0.005000, -0.015000, -0.027500 +#*# -0.015000, 0.030000, 0.000000, -0.010000, -0.027500 +#*# 0.010000, 0.060000, 0.027500, 0.015000, -0.015000 +#*# 0.065000, 0.112500, 0.077500, 0.072500, 0.047500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic #*# y_count = 5 #*# mesh_y_pps = 2 -#*# min_y = 40.0 +#*# min_y = 60.0 #*# x_count = 5 -#*# max_y = 260.0 +#*# max_y = 280.0 #*# mesh_x_pps = 2 #*# max_x = 260.0 #*# #*# [stepper_z] -#*# position_endstop = 0.642 +#*# position_endstop = 0.907 From 7471accfd63a461ad36b6b927f8c597c0984ab9f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 8 Oct 2021 18:30:02 +0200 Subject: [PATCH 027/131] v2.4: tweak raspicam --- webcam.txt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/webcam.txt b/webcam.txt index 582de1c..d489cf7 100644 --- a/webcam.txt +++ b/webcam.txt @@ -1,8 +1,4 @@ -### Windows users: To edit this file use Notepad++, VSCode, Atom or SublimeText. -### Do not use Notepad or WordPad. - -### MacOSX users: If you use Textedit to edit this file make sure to use -### "plain text format" and "disable smart quotes" in "Textedit > Preferences" +# vim: ft=conf ### Configure which camera to use # @@ -13,7 +9,7 @@ # # Defaults to auto # -#camera="auto" +camera="raspi" ### Additional options to supply to MJPG Streamer for the USB camera # @@ -26,9 +22,9 @@ camera_usb_options="-r 800x600 -f 10" ### Additional webcam devices known to cause problems with -f # -# Apparently there a some devices out there that with the current -# mjpg_streamer release do not support the -f parameter (for specifying -# the capturing framerate) and will just refuse to output an image if it +# Apparently there a some devices out there that with the current +# mjpg_streamer release do not support the -f parameter (for specifying +# the capturing framerate) and will just refuse to output an image if it # is supplied. # # The webcam daemon will detect those devices by their USB Vendor and Product @@ -42,7 +38,7 @@ camera_usb_options="-r 800x600 -f 10" # # Using the following option it is possible to add additional devices. If # your webcam happens to show above symptoms, try determining your cam's -# vendor and product id via lsusb, activating the line below by removing # and +# vendor and product id via lsusb, activating the line below by removing # and # adding it, e.g. for two broken cameras "aabb:ccdd" and "aabb:eeff" # # additional_brokenfps_usb_devices=("aabb:ccdd" "aabb:eeff") @@ -57,7 +53,7 @@ camera_usb_options="-r 800x600 -f 10" # Defaults to 10fps # # camera_raspi_options="-fps 10" -camera_raspi_options="-r 800x600 -fps 10" +camera_raspi_options="-rot 180 -x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" ### Configuration of camera HTTP output # From f1c6a74b36a0b8c97672729df670ec17d1b6e91c Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 8 Oct 2021 21:13:51 +0200 Subject: [PATCH 028/131] v2.4: update menu, macros --- display_menu.cfg | 12 +++++++++--- macros.cfg | 27 ++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/display_menu.cfg b/display_menu.cfg index cb16ad5..ddf66ff 100644 --- a/display_menu.cfg +++ b/display_menu.cfg @@ -39,17 +39,23 @@ type: disabled # Added Items to the Stock menu +[menu __main __filament __front_center] +type: command +name: Front Center +gcode: + CENTER Y=25 + [menu __main __filament __preheat_pla] type: command -name: Preheat for PLA +name: Preheat PLA gcode: PREHEAT EXTRUDER_TEMP=190 [menu __main __filament __preheat_abs] type: command -name: Preheat for ABS +name: Preheat ABS gcode: - PREHEAT EXTRUDER_TEMP=210 + PREHEAT EXTRUDER_TEMP=215 [menu __main __filament __load] type: command diff --git a/macros.cfg b/macros.cfg index 7c0438a..c7a6c85 100644 --- a/macros.cfg +++ b/macros.cfg @@ -1,9 +1,15 @@ [gcode_macro G32] gcode: - BED_MESH_CLEAR + BED_MESH_CLEAR # clear bed_mesh profile + M117 > home G28 + M117 > QGL QUAD_GANTRY_LEVEL + M117 > HOME G28 + M117 > bed mesh calibrate + BED_MESH_CALIBRATE + # BED_MESH_PROFILE load=default # load default bed_mesh profile G0 X150 Y150 Z30 F3600 @@ -27,8 +33,10 @@ gcode: [gcode_macro CENTER] gcode: + {% set X=params.X|default(150) %} + {% set Y=params.Y|default(150) %} {% if "xyz" in printer.toolhead.homed_axes %} - G0 X150 Y150 F10000 + G0 X{X} Y{Y} F10000 {% else %} {action_respond_info("Printer not homed")} {% endif %} @@ -94,6 +102,16 @@ gcode: {% endif %} RESUME_BASE {get_params} +[gcode_macro PREHEAT] +description: set bed and extruder temperature +gcode: + {% set BED_TEMP = params.BED_TEMP|default(0)|float %} + {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} + M117 > start heating + M140 S{BED_TEMP} # start bed heating + M104 S{EXTRUDER_TEMP} # start extruder heating + M109 S{EXTRUDER_TEMP} # set and wait for nozzle temperature + M117 > done [gcode_macro FILAMENT_UNLOAD] description: unload filament @@ -147,26 +165,29 @@ gcode: gcode: M117 > configuring SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 + G4 P2000 M140 S{BED} # start bed heating M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder G21 # set units to millimeters G90 # use absolute coordinates M83 # use relative distances for extrusion - G4 P1000 M117 > homing SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 + G4 P2000 G32 # home all axes M117 > heating SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 + G4 P2000 G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature M109 S{EXTRUDER} # set and wait for nozzle temperature M117 > starting SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 + G4 P2000 [gcode_macro PRINT_LAYER_CHANGE] gcode: From e54c492c69a431e066ded19466b0dd5da0deac11 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 13 Oct 2021 18:48:11 +0200 Subject: [PATCH 029/131] v2.4: update moonraker, allow mainsail.xyz --- moonraker.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/moonraker.conf b/moonraker.conf index aaa2dea..37dc25a 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -14,6 +14,7 @@ cors_domains: *.lan *.nom *://app.fluidd.xyz + *://my.mainsail.xyz trusted_clients: 10.0.0.0/8 From 288b21055e4489591e3e088a31aab8eff00a92b7 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 13 Oct 2021 18:47:38 +0200 Subject: [PATCH 030/131] v2.4: update macros --- macros.cfg | 142 +++++++++++++++++------------------------------------ 1 file changed, 45 insertions(+), 97 deletions(-) diff --git a/macros.cfg b/macros.cfg index c7a6c85..fa13380 100644 --- a/macros.cfg +++ b/macros.cfg @@ -1,11 +1,11 @@ [gcode_macro G32] gcode: - BED_MESH_CLEAR # clear bed_mesh profile + BED_MESH_CLEAR M117 > home G28 - M117 > QGL + M117 > qgl QUAD_GANTRY_LEVEL - M117 > HOME + M117 > home G28 M117 > bed mesh calibrate BED_MESH_CALIBRATE @@ -18,7 +18,6 @@ description: Change filament gcode: SAVE_GCODE_STATE NAME=M600_state PAUSE - FILAMENT_UNLOAD M117 > change filament RESTORE_GCODE_STATE NAME=M600_state @@ -28,6 +27,7 @@ description: Cancel the actual running print rename_existing: CANCEL_PRINT_BASE gcode: TURN_OFF_HEATERS + PARK CANCEL_PRINT_BASE @@ -35,8 +35,33 @@ gcode: gcode: {% set X=params.X|default(150) %} {% set Y=params.Y|default(150) %} + {% set Z=params.Z|default(25) %} {% if "xyz" in printer.toolhead.homed_axes %} - G0 X{X} Y{Y} F10000 + G0 X{X} Y{Y} Z{Z} F10000 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro PARK] +gcode: + {% if "xyz" in printer.toolhead.homed_axes %} + # set park positon for x and y + ## close to max + {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} + ## close to min + {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} + # calculate save lift position + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 20.0) %} + {% set z_safe = 20.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + G91 + G0 Z{z_safe} F900 + G90 + G0 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} @@ -50,35 +75,18 @@ variable_extrude: 1.0 gcode: # read E from pause macro {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # set park positon for x and y - ## close to max - {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} - ## close to min - {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} - # calculate save lift position - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 2.0) %} - {% set z_safe = 2.0 %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} # end of definitions M117 > pause PAUSE_BASE - G91 {% if printer.extruder.can_extrude|lower == 'true' %} + G91 G1 E-{E} F2100 + G90 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} - {% if "xyz" in printer.toolhead.homed_axes %} - G1 Z{z_safe} F900 - G90 - G1 X{x_park} Y{y_park} F6000 - {% else %} - {action_respond_info("Printer not homed")} - {% endif %} + PARK + [gcode_macro RESUME] description: Resume the actual running print @@ -102,64 +110,6 @@ gcode: {% endif %} RESUME_BASE {get_params} -[gcode_macro PREHEAT] -description: set bed and extruder temperature -gcode: - {% set BED_TEMP = params.BED_TEMP|default(0)|float %} - {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} - M117 > start heating - M140 S{BED_TEMP} # start bed heating - M104 S{EXTRUDER_TEMP} # start extruder heating - M109 S{EXTRUDER_TEMP} # set and wait for nozzle temperature - M117 > done - -[gcode_macro FILAMENT_UNLOAD] -description: unload filament -gcode: - {% if printer.extruder.can_extrude|lower == 'true' %} - M83 # e relative coordinates - G0 E-75 F3000 # unload - M82 # e absolute coordinates - {% else %} - {action_respond_info("extruder not hot enough")} - {% endif %} - - -[gcode_macro FILAMENT_LOAD] -description: load filament -gcode: - {% if printer.extruder.can_extrude|lower == 'true' %} - M83 # e relative coordinates - G0 E50 F3000 # load fast - G4 P1000 # wait 1s - G0 E35 F300 # load slow - M82 # e absolute coordinates - {% else %} - {action_respond_info("extruder not hot enough")} - {% endif %} - - -[gcode_macro FILAMENT_PURGE] -description: purge filament -gcode: - {% set e = params.e|default(10)|float %} - {% if printer.extruder.can_extrude|lower == 'true' %} - M83 # e relative coordinates - G1 E{e} F300 - M82 # e absolute coordinates - {% else %} - {action_respond_info("extruder not hot enough")} - {% endif %} - - -[gcode_macro HOME] -gcode: - M117 > homing - G28 - M117 > moving - G0 X150 Y25 Z30 F10000 - M117 > homing done - [gcode_macro PRINT_START] gcode: @@ -188,6 +138,8 @@ gcode: M117 > starting SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 + SET_FAN_SPEED FAN=exhaust_fan SPEED=0.5 + CLEAN_NOZZLE [gcode_macro PRINT_LAYER_CHANGE] gcode: @@ -198,30 +150,26 @@ gcode: [gcode_macro CLEAN_NOZZLE] gcode: - {% set y0=params.y0|default(15) %} - {% set y1=params.y1|default(15.8) %} {% set x0=params.x0|default(75) %} {% set x1=params.x1|default(225) %} + {% set y0=params.y0|default(15) %} + {% set y1=params.y1|default(15.8) %} M117 > clean nozzle G0 Z5 F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 G0 Z0.2 F1500 # lower Z G0 X{x1} E30 # draw line G0 Y{y1} # move to y1 - G0 X{y0} E15 # draw fine line + G0 X{x0} E15 # draw fine line [gcode_macro PRINT_END] gcode: M117 > finished - M400 ; wait for buffer to clear - G92 E0 ; zero the extruder - G1 E-10.0 F3600 ; retract filament - G91 ; relative positioning - G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing + M400 ; wait for buffer to clear + G92 E0 ; zero the extruder + G1 E-10.0 F3600 ; retract filament TURN_OFF_HEATERS - M107 ; turn off fan - G1 Z2 F3000 ; move nozzle up 2mm - G90 ; absolute positioning - G0 X125 Y250 F3600 ; park nozzle at rear - BED_MESH_CLEAR + M107 ; turn off fan + SET_FAN_SPEED FAN=exhaust_fan SPEED=0 + PARK From 8fdbec09659a6df1a5dd420fd665907067a3d632 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 13 Oct 2021 18:47:53 +0200 Subject: [PATCH 031/131] v2.4: update fans --- fans.cfg | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fans.cfg b/fans.cfg index e3ac7f0..f1fa961 100644 --- a/fans.cfg +++ b/fans.cfg @@ -33,12 +33,8 @@ heater: heater_bed heater_temp: 45.0 fan_speed: 0.40 -[heater_fan exhaust_fan] +[fan_generic exhaust_fan] pin: PD14 max_power: 1.0 shutdown_speed: 0.0 kick_start_time: 5.0 -heater: heater_bed -heater_temp: 55 -fan_speed: 0.4 - From fc28e259d5d90b49ab1f1867610e781fc9224553 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 13 Oct 2021 18:46:59 +0200 Subject: [PATCH 032/131] v2.4: update menu, disable some stock items, add more input-lists --- display_menu.cfg | 147 +++++++++++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 55 deletions(-) diff --git a/display_menu.cfg b/display_menu.cfg index ddf66ff..66071d2 100644 --- a/display_menu.cfg +++ b/display_menu.cfg @@ -6,6 +6,16 @@ [menu __main __octoprint] type: disabled +## Control +[menu __main __control __home] +type: disabled + +[menu __main __control __homez] +type: disabled + +[menu __main __control __homexy] +type: disabled + ## PreHeat [menu __main __temp __preheat_pla] type: disabled @@ -26,6 +36,17 @@ type: disabled [menu __main __filament __unloads] type: disabled +## Control +[menu __main __control __home] +type: disabled + +[menu __main __control __homez] +type: disabled + +[menu __main __control __homexy] +type: disabled + + # Bed Probe [menu __main __setup __calib __bedprobe] type: disabled @@ -39,62 +60,82 @@ type: disabled # Added Items to the Stock menu -[menu __main __filament __front_center] -type: command -name: Front Center -gcode: - CENTER Y=25 - -[menu __main __filament __preheat_pla] -type: command -name: Preheat PLA -gcode: - PREHEAT EXTRUDER_TEMP=190 - -[menu __main __filament __preheat_abs] -type: command -name: Preheat ABS -gcode: - PREHEAT EXTRUDER_TEMP=215 - -[menu __main __filament __load] -type: command -name: Load Filament -gcode: - FILAMENT_LOAD - -[menu __main __filament __unload] -type: command -name: Unload Filament -gcode: - FILAMENT_UNLOAD - -[menu __main __filament __purge] -type: command -name: Purge Filament (10mm) -gcode: - FILAMENT_PURGE - -[menu __main __setup __calib __home] -type: command +## Control +[menu __main __control __home] +type: input enable: {not printer.idle_timeout.state == "Printing"} -name: Home +name: Home: {['noop', 'ALL', 'XY', 'Z'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 3 +input_step: 1 gcode: - G28 + {%- if menu.event == 'long_click' -%} + {[' ', 'G28', 'G28 XY', 'G28 Z'][menu.input|int]} + {%- endif -%} -[menu __main __setup __calib __center] -type: command +[menu __main __control __move] +type: input enable: {not printer.idle_timeout.state == "Printing"} -name: Center +name: Move: {['FRONT CENTER', 'CENTER', 'REAR CENTER'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 2 +input_step: 1 gcode: - CENTER + {%- if menu.event == 'long_click' -%} + CENTER {['Y=15', '', 'Y=290'][menu.input|int]} + {%- endif -%} + +## Filament +[menu __main __filament __preheat] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Preheat: {['Off', 'ABS', 'PLA', 'PET'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 3 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + M104 S{[0, 215, 190, 200][menu.input|int]} + {%- endif -%} + + +[menu __main __filament __filament_load] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Filament: {['noop', 'Load', 'Unload', 'Purge (10mm)'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 3 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 {['E0', 'E50 F3000', 'E-75 F3000', 'E10 F300'][menu.input|int]} + G1 {['E0', 'E35 F300', 'E0', 'E0'][menu.input|int]} + M82 + {% else %} + {action_respond_info("extruder not hot enough")} + {%- endif -%} + {%- endif -%} + + +## Calibration [menu __main __setup __calib __bedprobe] type: command enable: {not printer.idle_timeout.state == "Printing"} name: Bed probe gcode: - PROBE + {%- if printer.toolhead.position.y|float < 270 -%} + PROBE + {%- else -%} + {action_respond_info("Won't probe inunsafe position")} + {%- endif -%} + ## Probe & Endstop Z-Offset calibration [menu __main __setup __calib __Z_offset] @@ -105,20 +146,16 @@ name: Z offset [menu __main __setup __calib __Z_offset __start] type: input enable: {not printer.idle_timeout.state == "Printing"} -name: Do {['None','Home','Probe','Endstop'][menu.input|int]} +name: Calibrate: {['noop','Probe','Endstop'][menu.input|int]} input: 0 input_min: 0 -input_max: 3 +input_max: 2 input_step: 1 gcode: {%- if menu.event == 'long_click' -%} {menu.back()} {%- endif -%} {%- if menu.input|int == 1 -%} - {action_respond_info("Start Homing")} - G28 - CENTER - {%- elif menu.input|int == 2 -%} {% if "xyz" in printer.toolhead.homed_axes %} {action_respond_info("Start Probe calibration")} CENTER @@ -126,7 +163,7 @@ gcode: {%- else -%} {action_respond_info("Printer not homed")} {%- endif -%} - {%- elif menu.input|int == 3 -%} + {%- elif menu.input|int == 2 -%} {% if "xyz" in printer.toolhead.homed_axes %} {action_respond_info(" Start Z-Endstop calibration")} CENTER @@ -157,14 +194,14 @@ gcode: [menu __main __setup __calib __Z_offset __test_z] type: input -name: Test Z: {['++','+','+.01','+.05','+.1','+.5','-.5','-.1','-.05','-.01','-','--'][menu.input|int]} +name: Test Z: {['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0.0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} input: 5 input_min: 0 -input_max: 11 +input_max: 10 input_step: 1 gcode: {%- if menu.event == 'long_click' -%} - TESTZ Z={['++','+','+.01','+.05','+.1','+.5','-.5','-.1','-.05','-.01','-','--'][menu.input|int]} + TESTZ Z={['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} {%- endif -%} [menu __main __setup __calib __Z_offset __test_z_live] From 42918126b79dee017e5731123bbe8803854b561c Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sat, 16 Oct 2021 19:48:21 +0200 Subject: [PATCH 033/131] v2.4: merge display config into single file --- display.cfg | 235 +++++++++++++++++++++++++++++++++++++++++++++++ display_menu.cfg | 233 ---------------------------------------------- printer.cfg | 1 - 3 files changed, 235 insertions(+), 234 deletions(-) delete mode 100644 display_menu.cfg diff --git a/display.cfg b/display.cfg index 35f2540..5f80b7e 100644 --- a/display.cfg +++ b/display.cfg @@ -49,3 +49,238 @@ gcode: SET_LED LED=btt_mini12864 RED=0.50 GREEN=0.00 BLUE=0.00 INDEX=1 TRANSMIT=0 SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=2 TRANSMIT=0 SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=3 + + +##################################################################### +# Display Menu definition +##################################################################### + +# Removed items +[menu __main __octoprint] +type: disabled + +## Control +[menu __main __control __home] +type: disabled + +[menu __main __control __homez] +type: disabled + +[menu __main __control __homexy] +type: disabled + +## PreHeat +[menu __main __temp __preheat_pla] +type: disabled + +[menu __main __temp __preheat_abs] +type: disabled + +## use own load and unload macro +[menu __main __filament __loadf] +type: disabled + +[menu __main __filament __loads] +type: disabled + +[menu __main __filament __unloadf] +type: disabled + +[menu __main __filament __unloads] +type: disabled + +## Control +[menu __main __control __home] +type: disabled + +[menu __main __control __homez] +type: disabled + +[menu __main __control __homexy] +type: disabled + + +# Bed Probe +[menu __main __setup __calib __bedprobe] +type: disabled + +## Delta Calibration +[menu __main __setup __calib __delta_calib_auto] +type: disabled + +[menu __main __setup __calib __delta_calib_man] +type: disabled + + +# Added Items to the Stock menu +## Control +[menu __main __control __home] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Home: {['noop', 'ALL', 'XY', 'Z'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 3 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + {[' ', 'G28', 'G28 XY', 'G28 Z'][menu.input|int]} + {%- endif -%} + +[menu __main __control __move] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Move: {['FRONT CENTER', 'CENTER', 'REAR CENTER'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 2 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + CENTER {['Y=15', '', 'Y=290'][menu.input|int]} + {%- endif -%} + + +## Filament +[menu __main __filament __preheat] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Preheat: {['Off', 'ABS', 'PLA', 'PET'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 3 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + M104 S{[0, 215, 190, 200][menu.input|int]} + {%- endif -%} + + +[menu __main __filament __filament_load] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Filament: {['noop', 'Load', 'Unload', 'Purge (10mm)'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 3 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 {['E0', 'E50 F3000', 'E-75 F3000', 'E10 F300'][menu.input|int]} + G1 {['E0', 'E35 F300', 'E0', 'E0'][menu.input|int]} + M82 + {% else %} + {action_respond_info("extruder not hot enough")} + {%- endif -%} + {%- endif -%} + + +## Calibration +[menu __main __setup __calib __bedprobe] +type: command +enable: {not printer.idle_timeout.state == "Printing"} +name: Bed probe +gcode: + {%- if printer.toolhead.position.y|float < 270 -%} + PROBE + {%- else -%} + {action_respond_info("Won't probe inunsafe position")} + {%- endif -%} + + +## Probe & Endstop Z-Offset calibration +[menu __main __setup __calib __Z_offset] +type: list +enable: {not printer.idle_timeout.state == "Printing"} +name: Z offset + +[menu __main __setup __calib __Z_offset __start] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Calibrate: {['noop','Probe','Endstop'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 2 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + {menu.back()} + {%- endif -%} + {%- if menu.input|int == 1 -%} + {% if "xyz" in printer.toolhead.homed_axes %} + {action_respond_info("Start Probe calibration")} + CENTER + PROBE_CALIBRATE + {%- else -%} + {action_respond_info("Printer not homed")} + {%- endif -%} + {%- elif menu.input|int == 2 -%} + {% if "xyz" in printer.toolhead.homed_axes %} + {action_respond_info(" Start Z-Endstop calibration")} + CENTER + Z_ENDSTOP_CALIBRATE + {%- else -%} + {action_respond_info("Printer not homed")} + {%- endif -%} + {%- endif -%} + + +[menu __main __setup __calib __Z_offset __move_z] +type: input +name: Move Z: {'%03.2f' % menu.input} +input: {printer.gcode_move.gcode_position.z} +input_step: 1 +realtime: True +gcode: + {%- if menu.event == 'change' -%} + G1 Z{'%.2f' % menu.input} + {%- elif menu.event == 'long_click' -%} + G1 Z{'%.2f' % menu.input} + SAVE_GCODE_STATE NAME=__move__axis + G91 + G1 Z2 + G1 Z-2 + RESTORE_GCODE_STATE NAME=__move__axis + {%- endif -%} + +[menu __main __setup __calib __Z_offset __test_z] +type: input +name: Test Z: {['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0.0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} +input: 5 +input_min: 0 +input_max: 10 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + TESTZ Z={['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __test_z_live] +type: input +name: Test Z : {'%03.3f' % menu.input} +input: 0 +input_min: -5.0 +input_max: 5.0 +input_step: 0.01 +realtime: True +gcode: + {%- if menu.event == 'long_click' -%} + TESTZ Z={'%.3f' % menu.input} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __accept] +type: command +name: Accept +gcode: ACCEPT + +[menu __main __setup __calib __Z_offset __abort] +type: command +name: Abort +gcode: ABORT + +[menu __main __setup __calib __Z_offset __saveconfig] +type: command +name: Save config +gcode: SAVE_CONFIG diff --git a/display_menu.cfg b/display_menu.cfg deleted file mode 100644 index 66071d2..0000000 --- a/display_menu.cfg +++ /dev/null @@ -1,233 +0,0 @@ -##################################################################### -# Display Menu definition -##################################################################### - -# Removed items -[menu __main __octoprint] -type: disabled - -## Control -[menu __main __control __home] -type: disabled - -[menu __main __control __homez] -type: disabled - -[menu __main __control __homexy] -type: disabled - -## PreHeat -[menu __main __temp __preheat_pla] -type: disabled - -[menu __main __temp __preheat_abs] -type: disabled - -## use own load and unload macro -[menu __main __filament __loadf] -type: disabled - -[menu __main __filament __loads] -type: disabled - -[menu __main __filament __unloadf] -type: disabled - -[menu __main __filament __unloads] -type: disabled - -## Control -[menu __main __control __home] -type: disabled - -[menu __main __control __homez] -type: disabled - -[menu __main __control __homexy] -type: disabled - - -# Bed Probe -[menu __main __setup __calib __bedprobe] -type: disabled - -## Delta Calibration -[menu __main __setup __calib __delta_calib_auto] -type: disabled - -[menu __main __setup __calib __delta_calib_man] -type: disabled - - -# Added Items to the Stock menu -## Control -[menu __main __control __home] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Home: {['noop', 'ALL', 'XY', 'Z'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 3 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - {[' ', 'G28', 'G28 XY', 'G28 Z'][menu.input|int]} - {%- endif -%} - -[menu __main __control __move] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Move: {['FRONT CENTER', 'CENTER', 'REAR CENTER'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 2 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - CENTER {['Y=15', '', 'Y=290'][menu.input|int]} - {%- endif -%} - - -## Filament -[menu __main __filament __preheat] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Preheat: {['Off', 'ABS', 'PLA', 'PET'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 3 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - M104 S{[0, 215, 190, 200][menu.input|int]} - {%- endif -%} - - -[menu __main __filament __filament_load] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Filament: {['noop', 'Load', 'Unload', 'Purge (10mm)'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 3 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - {% if printer.extruder.can_extrude|lower == 'true' %} - M83 - G1 {['E0', 'E50 F3000', 'E-75 F3000', 'E10 F300'][menu.input|int]} - G1 {['E0', 'E35 F300', 'E0', 'E0'][menu.input|int]} - M82 - {% else %} - {action_respond_info("extruder not hot enough")} - {%- endif -%} - {%- endif -%} - - -## Calibration -[menu __main __setup __calib __bedprobe] -type: command -enable: {not printer.idle_timeout.state == "Printing"} -name: Bed probe -gcode: - {%- if printer.toolhead.position.y|float < 270 -%} - PROBE - {%- else -%} - {action_respond_info("Won't probe inunsafe position")} - {%- endif -%} - - -## Probe & Endstop Z-Offset calibration -[menu __main __setup __calib __Z_offset] -type: list -enable: {not printer.idle_timeout.state == "Printing"} -name: Z offset - -[menu __main __setup __calib __Z_offset __start] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Calibrate: {['noop','Probe','Endstop'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 2 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - {menu.back()} - {%- endif -%} - {%- if menu.input|int == 1 -%} - {% if "xyz" in printer.toolhead.homed_axes %} - {action_respond_info("Start Probe calibration")} - CENTER - PROBE_CALIBRATE - {%- else -%} - {action_respond_info("Printer not homed")} - {%- endif -%} - {%- elif menu.input|int == 2 -%} - {% if "xyz" in printer.toolhead.homed_axes %} - {action_respond_info(" Start Z-Endstop calibration")} - CENTER - Z_ENDSTOP_CALIBRATE - {%- else -%} - {action_respond_info("Printer not homed")} - {%- endif -%} - {%- endif -%} - - -[menu __main __setup __calib __Z_offset __move_z] -type: input -name: Move Z: {'%03.2f' % menu.input} -input: {printer.gcode_move.gcode_position.z} -input_step: 1 -realtime: True -gcode: - {%- if menu.event == 'change' -%} - G1 Z{'%.2f' % menu.input} - {%- elif menu.event == 'long_click' -%} - G1 Z{'%.2f' % menu.input} - SAVE_GCODE_STATE NAME=__move__axis - G91 - G1 Z2 - G1 Z-2 - RESTORE_GCODE_STATE NAME=__move__axis - {%- endif -%} - -[menu __main __setup __calib __Z_offset __test_z] -type: input -name: Test Z: {['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0.0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} -input: 5 -input_min: 0 -input_max: 10 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - TESTZ Z={['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} - {%- endif -%} - -[menu __main __setup __calib __Z_offset __test_z_live] -type: input -name: Test Z : {'%03.3f' % menu.input} -input: 0 -input_min: -5.0 -input_max: 5.0 -input_step: 0.01 -realtime: True -gcode: - {%- if menu.event == 'long_click' -%} - TESTZ Z={'%.3f' % menu.input} - {%- endif -%} - -[menu __main __setup __calib __Z_offset __accept] -type: command -name: Accept -gcode: ACCEPT - -[menu __main __setup __calib __Z_offset __abort] -type: command -name: Abort -gcode: ABORT - -[menu __main __setup __calib __Z_offset __saveconfig] -type: command -name: Save config -gcode: SAVE_CONFIG diff --git a/printer.cfg b/printer.cfg index 0d3729a..111b348 100644 --- a/printer.cfg +++ b/printer.cfg @@ -47,7 +47,6 @@ square_corner_velocity: 5.0 [include fluidd.cfg] [include macros.cfg] [include display.cfg] -[include display_menu.cfg] [include neopixel.cfg] [include fans.cfg] From 71c696298bcb67b4737b4e566296c5db095fc7fb Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sat, 16 Oct 2021 19:49:44 +0200 Subject: [PATCH 034/131] v2.4: switch to klipperscreen on dsi display --- moonraker.conf | 8 ++++++++ printer.cfg | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/moonraker.conf b/moonraker.conf index 37dc25a..e231e1c 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -41,6 +41,14 @@ type: web repo: cadriel/fluidd path: ~/fluidd +[update_manager KlipperScreen] +type: git_repo +path: ~/KlipperScreen +origin: https://github.com/jordanruthe/KlipperScreen.git +env: ~/.KlipperScreen-env/bin/python +requirements: scripts/KlipperScreen-requirements.txt +install_script: scripts/KlipperScreen-install.sh + [power voron-v2.4] type: tplink_smartplug address: 192.168.11.91 diff --git a/printer.cfg b/printer.cfg index 111b348..904f044 100644 --- a/printer.cfg +++ b/printer.cfg @@ -46,7 +46,6 @@ square_corner_velocity: 5.0 [include fluidd.cfg] [include macros.cfg] -[include display.cfg] [include neopixel.cfg] [include fans.cfg] From b8638e4535ebf6d4fa21c5b8a4a6bd3618cbd630 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sat, 16 Oct 2021 19:50:54 +0200 Subject: [PATCH 035/131] v2.4: update fans, add nevermore --- fans.cfg | 23 +++++++++++++++-------- macros.cfg | 4 +--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/fans.cfg b/fans.cfg index f1fa961..705bda5 100644 --- a/fans.cfg +++ b/fans.cfg @@ -19,22 +19,29 @@ heater_temp: 50.0 ## If you are experiencing back flow, you can reduce fan_speed #fan_speed: 1.0 -[heater_fan side_fan1] +[heater_fan nevermore1] pin: PD12 kick_start_time: 0.5 heater: heater_bed -heater_temp: 45.0 -fan_speed: 0.40 +heater_temp: 40.0 +fan_speed: 0.80 -[heater_fan side_fan2] +[heater_fan nevermore2] pin: PD13 kick_start_time: 0.5 heater: heater_bed -heater_temp: 45.0 -fan_speed: 0.40 +heater_temp: 40.0 +fan_speed: 0.80 -[fan_generic exhaust_fan] +[heater_fan exhaust_fan] pin: PD14 max_power: 1.0 shutdown_speed: 0.0 -kick_start_time: 5.0 +kick_start_time: 0.5 +heater: heater_bed +heater_temp: 40 +fan_speed: 0.6 + +## always-on +# [heater_fan side1] +# [heater_fan side2] diff --git a/macros.cfg b/macros.cfg index fa13380..ee98448 100644 --- a/macros.cfg +++ b/macros.cfg @@ -138,7 +138,6 @@ gcode: M117 > starting SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 - SET_FAN_SPEED FAN=exhaust_fan SPEED=0.5 CLEAN_NOZZLE [gcode_macro PRINT_LAYER_CHANGE] @@ -166,10 +165,9 @@ gcode: [gcode_macro PRINT_END] gcode: M117 > finished + PARK M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-10.0 F3600 ; retract filament TURN_OFF_HEATERS M107 ; turn off fan - SET_FAN_SPEED FAN=exhaust_fan SPEED=0 - PARK From bbe58d064221192ffee202a488e54fe27412a859 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sat, 16 Oct 2021 19:51:22 +0200 Subject: [PATCH 036/131] v2.4: update macros, add Y parameter to PARK --- macros.cfg | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/macros.cfg b/macros.cfg index ee98448..2cb3fcf 100644 --- a/macros.cfg +++ b/macros.cfg @@ -17,7 +17,7 @@ gcode: description: Change filament gcode: SAVE_GCODE_STATE NAME=M600_state - PAUSE + PAUSE Y=15 M117 > change filament RESTORE_GCODE_STATE NAME=M600_state @@ -44,12 +44,15 @@ gcode: [gcode_macro PARK] gcode: + {% set Y=params.Y|default(295) %} {% if "xyz" in printer.toolhead.homed_axes %} # set park positon for x and y ## close to max {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} - ## close to min - {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + {% if Y != y_park %} + {% set y_park = Y %} + {% endif %} # calculate save lift position {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} @@ -73,19 +76,20 @@ rename_existing: PAUSE_BASE # change this if you need more or less extrusion variable_extrude: 1.0 gcode: - # read E from pause macro - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # end of definitions - M117 > pause - PAUSE_BASE - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E-{E} F2100 - G90 - {% else %} - {action_respond_info("Extruder not hot enough")} - {% endif %} - PARK + {% set Y=params.Y|default(295) %} + # read E from pause macro + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # end of definitions + M117 > pause + PAUSE_BASE + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E-{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + PARK Y={Y} [gcode_macro RESUME] From ac03c17a81fc46f48935d8913e30d83ff9183106 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 18 Oct 2021 16:43:57 +0200 Subject: [PATCH 037/131] v2.4: add resonance testing, host temperature, update calibration values --- input_shaper.cfg | 24 +++++++++++++++++++ printer.cfg | 43 ++++++++++++++++++++++++---------- resonance_test.cfg | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 input_shaper.cfg create mode 100644 resonance_test.cfg diff --git a/input_shaper.cfg b/input_shaper.cfg new file mode 100644 index 0000000..634c8d6 --- /dev/null +++ b/input_shaper.cfg @@ -0,0 +1,24 @@ +[input_shaper] +# A frequency (in Hz) of the input shaper for the axis. This is +# usually a resonance frequency of X axis that the input shaper +# should suppress. For more complex shapers, like 2- and 3-hump EI +# input shapers, this parameter can be set from different +# considerations. The default value is 0, which disables input +# shaping for the axis. +shaper_freq_x: 51.6 +shaper_freq_y: 48.0 +# A type of the input shaper to use for both X and Y axes. Supported +# shapers are zv, mzv, zvd, ei, 2hump_ei, and 3hump_ei. The default +# is mzv input shaper. +shaper_type: mzv +# If shaper_type is not set, these two parameters can be used to +# configure different input shapers for X and Y axes. The same +# values are supported as for shaper_type parameter. +# shaper_type_x: +# shaper_type_y: +# Damping ratios of vibrations of X and Y axes used by input shapers +# to improve vibration suppression. Default value is 0.1 which is a +# good all-round value for most printers. In most circumstances this +# parameter requires no tuning and should not be changed. +damping_ratio_x: 0.1 +damping_ratio_y: 0.1 diff --git a/printer.cfg b/printer.cfg index 904f044..81b343e 100644 --- a/printer.cfg +++ b/printer.cfg @@ -30,6 +30,7 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 #restart_method: command ##-------------------------------------------------------------------- + [printer] kinematics: corexy max_velocity: 300 @@ -38,6 +39,10 @@ max_accel_to_decel: 1500 # default half of max_accel max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 500 square_corner_velocity: 5.0 +## input_shaper +# max_accel: 7000 +# max_accel_to_decel: 3500 +# max_z_accel: 7000 ##################################################################### @@ -48,6 +53,8 @@ square_corner_velocity: 5.0 [include macros.cfg] [include neopixel.cfg] [include fans.cfg] +[include input_shaper.cfg] +# [include resonance_test.cfg] ##################################################################### @@ -268,7 +275,7 @@ max_temp: 120 pin: ~PB7 x_offset: 0 y_offset: 25.0 -z_offset: 0 +#z_offset: 0 speed: 10.0 samples: 3 samples_result: median @@ -296,19 +303,24 @@ insert_gcode: ##################################################################### # Enclosure Temp Sensor Section ##################################################################### -[thermistor chamber_temp] +[thermistor chamber] temperature1: 25 resistance1: 10000 beta: 3950 -[temperature_sensor enclosure_temp] +[temperature_sensor chamber] sensor_type: chamber_temp sensor_pin: PF5 min_temp: 0 max_temp: 100 gcode_id: C +[temperature_sensor rpi] +sensor_type: temperature_host +min_temp: 0 +max_temp: 100 + [idle_timeout] timeout: 1800 @@ -326,7 +338,7 @@ mesh_min: 40,60 mesh_max: 260,280 fade_start: 0.6 fade_end: 10 -probe_count: 5,5 +probe_count: 9,9 algorithm: bicubic relative_reference_index: 12 @@ -364,21 +376,28 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.005000, 0.050000, 0.017500, 0.007500, 0.002500 -#*# -0.005000, 0.037500, -0.005000, -0.015000, -0.027500 -#*# -0.015000, 0.030000, 0.000000, -0.010000, -0.027500 -#*# 0.010000, 0.060000, 0.027500, 0.015000, -0.015000 -#*# 0.065000, 0.112500, 0.077500, 0.072500, 0.047500 +#*# -0.032500, -0.010000, 0.017500, 0.002500, -0.017500, 0.012500, -0.025000, 0.020000, -0.020000 +#*# -0.040000, -0.020000, 0.000000, -0.012500, -0.037500, 0.000000, -0.040000, 0.007500, -0.030000 +#*# -0.045000, -0.025000, 0.000000, -0.012500, -0.035000, -0.002500, -0.040000, 0.000000, -0.042500 +#*# -0.065000, -0.045000, -0.020000, -0.032500, -0.057500, -0.022500, -0.067500, -0.020000, -0.057500 +#*# -0.052500, -0.032500, -0.010000, -0.020000, -0.042500, -0.007500, -0.050000, -0.010000, -0.060000 +#*# -0.045000, -0.022500, -0.005000, -0.017500, -0.040000, -0.010000, -0.047500, -0.005000, -0.047500 +#*# -0.042500, -0.025000, 0.000000, -0.015000, -0.035000, -0.002500, -0.040000, 0.000000, -0.047500 +#*# -0.027500, -0.015000, 0.010000, -0.012500, -0.032500, 0.000000, -0.035000, 0.005000, -0.035000 +#*# -0.005000, 0.012500, 0.045000, 0.025000, 0.005000, 0.040000, 0.002500, 0.042500, -0.007500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic -#*# y_count = 5 +#*# y_count = 9 #*# mesh_y_pps = 2 #*# min_y = 60.0 -#*# x_count = 5 +#*# x_count = 9 #*# max_y = 280.0 #*# mesh_x_pps = 2 #*# max_x = 260.0 #*# #*# [stepper_z] -#*# position_endstop = 0.907 +#*# position_endstop = 0.597 +#*# +#*# [probe] +#*# z_offset = 1.890 diff --git a/resonance_test.cfg b/resonance_test.cfg new file mode 100644 index 0000000..1e8430e --- /dev/null +++ b/resonance_test.cfg @@ -0,0 +1,58 @@ +# [mcu nano] +# serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 + +# [mcu pico] +# serial: /dev/serial/by-id/usb-Klipper_rp2040_E660583883511936-if00 + +# [board_pins arduino] +# mcu: nano +# aliases: +# ar0=PD0, ar1=PD1, ar2=PD2, ar3=PD3, ar4=PD4, +# ar5=PD5, ar6=PD6, ar7=PD7, ar8=PB0, ar9=PB1, +# ar10=PB2, ar11=PB3, ar12=PB4, ar13=PB5, ar14=PC0, +# ar15=PC1, ar16=PC2, ar17=PC3, ar18=PC4, ar19=PC5, +# analog0=PC0, analog1=PC1, analog2=PC2, analog3=PC3, analog4=PC4, +# analog5=PC5, analog6=PE2, analog7=PE3 + +# [output_pin led] +# pin: nano:ar13 +# value: 0 +# +# ## arduino nano +# [adxl345] +# # The SPI enable pin for the sensor. This parameter must be provided. +# cs_pin: nano:ar10 +# # The SPI speed (in hz) to use when communicating with the chip. +# # The default is 5000000. +# # spi_speed: 5000000 +# # See the "common SPI settings" section for a description of the +# # above parameters. +# # spi_bus: +# spi_software_sclk_pin: nano:ar13 +# spi_software_mosi_pin: nano:ar11 +# spi_software_miso_pin: nano:ar12 +# # The accelerometer axis for each of the printer's x, y, and z axes. +# # This may be useful if the accelerometer is mounted in an +# # orientation that does not match the printer orientation. For +# # example, one could set this to "y,x,z" to swap the x and y axes. +# # It is also possible to negate an axis if the accelerometer +# # direction is reversed (eg, "x,z,-y"). The default is "x,y,z". +# axes_map: x,z,-y +# # Output data rate for ADXL345. ADXL345 supports the following data +# # rates: 3200, 1600, 800, 400, 200, 100, 50, and 25. Note that it is +# # not recommended to change this rate from the default 3200, and +# # rates below 800 will considerably affect the quality of resonance +# # measurements. +# # rate: 3200 + +# ## rpi pico +# [adxl345] +# cs_pin: pico:gpio1 +# spi_bus: spi0a +# axes_map: x,y,z + +# [resonance_tester] +# accel_chip: adxl345 +# probe_points: +# 150,150,20 # an example + From 3c58884ede1b9ac4dcdf3e60fd7b89f0f8e08d30 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 18 Oct 2021 16:45:37 +0200 Subject: [PATCH 038/131] v2.4: add KlipperScreen.conf --- KlipperScreen.conf | 251 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 KlipperScreen.conf diff --git a/KlipperScreen.conf b/KlipperScreen.conf new file mode 100644 index 0000000..34aa433 --- /dev/null +++ b/KlipperScreen.conf @@ -0,0 +1,251 @@ +[main] +moonraker_host: 127.0.0.1 +moonraker_port: 7125 + +[preheat PLA] +bed = 40 +extruder = 195 + +[preheat ABS] +bed = 90 +extruder = 220 + +[menu __main] +name: {{ gettext('Main Menu') }} + +[menu __main homing] +name: {{ gettext('Homing') }} +icon: home + +[menu __main preheat] +name: {{ gettext('Preheat') }} +icon: heat-up +panel: preheat + +[menu __main actions] +name: {{ gettext('Actions') }} +icon: move + +[menu __main config] +name: {{ gettext('Configuration') }} +icon: settings + +[menu __main print] +name: {{ gettext('Print') }} +icon: print +panel: print + +[menu __main homing homeall] +name: {{ gettext('Home All') }} +icon: home +method: printer.gcode.script +params: {"script":"G28"} + +[menu __main homing homex] +name: {{ gettext('Home X') }} +icon: home-x +method: printer.gcode.script +params: {"script":"G28 X"} + +[menu __main homing homey] +name: {{ gettext('Home Y') }} +icon: home-y +method: printer.gcode.script +params: {"script":"G28 Y"} + +[menu __main homing homez] +name: {{ gettext('Home Z') }} +icon: home-z +method: printer.gcode.script +params: {"script":"G28 Z"} + +[menu __main homing homexy] +name: {{ gettext('Home XY') }} +icon: home +method: printer.gcode.script +params: {"script":"G28 X Y"} + +[menu __main homing quad_gantry_level] +name: {{ gettext('Quad Gantry Level') }} +icon: home-z +method: printer.gcode.script +params: {"script":"QUAD_GANTRY_LEVEL"} +enable: {{ printer.quad_gantry_level is defined }} + +[menu __main homing Z-Tilt] +name: {{ gettext('Z Tilt') }} +icon: z-tilt +method: printer.gcode.script +params: {"script":"Z_TILT_ADJUST"} +enable: {{ printer.z_tilt is defined }} + + +[menu __main actions move] +name: {{ gettext('Move') }} +icon: move +panel: move + +[menu __main actions extrude] +name: {{ gettext('Extrude') }} +icon: filament +panel: extrude + +[menu __main actions fan] +name: {{ gettext('Fan') }} +icon: fan +panel: fan + +[menu __main actions temperature] +name: {{ gettext('Temperature') }} +icon: heat-up +panel: temperature + +[menu __main actions macros] +name: {{ gettext('Macros') }} +icon: custom-script +panel: gcode_macros +enable: {{ printer.gcode_macros.count > 0 }} + +[menu __main actions power] +name: {{ gettext('Power') }} +icon: shutdown +panel: power +enable: {{ printer.power_devices.count > 0 }} + +[menu __main actions disablemotors] +name: {{ gettext('Disable Motors') }} +icon: motor-off +method: printer.gcode.script +params: {"script":"M18"} + +[menu __main actions console] +name: {{ gettext('Console') }} +icon: console +panel: console + +[menu __main config bedlevel] +name: {{ gettext('Bed Level') }} +icon: bed-level +panel: bed_level + +[menu __main config bedmesh] +name: {{ gettext('Bed Mesh') }} +icon: bed-level +panel: bed_mesh +enable: {{ printer.bed_mesh is defined }} + +[menu __main config zoffset] +name: {{ gettext('Z Calibrate') }} +icon: z-farther +panel: zcalibrate +enable: {{ ((printer.bltouch != False) or (printer.probe != False)) }} + +[menu __main config limits] +name: {{ gettext('Limits') }} +icon: fine-tune +panel: limits + +[menu __main config network] +name: {{ gettext('Network') }} +icon: network +panel: network + +[menu __main config system] +name: {{ gettext('System') }} +icon: info +panel: system + +[menu __main config save] +name: {{ gettext('Save Config') }} +icon: complete +method: printer.gcode.script +params: {"script":"SAVE_CONFIG"} +confirm: + {{ gettext('Save configuration.') }} + + {{ gettext('Klipper will reboot') }} + +[menu __main config settings] +name: {{ gettext('Settings') }} +icon: settings +panel: settings + +[menu __print] +name: {{ gettext('Print Control') }} + +[menu __print temperature] +name: {{ gettext('Temperature') }} +icon: heat-up +panel: temperature + +[menu __print fan] +name: {{ gettext('Fan') }} +icon: fan +panel: fan + +[menu __print extrude] +name: {{ gettext('Extrude') }} +icon: filament +panel: extrude +enable: {{ printer.pause_resume.is_paused == True }} + +[menu __print power] +name: {{ gettext('Power') }} +icon: shutdown +panel: power +enable: {{ printer.power_devices.count > 0 }} + +[menu __print macros] +name: {{ gettext('Macros') }} +icon: custom-script +panel: gcode_macros +enable: {{ printer.gcode_macros.count > 0 }} + +[menu __print console] +name: {{ gettext('Console') }} +icon: console +panel: console + +[menu __print limits] +name: {{ gettext('Limits') }} +icon: fine-tune +panel: limits + +[menu __print network] +name: {{ gettext('Network') }} +icon: network +panel: network + +[menu __print system] +name: {{ gettext('System') }} +icon: info +panel: system + +[menu __print settings] +name: {{ gettext('Settings') }} +icon: settings +panel: settings + +[menu __splashscreen] +name: {{ gettext('Menu') }} + +[menu __splashscreen power] +name: {{ gettext('Power') }} +icon: shutdown +panel: power +enable: {{ printer.power_devices.count > 0 }} + +[menu __splashscreen network] +name: {{ gettext('Network') }} +icon: network +panel: network + +[menu __splashscreen system] +name: {{ gettext('System') }} +icon: info +panel: system + +[menu __splashscreen settings] +name: {{ gettext('Settings') }} +icon: settings +panel: settings From 7e706e0ec2696fd58dbc1ad3ec7901a70969d2e9 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 18 Oct 2021 16:46:32 +0200 Subject: [PATCH 039/131] v2.4: make sure to PROBE on the bed, manually control exhaust_fan --- fans.cfg | 16 ++++++++++++---- macros.cfg | 31 +++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/fans.cfg b/fans.cfg index 705bda5..45290e6 100644 --- a/fans.cfg +++ b/fans.cfg @@ -33,14 +33,22 @@ heater: heater_bed heater_temp: 40.0 fan_speed: 0.80 -[heater_fan exhaust_fan] +# ## exhaust automatic +# [heater_fan exhaust_fan] +# pin: PD14 +# max_power: 1.0 +# shutdown_speed: 0.0 +# kick_start_time: 0.5 +# heater: heater_bed +# heater_temp: 40 +# fan_speed: 0.6 + +## exhaust manual +[fan_generic exhaust_fan] pin: PD14 max_power: 1.0 shutdown_speed: 0.0 kick_start_time: 0.5 -heater: heater_bed -heater_temp: 40 -fan_speed: 0.6 ## always-on # [heater_fan side1] diff --git a/macros.cfg b/macros.cfg index 2cb3fcf..e9ee387 100644 --- a/macros.cfg +++ b/macros.cfg @@ -7,9 +7,9 @@ gcode: QUAD_GANTRY_LEVEL M117 > home G28 - M117 > bed mesh calibrate - BED_MESH_CALIBRATE - # BED_MESH_PROFILE load=default # load default bed_mesh profile + # M117 > bed mesh calibrate + # BED_MESH_CALIBRATE + BED_MESH_PROFILE load=default # load default bed_mesh profile G0 X150 Y150 Z30 F3600 @@ -42,6 +42,7 @@ gcode: {action_respond_info("Printer not homed")} {% endif %} + [gcode_macro PARK] gcode: {% set Y=params.Y|default(295) %} @@ -70,6 +71,26 @@ gcode: {% endif %} +[gcode_macro PROBE] +description: Override PROBE and make sure we're over the bed +rename_existing: PROBE_BASE +gcode: + {%- if printer.toolhead.position.y|float > 270 -%} + G0 Y270 + {%- endif -%} + PROBE_BASE + + +[gcode_macro PROBE_CALIBRATE] +description: Override PROBE_CALIBRATE and make sure we're over the bed +rename_existing: PROBE_CALIBRATE_BASE +gcode: + {%- if printer.toolhead.position.y|float > 270 -%} + G0 Y270 + {%- endif -%} + PROBE_CALIBRATE_BASE + + [gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE @@ -130,7 +151,7 @@ gcode: M117 > homing SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 G4 P2000 - G32 # home all axes + G32 # home and qgl M117 > heating SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 @@ -142,6 +163,7 @@ gcode: M117 > starting SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 + SET_FAN_SPEED FAN=exhaust_fan SPEED=0.5 CLEAN_NOZZLE [gcode_macro PRINT_LAYER_CHANGE] @@ -175,3 +197,4 @@ gcode: G1 E-10.0 F3600 ; retract filament TURN_OFF_HEATERS M107 ; turn off fan + SET_FAN_SPEED FAN=exhaust_fan SPEED=0.0 From 3b059c1e3a4908e4b2c12de69bcb3616cd042226 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 27 Oct 2021 11:55:25 +0200 Subject: [PATCH 040/131] v2.4: update fans, again --- fans.cfg | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/fans.cfg b/fans.cfg index 45290e6..044555a 100644 --- a/fans.cfg +++ b/fans.cfg @@ -33,6 +33,20 @@ heater: heater_bed heater_temp: 40.0 fan_speed: 0.80 +[heater_fan side1] +pin: PD14 +kick_start_time: 0.5 +heater: heater_bed +heater_temp: 40.0 +fan_speed: 0.40 + +[heater_fan side2] +pin: PD15 +kick_start_time: 0.5 +heater: heater_bed +heater_temp: 40.0 +fan_speed: 0.40 + # ## exhaust automatic # [heater_fan exhaust_fan] # pin: PD14 @@ -43,13 +57,10 @@ fan_speed: 0.80 # heater_temp: 40 # fan_speed: 0.6 -## exhaust manual -[fan_generic exhaust_fan] -pin: PD14 -max_power: 1.0 -shutdown_speed: 0.0 -kick_start_time: 0.5 +# ## exhaust manual +# [fan_generic exhaust_fan] +# pin: PD14 +# max_power: 1.0 +# shutdown_speed: 0.0 +# kick_start_time: 0.5 -## always-on -# [heater_fan side1] -# [heater_fan side2] From f0b509ed84d78b989ace54daae6b33a9c5356aa9 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 27 Oct 2021 11:55:56 +0200 Subject: [PATCH 041/131] v2.4: update input_shaper config, resonance_test --- input_shaper.cfg | 19 ++++--------- resonance_test.cfg | 67 +++++++++++++++------------------------------- 2 files changed, 27 insertions(+), 59 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index 634c8d6..61f440b 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -1,21 +1,12 @@ [input_shaper] -# A frequency (in Hz) of the input shaper for the axis. This is -# usually a resonance frequency of X axis that the input shaper -# should suppress. For more complex shapers, like 2- and 3-hump EI -# input shapers, this parameter can be set from different -# considerations. The default value is 0, which disables input -# shaping for the axis. -shaper_freq_x: 51.6 -shaper_freq_y: 48.0 # A type of the input shaper to use for both X and Y axes. Supported # shapers are zv, mzv, zvd, ei, 2hump_ei, and 3hump_ei. The default # is mzv input shaper. -shaper_type: mzv -# If shaper_type is not set, these two parameters can be used to -# configure different input shapers for X and Y axes. The same -# values are supported as for shaper_type parameter. -# shaper_type_x: -# shaper_type_y: +# shaper_type: mzv +shaper_type_x: mzv +shaper_freq_x: 51 +shaper_type_y: ei +shaper_freq_y: 53.4 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/resonance_test.cfg b/resonance_test.cfg index 1e8430e..01d232d 100644 --- a/resonance_test.cfg +++ b/resonance_test.cfg @@ -1,49 +1,26 @@ -# [mcu nano] -# serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 +[mcu nano] +serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 # [mcu pico] # serial: /dev/serial/by-id/usb-Klipper_rp2040_E660583883511936-if00 -# [board_pins arduino] -# mcu: nano -# aliases: -# ar0=PD0, ar1=PD1, ar2=PD2, ar3=PD3, ar4=PD4, -# ar5=PD5, ar6=PD6, ar7=PD7, ar8=PB0, ar9=PB1, -# ar10=PB2, ar11=PB3, ar12=PB4, ar13=PB5, ar14=PC0, -# ar15=PC1, ar16=PC2, ar17=PC3, ar18=PC4, ar19=PC5, -# analog0=PC0, analog1=PC1, analog2=PC2, analog3=PC3, analog4=PC4, -# analog5=PC5, analog6=PE2, analog7=PE3 +[board_pins arduino] +mcu: nano +aliases: + ar0=PD0, ar1=PD1, ar2=PD2, ar3=PD3, ar4=PD4, + ar5=PD5, ar6=PD6, ar7=PD7, ar8=PB0, ar9=PB1, + ar10=PB2, ar11=PB3, ar12=PB4, ar13=PB5, ar14=PC0, + ar15=PC1, ar16=PC2, ar17=PC3, ar18=PC4, ar19=PC5, + analog0=PC0, analog1=PC1, analog2=PC2, analog3=PC3, analog4=PC4, + analog5=PC5, analog6=PE2, analog7=PE3 -# [output_pin led] -# pin: nano:ar13 -# value: 0 -# -# ## arduino nano -# [adxl345] -# # The SPI enable pin for the sensor. This parameter must be provided. -# cs_pin: nano:ar10 -# # The SPI speed (in hz) to use when communicating with the chip. -# # The default is 5000000. -# # spi_speed: 5000000 -# # See the "common SPI settings" section for a description of the -# # above parameters. -# # spi_bus: -# spi_software_sclk_pin: nano:ar13 -# spi_software_mosi_pin: nano:ar11 -# spi_software_miso_pin: nano:ar12 -# # The accelerometer axis for each of the printer's x, y, and z axes. -# # This may be useful if the accelerometer is mounted in an -# # orientation that does not match the printer orientation. For -# # example, one could set this to "y,x,z" to swap the x and y axes. -# # It is also possible to negate an axis if the accelerometer -# # direction is reversed (eg, "x,z,-y"). The default is "x,y,z". -# axes_map: x,z,-y -# # Output data rate for ADXL345. ADXL345 supports the following data -# # rates: 3200, 1600, 800, 400, 200, 100, 50, and 25. Note that it is -# # not recommended to change this rate from the default 3200, and -# # rates below 800 will considerably affect the quality of resonance -# # measurements. -# # rate: 3200 +## arduino nano +[adxl345] +cs_pin: nano:ar10 +spi_software_sclk_pin: nano:ar13 +spi_software_mosi_pin: nano:ar11 +spi_software_miso_pin: nano:ar12 +axes_map: x,y,z # ## rpi pico # [adxl345] @@ -51,8 +28,8 @@ # spi_bus: spi0a # axes_map: x,y,z -# [resonance_tester] -# accel_chip: adxl345 -# probe_points: -# 150,150,20 # an example +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150,150,20 # an example From 81bc1ff901ca3b210862ea94aacaf74e3d962a7c Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 27 Oct 2021 11:56:47 +0200 Subject: [PATCH 042/131] v2.4: update, reorder macros macros --- KlipperScreen.conf | 19 +++ macros.cfg | 289 ++++++++++++++++++++++++++------------------- 2 files changed, 188 insertions(+), 120 deletions(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 34aa433..f855d31 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -249,3 +249,22 @@ panel: system name: {{ gettext('Settings') }} icon: settings panel: settings +#~# --- Do not edit below this line. This section is auto generated --- #~# + +#~# +#~# [main] +#~# move_speed = 30 +#~# +#~# [displayed_macros Printer] +#~# g32 = False +#~# park = False +#~# cancel_print = False +#~# print_start = False +#~# print_end = False +#~# pause = False +#~# print_layer_change = False +#~# probe = False +#~# resume = False +#~# probe_calibrate = False +#~# purge_nozzle = False +#~# diff --git a/macros.cfg b/macros.cfg index e9ee387..ce7263d 100644 --- a/macros.cfg +++ b/macros.cfg @@ -1,34 +1,11 @@ -[gcode_macro G32] +## HELPERS +[gcode_macro ZES] +description: Z_ENDSTOP_CALIBRATE + extras gcode: - BED_MESH_CLEAR - M117 > home G28 - M117 > qgl - QUAD_GANTRY_LEVEL - M117 > home - G28 - # M117 > bed mesh calibrate - # BED_MESH_CALIBRATE - BED_MESH_PROFILE load=default # load default bed_mesh profile - G0 X150 Y150 Z30 F3600 - - -[gcode_macro M600] -description: Change filament -gcode: - SAVE_GCODE_STATE NAME=M600_state - PAUSE Y=15 - M117 > change filament - RESTORE_GCODE_STATE NAME=M600_state - - -[gcode_macro CANCEL_PRINT] -description: Cancel the actual running print -rename_existing: CANCEL_PRINT_BASE -gcode: - TURN_OFF_HEATERS - PARK - CANCEL_PRINT_BASE + G0 X150 Y150 Z10 F10000 + Z_ENDSTOP_CALIBRATE + TESTZ Z=-9 [gcode_macro CENTER] @@ -43,6 +20,41 @@ gcode: {% endif %} +[gcode_macro PURGE_NOZZLE] +gcode: + {% set x0=params.x0|default(75) %} + {% set x1=params.x1|default(225) %} + {% set y0=params.y0|default(15) %} + {% set y1=params.y1|default(15.8) %} + M117 > purge nozzle + G0 Z10 F300 # move Z to travel height + G0 X{x0} Y{y0} F5000 # move to x0/y0 + G0 Z0.2 F1500 # lower Z + G0 X{x1} E30 # draw line + G0 Y{y1} # move to y1 + G0 X{x0} E15 # draw fine line + + +[gcode_macro BRUSHIE] +gcode: + {% set x0=50 %} + {% set x1=110 %} + {% set y0=305 %} + {% set z0=2 %} + {% if "xyz" in printer.toolhead.homed_axes %} + M117 > brushie brushie brushie + G0 Z20 F1000 # move Z to travel height + G0 X{x0} Y{y0} F5000 # move to x0/y0 + G0 Z{z0} # lower + G0 X{x1} # back + G0 X{x0} # forth + G0 X{x1} # back + G0 Z20 F300 # move Z to travel height + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + + [gcode_macro PARK] gcode: {% set Y=params.Y|default(295) %} @@ -71,26 +83,93 @@ gcode: {% endif %} -[gcode_macro PROBE] -description: Override PROBE and make sure we're over the bed -rename_existing: PROBE_BASE +[gcode_macro G32] gcode: - {%- if printer.toolhead.position.y|float > 270 -%} - G0 Y270 - {%- endif -%} - PROBE_BASE + BED_MESH_CLEAR + M117 > home + G28 + M117 > qgl + QUAD_GANTRY_LEVEL + M117 > brushie + BRUSHIE + M117 > home + G28 + M117 > bed mesh calibrate + BED_MESH_CALIBRATE + # BED_MESH_PROFILE load=default # load default bed_mesh profile + G0 X150 Y150 Z30 F3600 -[gcode_macro PROBE_CALIBRATE] -description: Override PROBE_CALIBRATE and make sure we're over the bed -rename_existing: PROBE_CALIBRATE_BASE +[gcode_macro M600] +description: Change filament gcode: - {%- if printer.toolhead.position.y|float > 270 -%} - G0 Y270 - {%- endif -%} - PROBE_CALIBRATE_BASE + SAVE_GCODE_STATE NAME=M600_state + PAUSE Y=15 + M117 > change filament + RESTORE_GCODE_STATE NAME=M600_state +## PRINT_ +[gcode_macro PRINT_START] +gcode: + {% set BED=params.BED|default(100) %} + {% set EXTRUDER=params.EXTRUDER|default(250) %} + {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} + # TODO + {% set BMC=params.BMC|default(0) %} + {% set ERCF=params.ERCF|default(0) %} + M117 > configuring + SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 + G4 P2000 + M140 S{BED} # start bed heating + M104 S{EXTRUDER} # start extruder heating + G92 E0 # reset extruder + G21 # set units to millimeters + G90 # use absolute coordinates + M83 # use relative distances for extrusion + + M117 > homing + SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 + G4 P2000 + G32 # home, qgl and mesh + + M117 > heating + SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 + G4 P2000 + G92 E0 # reset extruder + M190 S{BED} # set and wait for bed temperature + M109 S{EXTRUDER} # set and wait for nozzle temperature + M117 > soaking for {SOAK/1000/60|int} min + G4 P{SOAK} + + M117 > starting + SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 + G4 P2000 + # SET_FAN_SPEED FAN=exhaust_fan SPEED=0.5 + PURGE_NOZZLE + + +[gcode_macro PRINT_END] +gcode: + M117 > finished + PARK + M400 ; wait for buffer to clear + G92 E0 ; zero the extruder + G1 E-10.0 F3600 ; retract filament + TURN_OFF_HEATERS + M107 ; turn off fan + # SET_FAN_SPEED FAN=exhaust_fan SPEED=0.0 + + +[gcode_macro PRINT_LAYER_CHANGE] +gcode: + {% set layer=params.LAYER|default(0)|int %} + {% set layer_z=params.LAYER_Z|default(0) %} + {% set total_layer_count=params.TOTAL_LAYER_COUNT|default(0) %} + M117 > layer {layer+1}/{total_layer_count} {layer_z}mm + + +## OVERRIDES [gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE @@ -117,84 +196,54 @@ gcode: description: Resume the actual running print rename_existing: RESUME_BASE gcode: - # read E from pause macro - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # get VELOCITY parameter if specified - {% if 'VELOCITY' in params|upper %} - {% set get_params = ('VELOCITY=' + params.VELOCITY) %} - {%else %} - {% set get_params = "" %} - {% endif %} - # end of definitions - M117 > resume - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E{E} F6000 - {% else %} - {action_respond_info("Extruder not hot enough")} - {% endif %} - RESUME_BASE {get_params} + # read E from pause macro + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # get VELOCITY parameter if specified + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + # end of definitions + M117 > resume + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F6000 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} -[gcode_macro PRINT_START] +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE gcode: - M117 > configuring - SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 - G4 P2000 - M140 S{BED} # start bed heating - M104 S{EXTRUDER} # start extruder heating - G92 E0 # reset extruder - G21 # set units to millimeters - G90 # use absolute coordinates - M83 # use relative distances for extrusion - - M117 > homing - SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 - G4 P2000 - G32 # home and qgl - - M117 > heating - SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 - G4 P2000 - G92 E0 # reset extruder - M190 S{BED} # set and wait for bed temperature - M109 S{EXTRUDER} # set and wait for nozzle temperature - - M117 > starting - SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 - G4 P2000 - SET_FAN_SPEED FAN=exhaust_fan SPEED=0.5 - CLEAN_NOZZLE - -[gcode_macro PRINT_LAYER_CHANGE] -gcode: - {% set layer=params.LAYER|default(0) %} - {% set layer_z=params.LAYER_Z|default(0) %} - M117 > layer {layer}/{layer_z}mm - - -[gcode_macro CLEAN_NOZZLE] -gcode: - {% set x0=params.x0|default(75) %} - {% set x1=params.x1|default(225) %} - {% set y0=params.y0|default(15) %} - {% set y1=params.y1|default(15.8) %} - M117 > clean nozzle - G0 Z5 F300 # move Z to travel height - G0 X{x0} Y{y0} F5000 # move to x0/y0 - G0 Z0.2 F1500 # lower Z - G0 X{x1} E30 # draw line - G0 Y{y1} # move to y1 - G0 X{x0} E15 # draw fine line - - -[gcode_macro PRINT_END] -gcode: - M117 > finished - PARK - M400 ; wait for buffer to clear - G92 E0 ; zero the extruder - G1 E-10.0 F3600 ; retract filament TURN_OFF_HEATERS - M107 ; turn off fan - SET_FAN_SPEED FAN=exhaust_fan SPEED=0.0 + PARK + CANCEL_PRINT_BASE + + +[gcode_macro PROBE] +description: Override PROBE and make sure we're over the bed +rename_existing: PROBE_BASE +gcode: + {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} + {% if printer.toolhead.position.y|float > 270 %} + G0 Y270 + {% endif %} + {% if P %} + PROBE_BASE + {% else %} + {action_respond_info("Probe not attached")} + {% endif %} + + +[gcode_macro PROBE_CALIBRATE] +description: Override PROBE_CALIBRATE and make sure we're over the bed +rename_existing: PROBE_CALIBRATE_BASE +gcode: + {%- if printer.toolhead.position.y|float > 270 -%} + G0 Y270 + {%- endif -%} + PROBE_CALIBRATE_BASE From b96a32f1a3f4b8b04f672f57e6ae37166fada698 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 27 Oct 2021 11:57:16 +0200 Subject: [PATCH 043/131] v2.4: update klipperscreen --- KlipperScreen.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index f855d31..ab59475 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -267,4 +267,3 @@ panel: settings #~# resume = False #~# probe_calibrate = False #~# purge_nozzle = False -#~# From 97a84b3338c2900f1ee455a41f1cba175c539ea6 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 27 Oct 2021 11:58:25 +0200 Subject: [PATCH 044/131] v2.4: update printer, use klicky-probe --- klicky-probe.cfg | 662 +++++++++++++++++++++++++++++++++++++++++++++++ printer.cfg | 59 +++-- 2 files changed, 691 insertions(+), 30 deletions(-) create mode 100644 klicky-probe.cfg diff --git a/klicky-probe.cfg b/klicky-probe.cfg new file mode 100644 index 0000000..04bb59f --- /dev/null +++ b/klicky-probe.cfg @@ -0,0 +1,662 @@ +# This macro was provided by discord user Garrettwp to whom i give my thanks for sharing it with me. +# I have tweaked it a lot. +# +# this macro is based on the great Annex magprobe dockable probe macros "#Originally developed by Mental, modified for better use on K-series printers by RyanG and Trails" +# that macro can be found here https://github.com/Annex-Engineering/Annex-Engineering_Other_Printer_Mods/blob/master/All_Printers/Microswitch_Probe/Klipper_Macros/dockable_probe_macros.cfg +# +# by standing on the shoulders of giants, lets see if we can see further +# Klicky-probe.cfg version 11-10-2021 01 + +[gcode_macro _User_Variables] +variable_verbose: True # Enable verbose output +variable_travel_speed: 200 # how fast all other travel moves will be performed when running these macros +variable_dock_speed: 50 # how fast should the toolhead move when docking the probe for the final movement +variable_release_speed: 100 # how fast should the toolhead move to release the hold of the magnets after docking +variable_z_drop_speed: 20 # how fast the z will lower when moving to the z location to clear the probe +variable_home_z_height: 20 # Z when homing +variable_allow_g28xy_without_z: 0 # forces the initial G28 to calibrate X Y and Z, otherwise you could only do one axis and potentially hit the bed or gantry (by doing only a G28 Z) +variable_max_bed_y: 250 #maximum Bed size avoids doing a probe_accuracy outside the bed + + +# if a separate Z endstop switch is in +# use, specify the coordinates of the switch here (Voron). +# Set to 0 to have the probe move to center of bed +variable_z_endstop_x: 208 +variable_z_endstop_y: 305 + +# location to park the toolhead +variable_park_toolhead: False # Enable toolhead parking +variable_parkposition_x: 125 +variable_parkposition_y: 125 +variable_parkposition_z: 30 + +#dock location +variable_docklocation_x: 148 # X Dock position +variable_docklocation_y: 305 # Y Dock position +variable_docklocation_z: -128 # Z dock position (-128 for a gantry mount) +variable_dockarmslenght: 30 # Dock arms lenght, toolhead movement necessary to clear the dock arms + +#Umbilical to help untangle the umbilical in difficult situations +variable_umbilical_x: 15 #X umbilical position +variable_umbilical_y: 15 #Y umbilical position +variable_umbilical: False #should we untabgle the umbilical + +# Do not modify below +gcode: + {% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %} + {% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %} + {% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %} + {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} + {% set Oz = printer['configfile'].config["probe"]["z_offset"]|float %} + + # if docklocation_z is zero, use Home Z height for safety + {% if docklocation_z == 0 %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=docklocation_z VALUE={ home_z_height } + {% endif %} + + # If x, y coordinates are set for z endstop, assign them + {% if z_endstop_x != 0 or z_endstop_y != 0 %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_x VALUE={ z_endstop_x } + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_y VALUE={ z_endstop_y } + + # if no x, y coordinates for z endstop, assume probe is endstop and move toolhead to center of bed + {% else %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_x VALUE={ (Mx * 0.5) - Ox } + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_y VALUE={ (My * 0.5) - Oy } + {% endif %} + + +[gcode_macro _Probe_Variables] +variable_probe_attached: False +variable_probe_state: False +variable_probe_lock: False +variable_z_endstop_x: 0 +variable_z_endstop_y: 0 +gcode: + + +[gcode_macro _Homing_Variables] +gcode: + {% set R = params.RESET|default(0) %} + + {% if R %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ False } + {% endif %} + +# Attach probe and lock it +[gcode_macro Attach_Probe_Lock] +description: Attaches Klicky Probe, can only be docked after unlocking +gcode: + Attach_Probe + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ True } + + +# Dock probe and lock it +[gcode_macro Dock_Probe_Unlock] +description: Docks Klicky Probe even if it was locked +gcode: + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ False } + Dock_Probe + +# Unlock Probe +[gcode_macro Probe_Unlock] +description: Unlocks Klicky Probe state +gcode: + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ False } + +# Lock Probe +[gcode_macro Probe_Lock] +description: Locks Klicky Probe state +gcode: + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ True } + +# Attach Probe Routine +[gcode_macro Attach_Probe] +description: Attaches Klicky Probe +gcode: + # Get probe attach status + {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} + {% set L = printer["gcode_macro _Probe_Variables"].probe_lock %} + {% set V = printer["gcode_macro _User_Variables"].verbose %} + # Get Docking location + {% set Dx = printer["gcode_macro _User_Variables"].docklocation_x %} + {% set Dy = printer["gcode_macro _User_Variables"].docklocation_y %} + {% set Dz = printer["gcode_macro _User_Variables"].docklocation_z %} + {% set Da = printer["gcode_macro _User_Variables"].dockarmslenght %} + # Safe Z for travel + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + #Set speed + {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} + + #prior to saving actual position, check if its necessary to move to a safe Z + #that has enought overhead for the attached probe + {% if (printer.toolhead.position.z < Hzh) %} + G1 Z{Hzh} F1200 + {% endif %} + M400 # mandatory to save the new safe position + #allows the docking position to be independent of the Z offset, necessary for bed mounted probes + SAVE_GCODE_STATE name=_attachProbe + SET_GCODE_OFFSET Z=0 + + # if x and y are not homed + {% if not 'xy' in printer.toolhead.homed_axes %} + { action_raise_error("Must Home X and Y Axis First!") } + + # If probe not attached and locked + {% elif not P and not L %} + {% if V %} + { action_respond_info("Attaching Probe") } + {% endif %} + G90 + + {% if (not 'z' in printer.toolhead.homed_axes) %} + {% if V %} + { action_respond_info("Resetting Z position to zero") } + {% endif %} + SET_KINEMATIC_POSITION Z=0 + {% endif %} + + {% if (printer.toolhead.position.z < Hzh) %} + G1 Z{Hzh} F1200 + {% endif %} + + _Umbilical_Path + + # Probe entry location + G1 X{Dx} Y{Dy|int - Da|int} F{St} + {% if Dz != -128 %} + #lower to Z dock + G1 Z{Dz} F600 + {% endif %} + # pickup from Probe location + G1 X{Dx} Y{Dy} F1800 + # Probe entry location + G1 X{Dx} Y{Dy|int - Da|int} F6000 + #Go to Z safe distance + {% if (printer.toolhead.position.z < Hzh) %} + G1 Z{Hzh} F600 + {% endif %} + _Park_Toolhead + + _CheckProbe action=attach + + {% elif L %} + {% if V %} + { action_respond_info("Probe locked!") } + {% endif %} + + # Probe attached, do nothing + _CheckProbe action=query + + {% else %} + {% if V %} + { action_respond_info("Probe already attached!") } + {% endif %} + + # Probe attached, do nothing + _CheckProbe action=query + + {% endif %} + #reverts to the original Z offset + RESTORE_GCODE_STATE name=_attachProbe + + +# Dock Probe Routine +[gcode_macro Dock_Probe] +description: Docks Klicky Probe +gcode: + # Get probe attach status + {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} + {% set L = printer["gcode_macro _Probe_Variables"].probe_lock %} + {% set V = printer["gcode_macro _User_Variables"].verbose %} + # Get Docking location + {% set Dx = printer["gcode_macro _User_Variables"].docklocation_x %} + {% set Dy = printer["gcode_macro _User_Variables"].docklocation_y %} + {% set Dz = printer["gcode_macro _User_Variables"].docklocation_z %} + {% set Da = printer["gcode_macro _User_Variables"].dockarmslenght %} + # Safe Z for travel + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + # Set speed + {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} + {% set Sd = printer["gcode_macro _User_Variables"].dock_speed * 60 %} + {% set Sr = printer["gcode_macro _User_Variables"].release_speed * 60 %} + {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} + + M400 # mandatory to save the new safe position + #allows the docking position to be independent of the Z offset, necessary for bed mounted probes + SAVE_GCODE_STATE name=_dockProbe + SET_GCODE_OFFSET Z=0 + + {% if not 'xyz' in printer.toolhead.homed_axes %} + { action_raise_error("Must Home X, Y and Z Axis First!") } + + # If probe not attached and not locked + {% elif P and not L %} + {% if V %} + { action_respond_info("Docking Probe") } + {% endif %} + G90 + + {% if (printer.toolhead.position.z < Hzh) %} + G1 Z{Hzh} F{Sz} + {% endif %} + + _Umbilical_Path + + # Probe entry location + G1 X{Dx} Y{Dy|int - Da|int} F{St} + {% if Dz != -128 %} + #lower to Z dock + G1 Z{Dz} F600 + {% endif %} + # Drop Probe to Probe location + G1 X{Dx} Y{Dy} F{Sd} + # Probe decoupling + G1 X{Dx|int + 40} Y{Dy} F{Sr} + #Go to Z safe distance + {% if (printer.toolhead.position.z < Hzh) %} + G1 Z{Hzh} F600 + {% endif %} + + _Park_Toolhead + + G4 P1000 + _CheckProbe action=dock + + {% elif L %} + {% if V %} + { action_respond_info("Probe locked!") } + {% endif %} + + # Probe docked, do nothing + _CheckProbe action=query + + {% else %} + {% if V %} + { action_respond_info("Probe already docked!") } + {% endif %} + + # Probe docked, do nothing + _CheckProbe action=query + + {% endif %} + #reverts to the original Z offset + RESTORE_GCODE_STATE name=_dockProbe + + + +# Quad Gantry Level +[gcode_macro QUAD_GANTRY_LEVEL] +rename_existing: _QUAD_GANTRY_LEVEL +description: Conform a moving, twistable gantry to the shape of a stationary bed with klicky automount +gcode: + {% set V = printer["gcode_macro _User_Variables"].verbose %} + {% if V %} + { action_respond_info("QG Level") } + {% endif %} + + _CheckProbe action=query + Attach_Probe + + _QUAD_GANTRY_LEVEL {% for p in params + %}{'%s=%s ' % (p, params[p])}{% + endfor %} + Dock_Probe + + +# Z Tilt Adjust +#[gcode_macro Z_TILT_ADJUST] +#rename_existing: _Z_TILT_ADJUST +#description: +#gcode: +# {% set V = printer["gcode_macro _User_Variables"].verbose %} +# {% if V %} +# { action_respond_info("Z Tilt Adjust") } +# {% endif %} +# +# _CheckProbe action=query +# Attach_Probe +# +# _Z_TILT_ADJUST {% for p in params +# %}{'%s=%s ' % (p, params[p])}{% +# endfor %} +# G28 Z0 +# Dock_Probe + + +# Screws Tilt Adjust +#gcode_macro SCREWS_TILT_CALCULATE] +#rename_existing: _SCREWS_TILT_CALCULATE +#description: +#gcode: +# {% set V = printer["gcode_macro _User_Variables"].verbose %} +# {% if V %} +# { action_respond_info("Screws Tilt Adjust") } +# {% endif %} +# +# _CheckProbe action=query +# Attach_Probe +# +# _SCREWS_TILT_CALCULATE {% for p in params +# %}{'%s=%s ' % (p, params[p])}{% +# endfor %} +# +# Dock_Probe + +# Bed Mesh Calibrate +[bed_mesh] + +[gcode_macro BED_MESH_CALIBRATE] +rename_existing: _BED_MESH_CALIBRATE +description: Perform Mesh Bed Leveling with klicky automount +gcode: + + {% set V = printer["gcode_macro _User_Variables"].verbose %} + {% if V %} + { action_respond_info("Bed Mesh Calibrate") } + {% endif %} + + _CheckProbe action=query + Attach_Probe + + _BED_MESH_CALIBRATE {% for p in params + %}{'%s=%s ' % (p, params[p])}{% + endfor %} + + Dock_Probe + + +# Probe Calibrate +[gcode_macro PROBE_CALIBRATE] +rename_existing: _PROBE_CALIBRATE +description:Calibrate the probe's z_offset with klicky automount +gcode: + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} + {% set St = printer["gcode_macro _User_Variables"].travel_speed %} + {% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %} + {% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %} + {% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %} + {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} + + # Go to Z safe distance before saving location in order to + # avoid crashing the probe on the bed when coming back + G1 Z{Hzh} F{Sz} + #Protect against PROBE CALIBRATE performed from outside the bed + {% if (printer['gcode_move'].position.y > (My - Oy)) or (printer['gcode_move'].position.x > (Mx - Ox)) or (printer['gcode_move'].position.x < Ox) %} + { action_raise_error("Must perform PROBE_CALIBRATE with the probe above the BED!!!") } + {% endif%} + M400 # mandatory to save the new safe position + SAVE_GCODE_STATE NAME=_original_nozzle_location + + _CheckProbe action=query + Attach_Probe + + # Restore nozzle location to probe the right place + RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} + + _PROBE_CALIBRATE {% for p in params + %}{'%s=%s ' % (p, params[p])}{% + endfor %} + + #store current nozzle location + SAVE_GCODE_STATE NAME=_original_nozzle_location + Dock_Probe + + # Restore nozzle location again at the end + RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} + + +# Probe Accuracy +[gcode_macro PROBE_ACCURACY] +rename_existing: _PROBE_ACCURACY +description:Probe Z-height accuracy at current XY position with klicky automount +gcode: + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} + {% set St = printer["gcode_macro _User_Variables"].travel_speed %} + {% set By = printer["gcode_macro _User_Variables"].max_bed_y %} + {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} + + # Go to Z safe distance before saving location in order to + # avoid crashing the probe on the bed when coming back + G1 Z{Hzh} F{Sz} + #Protect against PROBE ACCURACY performed from outside the bed + {% if (printer.toolhead.position.y > (By - Oy)) %} + { action_raise_error("Must perform PROBE_ACCURACY with the probe above the BED!!!") } + {% endif%} + M400 # mandatory to save the new safe position + SAVE_GCODE_STATE NAME=_original_nozzle_location + + _CheckProbe action=query + Attach_Probe + + # Restore nozzle location to probe the right place + RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} + + _PROBE_ACCURACY {% for p in params + %}{'%s=%s ' % (p, params[p])}{% + endfor %} + + #store current nozzle location + SAVE_GCODE_STATE NAME=_original_nozzle_location + + Dock_Probe + + # Restore nozzle location again at the end + RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} + + +# enable to SET_KINEMATIC_POSITION for Z hop +[force_move] +enable_force_move: True + +# Homeing Override +[homing_override] +axes: xyz +gcode: + # collect user state variables + _User_Variables + {% set V = printer["gcode_macro _User_Variables"].verbose %} + {% set XYwZ = printer["gcode_macro _User_Variables"].allow_g28xy_without_z %} + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + + _CheckProbe action=query + + # reset parameters + {% set X, Y, Z = False, False, False %} + + # which axes have been requested for homing + {% if not 'X' in params + and not 'Y' in params + and not 'Z' in params %} + + {% set X, Y, Z = True, True, True %} + + {% else %} + {% if 'X' in params %} + {% set X = True %} + {% endif %} + + {% if 'Y' in params %} + {% set Y = True %} + {% endif %} + + {% if 'Z' in params %} + {% set Z = True %} + {% endif %} + + {% if 'X' in params + and 'Y' in params + and 'Z' in params %} + # reset homing state variables + # if homing all axes + _Homing_Variables reset=1 + {% endif %} + + {% endif %} + + {% if ('z' in printer.toolhead.homed_axes) %} + {% if (printer.toolhead.position.z < Hzh) %} + {% if V %} + { action_respond_info("Z too low, performing ZHOP") } + {% endif %} + G1 Z{Hzh} F1200 + {% endif %} + {% else %} + #checks if it's allowed to do initially G28 X/Y without doing a G28 Z + {% if ( XYwZ == 0) %} + {% if V %} + { action_respond_info("Z not homed, forcing full G28") } + {% endif %} + SET_KINEMATIC_POSITION X=0 Y=0 Z=0 + G1 Z{Hzh} F600 + {% set X, Y, Z = True, True, True %} + {% endif %} + {% endif %} + + # Home x + {% if X %} + {% if V %} + { action_respond_info("Homing X") } + {% endif %} + G28 X0 + {% endif %} + + # Home y + {% if Y %} + {% if V %} + { action_respond_info("Homing Y") } + {% endif %} + G28 Y0 + {% endif %} + + # Home z + {% if Z %} + {% if V %} + { action_respond_info("Homing Z") } + {% endif %} + + # if probe is configured as endstop, attach it, else dock the probe if attached + {% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %} + Attach_Probe + {% else %} + Dock_Probe + {% endif %} + + _Home_Z + + + # if probe is configured as endstop, dock it + {% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %} + Dock_Probe + {% endif %} + {% endif %} + _CheckProbe action=query + + # park the toolhead + _Park_Toolhead + +# umbilical path setup +[gcode_macro _Umbilical_Path] +gcode: + {% set Ux = printer["gcode_macro _User_Variables"].umbilical_x %} + {% set Uy = printer["gcode_macro _User_Variables"].umbilical_y %} + {% set U = printer["gcode_macro _User_Variables"].umbilical %} + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} + + {% if U %} + # Used to give the umbilical a better path to follow and coil properly if dock is tight in space + G1 X{Ux} Y{Uy} Z{Hzh} F{St} + {% endif %} + + +# Home Z Routine +[gcode_macro _Home_Z] +gcode: + {% set Zx = printer["gcode_macro _Probe_Variables"].z_endstop_x %} + {% set Zy = printer["gcode_macro _Probe_Variables"].z_endstop_y %} + {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} + {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} + {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} + + # if x and y are not homed yet, raise error + {% if not 'xy' in printer.toolhead.homed_axes %} + { action_raise_error("Must Home X and Y Axis First!") } + + {% else %} + {% if (not 'z' in printer.toolhead.homed_axes) %} + {% if V %} + { action_respond_info("Resetting Z position to zero") } + {% endif %} + SET_KINEMATIC_POSITION Z=0 + {% endif %} + + # move tool to safe homing position and home Z axis + # location of z endstop + G1 X{Zx} Y{Zy} Z{Hzh} F{St} + G28 Z0 + G1 Z{Hzh} F{Sz} + + {% endif %} + + +# check to see if probe is where it is supposed to be after +# attaching/docking maneuver and set homing error or shutdown +[gcode_macro _CheckProbe] +variable_probe_state: 0 +gcode: + Query_Probe + _SetProbeState action={ ACTION } + + +# due to how templates are evaluated, we have query endstops in one +# macro and call another macro to make decisions based on the result +[gcode_macro _SetProbeState] +gcode: + {% set P = printer.probe.last_query %} + {% set V = printer["gcode_macro _User_Variables"].verbose %} + + # If triggered (true), probe not attached + {% if P %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_attached VALUE={ False } + + # If not triggered (false), probe attached + {% else %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_attached VALUE={ True } + {% endif %} + + {% if params.ACTION == 'query' %} + SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_state VALUE={ P } + {% endif %} + + # if probe fails to attach/detach + # if not docked + {% if (not P and params.ACTION == 'dock') %} + { action_raise_error("Probe dock failed!") } + {% endif %} + + # if not attached + {% if P and params.ACTION == 'attach' %} + { action_raise_error("Probe attach failed!") } + {% endif %} + +# Park Toolhead Routine +[gcode_macro _Park_Toolhead] +gcode: + {% set P = printer["gcode_macro _User_Variables"].park_toolhead %} + {% set Px = printer["gcode_macro _User_Variables"].parkposition_x %} + {% set Py = printer["gcode_macro _User_Variables"].parkposition_y %} + {% set Pz = printer["gcode_macro _User_Variables"].parkposition_z %} + {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} + {% set V = printer["gcode_macro _User_Variables"].verbose %} + + {% if (P and 'xyz' in printer.toolhead.homed_axes) %} + {% if V %} + { action_respond_info("Parking Toolhead") } + {% endif %} + G90 + G1 X{Px} Y{Py} Z{Pz} F{St} + {% endif %} + diff --git a/printer.cfg b/printer.cfg index 81b343e..a1bbab0 100644 --- a/printer.cfg +++ b/printer.cfg @@ -34,15 +34,16 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 [printer] kinematics: corexy max_velocity: 300 +## regular max_accel: 3000 # Max 4000 max_accel_to_decel: 1500 # default half of max_accel -max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V -max_z_accel: 500 -square_corner_velocity: 5.0 ## input_shaper # max_accel: 7000 # max_accel_to_decel: 3500 -# max_z_accel: 7000 +## +max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V +max_z_accel: 500 +square_corner_velocity: 5.0 ##################################################################### @@ -55,6 +56,7 @@ square_corner_velocity: 5.0 [include fans.cfg] [include input_shaper.cfg] # [include resonance_test.cfg] +[include klicky-probe.cfg] ##################################################################### @@ -270,9 +272,8 @@ max_temp: 120 ##################################################################### [probe] -## Inductive Probe -## This probe is not used for Z height, only Quad Gantry Leveling -pin: ~PB7 +## Microswitch probe +pin: ^PG11 x_offset: 0 y_offset: 25.0 #z_offset: 0 @@ -280,7 +281,7 @@ speed: 10.0 samples: 3 samples_result: median sample_retract_dist: 3.0 -samples_tolerance: 0.006 +samples_tolerance: 0.01 samples_tolerance_retries: 3 @@ -289,7 +290,7 @@ samples_tolerance_retries: 3 ##################################################################### [filament_switch_sensor filament_switch] -switch_pin: ^!PG11 +switch_pin: ^!PG12 pause_on_runout: True # runout_gcode is executed after pause_on_runout runout_gcode: @@ -310,7 +311,7 @@ beta: 3950 [temperature_sensor chamber] -sensor_type: chamber_temp +sensor_type: chamber sensor_pin: PF5 min_temp: 0 max_temp: 100 @@ -324,12 +325,13 @@ max_temp: 100 [idle_timeout] timeout: 1800 -[safe_z_home] -## XY Location of the Z Endstop Switch -home_xy_position: 208, 305 -speed: 100 -z_hop: 10 -z_hop_speed: 25 +## replaced with homing_override in klicky-probe.cfg +# [safe_z_home] +# ## XY Location of the Z Endstop Switch +# home_xy_position: 208, 305 +# speed: 100 +# z_hop: 10 +# z_hop_speed: 25 [bed_mesh] speed: 500 @@ -338,8 +340,9 @@ mesh_min: 40,60 mesh_max: 260,280 fade_start: 0.6 fade_end: 10 -probe_count: 9,9 +probe_count: 5,5 algorithm: bicubic +# relative_reference_index = ((x points * y points) - 1) / 2 relative_reference_index: 12 [quad_gantry_level] @@ -376,28 +379,24 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.032500, -0.010000, 0.017500, 0.002500, -0.017500, 0.012500, -0.025000, 0.020000, -0.020000 -#*# -0.040000, -0.020000, 0.000000, -0.012500, -0.037500, 0.000000, -0.040000, 0.007500, -0.030000 -#*# -0.045000, -0.025000, 0.000000, -0.012500, -0.035000, -0.002500, -0.040000, 0.000000, -0.042500 -#*# -0.065000, -0.045000, -0.020000, -0.032500, -0.057500, -0.022500, -0.067500, -0.020000, -0.057500 -#*# -0.052500, -0.032500, -0.010000, -0.020000, -0.042500, -0.007500, -0.050000, -0.010000, -0.060000 -#*# -0.045000, -0.022500, -0.005000, -0.017500, -0.040000, -0.010000, -0.047500, -0.005000, -0.047500 -#*# -0.042500, -0.025000, 0.000000, -0.015000, -0.035000, -0.002500, -0.040000, 0.000000, -0.047500 -#*# -0.027500, -0.015000, 0.010000, -0.012500, -0.032500, 0.000000, -0.035000, 0.005000, -0.035000 -#*# -0.005000, 0.012500, 0.045000, 0.025000, 0.005000, 0.040000, 0.002500, 0.042500, -0.007500 +#*# -0.002500, -0.015000, -0.002500, -0.005000, -0.045000 +#*# -0.000000, -0.012500, 0.002500, -0.005000, -0.040000 +#*# -0.002500, 0.002500, 0.000000, 0.012500, -0.032500 +#*# -0.012500, -0.007500, 0.025000, 0.017500, 0.000000 +#*# 0.057500, 0.072500, 0.042500, 0.075000, 0.027500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic -#*# y_count = 9 +#*# y_count = 5 #*# mesh_y_pps = 2 #*# min_y = 60.0 -#*# x_count = 9 +#*# x_count = 5 #*# max_y = 280.0 #*# mesh_x_pps = 2 #*# max_x = 260.0 #*# #*# [stepper_z] -#*# position_endstop = 0.597 +#*# position_endstop = 0.817 #*# #*# [probe] -#*# z_offset = 1.890 +#*# z_offset = 7.660 From fce3702a8a278234e8901cce8f15767fb2f55ed9 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 27 Oct 2021 17:57:47 +0200 Subject: [PATCH 045/131] v2.4: use z_calibration plugin --- klicky-probe.cfg | 662 -------------------------------- moonraker.conf | 6 + printer.cfg | 8 +- z_calibration/README.md | 11 + z_calibration/homing.cfg | 129 +++++++ z_calibration/macros.cfg | 48 +++ z_calibration/printer.cfg | 37 ++ z_calibration/probing.cfg | 567 +++++++++++++++++++++++++++ z_calibration/z_calibration.cfg | 127 ++++++ 9 files changed, 929 insertions(+), 666 deletions(-) delete mode 100644 klicky-probe.cfg create mode 100644 z_calibration/README.md create mode 100644 z_calibration/homing.cfg create mode 100644 z_calibration/macros.cfg create mode 100644 z_calibration/printer.cfg create mode 100644 z_calibration/probing.cfg create mode 100644 z_calibration/z_calibration.cfg diff --git a/klicky-probe.cfg b/klicky-probe.cfg deleted file mode 100644 index 04bb59f..0000000 --- a/klicky-probe.cfg +++ /dev/null @@ -1,662 +0,0 @@ -# This macro was provided by discord user Garrettwp to whom i give my thanks for sharing it with me. -# I have tweaked it a lot. -# -# this macro is based on the great Annex magprobe dockable probe macros "#Originally developed by Mental, modified for better use on K-series printers by RyanG and Trails" -# that macro can be found here https://github.com/Annex-Engineering/Annex-Engineering_Other_Printer_Mods/blob/master/All_Printers/Microswitch_Probe/Klipper_Macros/dockable_probe_macros.cfg -# -# by standing on the shoulders of giants, lets see if we can see further -# Klicky-probe.cfg version 11-10-2021 01 - -[gcode_macro _User_Variables] -variable_verbose: True # Enable verbose output -variable_travel_speed: 200 # how fast all other travel moves will be performed when running these macros -variable_dock_speed: 50 # how fast should the toolhead move when docking the probe for the final movement -variable_release_speed: 100 # how fast should the toolhead move to release the hold of the magnets after docking -variable_z_drop_speed: 20 # how fast the z will lower when moving to the z location to clear the probe -variable_home_z_height: 20 # Z when homing -variable_allow_g28xy_without_z: 0 # forces the initial G28 to calibrate X Y and Z, otherwise you could only do one axis and potentially hit the bed or gantry (by doing only a G28 Z) -variable_max_bed_y: 250 #maximum Bed size avoids doing a probe_accuracy outside the bed - - -# if a separate Z endstop switch is in -# use, specify the coordinates of the switch here (Voron). -# Set to 0 to have the probe move to center of bed -variable_z_endstop_x: 208 -variable_z_endstop_y: 305 - -# location to park the toolhead -variable_park_toolhead: False # Enable toolhead parking -variable_parkposition_x: 125 -variable_parkposition_y: 125 -variable_parkposition_z: 30 - -#dock location -variable_docklocation_x: 148 # X Dock position -variable_docklocation_y: 305 # Y Dock position -variable_docklocation_z: -128 # Z dock position (-128 for a gantry mount) -variable_dockarmslenght: 30 # Dock arms lenght, toolhead movement necessary to clear the dock arms - -#Umbilical to help untangle the umbilical in difficult situations -variable_umbilical_x: 15 #X umbilical position -variable_umbilical_y: 15 #Y umbilical position -variable_umbilical: False #should we untabgle the umbilical - -# Do not modify below -gcode: - {% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %} - {% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %} - {% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %} - {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} - {% set Oz = printer['configfile'].config["probe"]["z_offset"]|float %} - - # if docklocation_z is zero, use Home Z height for safety - {% if docklocation_z == 0 %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=docklocation_z VALUE={ home_z_height } - {% endif %} - - # If x, y coordinates are set for z endstop, assign them - {% if z_endstop_x != 0 or z_endstop_y != 0 %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_x VALUE={ z_endstop_x } - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_y VALUE={ z_endstop_y } - - # if no x, y coordinates for z endstop, assume probe is endstop and move toolhead to center of bed - {% else %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_x VALUE={ (Mx * 0.5) - Ox } - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_y VALUE={ (My * 0.5) - Oy } - {% endif %} - - -[gcode_macro _Probe_Variables] -variable_probe_attached: False -variable_probe_state: False -variable_probe_lock: False -variable_z_endstop_x: 0 -variable_z_endstop_y: 0 -gcode: - - -[gcode_macro _Homing_Variables] -gcode: - {% set R = params.RESET|default(0) %} - - {% if R %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ False } - {% endif %} - -# Attach probe and lock it -[gcode_macro Attach_Probe_Lock] -description: Attaches Klicky Probe, can only be docked after unlocking -gcode: - Attach_Probe - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ True } - - -# Dock probe and lock it -[gcode_macro Dock_Probe_Unlock] -description: Docks Klicky Probe even if it was locked -gcode: - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ False } - Dock_Probe - -# Unlock Probe -[gcode_macro Probe_Unlock] -description: Unlocks Klicky Probe state -gcode: - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ False } - -# Lock Probe -[gcode_macro Probe_Lock] -description: Locks Klicky Probe state -gcode: - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_lock VALUE={ True } - -# Attach Probe Routine -[gcode_macro Attach_Probe] -description: Attaches Klicky Probe -gcode: - # Get probe attach status - {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} - {% set L = printer["gcode_macro _Probe_Variables"].probe_lock %} - {% set V = printer["gcode_macro _User_Variables"].verbose %} - # Get Docking location - {% set Dx = printer["gcode_macro _User_Variables"].docklocation_x %} - {% set Dy = printer["gcode_macro _User_Variables"].docklocation_y %} - {% set Dz = printer["gcode_macro _User_Variables"].docklocation_z %} - {% set Da = printer["gcode_macro _User_Variables"].dockarmslenght %} - # Safe Z for travel - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - #Set speed - {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} - - #prior to saving actual position, check if its necessary to move to a safe Z - #that has enought overhead for the attached probe - {% if (printer.toolhead.position.z < Hzh) %} - G1 Z{Hzh} F1200 - {% endif %} - M400 # mandatory to save the new safe position - #allows the docking position to be independent of the Z offset, necessary for bed mounted probes - SAVE_GCODE_STATE name=_attachProbe - SET_GCODE_OFFSET Z=0 - - # if x and y are not homed - {% if not 'xy' in printer.toolhead.homed_axes %} - { action_raise_error("Must Home X and Y Axis First!") } - - # If probe not attached and locked - {% elif not P and not L %} - {% if V %} - { action_respond_info("Attaching Probe") } - {% endif %} - G90 - - {% if (not 'z' in printer.toolhead.homed_axes) %} - {% if V %} - { action_respond_info("Resetting Z position to zero") } - {% endif %} - SET_KINEMATIC_POSITION Z=0 - {% endif %} - - {% if (printer.toolhead.position.z < Hzh) %} - G1 Z{Hzh} F1200 - {% endif %} - - _Umbilical_Path - - # Probe entry location - G1 X{Dx} Y{Dy|int - Da|int} F{St} - {% if Dz != -128 %} - #lower to Z dock - G1 Z{Dz} F600 - {% endif %} - # pickup from Probe location - G1 X{Dx} Y{Dy} F1800 - # Probe entry location - G1 X{Dx} Y{Dy|int - Da|int} F6000 - #Go to Z safe distance - {% if (printer.toolhead.position.z < Hzh) %} - G1 Z{Hzh} F600 - {% endif %} - _Park_Toolhead - - _CheckProbe action=attach - - {% elif L %} - {% if V %} - { action_respond_info("Probe locked!") } - {% endif %} - - # Probe attached, do nothing - _CheckProbe action=query - - {% else %} - {% if V %} - { action_respond_info("Probe already attached!") } - {% endif %} - - # Probe attached, do nothing - _CheckProbe action=query - - {% endif %} - #reverts to the original Z offset - RESTORE_GCODE_STATE name=_attachProbe - - -# Dock Probe Routine -[gcode_macro Dock_Probe] -description: Docks Klicky Probe -gcode: - # Get probe attach status - {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} - {% set L = printer["gcode_macro _Probe_Variables"].probe_lock %} - {% set V = printer["gcode_macro _User_Variables"].verbose %} - # Get Docking location - {% set Dx = printer["gcode_macro _User_Variables"].docklocation_x %} - {% set Dy = printer["gcode_macro _User_Variables"].docklocation_y %} - {% set Dz = printer["gcode_macro _User_Variables"].docklocation_z %} - {% set Da = printer["gcode_macro _User_Variables"].dockarmslenght %} - # Safe Z for travel - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - # Set speed - {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} - {% set Sd = printer["gcode_macro _User_Variables"].dock_speed * 60 %} - {% set Sr = printer["gcode_macro _User_Variables"].release_speed * 60 %} - {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} - - M400 # mandatory to save the new safe position - #allows the docking position to be independent of the Z offset, necessary for bed mounted probes - SAVE_GCODE_STATE name=_dockProbe - SET_GCODE_OFFSET Z=0 - - {% if not 'xyz' in printer.toolhead.homed_axes %} - { action_raise_error("Must Home X, Y and Z Axis First!") } - - # If probe not attached and not locked - {% elif P and not L %} - {% if V %} - { action_respond_info("Docking Probe") } - {% endif %} - G90 - - {% if (printer.toolhead.position.z < Hzh) %} - G1 Z{Hzh} F{Sz} - {% endif %} - - _Umbilical_Path - - # Probe entry location - G1 X{Dx} Y{Dy|int - Da|int} F{St} - {% if Dz != -128 %} - #lower to Z dock - G1 Z{Dz} F600 - {% endif %} - # Drop Probe to Probe location - G1 X{Dx} Y{Dy} F{Sd} - # Probe decoupling - G1 X{Dx|int + 40} Y{Dy} F{Sr} - #Go to Z safe distance - {% if (printer.toolhead.position.z < Hzh) %} - G1 Z{Hzh} F600 - {% endif %} - - _Park_Toolhead - - G4 P1000 - _CheckProbe action=dock - - {% elif L %} - {% if V %} - { action_respond_info("Probe locked!") } - {% endif %} - - # Probe docked, do nothing - _CheckProbe action=query - - {% else %} - {% if V %} - { action_respond_info("Probe already docked!") } - {% endif %} - - # Probe docked, do nothing - _CheckProbe action=query - - {% endif %} - #reverts to the original Z offset - RESTORE_GCODE_STATE name=_dockProbe - - - -# Quad Gantry Level -[gcode_macro QUAD_GANTRY_LEVEL] -rename_existing: _QUAD_GANTRY_LEVEL -description: Conform a moving, twistable gantry to the shape of a stationary bed with klicky automount -gcode: - {% set V = printer["gcode_macro _User_Variables"].verbose %} - {% if V %} - { action_respond_info("QG Level") } - {% endif %} - - _CheckProbe action=query - Attach_Probe - - _QUAD_GANTRY_LEVEL {% for p in params - %}{'%s=%s ' % (p, params[p])}{% - endfor %} - Dock_Probe - - -# Z Tilt Adjust -#[gcode_macro Z_TILT_ADJUST] -#rename_existing: _Z_TILT_ADJUST -#description: -#gcode: -# {% set V = printer["gcode_macro _User_Variables"].verbose %} -# {% if V %} -# { action_respond_info("Z Tilt Adjust") } -# {% endif %} -# -# _CheckProbe action=query -# Attach_Probe -# -# _Z_TILT_ADJUST {% for p in params -# %}{'%s=%s ' % (p, params[p])}{% -# endfor %} -# G28 Z0 -# Dock_Probe - - -# Screws Tilt Adjust -#gcode_macro SCREWS_TILT_CALCULATE] -#rename_existing: _SCREWS_TILT_CALCULATE -#description: -#gcode: -# {% set V = printer["gcode_macro _User_Variables"].verbose %} -# {% if V %} -# { action_respond_info("Screws Tilt Adjust") } -# {% endif %} -# -# _CheckProbe action=query -# Attach_Probe -# -# _SCREWS_TILT_CALCULATE {% for p in params -# %}{'%s=%s ' % (p, params[p])}{% -# endfor %} -# -# Dock_Probe - -# Bed Mesh Calibrate -[bed_mesh] - -[gcode_macro BED_MESH_CALIBRATE] -rename_existing: _BED_MESH_CALIBRATE -description: Perform Mesh Bed Leveling with klicky automount -gcode: - - {% set V = printer["gcode_macro _User_Variables"].verbose %} - {% if V %} - { action_respond_info("Bed Mesh Calibrate") } - {% endif %} - - _CheckProbe action=query - Attach_Probe - - _BED_MESH_CALIBRATE {% for p in params - %}{'%s=%s ' % (p, params[p])}{% - endfor %} - - Dock_Probe - - -# Probe Calibrate -[gcode_macro PROBE_CALIBRATE] -rename_existing: _PROBE_CALIBRATE -description:Calibrate the probe's z_offset with klicky automount -gcode: - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} - {% set St = printer["gcode_macro _User_Variables"].travel_speed %} - {% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %} - {% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %} - {% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %} - {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} - - # Go to Z safe distance before saving location in order to - # avoid crashing the probe on the bed when coming back - G1 Z{Hzh} F{Sz} - #Protect against PROBE CALIBRATE performed from outside the bed - {% if (printer['gcode_move'].position.y > (My - Oy)) or (printer['gcode_move'].position.x > (Mx - Ox)) or (printer['gcode_move'].position.x < Ox) %} - { action_raise_error("Must perform PROBE_CALIBRATE with the probe above the BED!!!") } - {% endif%} - M400 # mandatory to save the new safe position - SAVE_GCODE_STATE NAME=_original_nozzle_location - - _CheckProbe action=query - Attach_Probe - - # Restore nozzle location to probe the right place - RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} - - _PROBE_CALIBRATE {% for p in params - %}{'%s=%s ' % (p, params[p])}{% - endfor %} - - #store current nozzle location - SAVE_GCODE_STATE NAME=_original_nozzle_location - Dock_Probe - - # Restore nozzle location again at the end - RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} - - -# Probe Accuracy -[gcode_macro PROBE_ACCURACY] -rename_existing: _PROBE_ACCURACY -description:Probe Z-height accuracy at current XY position with klicky automount -gcode: - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} - {% set St = printer["gcode_macro _User_Variables"].travel_speed %} - {% set By = printer["gcode_macro _User_Variables"].max_bed_y %} - {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} - - # Go to Z safe distance before saving location in order to - # avoid crashing the probe on the bed when coming back - G1 Z{Hzh} F{Sz} - #Protect against PROBE ACCURACY performed from outside the bed - {% if (printer.toolhead.position.y > (By - Oy)) %} - { action_raise_error("Must perform PROBE_ACCURACY with the probe above the BED!!!") } - {% endif%} - M400 # mandatory to save the new safe position - SAVE_GCODE_STATE NAME=_original_nozzle_location - - _CheckProbe action=query - Attach_Probe - - # Restore nozzle location to probe the right place - RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} - - _PROBE_ACCURACY {% for p in params - %}{'%s=%s ' % (p, params[p])}{% - endfor %} - - #store current nozzle location - SAVE_GCODE_STATE NAME=_original_nozzle_location - - Dock_Probe - - # Restore nozzle location again at the end - RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St} - - -# enable to SET_KINEMATIC_POSITION for Z hop -[force_move] -enable_force_move: True - -# Homeing Override -[homing_override] -axes: xyz -gcode: - # collect user state variables - _User_Variables - {% set V = printer["gcode_macro _User_Variables"].verbose %} - {% set XYwZ = printer["gcode_macro _User_Variables"].allow_g28xy_without_z %} - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - - _CheckProbe action=query - - # reset parameters - {% set X, Y, Z = False, False, False %} - - # which axes have been requested for homing - {% if not 'X' in params - and not 'Y' in params - and not 'Z' in params %} - - {% set X, Y, Z = True, True, True %} - - {% else %} - {% if 'X' in params %} - {% set X = True %} - {% endif %} - - {% if 'Y' in params %} - {% set Y = True %} - {% endif %} - - {% if 'Z' in params %} - {% set Z = True %} - {% endif %} - - {% if 'X' in params - and 'Y' in params - and 'Z' in params %} - # reset homing state variables - # if homing all axes - _Homing_Variables reset=1 - {% endif %} - - {% endif %} - - {% if ('z' in printer.toolhead.homed_axes) %} - {% if (printer.toolhead.position.z < Hzh) %} - {% if V %} - { action_respond_info("Z too low, performing ZHOP") } - {% endif %} - G1 Z{Hzh} F1200 - {% endif %} - {% else %} - #checks if it's allowed to do initially G28 X/Y without doing a G28 Z - {% if ( XYwZ == 0) %} - {% if V %} - { action_respond_info("Z not homed, forcing full G28") } - {% endif %} - SET_KINEMATIC_POSITION X=0 Y=0 Z=0 - G1 Z{Hzh} F600 - {% set X, Y, Z = True, True, True %} - {% endif %} - {% endif %} - - # Home x - {% if X %} - {% if V %} - { action_respond_info("Homing X") } - {% endif %} - G28 X0 - {% endif %} - - # Home y - {% if Y %} - {% if V %} - { action_respond_info("Homing Y") } - {% endif %} - G28 Y0 - {% endif %} - - # Home z - {% if Z %} - {% if V %} - { action_respond_info("Homing Z") } - {% endif %} - - # if probe is configured as endstop, attach it, else dock the probe if attached - {% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %} - Attach_Probe - {% else %} - Dock_Probe - {% endif %} - - _Home_Z - - - # if probe is configured as endstop, dock it - {% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %} - Dock_Probe - {% endif %} - {% endif %} - _CheckProbe action=query - - # park the toolhead - _Park_Toolhead - -# umbilical path setup -[gcode_macro _Umbilical_Path] -gcode: - {% set Ux = printer["gcode_macro _User_Variables"].umbilical_x %} - {% set Uy = printer["gcode_macro _User_Variables"].umbilical_y %} - {% set U = printer["gcode_macro _User_Variables"].umbilical %} - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} - - {% if U %} - # Used to give the umbilical a better path to follow and coil properly if dock is tight in space - G1 X{Ux} Y{Uy} Z{Hzh} F{St} - {% endif %} - - -# Home Z Routine -[gcode_macro _Home_Z] -gcode: - {% set Zx = printer["gcode_macro _Probe_Variables"].z_endstop_x %} - {% set Zy = printer["gcode_macro _Probe_Variables"].z_endstop_y %} - {% set Hzh = printer["gcode_macro _User_Variables"].home_z_height|float %} - {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} - {% set Sz = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} - - # if x and y are not homed yet, raise error - {% if not 'xy' in printer.toolhead.homed_axes %} - { action_raise_error("Must Home X and Y Axis First!") } - - {% else %} - {% if (not 'z' in printer.toolhead.homed_axes) %} - {% if V %} - { action_respond_info("Resetting Z position to zero") } - {% endif %} - SET_KINEMATIC_POSITION Z=0 - {% endif %} - - # move tool to safe homing position and home Z axis - # location of z endstop - G1 X{Zx} Y{Zy} Z{Hzh} F{St} - G28 Z0 - G1 Z{Hzh} F{Sz} - - {% endif %} - - -# check to see if probe is where it is supposed to be after -# attaching/docking maneuver and set homing error or shutdown -[gcode_macro _CheckProbe] -variable_probe_state: 0 -gcode: - Query_Probe - _SetProbeState action={ ACTION } - - -# due to how templates are evaluated, we have query endstops in one -# macro and call another macro to make decisions based on the result -[gcode_macro _SetProbeState] -gcode: - {% set P = printer.probe.last_query %} - {% set V = printer["gcode_macro _User_Variables"].verbose %} - - # If triggered (true), probe not attached - {% if P %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_attached VALUE={ False } - - # If not triggered (false), probe attached - {% else %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_attached VALUE={ True } - {% endif %} - - {% if params.ACTION == 'query' %} - SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=probe_state VALUE={ P } - {% endif %} - - # if probe fails to attach/detach - # if not docked - {% if (not P and params.ACTION == 'dock') %} - { action_raise_error("Probe dock failed!") } - {% endif %} - - # if not attached - {% if P and params.ACTION == 'attach' %} - { action_raise_error("Probe attach failed!") } - {% endif %} - -# Park Toolhead Routine -[gcode_macro _Park_Toolhead] -gcode: - {% set P = printer["gcode_macro _User_Variables"].park_toolhead %} - {% set Px = printer["gcode_macro _User_Variables"].parkposition_x %} - {% set Py = printer["gcode_macro _User_Variables"].parkposition_y %} - {% set Pz = printer["gcode_macro _User_Variables"].parkposition_z %} - {% set St = printer["gcode_macro _User_Variables"].travel_speed * 60 %} - {% set V = printer["gcode_macro _User_Variables"].verbose %} - - {% if (P and 'xyz' in printer.toolhead.homed_axes) %} - {% if V %} - { action_respond_info("Parking Toolhead") } - {% endif %} - G90 - G1 X{Px} Y{Py} Z{Pz} F{St} - {% endif %} - diff --git a/moonraker.conf b/moonraker.conf index e231e1c..7aa9e95 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -49,6 +49,12 @@ env: ~/.KlipperScreen-env/bin/python requirements: scripts/KlipperScreen-requirements.txt install_script: scripts/KlipperScreen-install.sh +[update_manager client z_calibration] +type: git_repo +path: /home/pi/klipper_z_calibration +origin: https://github.com/protoloft/klipper_z_calibration.git +install_script: install.sh + [power voron-v2.4] type: tplink_smartplug address: 192.168.11.91 diff --git a/printer.cfg b/printer.cfg index a1bbab0..24e34f1 100644 --- a/printer.cfg +++ b/printer.cfg @@ -45,7 +45,6 @@ max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 500 square_corner_velocity: 5.0 - ##################################################################### # includes ##################################################################### @@ -56,7 +55,7 @@ square_corner_velocity: 5.0 [include fans.cfg] [include input_shaper.cfg] # [include resonance_test.cfg] -[include klicky-probe.cfg] +[include z_calibration/printer.cfg] ##################################################################### @@ -277,8 +276,9 @@ pin: ^PG11 x_offset: 0 y_offset: 25.0 #z_offset: 0 -speed: 10.0 -samples: 3 +speed: 6 +lift_speed: 11 +samples: 5 samples_result: median sample_retract_dist: 3.0 samples_tolerance: 0.01 diff --git a/z_calibration/README.md b/z_calibration/README.md new file mode 100644 index 0000000..9fc2119 --- /dev/null +++ b/z_calibration/README.md @@ -0,0 +1,11 @@ +# Sample Configuration + +This are some parts of my V2 300 configurations describing all the mag-probe, probing +and QGL stuff. + +These configurations are the essence of the overall configuration from +[zellneralex](https://github.com/zellneralex/klipper_config/tree/master) +which is really well done !! Have a look if you want to take all of it! + +**CAUTION: Please, don't just copy it - understand and adapt for your needs instead! +Use this on your own risk!** diff --git a/z_calibration/homing.cfg b/z_calibration/homing.cfg new file mode 100644 index 0000000..9014df5 --- /dev/null +++ b/z_calibration/homing.cfg @@ -0,0 +1,129 @@ +##################################################################### +# Homing definition +##################################################################### +[homing_override] +axes: z +set_position_z: 0 +gcode: + ##### get user defines ##### + # use -10 as default to insure it error in case the variable is not existing + {% set z_endstop_x = printer['gcode_macro _USER_VARIABLE'].z_endstop_x|default(-10) %} + {% set z_endstop_y = printer['gcode_macro _USER_VARIABLE'].z_endstop_y|default(-10) %} + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=HOMING_state + + ## reduce current of Z motors + _SET_ACC VAL=HOME + _SET_CURRENT VAL=HOME + + G91 ; relative positioning + # G0 Z10 F1500 + G0 Z10 F1300 + G90 ; absolute positioning + + # Home X and Y only for G28 or G28 XYZ + {% if 'Z' in params %} + {% if "x" not in printer.toolhead.homed_axes %} + G28 X + {% endif %} + {% if "y" not in printer.toolhead.homed_axes %} + G28 Y + {% endif %} + {% else %} + G28 X Y + {% endif %} + + ## XY Location of the Z Endstop Switch + G0 X{z_endstop_x} Y{z_endstop_y} F12000 + G28 Z ; home Z + # G0 Z2 F1500 ; move up + G0 Z2 F1300 ; move up + + ## return to org current settings + {% if params.RESET_SETTINGS|default('true') == 'true' %} + DETACH_PROBE + _SET_CURRENT + _SET_ACC + {% endif %} + + # Lift Z + # G0 Z{z_hop} F1800 + G0 Z{z_hop} F1300 + + RESTORE_GCODE_STATE NAME=HOMING_state + +##################################################################### +# Macros +##################################################################### +## conditional home +[gcode_macro _CG28] +gcode: + {% if "xyz" not in printer.toolhead.homed_axes %} + G28 RESET_SETTINGS={ params.RESET_SETTINGS|default('true') } + {% endif %} + +[gcode_macro _SET_CURRENT] +description: Helper: Set Z-drive motor current +variable_last_val: 'CONFIG' +gcode: + ###### set default values ##### + {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_current|int %} + {% set val = params.VAL|default('CONFIG') %} + {% set respond = params.Z_RESPOND|default(default_respond)|int %} + {% if val == 'HOME' %} + {% set xy_run = printer['gcode_macro _USER_VARIABLE'].xy_home_current %} + {% set xy_hold = printer['gcode_macro _USER_VARIABLE'].xy_home_current %} + {% set z_run = printer['gcode_macro _USER_VARIABLE'].z_home_current %} + {% set z_hold = printer['gcode_macro _USER_VARIABLE'].z_home_current %} + {% else %} + {% if 'tmc2209 stepper_z' in printer.configfile.settings %} + {% set xy_run = printer.configfile.settings['tmc2209 stepper_x'].run_current %} + {% set xy_hold = printer.configfile.settings['tmc2209 stepper_x'].hold_current %} + {% set z_run = printer.configfile.settings['tmc2209 stepper_z'].run_current %} + {% set z_hold = printer.configfile.settings['tmc2209 stepper_z'].hold_current %} + {% elif 'tmc5160 stepper_z' in printer.configfile.settings %} + {% set xy_run = printer.configfile.settings['tmc5160 stepper_x'].run_current %} + {% set xy_hold = printer.configfile.settings['tmc5160 stepper_x'].hold_current %} + {% set z_run = printer.configfile.settings['tmc5160 stepper_z'].run_current %} + {% set z_hold = printer.configfile.settings['tmc5160 stepper_z'].hold_current %} + {% endif %} + {% endif %} + ##### end of definition ##### + {% if val != last_val %} + SET_GCODE_VARIABLE MACRO=_SET_CURRENT VARIABLE=last_val VALUE='"{val}"' + {% if respond == 1 %} + {action_respond_info("Home&Probe: RunCur %.2fA rms HoldCur %.2fA rms" % (z_run|float, z_hold|float))} + {% endif %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={xy_run} HOLDCURRENT={xy_hold} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={xy_run} HOLDCURRENT={xy_hold} + SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} + M400 + {% endif %} + +[gcode_macro _SET_ACC] +description: Helper: Set accel and accel_to_decel value +variable_last_val: 'CONFIG' +gcode: + ##### set default value ##### + {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_acc|int %} + {% set val = params.VAL|default('CONFIG') %} + {% set respond = params.RESPOND|default(default_respond)|int %} + {% if val == 'HOME' %} + {% set accel = printer['gcode_macro _USER_VARIABLE'].home_accel %} + {% set accel_to_decel = printer['gcode_macro _USER_VARIABLE'].home_accel|int / 2 %} + {% else %} + {% set accel = printer.configfile.settings.printer.max_accel %} + {% set accel_to_decel = printer.configfile.settings.printer.max_accel_to_decel %} + {% endif %} + ##### end of definition ##### + {% if val != last_val %} + SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{val}"' + {% if respond == 1 %} + {action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))} + {% endif %} + SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel} RESPOND=0 + {% endif %} diff --git a/z_calibration/macros.cfg b/z_calibration/macros.cfg new file mode 100644 index 0000000..9ebf151 --- /dev/null +++ b/z_calibration/macros.cfg @@ -0,0 +1,48 @@ +##################################################################### +# Macros +##################################################################### +[gcode_macro PRINT_START] +gcode: + {% set bed_temp = params.BED_TEMP|default(100)|float %} + {% set extruder_temp = params.EXTRUDER_TEMP|default(220)|float %} + {% set z_adjust = params.Z_ADJUST|default(0.0)|float %} + {% set retract = 10 %} + BED_MESH_CLEAR ; clear mesh + _CG28 ; Home the printer + G90 ; Use absolute coordinates + PARKCENTER ; Move to center + M117 Heating.. + _HEATER_ON + M106 S255 ; set print fan to full speed + M140 S{bed_temp} ; Start bed heating + M190 S{bed_temp} ; Wait for bed to reach temperature + M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature + M107 ; turn print fan off + QUAD_GANTRY_LEVEL PARK=false + M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature + clean_nozzle ; clean nozzle + CALIBRATE_Z + #BED_MESH_PROFILE LOAD=default ; load mesh if needed + # Adjust the G-Code Z offset with the Z_ADJUST parameter if needed + #SET_GCODE_OFFSET Z_ADJUST={z_adjust} MOVE=1 + M117 Intro Line.. + G90 ; Use absolute coordinates + G1 Y0 X130 Z5 F12000 ; Move the nozzle to the front and near the bed + G1 Z0.7 F300 ; Move the nozzle very close to the bed + G92 E0.0 ; set extruder position to 0 + G1 E{retract} F3600 ; extrude retract + G92 E0.0 ; set extruder option to 0 + G1 X180 E15.0 F500.0 ; intro line + G92 E0.0 ; set extruder Poisson to 0 + G1 X174 F6000 ; move away from intro line + M117 + +[gcode_macro PARKCENTER] +gcode: + {% set Z = params.Z|default(30)|float %} + SAVE_GCODE_STATE NAME=PARKCENTER_state + _CG28 ; Home if not already homed + G90 ; absolute positioning + G0 X150 Y150 Z{Z} F12000 ; move to center + RESTORE_GCODE_STATE NAME=PARKCENTER_state + diff --git a/z_calibration/printer.cfg b/z_calibration/printer.cfg new file mode 100644 index 0000000..7a70810 --- /dev/null +++ b/z_calibration/printer.cfg @@ -0,0 +1,37 @@ +##################################################################### +# User Variables +##################################################################### +[gcode_macro _USER_VARIABLE] +description: Helper: Contains User defined printer variables +##### Homing and general movement ##### +variable_z_endstop_x: 208 ; z Endstop x position inside right profile +variable_z_endstop_y: 305 ; z Endstop y position +variable_z_hop: 10.0 ; z hop for moves e.g homing +variable_xy_home_current: 0.4 ; reduced homing current for x and y +variable_z_home_current: 0.3 ; reduced homing current for z +variable_home_accel: 1200 ; reduced ACCEL for homing +##### Mag Probe ##### +variable_probe_dock_x: 148 ; x toolhead position before docking probe +variable_probe_dock_y: 285 ; y toolhead position before docking probe +variable_probe_dock_z: 10 ; z toolhead position before docking probe (only for bed dock) +variable_probe_undock_x: 200 ; x toolhead position after docking probe +variable_probe_undock_y: 305 ; y toolhead position after docking probe +variable_probe_undock_z: 10 ; z toolhead position after docking probe (only for bed dock) +variable_probe_z_min: 10 ; z minimum height to avoid crash +variable_probe_travel_speed: 200 ; dock moves travel speed +variable_probe_dock_speed: 100 ; dock speed for attach/dock +##### Respond defaults ##### +variable_respond_set_current: 0 ; default of RESPOND if not set in the call +variable_respond_set_acc: 0 ; default of RESPOND if not set in the call +variable_respond_probe_action: 1 ; default of RESPOND if not set in the call +##### Park Position ##### +variable_park_bed: [150,150,30] ; different park position +gcode: + +##################################################################### +# Includes +##################################################################### +[include macros.cfg] +[include homing.cfg] +[include probing.cfg] +[include z_calibration.cfg] diff --git a/z_calibration/probing.cfg b/z_calibration/probing.cfg new file mode 100644 index 0000000..beba31c --- /dev/null +++ b/z_calibration/probing.cfg @@ -0,0 +1,567 @@ +##################################################################### +# Mag Probe +##################################################################### +# defined in printer.cfg + +##################################################################### +# Gantry Adjustment Routines +##################################################################### +[quad_gantry_level] +## Gantry Corners for 300mm Build +gantry_corners: + -60,-10 + 360,370 +# Probe points for 300m Build +points: + 50,25 + 50,225 + 250,225 + 250,25 +speed: 300 +horizontal_move_z: 10 +retries: 5 +retry_tolerance: 0.007 +max_adjust: 10 + +##################################################################### +# Macros +##################################################################### +[gcode_macro QUAD_GANTRY_LEVEL] +description: Level a flying gantry to a stationary bed +rename_existing: QUAD_GANTRY_LEVEL_BASE +gcode: + ##### get user defines ##### + {% set park_pos = printer['gcode_macro _USER_VARIABLE'].park_bed %} + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|float %} + ##### get toolhead position ##### + {% set act_z = printer.toolhead.position.z|float %} + ##### set default ##### + {% set park = params.PARK|default('true') %} + ##### end of definitions ##### + # home all axes if not already + {% if "xyz" not in printer.toolhead.homed_axes %} + _CG28 + {% endif %} + SAVE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL + _SET_ACC VAL=HOME + _SET_CURRENT VAL=HOME + _CG28 RESET_SETTINGS=false + {% if act_z < z_hop %} + G1 Z{z_hop} F900 ; move head up to insure Probe is not triggered in error case + {% endif %} + ATTACH_PROBE + QUAD_GANTRY_LEVEL_BASE + {% if params.CALIBRATE|default('false') == 'true' %} + CALIBRATE_Z RESET_SETTINGS=false + {% else %} + DETACH_PROBE + {% endif %} + #G28 Z + {% if params.RESET_SETTINGS|default('true') == 'true' %} + _SET_CURRENT + _SET_ACC + {% endif %} + {% if park|lower == 'true' %} + G90 + G0 Z{park_pos[2]} F1800 ; move nozzle to z high first + G0 X{park_pos[0]} Y{park_pos[1]} F18000 ; home to get toolhead in the middle + {% endif %} + RESTORE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL + +[gcode_macro ATTACH_PROBE] +description: Attaching the MagProbe if not already attached +gcode: + _MAG_PROBE ACTION=ATTACH + _MAG_PROBE ACTION=CHECK_ATTACH + +[gcode_macro DETACH_PROBE] +description: Dock the MagProbe if not already docked +gcode: + _MAG_PROBE ACTION=DOCK + _MAG_PROBE ACTION=CHECK_DOCK + +[gcode_macro GET_PROBE_STATUS] +description: Prints the current MagProbe state, valid probe states are UNKNOWN, ATTACHED and DOCKED +gcode: + _MAG_PROBE ACTION=GET_STATUS RESPOND=1 + + +[gcode_macro SET_PROBE_STATUS] +description: Manually specify MagProbe status, valid probe states are UNKNOWN, ATTACHED and DOCKED +variable_state: 'unknown' +gcode: + {% if 'STATE' in params|upper and + (params.STATE|lower == 'unknown' or params.STATE|lower == 'attached' or params.STATE|lower == 'docked') %} + SET_GCODE_VARIABLE MACRO=SET_PROBE_STATUS VARIABLE=state VALUE='"{params.STATE|lower}"' + SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=state VALUE='"{params.STATE|lower}"' + {% else %} + {% set state = params.STATE|default('none') %} + {action_raise_error("Invalid probe state: %s. Valid probe states are [UNKNOWN, ATTACHED, DOCKED]" % state|upper)} + {% endif %} + +##################################################################### +# Helper Macros +##################################################################### +# QUERY_PROBE must run direct before _PROBE_ACTION +# that relation is insured by the caller id +[gcode_macro _MAG_PROBE] +description: Helper: Query MagProbe state and request action +variable_state: 'unknown' +variable_id: 0 +gcode: + ##### add RESPOND if specified ##### + {% if 'RESPOND' in params|upper %} + {% set respond = "RESPOND=" + params.RESPOND %} + {% else %} + {% set respond = "" %} + {% endif %} + ##### generate an id not equal to 0 ##### + {% if id == 0 %} + {% set id = 1 %} + {% else %} + {% set id = id + 1 %} + {% endif %} + ##### end of definition ##### + QUERY_PROBE ID={id} + _PROBE_ACTION ACTION={params.ACTION} ID={id} {respond} + SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=id VALUE={id} + M400 + +[gcode_macro _PROBE_ACTION] +description: Helper: Perform MagProbe action +gcode: + ##### get params and defaults ##### + {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_probe_action|default(1)|int %} + {% set respond = params.RESPOND|default(default_respond)|int %} + {% set action = params.ACTION|lower %} + {% set id = params.ID|default(0)|int %} ; call id 0 means invalid + ##### get probe variables ##### + {% set probe_id = printer['gcode_macro QUERY_PROBE'].id|default(0)|int %} + {% set man_state = printer['gcode_macro SET_PROBE_STATUS'].state|lower %} + ##### generate state ##### + {% if man_state != 'unknown' %} + SET_GCODE_VARIABLE MACRO=SET_PROBE_STATUS VARIABLE=state VALUE='"unknown"' + {% set state = man_state %} + {% if respond == 1 %} + {action_respond_info("MagProbe: State was set to %s by SET_PROBE_STATUS"% man_state|upper)} + {% endif %} + {% elif id == 0 or id != probe_id %} + {action_raise_error("MagProbe: Call ID invalid or does not match QUERY_PROBE call ID")} + {% elif printer.probe.last_query|lower == 'false' %} + {action_raise_error("MagProbe: Please execute QUERY_PROBE first")} + {% else %} + {% if printer.probe.last_query|int == 0 %} + {% set state = 'attached' %} + {% else %} + {% set state = 'docked' %} + {% endif %} + {% endif %} + ##### end of defines ##### + SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=state VALUE='"{state}"' + {% if action == 'attach' %} + {% if state == 'docked' %} + {% if respond == 1 %} + {action_respond_info("MagProbe: Attach Probe")} + {% endif %} + _ATTACH_PROBE + {% else %} + {% if respond == 1 %} + {action_respond_info("MagProbe: already attached")} + {% endif %} + {% endif %} + {% elif action == 'dock' %} + {% if state == 'attached' %} + {% if respond == 1 %} + {action_respond_info("MagProbe: Dock Probe")} + {% endif %} + _DOCK_PROBE + {% else %} + {% if respond == 1 %} + {action_respond_info("MagProbe: already docked")} + {% endif %} + {% endif %} + {% elif action == 'check_dock' %} + {% if state != 'docked' %} + {action_raise_error("MagProbe: dock failed!")} + {% endif %} + {% elif action == 'check_attach' %} + {% if state != 'attached' %} + {action_raise_error("MagProbe: attach failed!")} + {% endif %} + {% elif action == 'get_status' %} + {% if respond == 1 %} + {action_respond_info("MagProbe Status: %s" % state)} + {% endif %} + {% else %} + {action_raise_error("MagProbe: action not defined")} + {% endif %} + +[gcode_macro _ATTACH_PROBE] +description: Helper: Attach MagProbe +gcode: + ##### Get user defines ##### + {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} + {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} + {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} + {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} + {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} + {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} + ##### get toolhead position ##### + {% set act_z = printer.toolhead.position.z|float %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=STATE_ATTACH_PROBE + SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored + G90 ; absolute positioning + {% if act_z < z_min %} + G0 Z{z_min} F1500 ; move head up + {% endif %} + + ################################################################### + # !!! Caution !!! + # + # Adapt for your needs if needed !! + ################################################################### + + ##### Example for a bed dock: + #G0 X{undock_x} Y{undock_y} F{t_speed} ; move to mag-probe + #G0 Z{dock_z} F1500 FORCE ; move down to probe + #G0 Y{dock_y} F{d_speed} ; move out of holder + #G0 Z{undock_z} F1500 ; move head up + + ##### Example for a gantry dock: + G0 X{undock_x} Y{undock_y} F{t_speed} ; move next to mag-probe + G0 X{dock_x} F{d_speed} ; move sideways to attach probe + G0 Y{dock_y} F{d_speed} ; move out of holder + + RESTORE_GCODE_STATE NAME=STATE_ATTACH_PROBE + +[gcode_macro _DOCK_PROBE] +description: Helper: Dock MagProbe +gcode: + ##### Get user defines ##### + {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} + {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} + {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} + {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} + {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} + {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} + ##### get toolhead position ##### + {% set act_z = printer.toolhead.position.z|float %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=STATE_DOCK_PROBE + SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored + G90 ; absolute positioning + {% if act_z < z_min %} + G0 Z{z_min} F900 ; move head up + {% endif %} + + ################################################################### + # !!! Caution !!! + # + # Adapt for your needs if needed !! + ################################################################### + + ##### Example for a bed dock: + #G0 X{dock_x} Y{dock_y} F{t_speed} ; move to mag-probe + #G0 Z{dock_z} F1500 FORCE ; move down to probe + #G0 Y{undock_y} F{d_speed} ; move into the holder + #G0 Z{undock_z} F1500 ; move upwards to remove probe + + ##### Example for a gantry dock: + G0 X{dock_x} Y{dock_y} F{t_speed} ; move in front of mag-probe + G0 Y{undock_y} F{d_speed} ; move into the holder + G0 X{undock_x} F{d_speed} ; move sideways to remove probe + + RESTORE_GCODE_STATE NAME=STATE_DOCK_PROBE + +##################################################################### +# Customized standard macros +##################################################################### +# +# !!! Caution !!! +# +# PROBE_CALIBRATE can not dock the Magprobe automatically, as it +# start's a scripting process we need to stop at the execution +# of the base macro. Use +# - PROBE_ABORT +# - PROBE_ACCEPT +# instead of the original ABORT and ACCEPT to also dock the probe +# +##################################################################### +# +# If your probe needs a Z move for attach/detach use either +# G0 .... FORCE +# G1 .... FORCE +# +##################################################################### +[gcode_macro G0] +description: Move gcode that prevents moves lower than the limit when probe attached +rename_existing: G0.1 +gcode: + ##### set manual override ##### + {% if 'FORCE' in params|upper %} + {% set force = 1 %} + {% else %} + {% set force = 0 %} + {% endif %} + ##### get params ##### + {% set get_params = [] %} + {% for key in params %} + {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endif %} + {% endfor %} + ##### add caller ##### + {% set tmp = get_params.append("CALLER=G0") %} ;hack to append list objects outside of a loop + ##### add force ##### + {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop + ##### end of definition ##### + {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} + _MAG_PROBE ACTION=GET_STATUS RESPOND=0 + {% endif %} + _Z_MOVE_CHECK {get_params|join(" ")} + +[gcode_macro G1] +description: Move gcode that prevents moves lower than the limit when probe attached +rename_existing: G1.1 +gcode: + ##### set manual override ##### + {% if 'FORCE' in params|upper %} + {% set force = 1 %} + {% else %} + {% set force = 0 %} + {% endif %} + ##### get params ##### + {% set get_params = [] %} + {% for key in params %} + {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endif %} + {% endfor %} + ##### add caller ##### + {% set tmp = get_params.append("CALLER=G1") %} ;hack to append list objects outside of a loop + ##### add force ##### + {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop + ##### end of definition ##### + {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} + _MAG_PROBE ACTION=GET_STATUS RESPOND=0 + {% endif %} + _Z_MOVE_CHECK {get_params|join(" ")} + +[gcode_macro _Z_MOVE_CHECK] +description: Helper: Check limit and perform move +gcode: + ##### define defaults ###### + {% set caller = params.CALLER|default('G0')|upper %} + {% set force = params.FORCE|default(0)|int %} + ##### z values ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set z_act = printer.toolhead.position.z|float %} + ##### MagProbe state ##### + {% set probe_state = printer['gcode_macro _MAG_PROBE'].state|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% if key is not in ['Z', 'CALLER', 'FORCE'] %} + {% set get_params = get_params.append(key + params[key]) %} + {% elif key is in ['Z'] %} + {% if force == 1 %} ;manual override of probe check + {% set get_params = get_params.append(key + params[key]) %} + {% elif probe_state == 'unknown' %} + {action_raise_error("%s: MagProbe state %s run \"_MAG_PROBE ACTION=GET_STATUS\"" % (caller, probe_state|upper))} + {% elif probe_state == 'docked' %} + {% set get_params = get_params.append(key + params[key]) %} + {% elif probe_state == 'attached' %} + ##### define move target position depending on absolute_coordinates ##### + {% if printer.gcode_move.absolute_coordinates|lower == 'true' %} + {% set z_target = params.Z|float %} + {% else %} + {% set z_target = z_act + params.Z|float %} + {% endif %} + ##### decide if a Z move can be executed ##### + {% if z_target > z_min or z_act < z_target %} + {% set get_params = get_params.append(key + params[key]) %} + {% else %} + {action_respond_info("%s: Z Moves lower than %.1fmm not allowed with installed probe" % (caller,z_min))} + {% endif %} + {% else %} + {action_raise_error("%s: MagProbe state %s not valid" % (caller, probe_state|upper))} + {% endif %} + {% endif %} + {% endfor %} + ##### end of definitions ##### + {caller}.1 {get_params|join(" ")} + +[gcode_macro QUERY_PROBE] +description: Return the status of the z-probe and store ID +rename_existing: QUERY_PROBE_BASE +variable_id: 0 +gcode: + {% set id = params.ID|default(0) %} ; call id 0 means invalid + QUERY_PROBE_BASE + SET_GCODE_VARIABLE MACRO=QUERY_PROBE VARIABLE=id VALUE={id} + +[gcode_macro PROBE_ACCURACY] +description: Probe Z-height accuracy at current XY position and dock/undock MagProbe +rename_existing: PROBE_ACCURACY_BASE +gcode: + ##### get new parameter. ##### + {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking + ##### get user defines ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + # as we need to return to the position with the probe we need to be at least at z_min + G90 ; absolute positioning + {% if act_z < z_min %} + {action_respond_info("PROBE_ACCURACY: High must be above %.2f" % z_min)} + G1 Z{z_min} F900 ; move head up + {% endif %} + M400 ; get the buffer cleared first + SAVE_GCODE_STATE NAME=STATE_PROBE_ACCURACY + ATTACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} + PROBE_ACCURACY_BASE {get_params|join(" ")} + {% if dock == 1 %} + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} + {% endif %} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + +[gcode_macro PROBE] +description: Probe Z-height at current XY position and dock/undock MagProbe +rename_existing: PROBE_BASE +gcode: + ##### get new parameter. ##### + {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking + ##### get user defines ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + # as we need to return to the position with the probe we need to be at least at z_min + G90 ; absolute positioning + {% if act_z < z_min %} + {action_respond_info("PROBE: High must be above %.2f" % z_min)} + G1 Z{z_min} F900 ; move head up + {% endif %} + M400 ; get the buffer cleared first + SAVE_GCODE_STATE NAME=STATE_PROBE + ATTACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} + PROBE_BASE {get_params|join(" ")} + G1 Z{z_min} F900 ; move head up to remove trigger + {% if dock == 1 %} + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} + {% endif %} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + +[gcode_macro PROBE_CALIBRATE] +description: Calibrate the probes z_offset and undock MagProbe +rename_existing: PROBE_CALIBRATE_BASE +gcode: + ##### get user defines ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + # as we need to return to the position with the probe we need to be at least at z_min + G90 ; absolute positioning + {% if act_z < z_min %} + {action_respond_info("PROBE_CALIBRATE: High must be above %.2f" % z_min)} + G1 Z{z_min} F900 ; move head up + {% endif %} + M400 ; get the buffer cleared first + SAVE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE + ATTACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"calib"' + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=absolute_coordinates VALUE='"{absolute_coordinates}"' + PROBE_CALIBRATE_BASE {get_params|join(" ")} + +[gcode_macro BED_MESH_CALIBRATE] +description: Perform QGL and bed mesh leveling +rename_existing: BED_MESH_CALIBRATE_BASE +gcode: + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + _CG28 + BED_MESH_CLEAR + ## check if QGL was already executed + {% if printer.quad_gantry_level.applied|lower == 'false' %} + QUAD_GANTRY_LEVEL PARK=false + {% endif %} + ATTACH_PROBE + BED_MESH_CALIBRATE_BASE {get_params|join(" ")} + DETACH_PROBE + +[gcode_macro PROBE_ABORT] +description: Abort manual Z probing tool for Probe and dock MagProbe +variable_caller: 'unknown' +variable_absolute_coordinates: False +gcode: + ##### get user defines ##### + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### end of definitions ##### + {% if caller|lower|string == 'calib' %} + ABORT + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' + {% else %} + {action_respond_info("PROBE_ABORT: Executed while PROBE_CALIBRATE is not running")} + {% endif %} + +[gcode_macro PROBE_ACCEPT] +description: Accept the current Z position for Probe and dock MagProbe +gcode: + ##### get variables from ABORT ##### + {% set caller = printer['gcode_macro PROBE_ABORT'].caller %} + {% set absolute_coordinates = printer['gcode_macro PROBE_ABORT'].absolute_coordinates %} + ##### get user defines ##### + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### end of definitions ##### + {% if caller|lower|string == 'calib' %} + ACCEPT + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' + {% else %} + {action_respond_info("PROBE_ACCEPT: Executed while PROBE_CALIBRATE is not running")} + {% endif %} + diff --git a/z_calibration/z_calibration.cfg b/z_calibration/z_calibration.cfg new file mode 100644 index 0000000..f932419 --- /dev/null +++ b/z_calibration/z_calibration.cfg @@ -0,0 +1,127 @@ +##################################################################### +# Z Calibration +##################################################################### +[z_calibration] +# The X and Y coordinates (in mm) for clicking the nozzle on the +# Z endstop. +probe_nozzle_x: 208 +probe_nozzle_y: 305 +# The X and Y coordinates (in mm) for clicking the probe's switch +# on the Z endstop. +probe_switch_x: 201 +probe_switch_y: 284 +# The X and Y coordinates (in mm) for probing on the print surface +# (e.g. the center point) These coordinates will be adapted by the +# probe's X and Y offsets. The default is the relative_reference_index +# of the configured bed_mesh. It will raise an error if there is no +# probe_bed site and no bed_mesh with a relative_reference_index +# configured. +probe_bed_x: 150 +probe_bed_y: 150 +# The trigger point offset of the used mag-probe switch. +# This needs to be fined out manually. More on this later +# in this section.. +switch_offset: 0.42 +# The maximum allowed deviation of the calculated offset. +# If the offset exceeds this value, it will stop! +# The default is 1.0 mm. +max_deviation: 1.5 +# The number of times to probe each point. The probed z-values +# will be averaged. The default is from the probe's configuration. +#samples: default from "probe:samples" section +# The maximum Z distance (in mm) that a sample may differ from other +# samples. The default is from the probe's configuration. +#samples_tolerance: default from "probe:samples_tolerance" section +# The number of times to retry if a sample is found that exceeds +# samples_tolerance. The default is from the probe's configuration. +#samples_tolerance_retries: default from "probe:samples_tolerance_retries" section +# The calculation method when sampling more than once - either +# "median" or "average". The default is from the probe's configuration. +#samples_result: default from "probe:samples_result" section +# The distance in mm to move up before moving to the next +# position. The default is two times the z_offset from the probe's +# configuration. +clearance: 7.5 +#position_min: default from "stepper_z:position_min" section. +# The moving speed in X and Y. The default is 50 mm/s. +speed: 200 +# Speed (in mm/s) of the Z axis when lifting the probe between +# samples and clearance moves. The default is from the probe's +# configuration. +#lift_speed: default from "probe:lift_speed" section +# The fast probing speed (in mm/s) used, when probing_first_fast +# is activated. The default is from the Z rail configuration. +#probing_speed: default from "stepper_z:homing_speed" section. +# The slower speed (in mm/s) for probing the recorded samples. +# The default is second_homing_speed of the Z rail configuration. +#probing_second_speed: default from "stepper_z:second_homing_speed" section. +# Distance to back off (in mm) before probing the next sample. +# The default is homing_retract_dist from the Z rail configuration. +#probing_retract_dist: default from "stepper_z:homing_retract_dist" section. +# If true, the first probing is done faster by the probing speed. +# This is to get faster down and the result is not recorded as a +# probing sample. The default is false. +probing_first_fast: true +# If true, the first probing is done faster by the probing speed. +# This is to get faster down and the result is not recorded as a +# probing sample. The default is false. +start_gcode: DETACH_PROBE +# A list of G-Code commands to execute prior to each calibration command. +# See docs/Command_Templates.md for G-Code format. This can be used to +# attach the probe. +before_switch_gcode: ATTACH_PROBE +# A list of G-Code commands to execute prior to each probing on the +# mag-probe. See docs/Command_Templates.md for G-Code format. This can be +# used to attach the probe after probing on the nozzle and before probing +# on the mag-probe. +end_gcode: DETACH_PROBE +# A list of G-Code commands to execute after each calibration command. +# See docs/Command_Templates.md for G-Code format. This can be used to +# detach the probe afterwards. + +##################################################################### +## With these settings, the probe is attached after probing the nozzle +## and before probing the switch !! +##################################################################### +## Otherwise, starting with the probe attached would be like this: +start_gcode: ATTACH_PROBE +#before_switch_gcode: ATTACH_PROBE +end_gcode: DETACH_PROBE +##################################################################### + +##################################################################### +# Macros +##################################################################### + +################################################################### +# !!! Caution !!! +# +# This Macro is only needed if not using the start/end_gcode +# properties to attach/detach the probe +################################################################### +[gcode_macro CALIBRATE_Z] +description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe +rename_existing: CALIBRATE_Z_BASE +gcode: + ##### get user defines ##### + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + #### end of definitions ##### + ## reduce current of motors + _SET_ACC VAL=HOME + _SET_CURRENT VAL=HOME + _CG28 RESET_SETTINGS=false + {% if act_z < z_hop %} + G90 ; absolute positioning + {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} + G1 Z{z_hop} F900 ; move head up + {% endif %} + #ATTACH_PROBE + CALIBRATE_Z_BASE + #DETACH_PROBE + {% if params.RESET_SETTINGS|default('true') == 'true' %} + ## return to org current settings + _SET_CURRENT + _SET_ACC + {% endif %} From 37cc42b363bfa0003a7c556bbcb46454a95c6d4f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 28 Oct 2021 12:18:14 +0200 Subject: [PATCH 046/131] v2.4: update z_calibration --- macros.cfg | 57 ++++++----- printer.cfg | 6 +- .../z_calibration.cfg => z_calibration.cfg | 51 ++++++++-- z_calibration/macros.cfg | 96 +++++++++---------- z_calibration/printer.cfg | 37 ------- 5 files changed, 128 insertions(+), 119 deletions(-) rename z_calibration/z_calibration.cfg => z_calibration.cfg (71%) delete mode 100644 z_calibration/printer.cfg diff --git a/macros.cfg b/macros.cfg index ce7263d..c220f2a 100644 --- a/macros.cfg +++ b/macros.cfg @@ -83,23 +83,6 @@ gcode: {% endif %} -[gcode_macro G32] -gcode: - BED_MESH_CLEAR - M117 > home - G28 - M117 > qgl - QUAD_GANTRY_LEVEL - M117 > brushie - BRUSHIE - M117 > home - G28 - M117 > bed mesh calibrate - BED_MESH_CALIBRATE - # BED_MESH_PROFILE load=default # load default bed_mesh profile - G0 X150 Y150 Z30 F3600 - - [gcode_macro M600] description: Change filament gcode: @@ -114,13 +97,17 @@ gcode: gcode: {% set BED=params.BED|default(100) %} {% set EXTRUDER=params.EXTRUDER|default(250) %} + {% set QGL=params.QGL|default(1)|int %} + {% set BMC=params.BMC|default(0)|int %} + {% set PURGE=params.PURGE|default(1)|int %} {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} + {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} # TODO - {% set BMC=params.BMC|default(0) %} {% set ERCF=params.ERCF|default(0) %} M117 > configuring SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 G4 P2000 + SET_GCODE_OFFSET Z=0.0 # reset z offset M140 S{BED} # start bed heating M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder @@ -131,7 +118,26 @@ gcode: M117 > homing SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 G4 P2000 - G32 # home, qgl and mesh + {% if BMC %} + BED_MESH_CLEAR + {% endif %} + M117 > home + G28 + {% if QGL %} + M117 > qgl + QUAD_GANTRY_LEVEL + {% endif %} + M117 > brushie + BRUSHIE + M117 > calibrate z + CALIBRATE_Z + {% if BMC %} + M117 > bed mesh calibrate + BED_MESH_CALIBRATE + {% else %} + M117 > bed mesh load + BED_MESH_PROFILE LOAD=default + {% endif %} M117 > heating SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 @@ -139,14 +145,18 @@ gcode: G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature M109 S{EXTRUDER} # set and wait for nozzle temperature - M117 > soaking for {SOAK/1000/60|int} min - G4 P{SOAK} + {% if SOAK > 0 %} + M117 > soaking for {SOAK/1000/60|int} min + G4 P{SOAK} + {% endif %} M117 > starting + SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 - # SET_FAN_SPEED FAN=exhaust_fan SPEED=0.5 - PURGE_NOZZLE + {% if PURGE %} + PURGE_NOZZLE + {% endif %} [gcode_macro PRINT_END] @@ -158,7 +168,6 @@ gcode: G1 E-10.0 F3600 ; retract filament TURN_OFF_HEATERS M107 ; turn off fan - # SET_FAN_SPEED FAN=exhaust_fan SPEED=0.0 [gcode_macro PRINT_LAYER_CHANGE] diff --git a/printer.cfg b/printer.cfg index 24e34f1..0a02957 100644 --- a/printer.cfg +++ b/printer.cfg @@ -55,7 +55,7 @@ square_corner_velocity: 5.0 [include fans.cfg] [include input_shaper.cfg] # [include resonance_test.cfg] -[include z_calibration/printer.cfg] +[include z_calibration.cfg] ##################################################################### @@ -335,7 +335,7 @@ timeout: 1800 [bed_mesh] speed: 500 -horizontal_move_z: 10 +horizontal_move_z: 15 mesh_min: 40,60 mesh_max: 260,280 fade_start: 0.6 @@ -356,7 +356,7 @@ points: 250,225 250,40 speed: 100 -horizontal_move_z: 10 +horizontal_move_z: 15 retries: 5 retry_tolerance: 0.0075 max_adjust: 10 diff --git a/z_calibration/z_calibration.cfg b/z_calibration.cfg similarity index 71% rename from z_calibration/z_calibration.cfg rename to z_calibration.cfg index f932419..3ac7d2e 100644 --- a/z_calibration/z_calibration.cfg +++ b/z_calibration.cfg @@ -1,6 +1,44 @@ +##################################################################### +# User Variables +##################################################################### +[gcode_macro _USER_VARIABLE] +description: Helper: Contains User defined printer variables +##### Homing and general movement ##### +variable_z_endstop_x: 208 ; z Endstop x position inside right profile +variable_z_endstop_y: 305 ; z Endstop y position +variable_z_hop: 15.0 ; z hop for moves e.g homing +variable_xy_home_current: 0.4 ; reduced homing current for x and y +variable_z_home_current: 0.3 ; reduced homing current for z +variable_home_accel: 1200 ; reduced ACCEL for homing +##### Mag Probe ##### +variable_probe_dock_x: 148 ; x toolhead position before docking probe +variable_probe_dock_y: 285 ; y toolhead position before docking probe +variable_probe_dock_z: 15 ; z toolhead position before docking probe (only for bed dock) +variable_probe_undock_x: 200 ; x toolhead position after docking probe +variable_probe_undock_y: 305 ; y toolhead position after docking probe +variable_probe_undock_z: 15 ; z toolhead position after docking probe (only for bed dock) +variable_probe_z_min: 15 ; z minimum height to avoid crash +variable_probe_travel_speed: 200 ; dock moves travel speed +variable_probe_dock_speed: 100 ; dock speed for attach/dock +##### Respond defaults ##### +variable_respond_set_current: 0 ; default of RESPOND if not set in the call +variable_respond_set_acc: 0 ; default of RESPOND if not set in the call +variable_respond_probe_action: 1 ; default of RESPOND if not set in the call +##### Park Position ##### +variable_park_bed: [150,150,30] ; different park position +gcode: + +##################################################################### +# Includes +##################################################################### +[include z_calibration/macros.cfg] +[include z_calibration/homing.cfg] +[include z_calibration/probing.cfg] + ##################################################################### # Z Calibration ##################################################################### + [z_calibration] # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. @@ -20,12 +58,12 @@ probe_bed_x: 150 probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later -# in this section.. -switch_offset: 0.42 +# in this section. smaller switch_offset -> more distance to the build plate +switch_offset: 0.7 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. -max_deviation: 1.5 +max_deviation: 1.0 # The number of times to probe each point. The probed z-values # will be averaged. The default is from the probe's configuration. #samples: default from "probe:samples" section @@ -41,10 +79,9 @@ max_deviation: 1.5 # The distance in mm to move up before moving to the next # position. The default is two times the z_offset from the probe's # configuration. -clearance: 7.5 #position_min: default from "stepper_z:position_min" section. # The moving speed in X and Y. The default is 50 mm/s. -speed: 200 +# speed: 200 # Speed (in mm/s) of the Z axis when lifting the probe between # samples and clearance moves. The default is from the probe's # configuration. @@ -100,7 +137,7 @@ end_gcode: DETACH_PROBE # properties to attach/detach the probe ################################################################### [gcode_macro CALIBRATE_Z] -description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe +description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe rename_existing: CALIBRATE_Z_BASE gcode: ##### get user defines ##### @@ -119,7 +156,7 @@ gcode: {% endif %} #ATTACH_PROBE CALIBRATE_Z_BASE - #DETACH_PROBE + #DETACH_PROBE {% if params.RESET_SETTINGS|default('true') == 'true' %} ## return to org current settings _SET_CURRENT diff --git a/z_calibration/macros.cfg b/z_calibration/macros.cfg index 9ebf151..a823d7e 100644 --- a/z_calibration/macros.cfg +++ b/z_calibration/macros.cfg @@ -1,48 +1,48 @@ -##################################################################### -# Macros -##################################################################### -[gcode_macro PRINT_START] -gcode: - {% set bed_temp = params.BED_TEMP|default(100)|float %} - {% set extruder_temp = params.EXTRUDER_TEMP|default(220)|float %} - {% set z_adjust = params.Z_ADJUST|default(0.0)|float %} - {% set retract = 10 %} - BED_MESH_CLEAR ; clear mesh - _CG28 ; Home the printer - G90 ; Use absolute coordinates - PARKCENTER ; Move to center - M117 Heating.. - _HEATER_ON - M106 S255 ; set print fan to full speed - M140 S{bed_temp} ; Start bed heating - M190 S{bed_temp} ; Wait for bed to reach temperature - M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature - M107 ; turn print fan off - QUAD_GANTRY_LEVEL PARK=false - M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature - clean_nozzle ; clean nozzle - CALIBRATE_Z - #BED_MESH_PROFILE LOAD=default ; load mesh if needed - # Adjust the G-Code Z offset with the Z_ADJUST parameter if needed - #SET_GCODE_OFFSET Z_ADJUST={z_adjust} MOVE=1 - M117 Intro Line.. - G90 ; Use absolute coordinates - G1 Y0 X130 Z5 F12000 ; Move the nozzle to the front and near the bed - G1 Z0.7 F300 ; Move the nozzle very close to the bed - G92 E0.0 ; set extruder position to 0 - G1 E{retract} F3600 ; extrude retract - G92 E0.0 ; set extruder option to 0 - G1 X180 E15.0 F500.0 ; intro line - G92 E0.0 ; set extruder Poisson to 0 - G1 X174 F6000 ; move away from intro line - M117 - -[gcode_macro PARKCENTER] -gcode: - {% set Z = params.Z|default(30)|float %} - SAVE_GCODE_STATE NAME=PARKCENTER_state - _CG28 ; Home if not already homed - G90 ; absolute positioning - G0 X150 Y150 Z{Z} F12000 ; move to center - RESTORE_GCODE_STATE NAME=PARKCENTER_state - +# ##################################################################### +# # Macros +# ##################################################################### +# [gcode_macro PRINT_START] +# gcode: +# {% set bed_temp = params.BED_TEMP|default(100)|float %} +# {% set extruder_temp = params.EXTRUDER_TEMP|default(220)|float %} +# {% set z_adjust = params.Z_ADJUST|default(0.0)|float %} +# {% set retract = 10 %} +# BED_MESH_CLEAR ; clear mesh +# _CG28 ; Home the printer +# G90 ; Use absolute coordinates +# PARKCENTER ; Move to center +# M117 Heating.. +# _HEATER_ON +# M106 S255 ; set print fan to full speed +# M140 S{bed_temp} ; Start bed heating +# M190 S{bed_temp} ; Wait for bed to reach temperature +# M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature +# M107 ; turn print fan off +# QUAD_GANTRY_LEVEL PARK=false +# M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature +# clean_nozzle ; clean nozzle +# CALIBRATE_Z +# #BED_MESH_PROFILE LOAD=default ; load mesh if needed +# # Adjust the G-Code Z offset with the Z_ADJUST parameter if needed +# #SET_GCODE_OFFSET Z_ADJUST={z_adjust} MOVE=1 +# M117 Intro Line.. +# G90 ; Use absolute coordinates +# G1 Y0 X130 Z5 F12000 ; Move the nozzle to the front and near the bed +# G1 Z0.7 F300 ; Move the nozzle very close to the bed +# G92 E0.0 ; set extruder position to 0 +# G1 E{retract} F3600 ; extrude retract +# G92 E0.0 ; set extruder option to 0 +# G1 X180 E15.0 F500.0 ; intro line +# G92 E0.0 ; set extruder Poisson to 0 +# G1 X174 F6000 ; move away from intro line +# M117 +# +# [gcode_macro PARKCENTER] +# gcode: +# {% set Z = params.Z|default(30)|float %} +# SAVE_GCODE_STATE NAME=PARKCENTER_state +# _CG28 ; Home if not already homed +# G90 ; absolute positioning +# G0 X150 Y150 Z{Z} F12000 ; move to center +# RESTORE_GCODE_STATE NAME=PARKCENTER_state +# diff --git a/z_calibration/printer.cfg b/z_calibration/printer.cfg deleted file mode 100644 index 7a70810..0000000 --- a/z_calibration/printer.cfg +++ /dev/null @@ -1,37 +0,0 @@ -##################################################################### -# User Variables -##################################################################### -[gcode_macro _USER_VARIABLE] -description: Helper: Contains User defined printer variables -##### Homing and general movement ##### -variable_z_endstop_x: 208 ; z Endstop x position inside right profile -variable_z_endstop_y: 305 ; z Endstop y position -variable_z_hop: 10.0 ; z hop for moves e.g homing -variable_xy_home_current: 0.4 ; reduced homing current for x and y -variable_z_home_current: 0.3 ; reduced homing current for z -variable_home_accel: 1200 ; reduced ACCEL for homing -##### Mag Probe ##### -variable_probe_dock_x: 148 ; x toolhead position before docking probe -variable_probe_dock_y: 285 ; y toolhead position before docking probe -variable_probe_dock_z: 10 ; z toolhead position before docking probe (only for bed dock) -variable_probe_undock_x: 200 ; x toolhead position after docking probe -variable_probe_undock_y: 305 ; y toolhead position after docking probe -variable_probe_undock_z: 10 ; z toolhead position after docking probe (only for bed dock) -variable_probe_z_min: 10 ; z minimum height to avoid crash -variable_probe_travel_speed: 200 ; dock moves travel speed -variable_probe_dock_speed: 100 ; dock speed for attach/dock -##### Respond defaults ##### -variable_respond_set_current: 0 ; default of RESPOND if not set in the call -variable_respond_set_acc: 0 ; default of RESPOND if not set in the call -variable_respond_probe_action: 1 ; default of RESPOND if not set in the call -##### Park Position ##### -variable_park_bed: [150,150,30] ; different park position -gcode: - -##################################################################### -# Includes -##################################################################### -[include macros.cfg] -[include homing.cfg] -[include probing.cfg] -[include z_calibration.cfg] From 05a1eb30e1996778d79d9b2f8a0260918de71bff Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 29 Oct 2021 16:11:19 +0200 Subject: [PATCH 047/131] v2.4: update fans, optionally generic --- fans.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fans.cfg b/fans.cfg index 044555a..9682105 100644 --- a/fans.cfg +++ b/fans.cfg @@ -19,6 +19,7 @@ heater_temp: 50.0 ## If you are experiencing back flow, you can reduce fan_speed #fan_speed: 1.0 +# [fan_generic nevermore1] [heater_fan nevermore1] pin: PD12 kick_start_time: 0.5 @@ -26,6 +27,7 @@ heater: heater_bed heater_temp: 40.0 fan_speed: 0.80 +# [fan_generic nevermore2] [heater_fan nevermore2] pin: PD13 kick_start_time: 0.5 @@ -33,6 +35,7 @@ heater: heater_bed heater_temp: 40.0 fan_speed: 0.80 +# [fan_generic side1] [heater_fan side1] pin: PD14 kick_start_time: 0.5 @@ -40,6 +43,7 @@ heater: heater_bed heater_temp: 40.0 fan_speed: 0.40 +# [fan_generic side1] [heater_fan side2] pin: PD15 kick_start_time: 0.5 From 830ceb1e3fca357e5f75a6f3859203677cbad2e0 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 29 Oct 2021 16:12:12 +0200 Subject: [PATCH 048/131] v2.4: update macros, always perform qgl --- macros.cfg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/macros.cfg b/macros.cfg index c220f2a..c4c02ac 100644 --- a/macros.cfg +++ b/macros.cfg @@ -95,15 +95,16 @@ gcode: ## PRINT_ [gcode_macro PRINT_START] gcode: - {% set BED=params.BED|default(100) %} - {% set EXTRUDER=params.EXTRUDER|default(250) %} - {% set QGL=params.QGL|default(1)|int %} + {% set BED=params.BED|default(100)|int %} + {% set EXTRUDER=params.EXTRUDER|default(250)|int %} + {% set CHAMBER=params.CHAMBER|default(0)|int %} {% set BMC=params.BMC|default(0)|int %} {% set PURGE=params.PURGE|default(1)|int %} {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} # TODO {% set ERCF=params.ERCF|default(0) %} + {action_respond_info("starting print BED=%d, EXTRUDER=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, BMC, PURGE, SOAK, Z_ADJUST))} M117 > configuring SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 G4 P2000 @@ -123,10 +124,8 @@ gcode: {% endif %} M117 > home G28 - {% if QGL %} - M117 > qgl - QUAD_GANTRY_LEVEL - {% endif %} + M117 > qgl + QUAD_GANTRY_LEVEL M117 > brushie BRUSHIE M117 > calibrate z @@ -145,6 +144,7 @@ gcode: G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature M109 S{EXTRUDER} # set and wait for nozzle temperature + TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={CHAMBER} # wait for chamber temp {% if SOAK > 0 %} M117 > soaking for {SOAK/1000/60|int} min G4 P{SOAK} From b67abe3a1700094d9016da0d0b5148c6bc4a0566 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 29 Oct 2021 16:12:43 +0200 Subject: [PATCH 049/131] v2.4: updates to printer and z_calibration --- printer.cfg | 11 ++++++----- z_calibration.cfg | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/printer.cfg b/printer.cfg index 0a02957..7749743 100644 --- a/printer.cfg +++ b/printer.cfg @@ -26,8 +26,9 @@ ## [E in MOTOR6] - Extruder ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify ##-------------------------------------------------------------------- -serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 -#restart_method: command +# serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 +serial: /dev/serial0 +restart_method: command ##-------------------------------------------------------------------- @@ -173,7 +174,7 @@ microsteps: 16 uart_pin: PF2 interpolate: true run_current: 0.8 -hold_current: 0.80 +hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -190,7 +191,7 @@ microsteps: 16 uart_pin: PE4 interpolate: true run_current: 0.8 -hold_current: 0.80 +hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -357,7 +358,7 @@ points: 250,40 speed: 100 horizontal_move_z: 15 -retries: 5 +retries: 8 retry_tolerance: 0.0075 max_adjust: 10 diff --git a/z_calibration.cfg b/z_calibration.cfg index 3ac7d2e..416f33d 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -9,7 +9,7 @@ variable_z_endstop_y: 305 ; z Endstop y position variable_z_hop: 15.0 ; z hop for moves e.g homing variable_xy_home_current: 0.4 ; reduced homing current for x and y variable_z_home_current: 0.3 ; reduced homing current for z -variable_home_accel: 1200 ; reduced ACCEL for homing +variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### variable_probe_dock_x: 148 ; x toolhead position before docking probe variable_probe_dock_y: 285 ; y toolhead position before docking probe @@ -25,7 +25,7 @@ variable_respond_set_current: 0 ; default of RESPOND if not set in the cal variable_respond_set_acc: 0 ; default of RESPOND if not set in the call variable_respond_probe_action: 1 ; default of RESPOND if not set in the call ##### Park Position ##### -variable_park_bed: [150,150,30] ; different park position +variable_park_bed: [280,280,30] ; different park position gcode: ##################################################################### @@ -59,7 +59,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.7 +switch_offset: 0.73 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From a8f3ab247a461fd778263b597b5cc9d658666b85 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 1 Nov 2021 21:24:21 +0100 Subject: [PATCH 050/131] v2.4: restructure all the things --- KlipperScreen.conf | 8 +- macros/_init.cfg | 10 + macros/debug.cfg | 85 +++ macros/helpers.cfg | 55 ++ macros/override.cfg | 147 ++++ macros.cfg => macros/print.cfg | 201 +++--- z_calibration/probing.cfg => macros/probe.cfg | 673 +++++++----------- .../homing.cfg => macros/z_calibration.cfg | 128 ++-- printer.cfg | 62 +- webcam.txt | 3 +- z_calibration.cfg | 128 ++-- z_calibration/README.md | 11 - z_calibration/macros.cfg | 48 -- 13 files changed, 822 insertions(+), 737 deletions(-) create mode 100644 macros/_init.cfg create mode 100644 macros/debug.cfg create mode 100644 macros/helpers.cfg create mode 100644 macros/override.cfg rename macros.cfg => macros/print.cfg (75%) rename z_calibration/probing.cfg => macros/probe.cfg (71%) rename z_calibration/homing.cfg => macros/z_calibration.cfg (72%) delete mode 100644 z_calibration/README.md delete mode 100644 z_calibration/macros.cfg diff --git a/KlipperScreen.conf b/KlipperScreen.conf index ab59475..9c9139e 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -3,12 +3,12 @@ moonraker_host: 127.0.0.1 moonraker_port: 7125 [preheat PLA] -bed = 40 -extruder = 195 +bed = 50 +extruder = 200 [preheat ABS] -bed = 90 -extruder = 220 +bed = 100 +extruder = 250 [menu __main] name: {{ gettext('Main Menu') }} diff --git a/macros/_init.cfg b/macros/_init.cfg new file mode 100644 index 0000000..c7ebc50 --- /dev/null +++ b/macros/_init.cfg @@ -0,0 +1,10 @@ +##################################################################### +# include all the macros +# large parts taken from alexz and others +##################################################################### +[include debug.cfg] +[include helpers.cfg] +[include override.cfg] +[include print.cfg] +[include probe.cfg] +[include z_calibration.cfg] diff --git a/macros/debug.cfg b/macros/debug.cfg new file mode 100644 index 0000000..ba21067 --- /dev/null +++ b/macros/debug.cfg @@ -0,0 +1,85 @@ +##################################################################### +# Macros to debug the printer variable +# - DUMP_PARAMETERS +# - DUMP_CONFIG +# - DUMP_WARNINGS +# - DUMP_SETTINGS +##################################################################### + + +## Use: +## - DUMP_PARAMETERS +## - DUMP_PARAMETERS S='gcode_macro _USER_VARIABLE' +[gcode_macro DUMP_PARAMETERS] +description: Debug: Print all entries of the printer object +gcode: + {% set parameters = [] %} + {% for name1 in printer|sort %} + {% if 'S' in params %} + {% if name1 is in [params.S] %} + {% for name2 in printer[name1]|sort %} + {% set parameters = parameters.append("printer['%s'].%s = %s" % (name1, name2, printer[name1][name2])) %} + {% endfor %} + {% endif %} + {% else %} + {% if name1 is not in ['configfile'] %} + {% for name2 in printer[name1]|sort %} + {% set parameters = parameters.append("printer['%s'].%s = %s" % (name1, name2, printer[name1][name2])) %} + {% endfor %} + {% endif %} + {% endif %} + {% endfor %} + {action_respond_info(parameters|join("\n"))} + +## Use: +## - DUMP_CONFIG S='printer' +[gcode_macro DUMP_CONFIG] +description: Debug: Print the selected entry of the printer config object +gcode: + {% if 'S' in params %} + {% set parameters = [] %} + {% for name1 in printer.configfile.config %} + {% if name1 is in [params.S] %} + {% for name2 in printer.configfile.config[name1]|sort %} + {% set parameters = parameters.append("printer.configfile.config['%s'].%s = %s" % (name1, name2, printer.configfile.config[name1][name2])) %} + {% endfor %} + {% endif %} + {% endfor %} + {action_respond_info(parameters|join("\n"))} + {% else %} + {action_respond_info("WARNING: parameter S needed call e.g. DUMP_CONFIG S='printer'")} + {% endif %} + +## Use: +## - DUMP_WARNINGS +[gcode_macro DUMP_WARNINGS] +description: Debug: Print all warning messages from klipper +gcode: + {% set parameters = ["printer.configfile.warnings:"] %} + {% for name1 in printer.configfile.warnings %} + {% set parameters = parameters.append("%s -> %s -> %s\n%s" % (name1.type, name1.section, name1.option, name1.message)) %} + {% endfor %} + {action_respond_info(parameters|join("\n"))} + +## Use: +## - DUMP_SETTINGS S='printer' +[gcode_macro DUMP_SETTINGS] +description: Debug: Print the selected entry of the printer settings object +gcode: + {% if 'S' in params %} + {% set parameters = [] %} + {% for name1 in printer.configfile.settings %} + {% if name1 is in [params.S] %} + {% for name2 in printer.configfile.settings[name1]|sort %} + {% set parameters = parameters.append("printer.configfile.settings['%s'].%s = %s" % (name1, name2, printer.configfile.settings[name1][name2])) %} + {% endfor %} + {% endif %} + {% endfor %} + {action_respond_info(parameters|join("\n"))} + {% else %} + {action_respond_info("WARNING: parameter S needed call e.g. DUMP_SETTINGS S='printer'")} + {% endif %} + +##################################################################### +# Macros needed for several debug activities +##################################################################### diff --git a/macros/helpers.cfg b/macros/helpers.cfg new file mode 100644 index 0000000..6bfda81 --- /dev/null +++ b/macros/helpers.cfg @@ -0,0 +1,55 @@ +#################################################################### +# Helper macros +# - MOVE_SPEED +# - ZES +#################################################################### + +[gcode_macro MOVE_SPEED] +description: move along certain patterns with selected speed +gcode: + {% set F=params.F|default(3000)|int %} + {% if printer.idle_timeout.state != "Printing" %} + {% if "xyz" in printer.toolhead.homed_axes %} + {action_respond_info("moving with F%d" % F)} + ; square clockwise + M117 > square clockwise + G0 X275 Y275 F{F} + G0 Y25 + G0 X25 + G0 Y275 + G0 X275 + ; square counter-clockwise + M117 > square counter-clockwise + G0 X25 + G0 Y25 + G0 X275 + G0 Y275 + ; diagonal motor a + M117 > diagonal motor a + G0 X25 Y25 + G0 X275 Y275 + G0 X25 + ; diagonal motor b + M117 > diagonal motor b + G0 X275 Y25 + G0 X25 Y275 + G0 X275 Y275 + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% else %} + {action_respond_info("Already printing")} + {% endif %} + + +[gcode_macro ZES] +description: Z_ENDSTOP_CALIBRATE + extras +gcode: + {% if printer.idle_timeout.state != "Printing" %} + G28 + G0 X150 Y150 Z10 F10000 + Z_ENDSTOP_CALIBRATE + TESTZ Z=-9 + {% else %} + {action_respond_info("Already printing")} + {% endif %} diff --git a/macros/override.cfg b/macros/override.cfg new file mode 100644 index 0000000..b728df7 --- /dev/null +++ b/macros/override.cfg @@ -0,0 +1,147 @@ +##################################################################### +# Customized standard macros +##################################################################### +# +# !!! Caution !!! +# +# PROBE_CALIBRATE can not dock the Magprobe automatically, as it +# start's a scripting process we need to stop at the execution +# of the base macro. Use +# - PROBE_ABORT +# - PROBE_ACCEPT +# instead of the original ABORT and ACCEPT to also dock the probe +# +# - BED_MESH_CALIBRATE +# - G0 +# - G1 +# - QUAD_GANTRY_LEVEL +##################################################################### + + +## BED_MESH_CALIBRATE +[gcode_macro BED_MESH_CALIBRATE] +description: Perform QGL and bed mesh leveling +rename_existing: _BED_MESH_CALIBRATE_BASE +gcode: + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + _CG28 + BED_MESH_CLEAR + ## check if QGL was already executed + {% if printer.quad_gantry_level.applied|lower == 'false' %} + QUAD_GANTRY_LEVEL PARK=false + {% endif %} + ATTACH_PROBE + _BED_MESH_CALIBRATE_BASE {get_params|join(" ")} + DETACH_PROBE + +## GO +# If your probe needs a Z move for attach/detach use either +# G0 .... FORCE +[gcode_macro G0] +description: Move gcode that prevents moves lower than the limit when probe attached +rename_existing: G0.1 +gcode: + ##### set manual override ##### + {% if 'FORCE' in params|upper %} + {% set force = 1 %} + {% else %} + {% set force = 0 %} + {% endif %} + ##### get params ##### + {% set get_params = [] %} + {% for key in params %} + {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endif %} + {% endfor %} + ##### add caller ##### + {% set tmp = get_params.append("CALLER=G0") %} ;hack to append list objects outside of a loop + ##### add force ##### + {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop + ##### end of definition ##### + {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} + _MAG_PROBE ACTION=GET_STATUS RESPOND=0 + {% endif %} + _Z_MOVE_CHECK {get_params|join(" ")} + +## TODO +## G1 +# If your probe needs a Z move for attach/detach use either +# G1 .... FORCE +# [gcode_macro G1] +# description: Move gcode that prevents moves lower than the limit when probe attached +# rename_existing: G1.1 +# gcode: +# ##### set manual override ##### +# {% if 'FORCE' in params|upper %} +# {% set force = 1 %} +# {% else %} +# {% set force = 0 %} +# {% endif %} +# ##### get params ##### +# {% set get_params = [] %} +# {% for key in params %} +# {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter +# {% set get_params = get_params.append(key + "=" + params[key]) %} +# {% endif %} +# {% endfor %} +# ##### add caller ##### +# {% set tmp = get_params.append("CALLER=G1") %} ;hack to append list objects outside of a loop +# ##### add force ##### +# {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop +# ##### end of definition ##### +# {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} +# _MAG_PROBE ACTION=GET_STATUS RESPOND=0 +# {% endif %} +# _Z_MOVE_CHECK {get_params|join(" ")} + + +## QUAD_GANTRY_LEVEL +[gcode_macro QUAD_GANTRY_LEVEL] +description: Level a flying gantry to a stationary bed +rename_existing: _QUAD_GANTRY_LEVEL +gcode: + ##### get user defines ##### + {% set park_pos = printer['gcode_macro _USER_VARIABLE'].park_bed %} + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|float %} + ##### get toolhead position ##### + {% set act_z = printer.toolhead.position.z|float %} + ##### set default ##### + {% set park = params.PARK|default('true') %} + ##### end of definitions ##### + # home all axes if not already + {% if "xyz" not in printer.toolhead.homed_axes %} + _CG28 + {% endif %} + SAVE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL + _SET_ACC VAL=HOME + _SET_CURRENT VAL=HOME + _CG28 RESET_SETTINGS=false + {% if act_z < z_hop %} + G1 Z{z_hop} F900 ; move head up to insure Probe is not triggered in error case + {% endif %} + ATTACH_PROBE + _QUAD_GANTRY_LEVEL + {% if params.CALIBRATE|default('false') == 'true' %} + CALIBRATE_Z RESET_SETTINGS=false + {% else %} + DETACH_PROBE + {% endif %} + #G28 Z + {% if params.RESET_SETTINGS|default('true') == 'true' %} + _SET_CURRENT + _SET_ACC + {% endif %} + {% if park|lower == 'true' %} + G90 + G0 Z{park_pos[2]} F1800 ; move nozzle to z high first + G0 X{park_pos[0]} Y{park_pos[1]} F18000 ; home to get toolhead in the middle + {% endif %} + RESTORE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL + + diff --git a/macros.cfg b/macros/print.cfg similarity index 75% rename from macros.cfg rename to macros/print.cfg index c4c02ac..649cd5e 100644 --- a/macros.cfg +++ b/macros/print.cfg @@ -1,60 +1,59 @@ -## HELPERS -[gcode_macro ZES] -description: Z_ENDSTOP_CALIBRATE + extras -gcode: - G28 - G0 X150 Y150 Z10 F10000 - Z_ENDSTOP_CALIBRATE - TESTZ Z=-9 - - -[gcode_macro CENTER] -gcode: - {% set X=params.X|default(150) %} - {% set Y=params.Y|default(150) %} - {% set Z=params.Z|default(25) %} - {% if "xyz" in printer.toolhead.homed_axes %} - G0 X{X} Y{Y} Z{Z} F10000 - {% else %} - {action_respond_info("Printer not homed")} - {% endif %} - - -[gcode_macro PURGE_NOZZLE] -gcode: - {% set x0=params.x0|default(75) %} - {% set x1=params.x1|default(225) %} - {% set y0=params.y0|default(15) %} - {% set y1=params.y1|default(15.8) %} - M117 > purge nozzle - G0 Z10 F300 # move Z to travel height - G0 X{x0} Y{y0} F5000 # move to x0/y0 - G0 Z0.2 F1500 # lower Z - G0 X{x1} E30 # draw line - G0 Y{y1} # move to y1 - G0 X{x0} E15 # draw fine line +#################################################################### +# Macros used for printing +# - BRUSHIE +# - CANCEL_PRINT +# - M600 +# - PARK +# - PAUSE +# - PRINT_START +# - PRINT_END +# - PURGE_NOZZLE +# - RESUME +#################################################################### +# BRUSHIE [gcode_macro BRUSHIE] gcode: - {% set x0=50 %} + {% set x0=40 %} {% set x1=110 %} {% set y0=305 %} - {% set z0=2 %} + {% set z0=1 %} + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} M117 > brushie brushie brushie - G0 Z20 F1000 # move Z to travel height + G0 Z{z_hop} F1000 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 G0 Z{z0} # lower G0 X{x1} # back G0 X{x0} # forth G0 X{x1} # back - G0 Z20 F300 # move Z to travel height + G0 Z{z_hop} F300 # move Z to travel height {% else %} {action_respond_info("Printer not homed")} {% endif %} +# CANCEL_PRINT +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: _CANCEL_PRINT_BASE +gcode: + TURN_OFF_HEATERS + PARK + _CANCEL_PRINT_BASE + + +[gcode_macro M600] +description: Change filament +gcode: + SAVE_GCODE_STATE NAME=M600_state + PAUSE Y=15 + M117 > change filament + RESTORE_GCODE_STATE NAME=M600_state + + +# PARK [gcode_macro PARK] gcode: {% set Y=params.Y|default(295) %} @@ -83,26 +82,41 @@ gcode: {% endif %} -[gcode_macro M600] -description: Change filament +# PAUSE +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: _PAUSE_BASE +# change this if you need more or less extrusion +variable_extrude: 1.0 gcode: - SAVE_GCODE_STATE NAME=M600_state - PAUSE Y=15 - M117 > change filament - RESTORE_GCODE_STATE NAME=M600_state + {% set Y=params.Y|default(295) %} + # read E from pause macro + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # end of definitions + M117 > pause + _PAUSE_BASE + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E-{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + PARK Y={Y} -## PRINT_ +# - PRINT_START [gcode_macro PRINT_START] gcode: {% set BED=params.BED|default(100)|int %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set CHAMBER=params.CHAMBER|default(0)|int %} {% set BMC=params.BMC|default(0)|int %} + {% set QGL=params.QGL|default(0)|int %} {% set PURGE=params.PURGE|default(1)|int %} {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} - # TODO + # TODO: ERCF {% set ERCF=params.ERCF|default(0) %} {action_respond_info("starting print BED=%d, EXTRUDER=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, BMC, PURGE, SOAK, Z_ADJUST))} M117 > configuring @@ -124,10 +138,12 @@ gcode: {% endif %} M117 > home G28 - M117 > qgl - QUAD_GANTRY_LEVEL - M117 > brushie BRUSHIE + {% if QGL %} + M117 > qgl + QUAD_GANTRY_LEVEL PARK=false + BRUSHIE + {% endif %} M117 > calibrate z CALIBRATE_Z {% if BMC %} @@ -159,6 +175,7 @@ gcode: {% endif %} +# - PRINT_END [gcode_macro PRINT_END] gcode: M117 > finished @@ -170,40 +187,28 @@ gcode: M107 ; turn off fan -[gcode_macro PRINT_LAYER_CHANGE] +# - PURGE_NOZZLE +[gcode_macro PURGE_NOZZLE] gcode: - {% set layer=params.LAYER|default(0)|int %} - {% set layer_z=params.LAYER_Z|default(0) %} - {% set total_layer_count=params.TOTAL_LAYER_COUNT|default(0) %} - M117 > layer {layer+1}/{total_layer_count} {layer_z}mm - - -## OVERRIDES -[gcode_macro PAUSE] -description: Pause the actual running print -rename_existing: PAUSE_BASE -# change this if you need more or less extrusion -variable_extrude: 1.0 -gcode: - {% set Y=params.Y|default(295) %} - # read E from pause macro - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # end of definitions - M117 > pause - PAUSE_BASE - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E-{E} F2100 - G90 - {% else %} - {action_respond_info("Extruder not hot enough")} - {% endif %} - PARK Y={Y} + {% set x0=params.x0|default(100) %} + {% set x1=params.x1|default(200) %} + {% set y0=params.y0|default(0) %} + {% set y1=params.y1|default(0.8) %} + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} + M117 > purge nozzle + G0 Z{z_hop} F300 # move Z to travel height + G0 X{x0} Y{y0} F5000 # move to x0/y0 + G0 Z0.2 F1500 # lower Z + G0 X{x1} E20 # draw line + G0 Y{y1} # move to y1 + G0 X{x0} E10 # draw fine line + G0 Z{z_hop} F300 # move Z to travel height +# - RESUME [gcode_macro RESUME] description: Resume the actual running print -rename_existing: RESUME_BASE +rename_existing: _RESUME_BASE gcode: # read E from pause macro {% set E = printer["gcode_macro PAUSE"].extrude|float %} @@ -221,38 +226,12 @@ gcode: {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} - RESUME_BASE {get_params} + _RESUME_BASE {get_params} -[gcode_macro CANCEL_PRINT] -description: Cancel the actual running print -rename_existing: CANCEL_PRINT_BASE +[gcode_macro PRINT_LAYER_CHANGE] gcode: - TURN_OFF_HEATERS - PARK - CANCEL_PRINT_BASE - - -[gcode_macro PROBE] -description: Override PROBE and make sure we're over the bed -rename_existing: PROBE_BASE -gcode: - {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} - {% if printer.toolhead.position.y|float > 270 %} - G0 Y270 - {% endif %} - {% if P %} - PROBE_BASE - {% else %} - {action_respond_info("Probe not attached")} - {% endif %} - - -[gcode_macro PROBE_CALIBRATE] -description: Override PROBE_CALIBRATE and make sure we're over the bed -rename_existing: PROBE_CALIBRATE_BASE -gcode: - {%- if printer.toolhead.position.y|float > 270 -%} - G0 Y270 - {%- endif -%} - PROBE_CALIBRATE_BASE + {% set layer=params.LAYER|default(0)|int %} + {% set layer_z=params.LAYER_Z|default(0) %} + {% set total_layer_count=params.TOTAL_LAYER_COUNT|default(0) %} + M117 > layer {layer+1}/{total_layer_count} {layer_z}mm diff --git a/z_calibration/probing.cfg b/macros/probe.cfg similarity index 71% rename from z_calibration/probing.cfg rename to macros/probe.cfg index beba31c..8fd6b41 100644 --- a/z_calibration/probing.cfg +++ b/macros/probe.cfg @@ -1,96 +1,216 @@ ##################################################################### -# Mag Probe +# Macros for mag probe +# - ATTACH_PROBE +# - DETACH_PROBE +# - GET_PROBE_STATUS +# - QUERY_PROBE +# - PROBE +# - PROBE_ABORT +# - PROBE_ACCURACY +# - PROBE_ACCEPT +# - PROBE_CALIBRATE +# - SET_PROBE_STATUS +# - _ATTACH_PROBE +# - _DOCK_PROBE +# - _MAG_PROBE +# - _PROBE_ACTION +# - _Z_MOVE_CHECK ##################################################################### -# defined in printer.cfg - -##################################################################### -# Gantry Adjustment Routines -##################################################################### -[quad_gantry_level] -## Gantry Corners for 300mm Build -gantry_corners: - -60,-10 - 360,370 -# Probe points for 300m Build -points: - 50,25 - 50,225 - 250,225 - 250,25 -speed: 300 -horizontal_move_z: 10 -retries: 5 -retry_tolerance: 0.007 -max_adjust: 10 -##################################################################### -# Macros -##################################################################### -[gcode_macro QUAD_GANTRY_LEVEL] -description: Level a flying gantry to a stationary bed -rename_existing: QUAD_GANTRY_LEVEL_BASE -gcode: - ##### get user defines ##### - {% set park_pos = printer['gcode_macro _USER_VARIABLE'].park_bed %} - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|float %} - ##### get toolhead position ##### - {% set act_z = printer.toolhead.position.z|float %} - ##### set default ##### - {% set park = params.PARK|default('true') %} - ##### end of definitions ##### - # home all axes if not already - {% if "xyz" not in printer.toolhead.homed_axes %} - _CG28 - {% endif %} - SAVE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL - _SET_ACC VAL=HOME - _SET_CURRENT VAL=HOME - _CG28 RESET_SETTINGS=false - {% if act_z < z_hop %} - G1 Z{z_hop} F900 ; move head up to insure Probe is not triggered in error case - {% endif %} - ATTACH_PROBE - QUAD_GANTRY_LEVEL_BASE - {% if params.CALIBRATE|default('false') == 'true' %} - CALIBRATE_Z RESET_SETTINGS=false - {% else %} - DETACH_PROBE - {% endif %} - #G28 Z - {% if params.RESET_SETTINGS|default('true') == 'true' %} - _SET_CURRENT - _SET_ACC - {% endif %} - {% if park|lower == 'true' %} - G90 - G0 Z{park_pos[2]} F1800 ; move nozzle to z high first - G0 X{park_pos[0]} Y{park_pos[1]} F18000 ; home to get toolhead in the middle - {% endif %} - RESTORE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL +## ATTACH_PROBE [gcode_macro ATTACH_PROBE] description: Attaching the MagProbe if not already attached gcode: _MAG_PROBE ACTION=ATTACH _MAG_PROBE ACTION=CHECK_ATTACH + +## DETACH_PROBE [gcode_macro DETACH_PROBE] description: Dock the MagProbe if not already docked gcode: _MAG_PROBE ACTION=DOCK _MAG_PROBE ACTION=CHECK_DOCK - + + +## GET_PROBE_STATUS [gcode_macro GET_PROBE_STATUS] description: Prints the current MagProbe state, valid probe states are UNKNOWN, ATTACHED and DOCKED gcode: _MAG_PROBE ACTION=GET_STATUS RESPOND=1 - + +## QUERY_PROBE +[gcode_macro QUERY_PROBE] +description: Return the status of the z-probe and store ID +rename_existing: _QUERY_PROBE_BASE +variable_id: 0 +gcode: + {% set id = params.ID|default(0) %} ; call id 0 means invalid + _QUERY_PROBE_BASE + SET_GCODE_VARIABLE MACRO=QUERY_PROBE VARIABLE=id VALUE={id} + + +## PROBE +[gcode_macro PROBE] +description: Probe Z-height at current XY position and dock/undock MagProbe +rename_existing: _PROBE_BASE +gcode: + ##### get new parameter. ##### + {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking + ##### get user defines ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + # as we need to return to the position with the probe we need to be at least at z_min + G90 ; absolute positioning + {% if act_z < z_min %} + {action_respond_info("PROBE: High must be above %.2f" % z_min)} + G1 Z{z_min} F900 ; move head up + {% endif %} + M400 ; get the buffer cleared first + SAVE_GCODE_STATE NAME=STATE_PROBE + ATTACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} + {% if printer.toolhead.position.y|float > 270 %} + G0 Y270 + {% endif %} + _PROBE_BASE {get_params|join(" ")} + G1 Z{z_min} F900 ; move head up to remove trigger + {% if dock == 1 %} + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} + {% endif %} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + + +## PROBE_ABORT +[gcode_macro PROBE_ABORT] +description: Abort manual Z probing tool for Probe and dock MagProbe +variable_caller: 'unknown' +variable_absolute_coordinates: False +gcode: + ##### get user defines ##### + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### end of definitions ##### + {% if caller|lower|string == 'calib' %} + ABORT + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' + {% else %} + {action_respond_info("PROBE_ABORT: Executed while PROBE_CALIBRATE is not running")} + {% endif %} + + +## PROBE_ACCURACY +[gcode_macro PROBE_ACCURACY] +description: Probe Z-height accuracy at current XY position and dock/undock MagProbe +rename_existing: _PROBE_ACCURACY_BASE +gcode: + ##### get new parameter. ##### + {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking + ##### get user defines ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + # as we need to return to the position with the probe we need to be at least at z_min + G90 ; absolute positioning + {% if act_z < z_min %} + {action_respond_info("PROBE_ACCURACY: High must be above %.2f" % z_min)} + G1 Z{z_min} F900 ; move head up + {% endif %} + M400 ; get the buffer cleared first + SAVE_GCODE_STATE NAME=STATE_PROBE_ACCURACY + ATTACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} + _PROBE_ACCURACY_BASE {get_params|join(" ")} + {% if dock == 1 %} + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} + {% endif %} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + + +## PROBE_ACCEPT +[gcode_macro PROBE_ACCEPT] +description: Accept the current Z position for Probe and dock MagProbe +gcode: + ##### get variables from ABORT ##### + {% set caller = printer['gcode_macro PROBE_ABORT'].caller %} + {% set absolute_coordinates = printer['gcode_macro PROBE_ABORT'].absolute_coordinates %} + ##### get user defines ##### + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### end of definitions ##### + {% if caller|lower|string == 'calib' %} + ACCEPT + DETACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} + {% if absolute_coordinates == 'false' %} G91 {% endif %} + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' + {% else %} + {action_respond_info("PROBE_ACCEPT: Executed while PROBE_CALIBRATE is not running")} + {% endif %} + + + + +## PROBE_CALIBRATE +[gcode_macro PROBE_CALIBRATE] +description: Calibrate the probes z_offset and undock MagProbe +rename_existing: _PROBE_CALIBRATE_BASE +gcode: + ##### get user defines ##### + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} + ##### get params and prepare to send them to the base macro ##### + {% set get_params = [] %} + {% for key in params %} + {% set get_params = get_params.append(key + "=" + params[key]) %} + {% endfor %} + ##### end of definitions ##### + # as we need to return to the position with the probe we need to be at least at z_min + G90 ; absolute positioning + {% if act_z < z_min %} + {action_respond_info("PROBE_CALIBRATE: High must be above %.2f" % z_min)} + G1 Z{z_min} F900 ; move head up + {% endif %} + M400 ; get the buffer cleared first + SAVE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE + ATTACH_PROBE + RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"calib"' + SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=absolute_coordinates VALUE='"{absolute_coordinates}"' + _PROBE_CALIBRATE_BASE {get_params|join(" ")} + + +## SET_PROBE_STATUS [gcode_macro SET_PROBE_STATUS] description: Manually specify MagProbe status, valid probe states are UNKNOWN, ATTACHED and DOCKED variable_state: 'unknown' gcode: - {% if 'STATE' in params|upper and + {% if 'STATE' in params|upper and (params.STATE|lower == 'unknown' or params.STATE|lower == 'attached' or params.STATE|lower == 'docked') %} SET_GCODE_VARIABLE MACRO=SET_PROBE_STATUS VARIABLE=state VALUE='"{params.STATE|lower}"' SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=state VALUE='"{params.STATE|lower}"' @@ -98,10 +218,85 @@ gcode: {% set state = params.STATE|default('none') %} {action_raise_error("Invalid probe state: %s. Valid probe states are [UNKNOWN, ATTACHED, DOCKED]" % state|upper)} {% endif %} - -##################################################################### -# Helper Macros -##################################################################### + + +## _ATTACH_PROBE +[gcode_macro _ATTACH_PROBE] +description: Helper: Attach MagProbe +gcode: + ##### Get user defines ##### + {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} + {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} + {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} + {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} + {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} + {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} + ##### get toolhead position ##### + {% set act_z = printer.toolhead.position.z|float %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=STATE_ATTACH_PROBE + SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored + G90 ; absolute positioning + {% if act_z < z_min %} + G0 Z{z_min} F1500 ; move head up + {% endif %} + + ##### gantry dock: + G0 X{undock_x} Y{undock_y} F{t_speed} ; move next to mag-probe + G0 X{dock_x} F{d_speed} ; move sideways to attach probe + G0 Y{dock_y} F{d_speed} ; move out of holder + + RESTORE_GCODE_STATE NAME=STATE_ATTACH_PROBE + + +## _DOCK_PROBE +[gcode_macro _DOCK_PROBE] +description: Helper: Dock MagProbe +gcode: + ##### Get user defines ##### + {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} + {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} + {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} + {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} + {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} + {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} + {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} + {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} + ##### get toolhead position ##### + {% set act_z = printer.toolhead.position.z|float %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=STATE_DOCK_PROBE + SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored + G90 ; absolute positioning + {% if act_z < z_min %} + G0 Z{z_min} F900 ; move head up + {% endif %} + + ################################################################### + # !!! Caution !!! + # + # Adapt for your needs if needed !! + ################################################################### + + ##### Example for a bed dock: + #G0 X{dock_x} Y{dock_y} F{t_speed} ; move to mag-probe + #G0 Z{dock_z} F1500 FORCE ; move down to probe + #G0 Y{undock_y} F{d_speed} ; move into the holder + #G0 Z{undock_z} F1500 ; move upwards to remove probe + + ##### Example for a gantry dock: + G0 X{dock_x} Y{dock_y} F{t_speed} ; move in front of mag-probe + G0 Y{undock_y} F{d_speed} ; move into the holder + G0 X{undock_x} F{d_speed} ; move sideways to remove probe + + RESTORE_GCODE_STATE NAME=STATE_DOCK_PROBE + + +## MAG_PROBE # QUERY_PROBE must run direct before _PROBE_ACTION # that relation is insured by the caller id [gcode_macro _MAG_PROBE] @@ -127,6 +322,8 @@ gcode: SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=id VALUE={id} M400 + +## _PROBE_ACTION [gcode_macro _PROBE_ACTION] description: Helper: Perform MagProbe action gcode: @@ -196,164 +393,8 @@ gcode: {action_raise_error("MagProbe: action not defined")} {% endif %} -[gcode_macro _ATTACH_PROBE] -description: Helper: Attach MagProbe -gcode: - ##### Get user defines ##### - {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} - {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} - {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} - {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} - {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} - {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} - ##### get toolhead position ##### - {% set act_z = printer.toolhead.position.z|float %} - ##### end of definitions ##### - SAVE_GCODE_STATE NAME=STATE_ATTACH_PROBE - SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored - G90 ; absolute positioning - {% if act_z < z_min %} - G0 Z{z_min} F1500 ; move head up - {% endif %} - ################################################################### - # !!! Caution !!! - # - # Adapt for your needs if needed !! - ################################################################### - - ##### Example for a bed dock: - #G0 X{undock_x} Y{undock_y} F{t_speed} ; move to mag-probe - #G0 Z{dock_z} F1500 FORCE ; move down to probe - #G0 Y{dock_y} F{d_speed} ; move out of holder - #G0 Z{undock_z} F1500 ; move head up - - ##### Example for a gantry dock: - G0 X{undock_x} Y{undock_y} F{t_speed} ; move next to mag-probe - G0 X{dock_x} F{d_speed} ; move sideways to attach probe - G0 Y{dock_y} F{d_speed} ; move out of holder - - RESTORE_GCODE_STATE NAME=STATE_ATTACH_PROBE - -[gcode_macro _DOCK_PROBE] -description: Helper: Dock MagProbe -gcode: - ##### Get user defines ##### - {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} - {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} - {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} - {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} - {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} - {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} - ##### get toolhead position ##### - {% set act_z = printer.toolhead.position.z|float %} - ##### end of definitions ##### - SAVE_GCODE_STATE NAME=STATE_DOCK_PROBE - SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored - G90 ; absolute positioning - {% if act_z < z_min %} - G0 Z{z_min} F900 ; move head up - {% endif %} - - ################################################################### - # !!! Caution !!! - # - # Adapt for your needs if needed !! - ################################################################### - - ##### Example for a bed dock: - #G0 X{dock_x} Y{dock_y} F{t_speed} ; move to mag-probe - #G0 Z{dock_z} F1500 FORCE ; move down to probe - #G0 Y{undock_y} F{d_speed} ; move into the holder - #G0 Z{undock_z} F1500 ; move upwards to remove probe - - ##### Example for a gantry dock: - G0 X{dock_x} Y{dock_y} F{t_speed} ; move in front of mag-probe - G0 Y{undock_y} F{d_speed} ; move into the holder - G0 X{undock_x} F{d_speed} ; move sideways to remove probe - - RESTORE_GCODE_STATE NAME=STATE_DOCK_PROBE - -##################################################################### -# Customized standard macros -##################################################################### -# -# !!! Caution !!! -# -# PROBE_CALIBRATE can not dock the Magprobe automatically, as it -# start's a scripting process we need to stop at the execution -# of the base macro. Use -# - PROBE_ABORT -# - PROBE_ACCEPT -# instead of the original ABORT and ACCEPT to also dock the probe -# -##################################################################### -# -# If your probe needs a Z move for attach/detach use either -# G0 .... FORCE -# G1 .... FORCE -# -##################################################################### -[gcode_macro G0] -description: Move gcode that prevents moves lower than the limit when probe attached -rename_existing: G0.1 -gcode: - ##### set manual override ##### - {% if 'FORCE' in params|upper %} - {% set force = 1 %} - {% else %} - {% set force = 0 %} - {% endif %} - ##### get params ##### - {% set get_params = [] %} - {% for key in params %} - {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endif %} - {% endfor %} - ##### add caller ##### - {% set tmp = get_params.append("CALLER=G0") %} ;hack to append list objects outside of a loop - ##### add force ##### - {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop - ##### end of definition ##### - {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} - _MAG_PROBE ACTION=GET_STATUS RESPOND=0 - {% endif %} - _Z_MOVE_CHECK {get_params|join(" ")} - -[gcode_macro G1] -description: Move gcode that prevents moves lower than the limit when probe attached -rename_existing: G1.1 -gcode: - ##### set manual override ##### - {% if 'FORCE' in params|upper %} - {% set force = 1 %} - {% else %} - {% set force = 0 %} - {% endif %} - ##### get params ##### - {% set get_params = [] %} - {% for key in params %} - {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endif %} - {% endfor %} - ##### add caller ##### - {% set tmp = get_params.append("CALLER=G1") %} ;hack to append list objects outside of a loop - ##### add force ##### - {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop - ##### end of definition ##### - {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} - _MAG_PROBE ACTION=GET_STATUS RESPOND=0 - {% endif %} - _Z_MOVE_CHECK {get_params|join(" ")} - +## _Z_MOVE_CHECK [gcode_macro _Z_MOVE_CHECK] description: Helper: Check limit and perform move gcode: @@ -386,9 +427,9 @@ gcode: {% endif %} ##### decide if a Z move can be executed ##### {% if z_target > z_min or z_act < z_target %} - {% set get_params = get_params.append(key + params[key]) %} + {% set get_params = get_params.append(key + params[key]) %} {% else %} - {action_respond_info("%s: Z Moves lower than %.1fmm not allowed with installed probe" % (caller,z_min))} + {action_respond_info("%s: Z Moves lower than %.1fmm not allowed with installed probe" % (caller,z_min))} {% endif %} {% else %} {action_raise_error("%s: MagProbe state %s not valid" % (caller, probe_state|upper))} @@ -397,171 +438,3 @@ gcode: {% endfor %} ##### end of definitions ##### {caller}.1 {get_params|join(" ")} - -[gcode_macro QUERY_PROBE] -description: Return the status of the z-probe and store ID -rename_existing: QUERY_PROBE_BASE -variable_id: 0 -gcode: - {% set id = params.ID|default(0) %} ; call id 0 means invalid - QUERY_PROBE_BASE - SET_GCODE_VARIABLE MACRO=QUERY_PROBE VARIABLE=id VALUE={id} - -[gcode_macro PROBE_ACCURACY] -description: Probe Z-height accuracy at current XY position and dock/undock MagProbe -rename_existing: PROBE_ACCURACY_BASE -gcode: - ##### get new parameter. ##### - {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking - ##### get user defines ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - # as we need to return to the position with the probe we need to be at least at z_min - G90 ; absolute positioning - {% if act_z < z_min %} - {action_respond_info("PROBE_ACCURACY: High must be above %.2f" % z_min)} - G1 Z{z_min} F900 ; move head up - {% endif %} - M400 ; get the buffer cleared first - SAVE_GCODE_STATE NAME=STATE_PROBE_ACCURACY - ATTACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} - PROBE_ACCURACY_BASE {get_params|join(" ")} - {% if dock == 1 %} - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} - {% endif %} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - -[gcode_macro PROBE] -description: Probe Z-height at current XY position and dock/undock MagProbe -rename_existing: PROBE_BASE -gcode: - ##### get new parameter. ##### - {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking - ##### get user defines ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - # as we need to return to the position with the probe we need to be at least at z_min - G90 ; absolute positioning - {% if act_z < z_min %} - {action_respond_info("PROBE: High must be above %.2f" % z_min)} - G1 Z{z_min} F900 ; move head up - {% endif %} - M400 ; get the buffer cleared first - SAVE_GCODE_STATE NAME=STATE_PROBE - ATTACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} - PROBE_BASE {get_params|join(" ")} - G1 Z{z_min} F900 ; move head up to remove trigger - {% if dock == 1 %} - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} - {% endif %} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - -[gcode_macro PROBE_CALIBRATE] -description: Calibrate the probes z_offset and undock MagProbe -rename_existing: PROBE_CALIBRATE_BASE -gcode: - ##### get user defines ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - # as we need to return to the position with the probe we need to be at least at z_min - G90 ; absolute positioning - {% if act_z < z_min %} - {action_respond_info("PROBE_CALIBRATE: High must be above %.2f" % z_min)} - G1 Z{z_min} F900 ; move head up - {% endif %} - M400 ; get the buffer cleared first - SAVE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE - ATTACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"calib"' - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=absolute_coordinates VALUE='"{absolute_coordinates}"' - PROBE_CALIBRATE_BASE {get_params|join(" ")} - -[gcode_macro BED_MESH_CALIBRATE] -description: Perform QGL and bed mesh leveling -rename_existing: BED_MESH_CALIBRATE_BASE -gcode: - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - _CG28 - BED_MESH_CLEAR - ## check if QGL was already executed - {% if printer.quad_gantry_level.applied|lower == 'false' %} - QUAD_GANTRY_LEVEL PARK=false - {% endif %} - ATTACH_PROBE - BED_MESH_CALIBRATE_BASE {get_params|join(" ")} - DETACH_PROBE - -[gcode_macro PROBE_ABORT] -description: Abort manual Z probing tool for Probe and dock MagProbe -variable_caller: 'unknown' -variable_absolute_coordinates: False -gcode: - ##### get user defines ##### - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### end of definitions ##### - {% if caller|lower|string == 'calib' %} - ABORT - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' - {% else %} - {action_respond_info("PROBE_ABORT: Executed while PROBE_CALIBRATE is not running")} - {% endif %} - -[gcode_macro PROBE_ACCEPT] -description: Accept the current Z position for Probe and dock MagProbe -gcode: - ##### get variables from ABORT ##### - {% set caller = printer['gcode_macro PROBE_ABORT'].caller %} - {% set absolute_coordinates = printer['gcode_macro PROBE_ABORT'].absolute_coordinates %} - ##### get user defines ##### - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### end of definitions ##### - {% if caller|lower|string == 'calib' %} - ACCEPT - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' - {% else %} - {action_respond_info("PROBE_ACCEPT: Executed while PROBE_CALIBRATE is not running")} - {% endif %} - diff --git a/z_calibration/homing.cfg b/macros/z_calibration.cfg similarity index 72% rename from z_calibration/homing.cfg rename to macros/z_calibration.cfg index 9014df5..00e8bb6 100644 --- a/z_calibration/homing.cfg +++ b/macros/z_calibration.cfg @@ -1,68 +1,76 @@ ##################################################################### -# Homing definition +# Macros for z-calibration +# - CALIBRATE_Z +# - _CG28 +# - _SET_CURRENT +# - _SET_ACC ##################################################################### -[homing_override] -axes: z -set_position_z: 0 -gcode: - ##### get user defines ##### - # use -10 as default to insure it error in case the variable is not existing - {% set z_endstop_x = printer['gcode_macro _USER_VARIABLE'].z_endstop_x|default(-10) %} - {% set z_endstop_y = printer['gcode_macro _USER_VARIABLE'].z_endstop_y|default(-10) %} - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop %} - ##### end of definitions ##### - SAVE_GCODE_STATE NAME=HOMING_state - ## reduce current of Z motors + +## CALIBRATE_Z +[gcode_macro CALIBRATE_Z] +description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe +rename_existing: _CALIBRATE_Z_BASE +gcode: + ##### get user defines ##### + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} + ##### get toolhead parameters ##### + {% set act_z = printer.gcode_move.gcode_position.z|float %} + #### end of definitions ##### + ## reduce current of motors _SET_ACC VAL=HOME _SET_CURRENT VAL=HOME - - G91 ; relative positioning - # G0 Z10 F1500 - G0 Z10 F1300 - G90 ; absolute positioning - - # Home X and Y only for G28 or G28 XYZ - {% if 'Z' in params %} - {% if "x" not in printer.toolhead.homed_axes %} - G28 X - {% endif %} - {% if "y" not in printer.toolhead.homed_axes %} - G28 Y - {% endif %} - {% else %} - G28 X Y - {% endif %} - - ## XY Location of the Z Endstop Switch - G0 X{z_endstop_x} Y{z_endstop_y} F12000 - G28 Z ; home Z - # G0 Z2 F1500 ; move up - G0 Z2 F1300 ; move up - - ## return to org current settings + _CG28 RESET_SETTINGS=false + {% if act_z < z_hop %} + G90 ; absolute positioning + {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} + G1 Z{z_hop} F900 ; move head up + {% endif %} + #ATTACH_PROBE ; if not using start_gcode + _CALIBRATE_Z_BASE + #DETACH_PROBE ; if not using end_gcode {% if params.RESET_SETTINGS|default('true') == 'true' %} - DETACH_PROBE + ## return to org current settings _SET_CURRENT _SET_ACC {% endif %} - # Lift Z - # G0 Z{z_hop} F1800 - G0 Z{z_hop} F1300 - RESTORE_GCODE_STATE NAME=HOMING_state - -##################################################################### -# Macros -##################################################################### -## conditional home +## _CG28 [gcode_macro _CG28] +description: conditional home gcode: {% if "xyz" not in printer.toolhead.homed_axes %} G28 RESET_SETTINGS={ params.RESET_SETTINGS|default('true') } {% endif %} +## _SET_ACC +[gcode_macro _SET_ACC] +description: Helper: Set accel and accel_to_decel value +variable_last_val: 'CONFIG' +gcode: + ##### set default value ##### + {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_acc|int %} + {% set val = params.VAL|default('CONFIG') %} + {% set respond = params.RESPOND|default(default_respond)|int %} + {% if val == 'HOME' %} + {% set accel = printer['gcode_macro _USER_VARIABLE'].home_accel %} + {% set accel_to_decel = printer['gcode_macro _USER_VARIABLE'].home_accel|int / 2 %} + {% else %} + {% set accel = printer.configfile.settings.printer.max_accel %} + {% set accel_to_decel = printer.configfile.settings.printer.max_accel_to_decel %} + {% endif %} + ##### end of definition ##### + {% if val != last_val %} + SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{val}"' + {% if respond == 1 %} + {action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))} + {% endif %} + SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel} RESPOND=0 + {% endif %} + + +## _SET_CURRENT [gcode_macro _SET_CURRENT] description: Helper: Set Z-drive motor current variable_last_val: 'CONFIG' @@ -103,27 +111,3 @@ gcode: SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} M400 {% endif %} - -[gcode_macro _SET_ACC] -description: Helper: Set accel and accel_to_decel value -variable_last_val: 'CONFIG' -gcode: - ##### set default value ##### - {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_acc|int %} - {% set val = params.VAL|default('CONFIG') %} - {% set respond = params.RESPOND|default(default_respond)|int %} - {% if val == 'HOME' %} - {% set accel = printer['gcode_macro _USER_VARIABLE'].home_accel %} - {% set accel_to_decel = printer['gcode_macro _USER_VARIABLE'].home_accel|int / 2 %} - {% else %} - {% set accel = printer.configfile.settings.printer.max_accel %} - {% set accel_to_decel = printer.configfile.settings.printer.max_accel_to_decel %} - {% endif %} - ##### end of definition ##### - {% if val != last_val %} - SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{val}"' - {% if respond == 1 %} - {action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))} - {% endif %} - SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel} RESPOND=0 - {% endif %} diff --git a/printer.cfg b/printer.cfg index 7749743..de2d4d4 100644 --- a/printer.cfg +++ b/printer.cfg @@ -32,6 +32,25 @@ restart_method: command ##-------------------------------------------------------------------- +[gcode_macro zc] +gcode: + {% set z_run = params.CUR|default(0.4)|float %} + {% set z_hold = z_run %} + {action_respond_info("zc: setting zcurrent to %.2f" % z_run)} + SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} + + +[gcode_macro zm] +gcode: + {% set speed = params.SPEED|default(300)|int %} + {action_respond_info("moving with F%d" % speed)} + G0 Z30 F{speed} + G0 Z10 F{speed} + + [printer] kinematics: corexy max_velocity: 300 @@ -51,7 +70,7 @@ square_corner_velocity: 5.0 ##################################################################### [include fluidd.cfg] -[include macros.cfg] +[include macros/_init.cfg] [include neopixel.cfg] [include fans.cfg] [include input_shaper.cfg] @@ -75,7 +94,7 @@ endstop_pin: PG6 position_min: 0 position_endstop: 300 position_max: 300 -homing_speed: 30 # Max 100 +homing_speed: 30 # speed: mm/sec, feedrate: mm/min homing_retract_dist: 5 homing_positive_dir: true @@ -96,7 +115,7 @@ rotation_distance: 40 microsteps: 16 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 -position_min: 15 # Camera +position_min: 0 position_endstop: 305 position_max: 305 homing_speed: 30 # Max 100 @@ -125,16 +144,13 @@ rotation_distance: 40 gear_ratio: 80:16 microsteps: 16 endstop_pin: PG10 -## 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 +## actual_position = measured_position_endstop - position_endstop +position_endstop: 0.5 position_max: 290 position_min: -5 -homing_speed: 11.0 # speed: mm/sec, feedrate: mm/min -second_homing_speed: 3 -homing_retract_dist: 3 +homing_speed: 13.0 # speed: mm/sec, feedrate: mm/min +second_homing_speed: 4 +homing_retract_dist: 13 [tmc2209 stepper_z] uart_pin: PC6 @@ -276,7 +292,7 @@ max_temp: 120 pin: ^PG11 x_offset: 0 y_offset: 25.0 -#z_offset: 0 +z_offset: 10 speed: 6 lift_speed: 11 samples: 5 @@ -329,7 +345,7 @@ timeout: 1800 ## replaced with homing_override in klicky-probe.cfg # [safe_z_home] # ## XY Location of the Z Endstop Switch -# home_xy_position: 208, 305 +# home_xy_position: 205, 305 # speed: 100 # z_hop: 10 # z_hop_speed: 25 @@ -356,9 +372,9 @@ points: 50,225 250,225 250,40 -speed: 100 +speed: 150 horizontal_move_z: 15 -retries: 8 +retries: 5 retry_tolerance: 0.0075 max_adjust: 10 @@ -380,11 +396,11 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.002500, -0.015000, -0.002500, -0.005000, -0.045000 -#*# -0.000000, -0.012500, 0.002500, -0.005000, -0.040000 -#*# -0.002500, 0.002500, 0.000000, 0.012500, -0.032500 -#*# -0.012500, -0.007500, 0.025000, 0.017500, 0.000000 -#*# 0.057500, 0.072500, 0.042500, 0.075000, 0.027500 +#*# -0.032500, 0.002500, 0.015000, 0.015000, -0.042500 +#*# -0.032500, -0.015000, 0.002500, 0.002500, -0.055000 +#*# -0.040000, -0.015000, 0.000000, 0.000000, -0.060000 +#*# -0.030000, -0.022500, 0.010000, 0.010000, -0.055000 +#*# 0.075000, 0.015000, 0.052500, 0.055000, -0.007500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic @@ -395,9 +411,3 @@ max_adjust: 10 #*# max_y = 280.0 #*# mesh_x_pps = 2 #*# max_x = 260.0 -#*# -#*# [stepper_z] -#*# position_endstop = 0.817 -#*# -#*# [probe] -#*# z_offset = 7.660 diff --git a/webcam.txt b/webcam.txt index d489cf7..8a90217 100644 --- a/webcam.txt +++ b/webcam.txt @@ -53,7 +53,8 @@ camera_usb_options="-r 800x600 -f 10" # Defaults to 10fps # # camera_raspi_options="-fps 10" -camera_raspi_options="-rot 180 -x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" +# camera_raspi_options="-rot 180 -x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" +camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" ### Configuration of camera HTTP output # diff --git a/z_calibration.cfg b/z_calibration.cfg index 416f33d..c4b7d38 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -4,21 +4,21 @@ [gcode_macro _USER_VARIABLE] description: Helper: Contains User defined printer variables ##### Homing and general movement ##### -variable_z_endstop_x: 208 ; z Endstop x position inside right profile +variable_z_endstop_x: 205 ; z Endstop x position inside right profile variable_z_endstop_y: 305 ; z Endstop y position -variable_z_hop: 15.0 ; z hop for moves e.g homing -variable_xy_home_current: 0.4 ; reduced homing current for x and y -variable_z_home_current: 0.3 ; reduced homing current for z +variable_z_hop: 10.0 ; z hop for moves e.g homing +variable_xy_home_current: 0.5 ; reduced homing current for x and y +variable_z_home_current: 0.4 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### -variable_probe_dock_x: 148 ; x toolhead position before docking probe +variable_probe_dock_x: 145 ; x toolhead position before docking probe variable_probe_dock_y: 285 ; y toolhead position before docking probe -variable_probe_dock_z: 15 ; z toolhead position before docking probe (only for bed dock) +variable_probe_dock_z: 10 ; z toolhead position before docking probe (only for bed dock) variable_probe_undock_x: 200 ; x toolhead position after docking probe variable_probe_undock_y: 305 ; y toolhead position after docking probe -variable_probe_undock_z: 15 ; z toolhead position after docking probe (only for bed dock) -variable_probe_z_min: 15 ; z minimum height to avoid crash -variable_probe_travel_speed: 200 ; dock moves travel speed +variable_probe_undock_z: 10 ; z toolhead position after docking probe (only for bed dock) +variable_probe_z_min: 10 ; z minimum height to avoid crash +variable_probe_travel_speed: 100 ; dock moves travel speed variable_probe_dock_speed: 100 ; dock speed for attach/dock ##### Respond defaults ##### variable_respond_set_current: 0 ; default of RESPOND if not set in the call @@ -28,21 +28,14 @@ variable_respond_probe_action: 1 ; default of RESPOND if not set in the cal variable_park_bed: [280,280,30] ; different park position gcode: -##################################################################### -# Includes -##################################################################### -[include z_calibration/macros.cfg] -[include z_calibration/homing.cfg] -[include z_calibration/probing.cfg] ##################################################################### # Z Calibration ##################################################################### - [z_calibration] # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. -probe_nozzle_x: 208 +probe_nozzle_x: 205 probe_nozzle_y: 305 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. @@ -59,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.73 +switch_offset: 0.75 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. @@ -99,66 +92,73 @@ max_deviation: 1.0 # This is to get faster down and the result is not recorded as a # probing sample. The default is false. probing_first_fast: true -# If true, the first probing is done faster by the probing speed. -# This is to get faster down and the result is not recorded as a -# probing sample. The default is false. -start_gcode: DETACH_PROBE # A list of G-Code commands to execute prior to each calibration command. -# See docs/Command_Templates.md for G-Code format. This can be used to -# attach the probe. -before_switch_gcode: ATTACH_PROBE +# See docs/Command_Templates.md for G-Code format. +# This can be used to attach the probe. +start_gcode: ATTACH_PROBE # A list of G-Code commands to execute prior to each probing on the -# mag-probe. See docs/Command_Templates.md for G-Code format. This can be -# used to attach the probe after probing on the nozzle and before probing -# on the mag-probe. -end_gcode: DETACH_PROBE +# mag-probe. See docs/Command_Templates.md for G-Code format. +# This can be used to attach the probe after probing on the nozzle and +# before probing on the mag-probe. +before_switch_gcode: ATTACH_PROBE # A list of G-Code commands to execute after each calibration command. # See docs/Command_Templates.md for G-Code format. This can be used to # detach the probe afterwards. - -##################################################################### -## With these settings, the probe is attached after probing the nozzle -## and before probing the switch !! -##################################################################### -## Otherwise, starting with the probe attached would be like this: -start_gcode: ATTACH_PROBE -#before_switch_gcode: ATTACH_PROBE end_gcode: DETACH_PROBE -##################################################################### + ##################################################################### -# Macros +# Homing definition ##################################################################### - -################################################################### -# !!! Caution !!! -# -# This Macro is only needed if not using the start/end_gcode -# properties to attach/detach the probe -################################################################### -[gcode_macro CALIBRATE_Z] -description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe -rename_existing: CALIBRATE_Z_BASE +[homing_override] +axes: z +set_position_z: 0 gcode: - ##### get user defines ##### - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - #### end of definitions ##### - ## reduce current of motors + ##### get user defines ##### + # use -10 as default to insure it error in case the variable is not existing + {% set z_endstop_x = printer['gcode_macro _USER_VARIABLE'].z_endstop_x|default(-10) %} + {% set z_endstop_y = printer['gcode_macro _USER_VARIABLE'].z_endstop_y|default(-10) %} + {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=HOMING_state + + ## reduce current of Z motors _SET_ACC VAL=HOME _SET_CURRENT VAL=HOME - _CG28 RESET_SETTINGS=false - {% if act_z < z_hop %} - G90 ; absolute positioning - {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} - G1 Z{z_hop} F900 ; move head up + + G91 ; relative positioning + G0 Z10 F1500 ; move z 10 up + G90 ; absolute positioning + + # Home X and Y only for G28 or G28 XYZ + {% if 'Z' in params %} + {% if "x" not in printer.toolhead.homed_axes %} + G28 X + {% endif %} + {% if "y" not in printer.toolhead.homed_axes %} + G28 Y + {% endif %} + {% else %} + G28 X Y {% endif %} - #ATTACH_PROBE - CALIBRATE_Z_BASE - #DETACH_PROBE + + ## XY Location of the Z Endstop Switch + # TODO check speed + # G0 X{z_endstop_x} Y{z_endstop_y} F12000 + G0 X{z_endstop_x} Y{z_endstop_y} F6000 + G28 Z ; home Z + G0 Z2 F1500 ; move up + + ## return to org current settings {% if params.RESET_SETTINGS|default('true') == 'true' %} - ## return to org current settings + DETACH_PROBE _SET_CURRENT _SET_ACC {% endif %} + + # Lift Z + # TODO check speed + # G0 Z{z_hop} F1800 + G0 Z{z_hop} F1300 + + RESTORE_GCODE_STATE NAME=HOMING_state diff --git a/z_calibration/README.md b/z_calibration/README.md deleted file mode 100644 index 9fc2119..0000000 --- a/z_calibration/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Sample Configuration - -This are some parts of my V2 300 configurations describing all the mag-probe, probing -and QGL stuff. - -These configurations are the essence of the overall configuration from -[zellneralex](https://github.com/zellneralex/klipper_config/tree/master) -which is really well done !! Have a look if you want to take all of it! - -**CAUTION: Please, don't just copy it - understand and adapt for your needs instead! -Use this on your own risk!** diff --git a/z_calibration/macros.cfg b/z_calibration/macros.cfg deleted file mode 100644 index a823d7e..0000000 --- a/z_calibration/macros.cfg +++ /dev/null @@ -1,48 +0,0 @@ -# ##################################################################### -# # Macros -# ##################################################################### -# [gcode_macro PRINT_START] -# gcode: -# {% set bed_temp = params.BED_TEMP|default(100)|float %} -# {% set extruder_temp = params.EXTRUDER_TEMP|default(220)|float %} -# {% set z_adjust = params.Z_ADJUST|default(0.0)|float %} -# {% set retract = 10 %} -# BED_MESH_CLEAR ; clear mesh -# _CG28 ; Home the printer -# G90 ; Use absolute coordinates -# PARKCENTER ; Move to center -# M117 Heating.. -# _HEATER_ON -# M106 S255 ; set print fan to full speed -# M140 S{bed_temp} ; Start bed heating -# M190 S{bed_temp} ; Wait for bed to reach temperature -# M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature -# M107 ; turn print fan off -# QUAD_GANTRY_LEVEL PARK=false -# M109 S{extruder_temp} ; Set and wait for nozzle to reach temperature -# clean_nozzle ; clean nozzle -# CALIBRATE_Z -# #BED_MESH_PROFILE LOAD=default ; load mesh if needed -# # Adjust the G-Code Z offset with the Z_ADJUST parameter if needed -# #SET_GCODE_OFFSET Z_ADJUST={z_adjust} MOVE=1 -# M117 Intro Line.. -# G90 ; Use absolute coordinates -# G1 Y0 X130 Z5 F12000 ; Move the nozzle to the front and near the bed -# G1 Z0.7 F300 ; Move the nozzle very close to the bed -# G92 E0.0 ; set extruder position to 0 -# G1 E{retract} F3600 ; extrude retract -# G92 E0.0 ; set extruder option to 0 -# G1 X180 E15.0 F500.0 ; intro line -# G92 E0.0 ; set extruder Poisson to 0 -# G1 X174 F6000 ; move away from intro line -# M117 -# -# [gcode_macro PARKCENTER] -# gcode: -# {% set Z = params.Z|default(30)|float %} -# SAVE_GCODE_STATE NAME=PARKCENTER_state -# _CG28 ; Home if not already homed -# G90 ; absolute positioning -# G0 X150 Y150 Z{Z} F12000 ; move to center -# RESTORE_GCODE_STATE NAME=PARKCENTER_state -# From dcc8b554c36b6d69a686b8f354629b9a126b04be Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 2 Nov 2021 14:03:30 +0100 Subject: [PATCH 051/131] v2.4: update clearance with probe --- z_calibration.cfg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/z_calibration.cfg b/z_calibration.cfg index c4b7d38..6d7f749 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -6,18 +6,18 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 205 ; z Endstop x position inside right profile variable_z_endstop_y: 305 ; z Endstop y position -variable_z_hop: 10.0 ; z hop for moves e.g homing +variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.5 ; reduced homing current for x and y variable_z_home_current: 0.4 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### variable_probe_dock_x: 145 ; x toolhead position before docking probe variable_probe_dock_y: 285 ; y toolhead position before docking probe -variable_probe_dock_z: 10 ; z toolhead position before docking probe (only for bed dock) +variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) variable_probe_undock_x: 200 ; x toolhead position after docking probe variable_probe_undock_y: 305 ; y toolhead position after docking probe -variable_probe_undock_z: 10 ; z toolhead position after docking probe (only for bed dock) -variable_probe_z_min: 10 ; z minimum height to avoid crash +variable_probe_undock_z: 12 ; z toolhead position after docking probe (only for bed dock) +variable_probe_z_min: 12 ; z minimum height to avoid crash variable_probe_travel_speed: 100 ; dock moves travel speed variable_probe_dock_speed: 100 ; dock speed for attach/dock ##### Respond defaults ##### @@ -74,6 +74,8 @@ max_deviation: 1.0 # configuration. #position_min: default from "stepper_z:position_min" section. # The moving speed in X and Y. The default is 50 mm/s. +# Clearance +clearance: 12 # speed: 200 # Speed (in mm/s) of the Z axis when lifting the probe between # samples and clearance moves. The default is from the probe's From 6e7400e3568ee22abd46489c823ca75328b4ec8b Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 3 Nov 2021 21:13:25 +0100 Subject: [PATCH 052/131] v2.4: update KlipperScreen --- KlipperScreen.conf | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 9c9139e..be26ab4 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -2,6 +2,10 @@ moonraker_host: 127.0.0.1 moonraker_port: 7125 +[z_calibrate_position] +calibrate_x_position: 150 +calibrate_y_position: 250 + [preheat PLA] bed = 50 extruder = 200 @@ -254,6 +258,7 @@ panel: settings #~# #~# [main] #~# move_speed = 30 +#~# print_sort_dir = date_asc #~# #~# [displayed_macros Printer] #~# g32 = False @@ -266,4 +271,27 @@ panel: settings #~# probe = False #~# resume = False #~# probe_calibrate = False -#~# purge_nozzle = False +#~# dump_warnings = False +#~# dump_parameters = False +#~# dump_settings = False +#~# g0 = False +#~# m900 = False +#~# dump_config = False +#~# get_probe_status = False +#~# probe_abort = False +#~# probe_accept = False +#~# probe_accuracy = False +#~# _set_current = False +#~# _attach_probe = False +#~# query_probe = False +#~# set_probe_status = False +#~# _cg28 = False +#~# _user_variable = False +#~# _set_acc = False +#~# _mag_probe = False +#~# _dock_probe = False +#~# _z_move_check = False +#~# zc = False +#~# _probe_action = False +#~# zm = False +#~# From eed32bf9b79dbcf376fab1a19e22c72f41fb7b7a Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 3 Nov 2021 21:14:49 +0100 Subject: [PATCH 053/131] v2.4: tweak bmc, z-calibration, add mcu-temp, M900 --- macros/print.cfg | 19 ++++++++++----- printer.cfg | 62 +++++++++++++++++++++++++++++------------------ z_calibration.cfg | 20 +++++++-------- 3 files changed, 61 insertions(+), 40 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index 649cd5e..e99d040 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -3,6 +3,7 @@ # - BRUSHIE # - CANCEL_PRINT # - M600 +# - M900 # - PARK # - PAUSE # - PRINT_START @@ -15,15 +16,15 @@ # BRUSHIE [gcode_macro BRUSHIE] gcode: - {% set x0=40 %} - {% set x1=110 %} - {% set y0=305 %} + {% set x0=200 %} + {% set x1=250 %} + {% set y0=306 %} {% set z0=1 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} M117 > brushie brushie brushie G0 Z{z_hop} F1000 # move Z to travel height - G0 X{x0} Y{y0} F5000 # move to x0/y0 + G0 X{x0} Y{y0} F6000 # move to x0/y0 G0 Z{z0} # lower G0 X{x1} # back G0 X{x0} # forth @@ -52,6 +53,11 @@ gcode: M117 > change filament RESTORE_GCODE_STATE NAME=M600_state +[gcode_macro M900] +description: Set pressure advance +gcode: + SET_PRESSURE_ADVANCE ADVANCE={params.K|default(0)} + # PARK [gcode_macro PARK] @@ -111,14 +117,14 @@ gcode: {% set BED=params.BED|default(100)|int %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set CHAMBER=params.CHAMBER|default(0)|int %} + {% set QGL=params.QGL|default(1)|int %} {% set BMC=params.BMC|default(0)|int %} - {% set QGL=params.QGL|default(0)|int %} {% set PURGE=params.PURGE|default(1)|int %} {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} # TODO: ERCF {% set ERCF=params.ERCF|default(0) %} - {action_respond_info("starting print BED=%d, EXTRUDER=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, BMC, PURGE, SOAK, Z_ADJUST))} + {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, CHAMBER, QGL, BMC, PURGE, SOAK, Z_ADJUST))} M117 > configuring SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 G4 P2000 @@ -167,6 +173,7 @@ gcode: {% endif %} M117 > starting + SET_PRESSURE_ADVANCE ADVANCE=0.05 SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 diff --git a/printer.cfg b/printer.cfg index de2d4d4..72fb61d 100644 --- a/printer.cfg +++ b/printer.cfg @@ -117,7 +117,7 @@ full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 position_endstop: 305 -position_max: 305 +position_max: 306 homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -149,8 +149,8 @@ position_endstop: 0.5 position_max: 290 position_min: -5 homing_speed: 13.0 # speed: mm/sec, feedrate: mm/min -second_homing_speed: 4 -homing_retract_dist: 13 +second_homing_speed: 3 +homing_retract_dist: 3 [tmc2209 stepper_z] uart_pin: PC6 @@ -291,15 +291,15 @@ max_temp: 120 ## Microswitch probe pin: ^PG11 x_offset: 0 -y_offset: 25.0 -z_offset: 10 -speed: 6 -lift_speed: 11 +y_offset: 30 +z_offset: 12 +speed: 3 +lift_speed: 25 samples: 5 samples_result: median -sample_retract_dist: 3.0 +sample_retract_dist: 2.0 samples_tolerance: 0.01 -samples_tolerance_retries: 3 +samples_tolerance_retries: 5 ##################################################################### @@ -326,6 +326,13 @@ temperature1: 25 resistance1: 10000 beta: 3950 +[temperature_sensor MCU] +sensor_type: temperature_mcu +sensor_mcu: mcu +min_temp: 0 +max_temp: 100 +# gcode_id: C + [temperature_sensor chamber] sensor_type: chamber @@ -334,7 +341,7 @@ min_temp: 0 max_temp: 100 gcode_id: C -[temperature_sensor rpi] +[temperature_sensor RPI] sensor_type: temperature_host min_temp: 0 max_temp: 100 @@ -345,35 +352,42 @@ timeout: 1800 ## replaced with homing_override in klicky-probe.cfg # [safe_z_home] # ## XY Location of the Z Endstop Switch -# home_xy_position: 205, 305 +# home_xy_position: 94.5, 305 # speed: 100 # z_hop: 10 # z_hop_speed: 25 [bed_mesh] speed: 500 -horizontal_move_z: 15 -mesh_min: 40,60 -mesh_max: 260,280 -fade_start: 0.6 -fade_end: 10 -probe_count: 5,5 +horizontal_move_z: 12 +# 40, 40 --> 40 + probe.x_offset, 40 + probe.y_offset +mesh_min: 40, 70 +# 260, 260 --> 260 + probe.x_offset, 260 + probe.y_offset +mesh_max: 260,290 +# fade_start: 1 +# fade_end: 10 +# fade_target: 0 algorithm: bicubic # relative_reference_index = ((x points * y points) - 1) / 2 -relative_reference_index: 12 +# 3x3: 4, 5x5: 12, 7x7: 24, 9x9: 40 +# probe_count: 3,3 +# relative_reference_index: 4 +# probe_count: 5,5 +# relative_reference_index: 9 +probe_count: 9,9 +relative_reference_index: 40 [quad_gantry_level] -## Use QUAD_GANTRY_LEVEL to level a gantry. gantry_corners: -60,-10 360,370 points: - 50,40 - 50,225 - 250,225 - 250,40 + 40,40 + 40,260 + 260,260 + 260,40 speed: 150 -horizontal_move_z: 15 +horizontal_move_z: 12 retries: 5 retry_tolerance: 0.0075 max_adjust: 10 diff --git a/z_calibration.cfg b/z_calibration.cfg index 6d7f749..798d04e 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -4,17 +4,17 @@ [gcode_macro _USER_VARIABLE] description: Helper: Contains User defined printer variables ##### Homing and general movement ##### -variable_z_endstop_x: 205 ; z Endstop x position inside right profile +variable_z_endstop_x: 94.5 ; z Endstop x position inside right profile variable_z_endstop_y: 305 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.5 ; reduced homing current for x and y variable_z_home_current: 0.4 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### -variable_probe_dock_x: 145 ; x toolhead position before docking probe -variable_probe_dock_y: 285 ; y toolhead position before docking probe +variable_probe_dock_x: 52 ; x toolhead position before docking probe +variable_probe_dock_y: 250 ; y toolhead position before docking probe variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) -variable_probe_undock_x: 200 ; x toolhead position after docking probe +variable_probe_undock_x: 120 ; x toolhead position after docking probe variable_probe_undock_y: 305 ; y toolhead position after docking probe variable_probe_undock_z: 12 ; z toolhead position after docking probe (only for bed dock) variable_probe_z_min: 12 ; z minimum height to avoid crash @@ -35,11 +35,11 @@ gcode: [z_calibration] # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. -probe_nozzle_x: 205 +probe_nozzle_x: 94.5 probe_nozzle_y: 305 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. -probe_switch_x: 201 +probe_switch_x: 90 probe_switch_y: 284 # The X and Y coordinates (in mm) for probing on the print surface # (e.g. the center point) These coordinates will be adapted by the @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.75 +switch_offset: 0.72 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. @@ -73,10 +73,10 @@ max_deviation: 1.0 # position. The default is two times the z_offset from the probe's # configuration. #position_min: default from "stepper_z:position_min" section. -# The moving speed in X and Y. The default is 50 mm/s. -# Clearance +# Extra clearance when moving clearance: 12 -# speed: 200 +# The moving speed in X and Y. The default is 50 mm/s. +speed: 100 # Speed (in mm/s) of the Z axis when lifting the probe between # samples and clearance moves. The default is from the probe's # configuration. From 54953511a16720144cb4212f907cae33152f5a15 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 3 Nov 2021 21:15:22 +0100 Subject: [PATCH 054/131] v2.4: update variables, input-shaper --- input_shaper.cfg | 4 ++-- printer.cfg | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index 61f440b..78eba1c 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -4,9 +4,9 @@ # is mzv input shaper. # shaper_type: mzv shaper_type_x: mzv -shaper_freq_x: 51 +shaper_freq_x: 53.8 shaper_type_y: ei -shaper_freq_y: 53.4 +shaper_freq_y: 50.8 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/printer.cfg b/printer.cfg index 72fb61d..53f9457 100644 --- a/printer.cfg +++ b/printer.cfg @@ -410,18 +410,22 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.032500, 0.002500, 0.015000, 0.015000, -0.042500 -#*# -0.032500, -0.015000, 0.002500, 0.002500, -0.055000 -#*# -0.040000, -0.015000, 0.000000, 0.000000, -0.060000 -#*# -0.030000, -0.022500, 0.010000, 0.010000, -0.055000 -#*# 0.075000, 0.015000, 0.052500, 0.055000, -0.007500 +#*# -0.092500, -0.097500, -0.052500, -0.045000, -0.030000, -0.017500, -0.022500, -0.052500, -0.090000 +#*# -0.117500, -0.102500, -0.047500, -0.055000, -0.020000, 0.015000, -0.017500, -0.047500, -0.072500 +#*# -0.102500, -0.092500, -0.065000, 0.005000, -0.015000, -0.005000, -0.027500, -0.045000, -0.075000 +#*# -0.142500, -0.122500, -0.062500, -0.022500, -0.042500, -0.017500, -0.017500, -0.080000, -0.125000 +#*# -0.150000, -0.100000, -0.072500, -0.007500, 0.000000, -0.002500, -0.020000, -0.007500, -0.095000 +#*# -0.110000, -0.082500, -0.035000, -0.025000, -0.007500, -0.007500, -0.027500, -0.035000, -0.120000 +#*# -0.125000, -0.087500, -0.065000, -0.005000, 0.005000, 0.017500, -0.037500, -0.045000, -0.110000 +#*# -0.100000, -0.077500, -0.035000, -0.002500, 0.025000, 0.025000, 0.020000, -0.017500, -0.087500 +#*# -0.077500, -0.065000, 0.010000, 0.025000, 0.045000, 0.047500, 0.005000, -0.005000, -0.085000 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic -#*# y_count = 5 +#*# y_count = 9 #*# mesh_y_pps = 2 -#*# min_y = 60.0 -#*# x_count = 5 -#*# max_y = 280.0 +#*# min_y = 70.0 +#*# x_count = 9 +#*# max_y = 290.0 #*# mesh_x_pps = 2 #*# max_x = 260.0 From 7d9575568494d6bd77f9edcb81b4832cf19e14d8 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 14 Nov 2021 20:16:09 +0100 Subject: [PATCH 055/131] v2.4: update KlipperScreen --- KlipperScreen.conf | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index be26ab4..b19626f 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -76,6 +76,19 @@ method: printer.gcode.script params: {"script":"QUAD_GANTRY_LEVEL"} enable: {{ printer.quad_gantry_level is defined }} +[menu __main homing bed_mesh_calibrate] +name: {{ gettext('Bed Mesh') }} +icon: bed-level +panel: bed_mesh +enable: {{ printer.bed_mesh is defined }} + +[menu __main homing calibrate_z] +name: {{ gettext('Calibrate Z') }} +icon: home-z +method: printer.gcode.script +params: {"script":"CALIBRATE_Z"} +enable: {{ printer.probe is defined }} + [menu __main homing Z-Tilt] name: {{ gettext('Z Tilt') }} icon: z-tilt @@ -257,8 +270,8 @@ panel: settings #~# #~# [main] -#~# move_speed = 30 -#~# print_sort_dir = date_asc +#~# move_speed = 50 +#~# print_sort_dir = date_desc #~# #~# [displayed_macros Printer] #~# g32 = False From b2860d4e5c8d6a04f22c9a802e5078e84d458056 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 14 Nov 2021 20:17:25 +0100 Subject: [PATCH 056/131] v2.4: update minor things --- printer.cfg | 24 +++++++++++------------- webcam.txt | 6 +++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/printer.cfg b/printer.cfg index 53f9457..9c0857c 100644 --- a/printer.cfg +++ b/printer.cfg @@ -410,22 +410,20 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.092500, -0.097500, -0.052500, -0.045000, -0.030000, -0.017500, -0.022500, -0.052500, -0.090000 -#*# -0.117500, -0.102500, -0.047500, -0.055000, -0.020000, 0.015000, -0.017500, -0.047500, -0.072500 -#*# -0.102500, -0.092500, -0.065000, 0.005000, -0.015000, -0.005000, -0.027500, -0.045000, -0.075000 -#*# -0.142500, -0.122500, -0.062500, -0.022500, -0.042500, -0.017500, -0.017500, -0.080000, -0.125000 -#*# -0.150000, -0.100000, -0.072500, -0.007500, 0.000000, -0.002500, -0.020000, -0.007500, -0.095000 -#*# -0.110000, -0.082500, -0.035000, -0.025000, -0.007500, -0.007500, -0.027500, -0.035000, -0.120000 -#*# -0.125000, -0.087500, -0.065000, -0.005000, 0.005000, 0.017500, -0.037500, -0.045000, -0.110000 -#*# -0.100000, -0.077500, -0.035000, -0.002500, 0.025000, 0.025000, 0.020000, -0.017500, -0.087500 -#*# -0.077500, -0.065000, 0.010000, 0.025000, 0.045000, 0.047500, 0.005000, -0.005000, -0.085000 +#*# 0.075000, 0.060000, 0.040000, 0.045000, 0.040000, 0.072500, 0.072500 +#*# 0.032500, 0.005000, 0.022500, 0.025000, 0.005000, 0.062500, 0.060000 +#*# -0.005000, -0.000000, -0.007500, -0.017500, -0.002500, 0.035000, 0.042500 +#*# -0.007500, 0.000000, 0.002500, 0.000000, 0.007500, 0.010000, 0.015000 +#*# -0.010000, 0.022500, 0.012500, -0.007500, 0.005000, 0.027500, 0.002500 +#*# 0.012500, 0.007500, 0.017500, -0.002500, 0.047500, 0.025000, 0.000000 +#*# 0.060000, 0.072500, 0.035000, 0.075000, 0.057500, 0.057500, 0.065000 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic -#*# y_count = 9 +#*# y_count = 7 #*# mesh_y_pps = 2 #*# min_y = 70.0 -#*# x_count = 9 -#*# max_y = 290.0 +#*# x_count = 7 +#*# max_y = 289.96 #*# mesh_x_pps = 2 -#*# max_x = 260.0 +#*# max_x = 259.96 diff --git a/webcam.txt b/webcam.txt index 8a90217..c21aae3 100644 --- a/webcam.txt +++ b/webcam.txt @@ -52,9 +52,9 @@ camera_usb_options="-r 800x600 -f 10" # # Defaults to 10fps # -# camera_raspi_options="-fps 10" -# camera_raspi_options="-rot 180 -x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" -camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" +# camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1 -rot 180" +# camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" +camera_raspi_options="-x 800 -y 600 -roi 0.0,0.0,0.998,1" ### Configuration of camera HTTP output # From ab85bbe1eb5882406bab0631ba54b9b7bc7a9fe0 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 14 Nov 2021 20:17:44 +0100 Subject: [PATCH 057/131] v2.4: update input_shaper frequencies --- input_shaper.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index 78eba1c..a3adc25 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -4,9 +4,9 @@ # is mzv input shaper. # shaper_type: mzv shaper_type_x: mzv -shaper_freq_x: 53.8 -shaper_type_y: ei -shaper_freq_y: 50.8 +shaper_freq_x: 53 +shaper_type_y: mzv +shaper_freq_y: 53 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this From ace55b8a4bb6fbce3b7b1ed3e543ed7503830bcb Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 14 Nov 2021 20:18:10 +0100 Subject: [PATCH 058/131] v2.4: update moonraker update_manager settings --- moonraker.conf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/moonraker.conf b/moonraker.conf index 7aa9e95..7d8b834 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -35,12 +35,21 @@ trusted_clients: [update_manager] enable_auto_refresh: True -# this enabled fluidd updates [update_manager client fluidd] type: web -repo: cadriel/fluidd +repo: fluidd-core/fluidd path: ~/fluidd +[update_manager client mainsail] +type: web +repo: meteyou/mainsail +path: ~/mainsail + +[update_manager klipper-mcu-update] +type: git_repo +origin: https://github.com/Klipper3d/klipper.git +path: ~/klipper + [update_manager KlipperScreen] type: git_repo path: ~/KlipperScreen From 63465ae331e6b955a0d2e9ff5540a2971fa5e13d Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 14 Nov 2021 20:18:34 +0100 Subject: [PATCH 059/131] v2.4: recalibrate all the positions --- macros/print.cfg | 24 ++++++------ macros/z_calibration.cfg | 3 ++ printer.cfg | 80 +++++++++++++++++++++------------------- resonance_test.cfg | 5 +++ z_calibration.cfg | 18 ++++----- 5 files changed, 71 insertions(+), 59 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index e99d040..78d9963 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -18,7 +18,7 @@ gcode: {% set x0=200 %} {% set x1=250 %} - {% set y0=306 %} + {% set y0=310 %} {% set z0=1 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} @@ -80,7 +80,7 @@ gcode: {% set z_safe = max_z - act_z %} {% endif %} G91 - G0 Z{z_safe} F900 + G0 Z{z_safe} F1200 G90 G0 X{x_park} Y{y_park} F6000 {% else %} @@ -117,6 +117,7 @@ gcode: {% set BED=params.BED|default(100)|int %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set CHAMBER=params.CHAMBER|default(0)|int %} + {% set SHEET=params.SHEET|default("default")|string %} {% set QGL=params.QGL|default(1)|int %} {% set BMC=params.BMC|default(0)|int %} {% set PURGE=params.PURGE|default(1)|int %} @@ -124,9 +125,9 @@ gcode: {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} # TODO: ERCF {% set ERCF=params.ERCF|default(0) %} - {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, CHAMBER, QGL, BMC, PURGE, SOAK, Z_ADJUST))} + {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, SHEET=%s, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, CHAMBER, SHEET, QGL, BMC, PURGE, SOAK, Z_ADJUST))} M117 > configuring - SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 + SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 SET_GCODE_OFFSET Z=0.0 # reset z offset M140 S{BED} # start bed heating @@ -137,7 +138,6 @@ gcode: M83 # use relative distances for extrusion M117 > homing - SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 G4 P2000 {% if BMC %} BED_MESH_CLEAR @@ -156,12 +156,11 @@ gcode: M117 > bed mesh calibrate BED_MESH_CALIBRATE {% else %} - M117 > bed mesh load - BED_MESH_PROFILE LOAD=default + M117 > bed mesh load {SHEET} + BED_MESH_PROFILE LOAD={SHEET} {% endif %} M117 > heating - SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 G4 P2000 G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature @@ -175,7 +174,6 @@ gcode: M117 > starting SET_PRESSURE_ADVANCE ADVANCE=0.05 SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 - SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 {% if PURGE %} PURGE_NOZZLE @@ -199,16 +197,18 @@ gcode: gcode: {% set x0=params.x0|default(100) %} {% set x1=params.x1|default(200) %} - {% set y0=params.y0|default(0) %} - {% set y1=params.y1|default(0.8) %} + {% set y0=params.y0|default(2) %} + {% set y1=params.y1|default(3) %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} M117 > purge nozzle G0 Z{z_hop} F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 - G0 Z0.2 F1500 # lower Z + G0 Z0.24 F300 # lower Z G0 X{x1} E20 # draw line G0 Y{y1} # move to y1 G0 X{x0} E10 # draw fine line + G0 X{x0-10} # move a little further + G0 E-3 # retract filament G0 Z{z_hop} F300 # move Z to travel height diff --git a/macros/z_calibration.cfg b/macros/z_calibration.cfg index 00e8bb6..210e6d9 100644 --- a/macros/z_calibration.cfg +++ b/macros/z_calibration.cfg @@ -26,6 +26,9 @@ gcode: {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} G1 Z{z_hop} F900 ; move head up {% endif %} + {% if printer.quad_gantry_level.applied|lower == 'false' %} + QUAD_GANTRY_LEVEL PARK=false + {% endif %} #ATTACH_PROBE ; if not using start_gcode _CALIBRATE_Z_BASE #DETACH_PROBE ; if not using end_gcode diff --git a/printer.cfg b/printer.cfg index 9c0857c..0330fda 100644 --- a/printer.cfg +++ b/printer.cfg @@ -26,9 +26,9 @@ ## [E in MOTOR6] - Extruder ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify ##-------------------------------------------------------------------- -# serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 -serial: /dev/serial0 -restart_method: command +serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 +# serial: /dev/serial0 +# restart_method: command ##-------------------------------------------------------------------- @@ -51,15 +51,18 @@ gcode: G0 Z10 F{speed} +[gcode_macro foo] +gcode: + {% set SENSOR = params.SENSOR|default("bme280 chamber")|string %} + {action_respond_info("sensor: %s, qgl: %s" % (SENSOR, printer.quad_gantry_level.applied))} + + [printer] kinematics: corexy -max_velocity: 300 +max_velocity: 500 ## regular -max_accel: 3000 # Max 4000 +max_accel: 3000 max_accel_to_decel: 1500 # default half of max_accel -## input_shaper -# max_accel: 7000 -# max_accel_to_decel: 3500 ## max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 500 @@ -89,12 +92,12 @@ dir_pin: !PF12 enable_pin: !PF14 rotation_distance: 40 microsteps: 16 -full_steps_per_rotation: 400 # 1.8 deg stepper: 200, 0.9 deg stepper +full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG6 position_min: 0 position_endstop: 300 position_max: 300 -homing_speed: 30 # speed: mm/sec, feedrate: mm/min +homing_speed: 30 # speed: mm/sec, feedrate: mm/min homing_retract_dist: 5 homing_positive_dir: true @@ -116,8 +119,8 @@ microsteps: 16 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 -position_endstop: 305 -position_max: 306 +position_endstop: 307 +position_max: 310 homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -149,7 +152,8 @@ position_endstop: 0.5 position_max: 290 position_min: -5 homing_speed: 13.0 # speed: mm/sec, feedrate: mm/min -second_homing_speed: 3 +homing_retract_speed: 10 +second_homing_speed: 2 homing_retract_dist: 3 [tmc2209 stepper_z] @@ -283,25 +287,6 @@ max_temp: 120 #pid_kd: 363.769 -##################################################################### -# Probe -##################################################################### - -[probe] -## Microswitch probe -pin: ^PG11 -x_offset: 0 -y_offset: 30 -z_offset: 12 -speed: 3 -lift_speed: 25 -samples: 5 -samples_result: median -sample_retract_dist: 2.0 -samples_tolerance: 0.01 -samples_tolerance_retries: 5 - - ##################################################################### # Filament Sensor ##################################################################### @@ -357,6 +342,25 @@ timeout: 1800 # z_hop: 10 # z_hop_speed: 25 + +##################################################################### +# Probe +##################################################################### + +[probe] +## Microswitch probe +pin: ^PG11 +x_offset: 0 +y_offset: 30 +z_offset: 12 +lift_speed: 20 +samples: 3 +samples_result: median +sample_retract_dist: 2 +samples_tolerance: 0.01 +samples_tolerance_retries: 5 + + [bed_mesh] speed: 500 horizontal_move_z: 12 @@ -373,11 +377,15 @@ algorithm: bicubic # probe_count: 3,3 # relative_reference_index: 4 # probe_count: 5,5 -# relative_reference_index: 9 -probe_count: 9,9 -relative_reference_index: 40 +# relative_reference_index: 12 +probe_count: 7,7 +relative_reference_index: 24 +# probe_count: 9,9 +# relative_reference_index: 40 [quad_gantry_level] +speed: 150 +horizontal_move_z: 12 gantry_corners: -60,-10 360,370 @@ -386,8 +394,6 @@ points: 40,260 260,260 260,40 -speed: 150 -horizontal_move_z: 12 retries: 5 retry_tolerance: 0.0075 max_adjust: 10 diff --git a/resonance_test.cfg b/resonance_test.cfg index 01d232d..733a8e6 100644 --- a/resonance_test.cfg +++ b/resonance_test.cfg @@ -1,3 +1,8 @@ +# override printer +[printer] +max_accel: 10000 +max_accel_to_decel: 5000 + [mcu nano] serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 diff --git a/z_calibration.cfg b/z_calibration.cfg index 798d04e..fff2349 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -5,7 +5,7 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 94.5 ; z Endstop x position inside right profile -variable_z_endstop_y: 305 ; z Endstop y position +variable_z_endstop_y: 310 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.5 ; reduced homing current for x and y variable_z_home_current: 0.4 ; reduced homing current for z @@ -14,8 +14,8 @@ variable_home_accel: 1000 ; reduced ACCEL for homing variable_probe_dock_x: 52 ; x toolhead position before docking probe variable_probe_dock_y: 250 ; y toolhead position before docking probe variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) -variable_probe_undock_x: 120 ; x toolhead position after docking probe -variable_probe_undock_y: 305 ; y toolhead position after docking probe +variable_probe_undock_x: 110 ; x toolhead position after docking probe +variable_probe_undock_y: 309 ; y toolhead position after docking probe variable_probe_undock_z: 12 ; z toolhead position after docking probe (only for bed dock) variable_probe_z_min: 12 ; z minimum height to avoid crash variable_probe_travel_speed: 100 ; dock moves travel speed @@ -36,11 +36,11 @@ gcode: # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. probe_nozzle_x: 94.5 -probe_nozzle_y: 305 +probe_nozzle_y: 310 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 -probe_switch_y: 284 +probe_switch_y: 290 # The X and Y coordinates (in mm) for probing on the print surface # (e.g. the center point) These coordinates will be adapted by the # probe's X and Y offsets. The default is the relative_reference_index @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.72 +switch_offset: 0.59 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. @@ -145,11 +145,9 @@ gcode: {% endif %} ## XY Location of the Z Endstop Switch - # TODO check speed - # G0 X{z_endstop_x} Y{z_endstop_y} F12000 G0 X{z_endstop_x} Y{z_endstop_y} F6000 - G28 Z ; home Z - G0 Z2 F1500 ; move up + G28 Z ; home Z + G0 Z3 F1500 ; move up ## return to org current settings {% if params.RESET_SETTINGS|default('true') == 'true' %} From f4a82d9200aa610d8c6f205792bbd474d37d9365 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 22 Nov 2021 17:10:10 +0100 Subject: [PATCH 060/131] v2.4: add vanilla ercf files --- ercf/client_macros.cfg | 58 +++ ercf/ercf_hardware.cfg | 73 ++++ ercf/ercf_software.cfg | 894 +++++++++++++++++++++++++++++++++++++++++ ercf/ercf_vars.cfg | 15 + 4 files changed, 1040 insertions(+) create mode 100644 ercf/client_macros.cfg create mode 100644 ercf/ercf_hardware.cfg create mode 100644 ercf/ercf_software.cfg create mode 100644 ercf/ercf_vars.cfg diff --git a/ercf/client_macros.cfg b/ercf/client_macros.cfg new file mode 100644 index 0000000..6c1268c --- /dev/null +++ b/ercf/client_macros.cfg @@ -0,0 +1,58 @@ +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + TURN_OFF_HEATERS + CLEAR_PAUSE + SDCARD_RESET_FILE + {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 20.0) %} + {% set z_safe = 20.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + G91 + G1 Z{z_safe} F900 + G90 + G0 X{x_park} Y{y_park} F6000 + BASE_CANCEL_PRINT + +[gcode_macro PAUSE] +rename_existing: BASE_PAUSE +gcode: + {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 5.0) %} + {% set z_safe = 5.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + G92 E0 + G1 E-1.0 F1500.0 + G90 + SAVE_GCODE_STATE NAME=PAUSE_state + BASE_PAUSE + G91 + G1 Z{z_safe} F900 + G90 + G0 X{x_park} Y{y_park} F6000 + +[gcode_macro RESUME] +rename_existing: BASE_RESUME +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} + M118 You can't resume the print without unlocking the ERCF first. + M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again + {% else %} + RESTORE_GCODE_STATE NAME=PAUSE_state + G90 + {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 + {% endif %} + BASE_RESUME + {% endif %} diff --git a/ercf/ercf_hardware.cfg b/ercf/ercf_hardware.cfg new file mode 100644 index 0000000..111c986 --- /dev/null +++ b/ercf/ercf_hardware.cfg @@ -0,0 +1,73 @@ +## Enraged Rabbit : Carrot Feeder V1.1 hardware config file +# Values are an example for voron 2.4 with 2 SKR1.4 + +# Carrot Feeder 5mm D-cut shaft +# Example for an SKR 1.4 Board (E1 on the XY mcu) +[manual_stepper gear_stepper] +step_pin: P1.15 +dir_pin: P1.14 +enable_pin: !P1.16 +rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears +gear_ratio: 80:20 +microsteps: 16 +full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree +velocity: 35 +accel: 150 +#Right now no pin is used for the endstop, but we need to define one for klipper. So just use a random, not used pin +endstop_pin: P0.10 + +[tmc2209 manual_stepper gear_stepper] +# Adapt accordingly to your setup and desires +# The default values are tested with the BOM NEMA14 motor +# Please adapt those values to the motor you are using +# Example : for NEMA17 motors, you'll usually set the stealthchop_threshold to 0 +# and use higher current +uart_pin: P1.1 +interpolate: True +run_current: 0.40 +hold_current: 0.1 +sense_resistor: 0.110 +stealthchop_threshold: 500 + +# Carrot Feeder selector +# Example for an SKR 1.4 Board (Z1 on the XY mcu) +[manual_stepper selector_stepper] +step_pin: P0.22 +dir_pin: P2.11 +enable_pin: !P0.21 +microsteps: 16 +rotation_distance: 40 +full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree +velocity: 200 +accel: 600 +endstop_pin: P1.25 + +[tmc2209 manual_stepper selector_stepper] +uart_pin: P1.8 +run_current: 0.55 +interpolate: True +sense_resistor: 0.110 +stealthchop_threshold: 5000 + +# Values are for the MG90S servo +[servo ercf_servo] +pin: P1.26 +maximum_servo_angle: 180 +minimum_pulse_width: 0.00085 +maximum_pulse_width: 0.00215 + +[duplicate_pin_override] +pins: P1.0 +# Put there the pin used by the encoder and the filament_motion_sensor +# It has to be the same pin for those 3 + +[filament_motion_sensor encoder_sensor] +switch_pin: ^P1.0 +pause_on_runout: False +detection_length: 4.0 +extruder: extruder +# runout_gcode: ERCF_ENCODER_MOTION_ISSUE + +[filament_switch_sensor toolhead_sensor] +pause_on_runout: False +switch_pin: ^P1.27 diff --git a/ercf/ercf_software.cfg b/ercf/ercf_software.cfg new file mode 100644 index 0000000..49a8bba --- /dev/null +++ b/ercf/ercf_software.cfg @@ -0,0 +1,894 @@ +############################### +# ERCF module +############################### + +[ercf] +# Encoder +encoder_pin: ^P1.0 +encoder_resolution: 1.365188 # in mm +# Speeds and accels +# Long moves are faster than the small ones +# 100mm/s should be "quiet" with the NEMA14 motor or a NEMA17 pancake, but you can go lower if your really want it to be low noise +# Tested without any issue at 200mm/s, but it's noisy. I'm running mine at 170mm/s for long moves and 50mm/s for short moves. +long_moves_speed: 100 # mm/s. Default value is 100mm/s. +long_moves_accel: 400 # mm/s². Default value is 400mm/s² +short_moves_speed: 25 # mm/s. Default value is 25mm/s. +short_moves_accel: 400 # mm/s². Default value is 400mm/s² + +[gcode_macro ERCF_VAR] +# ======================================================= +# ================== VALUES TO ADJUST =================== +# ======================================================= +# +# ==== Toolhead specific values ==== +# +# Distance between the end of the reverse bowden and the toolhead sensor. Value is toolhead specific. +# Tested values : +# Galileo Clockwork with ERCF V1.1 sensor (hall effect) : 27.0 +# LGX on AfterBurner with ERCF V1.1 sensor (hall effect) : 44.0 +# AfterBurner Clockwork with ERCF V1.1 sensor (hall effect) : 36.0 +variable_end_of_bowden_to_sensor: 27.0 +# Length from the sensor to the nozzle melt pool. +# Reduce this value if there are blobs of filament on each load, before the purge on the tower. +# Increase this value if there are big gaps on the purge tower (i.e. if it takes time for the filament to get pushed out after a swap) +# Tested values : +# Galileo Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 60.5 +# LGX on AfterBurner with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 55.6 +# AfterBurner Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 54.0 +variable_sensor_to_nozzle: 60.5 +# +# ==== Values to tune ==== +# +# Tool position for the selector. This has to be tuned manually. Please scale this array to the number of tools you have +variable_colorselector = [2.4, 24.0, 44.8, 71.2, 92.0, 113.6, 139.2, 160.8, 181.6] +# Base value for the loading length used by the auto-calibration macro +# Please use a value SMALLER than the real reverse bowden length (like 50mm less) +variable_min_bowden_length: 750.0 +# Servo angle for the Up position (i.e. tool disengaged). Refer to the manual to know how to properly tune this value +# Default values: +# MG90S servo : 30 +# SAVOX SH0255MG : 140 +variable_servo_up_angle: 30 +# Servo angle for the Down position (i.e. tool engaged). Refer to the manual to know how to properly tune this value +# Default values: +# MG90S servo : 140 +# SAVOX SH0255MG : 30 +variable_servo_down_angle: 140 +# Options to use or not +# Beware that the clog detection and endless spool mode are in BETA mode for now +# Use at your own risk (beware of the involved macros and the pause(s) and resume ones) +# Put 0 to disable, 1 to enable +variable_clog_detection: 0 +variable_endless_spool_mode: 0 +# ======================================================= +# ============ END OF VALUES TO ADJUST ================== +# ======================================================= +# You shouldn't have to change anything below this point + +# Things that you shouldn't have to change +variable_unload_modifier: 9.0 # Modifier to adjust the ERCF park position (where the filament ends when doing an unload) +variable_min_temp_extruder: 180 # Temp used during the auto-calibration macro, to ensure we can move the extruder (but not really extruding) +variable_extruder_eject_temp: 240 # Temp used during filament ejection (in the ERCF_HOME macro, if a filament is detected in the toolhead) +variable_timeout_pause: 72000 # Time out used by the ERCF_PAUSE +variable_disable_heater: 600 # Delay after which the hotend heater is disabled in the ERCF_PAUSE state +gcode: + +[save_variables] +filename: /home/pi/klipper_config/ercf_vars.cfg + +############################### +# ERCF Calibration macros +############################### +[gcode_macro ERCF_CALIB_SELECTOR] +description: Calibration of the selector position for a defined Tool +gcode: + ERCF_SERVO_UP + + {% set move_length=(20.0 + (params.TOOL|int + 1)*21.0 + ((params.TOOL|int + 1)/3)*5.0) %} + + M118 Measuring the selector position for tool {params.TOOL} + ERCF_GET_SELECTOR_POS REF={move_length|int} + + ERCF_MOTORS_OFF + +[gcode_macro ERCF_CALIBRATE] +description: Complete calibration of all ERCF Tools +gcode: + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + M118 Start the complete auto calibration... + M118 First home the ERCF + ERCF_HOME + + {% for chan in range(printer["gcode_macro ERCF_VAR"].colorselector|length) %} + ERCF_CALIBRATE_SINGLE TOOL={chan|int} + {% endfor %} + + M118 End of the complete auto calibration! + M118 Please reload the firmware for the calibration to be active! + +[gcode_macro ERCF_CALIBRATE_SINGLE] +description: Calibration of a single ERCF Tool +gcode: + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + {% if params.TOOL|int >= 0 and params.TOOL|int < printer["gcode_macro ERCF_VAR"].colorselector|length %} + {% if printer["gcode_macro ERCF_HOME"].home == -1 %} + M118 First home the ERCF + ERCF_HOME + {% endif %} + + ERCF_SELECT_TOOL TOOL={params.TOOL} + ERCF_SET_STEPS RATIO=1.0 + + {% if params.TOOL|int == 0 %} + {% if printer['extruder'].temperature < printer["gcode_macro ERCF_VAR"].min_temp_extruder %} + M109 S{printer["gcode_macro ERCF_VAR"].min_temp_extruder|int} + {% endif %} + + M118 Calibrating reference tool {params.TOOL} + ERCF_LOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length} + ERCF_HOME_EXTRUDER TOTAL_LENGTH=400 STEP_LENGTH=0.5 + + ERCF_CALIB_SAVE_VAR TOOL={params.TOOL} + + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 + G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + + ERCF_CALIB_UNLOAD + + ERCF_BUZZ_GEAR_MOTOR + ERCF_IS_FILAMENT_STUCK_IN_ERCF + + ERCF_UNSELECT_TOOL + {% else %} + M118 Calibrating tool {params.TOOL} + + ERCF_LOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0} + ERCF_CALIB_SAVE_VAR tool={params.TOOL} + + ERCF_CALIB_UNLOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0 + 27.0} + {% endif %} + + {% else %} + M118 Tool out of range + {% endif %} + +[gcode_macro ERCF_CALIB_SAVE_VAR] +description: Saving ERCF calibration values +gcode: + {% if params.TOOL|int == 0 %} + M118 Tool {params.TOOL} calibration value is {printer['ercf'].encoder_pos|float} + SAVE_VARIABLE VARIABLE=ercf_calib_ref VALUE={printer['ercf'].encoder_pos|float} # this is the reference value + SAVE_VARIABLE VARIABLE=ercf_calib_{params.TOOL|int} VALUE=1.0 + SET_GCODE_VARIABLE MACRO=ERCF_CALIB_UNLOAD VARIABLE=ref VALUE={printer['ercf'].encoder_pos|float} + SET_GCODE_VARIABLE MACRO=ERCF_CALIB_UNLOAD VARIABLE=ratio VALUE=1.0 + {% else %} + {% set ratio = (printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0) / printer['ercf'].encoder_pos|float %} + M118 Tool {params.TOOL} ratio is {ratio|float} + SAVE_VARIABLE VARIABLE=ercf_calib_{params.TOOL|int} VALUE={ratio|float} + SET_GCODE_VARIABLE MACRO=ERCF_CALIB_UNLOAD VARIABLE=ratio VALUE={ratio|float} + {% endif %} + +[gcode_macro ERCF_CALIB_UNLOAD] +description: Filament unload during ERCF calibration +variable_ratio: 0.0 +variable_ref: 0.0 +gcode: + {% set unload_length = params.LENGTH|default(0.0)|float %} + {% if unload_length|float == 0.0 %} + ERCF_UNLOAD LENGTH={(ref|float)*(ratio|float) - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + 27.0} + {% else %} + {% if ratio|float < 1.0 %} # No correction move is done in case of "over targeting", hence the correction ratio is not applied during this unload sequence + ERCF_UNLOAD LENGTH={(unload_length|float)} + {% else %} + ERCF_UNLOAD LENGTH={(unload_length|float)*(ratio|float)} + {% endif %} + {% endif %} + +[respond] +default_type: command + +############################### +# ERCF servo +############################### +# Push the top hat down (enable the bondtech gears) while "buzzing" the gear motor to ensure proper BMG gear meshing +[gcode_macro ERCF_SERVO_DOWN] +description: Engage the ERCF gear +gcode: + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.5 SPEED=25 ACCEL=0 SYNC=0 + SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro ERCF_VAR"].servo_down_angle} + G4 P200 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL=0 SYNC=0 + G4 P100 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-0.5 SPEED=25 ACCEL=0 SYNC=0 + G4 P100 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL=0 + SET_SERVO SERVO=ercf_servo WIDTH=0.0 + +# Pull the top hat up (disengage the bondtech gears) +[gcode_macro ERCF_SERVO_UP] +description: Disengage the ERCF gear +gcode: + SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro ERCF_VAR"].servo_up_angle} + G4 P250 + SET_SERVO SERVO=ercf_servo WIDTH=0.0 + +############################### +# ERCF motors +############################### +[gcode_macro ERCF_MOTORS_OFF] +description: Turn off both ERCF motors +gcode: + MANUAL_STEPPER STEPPER=gear_stepper ENABLE=0 + MANUAL_STEPPER STEPPER=selector_stepper ENABLE=0 + +############################### +# PAUSE MACROS +# ERCF_PAUSE is called when an human intervention is needed +# use ERCF_UNLOCK to start the manual intervention +# and use RESUME when the intervention is over to resume the current print +############################### + +# Stop the delayed stop of the heater +[gcode_macro ERCF_UNLOCK] +description: Unlock ERCF operations +gcode: + M118 Unlock the ERCF + SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=0 + UPDATE_DELAYED_GCODE ID=disable_heater DURATION=0 + ERCF_UNSELECT_TOOL + M104 S{printer["gcode_macro ERCF_PAUSE"].extruder_temp} + RESTORE_GCODE_STATE NAME=ERCF_state + M118 Refer to the manual before resuming the print + +[delayed_gcode disable_heater] +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} + M118 Disable extruder heater + M104 S0 + {% endif %} + +# Pause the ERCF, park the extruder at the parking position +# Save the current state and start the delayed stop of the heated +# modify the timeout of the printer accordingly to timeout_pause +[gcode_macro ERCF_PAUSE] +description: Pause the current print and lock the ERCF operations +variable_is_paused: 0 +variable_extruder_temp: 0 +gcode: + SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=extruder_temp VALUE={printer.extruder.target} + SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=1 + SET_IDLE_TIMEOUT TIMEOUT={printer["gcode_macro ERCF_VAR"].timeout_pause} + UPDATE_DELAYED_GCODE ID=disable_heater DURATION={printer["gcode_macro ERCF_VAR"].disable_heater} + M118 An issue with the ERCF has been detected and the ERCF has been PAUSED + M118 When you intervene to fix the issue, first call the "ERCF_UNLOCK" Gcode + M118 Refer to the manual before resuming the print + SAVE_GCODE_STATE NAME=ERCF_state + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + PAUSE + +############################################ +# Changing tool macros +# ERCF_CHANGE_TOOL_STANDALONE TOOL=XX to change filament outside of a print +# ERCF_CHANGE_TOOL_SLICER TOOL=XX will be called automatically (from the ACTIVATE_EXTRUDER gcode from SuperSlicer), don't use that for "manual" filament swap +# if the new extruder is different from the current extruder : +# eject the filament if needed +# load the new one +########################################### +[gcode_macro T0] +gcode: + ERCF_CHANGE_TOOL TOOL=0 + +[gcode_macro T1] +gcode: + ERCF_CHANGE_TOOL TOOL=1 + +[gcode_macro T2] +gcode: + ERCF_CHANGE_TOOL TOOL=2 + +[gcode_macro T3] +gcode: + ERCF_CHANGE_TOOL TOOL=3 + +[gcode_macro T4] +gcode: + ERCF_CHANGE_TOOL TOOL=4 + +[gcode_macro T5] +gcode: + ERCF_CHANGE_TOOL TOOL=5 + +[gcode_macro T6] +gcode: + ERCF_CHANGE_TOOL TOOL=6 + +[gcode_macro T7] +gcode: + ERCF_CHANGE_TOOL TOOL=7 + +[gcode_macro T8] +gcode: + ERCF_CHANGE_TOOL TOOL=8 + +[gcode_macro ERCF_CHANGE_TOOL] +description: Perform a tool swap +gcode: + {% if printer.idle_timeout.state == "Printing" %} + ERCF_CHANGE_TOOL_SLICER TOOL={params.TOOL|int} + {% else %} + ERCF_CHANGE_TOOL_STANDALONE TOOL={params.TOOL|int} + {% endif %} + +[gcode_macro ERCF_CHANGE_TOOL_SLICER] +description: Perform a tool swap during a print +gcode: + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} + # Add a variable 'SwapCounter' in your PRINT_START macro to display this info + # {% set newcounter = (printer["gcode_macro PRINT_START"].swapcounter|int + 1) %} + # SET_GCODE_VARIABLE MACRO=PRINT_START VARIABLE=swapcounter VALUE={newcounter} + # M118 Swap {newcounter|int} + M117 Change Tool T{params.TOOL|int} + ERCF_UNLOAD_TOOL + ERCF_LOAD_TOOL TOOL={params.TOOL|int} + ERCF_CHANGE_TOOL_SLICER_END + {% endif %} + +[gcode_macro ERCF_CHANGE_TOOL_SLICER_END] +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 + {% endif %} + {% endif %} + +[gcode_macro ERCF_CHANGE_TOOL_STANDALONE] +description: Perform a tool swap out of a print +gcode: + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + {% if printer["gcode_macro ERCF_HOME"].home == -1 %} + M118 ERCF not homed, homing it... + ERCF_HOME + M117 Change Tool T{params.TOOL|int} + ERCF_LOAD_TOOL TOOL={params.TOOL|int} + {% elif printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} + M117 Change Tool T{params.TOOL|int} + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} + M118 Unloading current filament + {% if printer['extruder'].temperature < 178 %} + M118 Preheat Nozzle + M109 S{printer["gcode_macro ERCF_VAR"].extruder_eject_temp} + {% endif %} + ERCF_EJECT + {% endif %} + + ERCF_LOAD_TOOL TOOL={params.TOOL|int} + {% endif %} + +############################################ +# Unloading/Loading Macros +############################################ + +# Load filament from ERCF to nozzle +[gcode_macro ERCF_LOAD_TOOL] +description: Load the filament from the ERCF to the toolhead +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro ERCF_HOME"].home == -1 %} + M118 ERCF not homed, homing it... + ERCF_HOME + {% endif %} + M118 Loading tool {params.TOOL|int} ... + ERCF_SELECT_TOOL TOOL={params.TOOL|int} + {% set ercf_params = printer.save_variables.variables %} + ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (params.TOOL|string)]} + M118 Loading filament from ERCF to extruder ... + {% set ercf_params = printer.save_variables.variables %} + ERCF_LOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} + ERCF_LOAD_FILAMENT_IN_EXTRUDER + {% endif %} + +# Unload filament from nozzle to ERCF, using built-in tip forming macro +[gcode_macro ERCF_EJECT] +description: Eject the filament out of a print and park it into the ERCF +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != -1 %} + M118 Unloading tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} + ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING + {% set ercf_params = printer.save_variables.variables %} + ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|string)]} + ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} + ERCF_UNSELECT_TOOL + {% else %} + ERCF_EJECT_UNKNOW_STATE + {% endif %} + {% else %} + ERCF_EJECT_UNKNOW_STATE + {% endif %} + {% endif %} + +# Unload filament from nozzle to ERCF, using SuperSlicer ramming +[gcode_macro ERCF_UNLOAD_TOOL] +description: Eject the filament during a print and park it into the ERCF +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != -1 %} + M118 Unload tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... + ERCF_HOME_EXTRUDER + ERCF_SELECT_TOOL TOOL={printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} + {% set ercf_params = printer.save_variables.variables %} + ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|string)]} + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + 20.0} SPEED=25 ACCEL=0 SYNC=0 + G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + 20.0} F1500.0 + {% set ercf_params = printer.save_variables.variables %} + ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float - 20.0} + ERCF_UNSELECT_TOOL + {% endif %} + {% endif %} + +############################################ +# Select/Unselect a tool +# move the selector (if needed) to the requested tool +############################################ + +# Select a tool. move the idler and then move the color selector (if needed) +[gcode_macro ERCF_SELECT_TOOL] +description: Move the selector to the Tool and select it +variable_tool_selected: -1 +variable_color_selected: -1 +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro ERCF_HOME"].home != -1 %} + M118 Select Tool {params.TOOL} ... + ERCF_SERVO_UP + MANUAL_STEPPER STEPPER=selector_stepper MOVE={printer["gcode_macro ERCF_VAR"].colorselector[params.TOOL|int]} + SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE={params.TOOL} + SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE={params.TOOL} + ERCF_SERVO_DOWN + M118 Tool {params.TOOL} Enabled + {% else %} + M118 Could not select tool, ERCF is not homed + {% endif %} + {% endif %} + +# Unselect a tool +[gcode_macro ERCF_UNSELECT_TOOL] +description: Unselect current Tool +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro ERCF_HOME"].home != -1 %} + ERCF_SERVO_UP + SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE=-1 + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == False %} + SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE=-1 + {% endif %} + ERCF_SET_STEPS RATIO=1.0 + {% else %} + M118 Could not unselect tool, ERCF is not homed + {% endif %} + {% endif %} + +############################################ +# Loading/Unloading part FROM/TO EXTRUDER TO/FROM NOZZLE +############################################ + +# Load the filament into the extruder +# Call ERCF_PAUSE if the filament is not detected by the toolhead sensor +[gcode_macro ERCF_LOAD_FILAMENT_IN_EXTRUDER] +description: Load filament from the toolhead entrance to the nozzle +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} + M118 Loading Filament... + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE={printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} SPEED=25 ACCEL=0 SYNC=0 + G1 E{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} F1500.0 + G4 P100 + ERCF_HOME_EXTRUDER TOTAL_LENGTH=30.0 STEP_LENGTH=0.5 + ERCF_UNSELECT_TOOL + G1 E15 F1800 + G1 E{printer["gcode_macro ERCF_VAR"].sensor_to_nozzle - 20} F1800 + G1 E5 F600 + G92 E0 + G90 + M118 Load Complete + {% else %} + M118 Extruder too cold + ERCF_PAUSE + {% endif %} + {% endif %} + +# StandAlone cooling moves to extract proper filament tip +[gcode_macro ERCF_FORM_TIP_STANDALONE] +description: Generic tip forming macro +gcode: + {% set COOLING_TUBE_LENGTH = params.COOLING_TUBE_LENGTH|default(15) %} # Dragon ST: 15, Dragon HF: 10, Mosquito: 20 + {% set COOLING_TUBE_RETRACTION = params.COOLING_TUBE_RETRACTION|default(35) %} # Dragon ST: 35, Dragon HF: 30, Mosquito: 38 + {% set INITIAL_COOLING_SPEED = params.INITIAL_COOLING_SPEED|default(10) %} + {% set FINAL_COOLING_SPEED = params.FINAL_COOLING_SPEED|default(50) %} + {% set COOLING_MOVES = params.COOLING_MOVES|default(5) %} + {% set TOOLCHANGE_TEMP = params.TOOLCHANGE_TEMP|default(0) %} + {% set USE_SKINNYDIP = params.USE_SKINNYDIP|default(1) %} + {% set USE_FAST_SKINNYDIP = params.USE_FAST_SKINNYDIP|default(1) %} + {% set SKINNYDIP_DISTANCE = params.SKINNYDIP_DISTANCE|default(26) %} + {% set DIP_INSERTION_SPEED = params.DIP_INSERTION_SPEED|default(33) %} + {% set DIP_EXTRACTION_SPEED = params.DIP_EXTRACTION_SPEED|default(70) %} + {% set MELT_ZONE_PAUSE = params.MELT_ZONE_PAUSE|default(0) %} + {% set COOLING_ZONE_PAUSE = params.COOLING_ZONE_PAUSE|default(0) %} + {% set UNLOADING_SPEED_START = params.UNLOADING_SPEED_START|default(199) %} + {% set UNLOADING_SPEED = params.UNLOADING_SPEED|default(20) %} + {% set RAMMING_VOLUME = params.RAMMING_VOLUME|default(0) %} # in mm3 + {% set INITIAL_RETRACT = params.INITIAL_RETRACT|default(0) %} # Use an initial retract or not. Don't use it if you want to ram the filament + {% set FINAL_EJECT = params.FINAL_EJECT|default(0) %} # Fully eject the filament afterwards, default is no + + G91 + G92 E0 + + SET_PRESSURE_ADVANCE ADVANCE=0 + {% set OLD_TEMP = printer.extruder.target %} + + # Ramming with SuperSlicer standard setting + {% if INITIAL_RETRACT|int == 1 %} + G1 E-8.5000 F3000 + {% endif %} + + {% set RATIO = (RAMMING_VOLUME|float) /23.0 %} + + G1 E{0.5784 * RATIO|float} F299 #7 + G1 E{0.5834 * RATIO|float} F302 #3 + G1 E{0.5918 * RATIO|float} F306 #6 + G1 E{0.6169 * RATIO|float} F319 #6 + G1 E{0.3393 * RATIO|float} F350 #0 + G1 E{0.3363 * RATIO|float} F350 #0 + G1 E{0.7577 * RATIO|float} F392 #6 + G1 E{0.8382 * RATIO|float} F434 #3 + G1 E{0.7776 * RATIO|float} F469 #9 + G1 E{0.1293 * RATIO|float} F469 #9 + G1 E{0.9673 * RATIO|float} F501 #2 + G1 E{1.0176 * RATIO|float} F527 #2 + G1 E{0.5956 * RATIO|float} F544 #6 + G1 E{0.4555 * RATIO|float} F544 #6 + G1 E{1.0662 * RATIO|float} F552 #4 + + # set toolchange temperature just prior to filament being extracted from melt zone and wait for set point + # (SKINNYDIP--normal mode only) + {% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 0 %} + M109 S{TOOLCHANGE_TEMP} + {% endif %} + + # Retraction + {% set TOTAL_RETRACTION_DISTANCE = COOLING_TUBE_RETRACTION|float + COOLING_TUBE_LENGTH|float / 2 - 15 %} + G1 E-15 F{1.0 * UNLOADING_SPEED_START|float * 60} + G1 E-{0.7 * TOTAL_RETRACTION_DISTANCE} F{1.0 * UNLOADING_SPEED|float * 60} + G1 E-{0.2 * TOTAL_RETRACTION_DISTANCE} F{0.5 * UNLOADING_SPEED|float * 60} + G1 E-{0.1 * TOTAL_RETRACTION_DISTANCE} F{0.3 * UNLOADING_SPEED|float * 60} + + {% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 1 %} + M104 S{TOOLCHANGE_TEMP} + {% endif %} + + # Generate Cooling Moves + {% set SPEED_INC = (FINAL_COOLING_SPEED|float - INITIAL_COOLING_SPEED|float) / (2 * COOLING_MOVES|float - 1) %} + {% for move in range(COOLING_MOVES|int) %} + G1 E{COOLING_TUBE_LENGTH} F{(INITIAL_COOLING_SPEED|float + SPEED_INC*move*2) * 60} + G1 E-{COOLING_TUBE_LENGTH} F{(INITIAL_COOLING_SPEED|float + SPEED_INC*(move*2+1)) * 60} + {% endfor %} + + # wait for extruder to reach toolchange temperature after cooling moves complete (SKINNYDIP--fast mode only) + {% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 1 %} + M109 S{TOOLCHANGE_TEMP} + {% endif %} + + # Generate a skinnydip move + {% if USE_SKINNYDIP|int == 1 %} + G1 E{SKINNYDIP_DISTANCE} F{DIP_INSERTION_SPEED|float * 60} + G4 P{MELT_ZONE_PAUSE} + G1 E-{SKINNYDIP_DISTANCE} F{DIP_EXTRACTION_SPEED|float * 60} + G4 P{COOLING_ZONE_PAUSE} + {% endif %} + + {% if TOOLCHANGE_TEMP|float > 0 %} + M104 S{OLD_TEMP} + {% endif %} + + {% if FINAL_EJECT|int == 1 %} + G92 E0 + G1 E-80 F3000 + {% endif %} + + G92 E0 + +# Unload from extruder with tip forming sequence +[gcode_macro ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING] +description: Unload filament from the nozzle to the toolhead entrance using generic tip forming macro +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} + {% if printer["gcode_macro ERCF_SELECT_TOOL"].tool_selected|int == -1 %} + M118 Forming filament tip and Unloading Filament... + G91 + ERCF_FORM_TIP_STANDALONE + G1 E-4.00 F1200.0 + G1 E-15.00 F2000 + ERCF_HOME_EXTRUDER + ERCF_SERVO_DOWN + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 + G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + M118 Filament removed + {% else %} + M118 Tool selected, UNSELECT it + ERCF_PAUSE + {% endif %} + {% else %} + M118 Extruder too cold + ERCF_PAUSE + {% endif %} + {% endif %} + +############################################ +# Endstop check macros +############################################ + +# Call ERCF_PAUSE if the filament is not detected by the toolhead sensor +[gcode_macro ERCF_IS_FILAMENT_IN_EXTRUDER] +gcode: + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} + M118 Filament is in extruder + {% else %} + M118 Filament not in extruder + ERCF_PAUSE + {% endif %} + +# Call ERCF_PAUSE if the filament is stuck in the ERCF +[gcode_macro ERCF_IS_FILAMENT_STUCK_IN_ERCF] +gcode: + {% if printer.ercf.encoder_pos|float != 0 %} + M118 Filament stuck in ERCF + ERCF_PAUSE + {% else %} + M118 Filament not in ERCF + {% endif %} + +############################################ +# Macros called during homing to try to eject the filament if loaded +############################################ + +# Eject from extruder gear to the ERCF +[gcode_macro ERCF_EJECT_UNKNOW_STATE] +description: Unload filament from an unknown position +gcode: + M118 Eject Filament if loaded ... + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} + M118 Filament in extruder, trying to eject it .. + {% if printer['extruder'].temperature < 178 %} + M118 Preheat Nozzle + M109 S{printer["gcode_macro ERCF_VAR"].extruder_eject_temp} + {% endif %} + ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING + ERCF_UNLOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length - 50} UNKNOWN=1 + {% else %} + ERCF_SERVO_DOWN + {% endif %} + ERCF_BUZZ_GEAR_MOTOR + G4 P200 + ERCF_EJECT_FROM_BOWDEN + +# Eject from the bowden to the ERCF +[gcode_macro ERCF_EJECT_FROM_BOWDEN] +description: Unload filament from the reverse bowden +gcode: + {% if printer.ercf.encoder_pos|float != 0 %} + ERCF_UNLOAD HOMING=1 + M118 Filament ejected ! + {% else %} + M118 Filament already ejected ! + {% endif %} + ERCF_SERVO_UP + +############################################ +# Homing macros +# ERCF_HOME must be called before using the ERCF +############################################ + +# Home the ERCF +# eject filament if loaded with ERCF_EJECT_UNKNOW_STATE +# next home the ERCF with ERCF_HOME_ONLY +[gcode_macro ERCF_HOME] +description: Home the ERCF +variable_home: -1 +gcode: + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + SET_GCODE_VARIABLE MACRO=ERCF_HOME VARIABLE=home VALUE=1 + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 1 %} + ERCF_UNLOCK + {% endif %} + M118 Homing ERCF ... + QUERY_ENDSTOPS + ERCF_EJECT_UNKNOW_STATE + ERCF_HOME_SELECTOR + ERCF_HOME_ONLY + +[gcode_macro ERCF_HOME_SELECTOR] +description: Home the ERCF selector +gcode: + M118 Homing selector + ERCF_SERVO_UP + + {% set number_of_chan=printer["gcode_macro ERCF_VAR"].colorselector|length %} + {% set selector_length=(20.0 + number_of_chan*21.0 + (number_of_chan/3)*5.0) %} + + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=100 MOVE=-{selector_length|float} STOP_ON_ENDSTOP=1 + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=100 MOVE=5.0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=10 MOVE=-10.0 STOP_ON_ENDSTOP=1 + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE=-1 + SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE=-1 + +# Home the ERCF: +# 1) home the color selector (if needed) +# 2) try to load filament 0 to ERCF and then unload it. Used to verify the ERCF gear +# if all is ok, the ERCF is ready to be used +[gcode_macro ERCF_HOME_ONLY] +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + M118 Test load filament 1 + ERCF_SELECT_TOOL TOOL=0 + ERCF_SET_STEPS RATIO=1.0 + M118 Loading filament to ERCF... + ERCF_LOAD LENGTH=45 + G4 P50 + ERCF_UNLOAD LENGTH=68 + ERCF_UNSELECT_TOOL + SET_GCODE_VARIABLE MACRO=ERCF_HOME VARIABLE=home VALUE=1 + M118 Homing ERCF ended ... + {% else %} + M118 Homing ERCF failed, ERCF is paused, run "ERCF_UNLOCK" to unlock it ... + {% endif %} + +############################################### +# Test Macros +############################################### +[gcode_macro ERCF_DISPLAY_ENCODER_POS] +description: Display current value of the ERCF encoder +gcode: + M118 Encoder value is {printer['ercf'].encoder_pos|float} + +[gcode_macro ERCF_TEST_MOVE_GEAR] +description: Move the ERCF gear +gcode: + {% set move_length = params.LENGTH|default(200.0)|float %} + {% set move_speed = params.SPEED|default(50.0)|float %} + {% set move_accel = params.ACCEL|default(200.0)|float %} + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE={move_length|float} SPEED={move_speed|float} ACCEL={move_accel|float} + +[gcode_macro ERCF_TEST_SERVO] +description: Test the servo angle +gcode: + SET_SERVO SERVO=ercf_servo ANGLE={params.VALUE|float} + G4 P250 + SET_SERVO SERVO=ercf_servo WIDTH=0.0 + +[gcode_macro ERCF_TEST_GRIP] +description: Test the ERCF grip for a Tool +gcode: + ERCF_SERVO_DOWN + ERCF_MOTORS_OFF + +[gcode_macro ERCF_TEST_LOAD_SEQUENCE] +description: Test sequence +gcode: + {% set loop_number = params.LOOP|default(10)|int %} + {% set use_rand = params.RAND|default(0)|int %} + {% for iteration in range(loop_number|int) %} + {% for load in range((printer["gcode_macro ERCF_VAR"].colorselector|length)|int) %} + {% if use_rand|int == 1 %} + ERCF_SELECT_TOOL TOOL={range(0, printer["gcode_macro ERCF_VAR"].colorselector|length)|random} + {% else %} + ERCF_SELECT_TOOL TOOL={load|int} + {% endif %} + + ERCF_LOAD LENGTH=100 + G4 P50 + ERCF_UNLOAD LENGTH=100 + ERCF_UNSELECT_TOOL + G4 P200 + {% endfor %} + {% endfor %} + +############################################### +# Endless spool mode and clog detection +############################################### + +[gcode_macro ERCF_ENCODER_MOTION_ISSUE] +description: Perform a test when the encoder sense an issue (clog or runout) +gcode: + M118 Issue on tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} + M118 Checking if this is a clog or a runout... + + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + + ERCF_SERVO_DOWN + ERCF_BUZZ_GEAR_MOTOR + ERCF_SERVO_UP + ERCF_CLOG_OR_RUNOUT + +[gcode_macro ERCF_CLOG_OR_RUNOUT] +description: Actions taken if a clog or a runout is detected by the ERCF encoder +gcode: + {% if printer.ercf.encoder_pos|float != 0 %} + M118 Clog detected, please check the ERCF and the printer + {% else %} + M118 Runout detected ! + {% if printer["gcode_macro ERCF_VAR"].endless_spool_mode|int == 1 %} + {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int >= (printer["gcode_macro ERCF_VAR"].colorselector|length -1) %} + {% set nexttool = 0 %} + {% else %} + {% set nexttool = (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int + 1) %} + {% endif %} + + M118 Loading tool {nexttool|int} + SAVE_GCODE_STATE NAME=ERCF_Pre_Brush_init + # Adapt the example below to your own setup + # The goal is just to clean the nozzle after the change + # In my case I have a purge bucket with a brush + # G0 X45 Y300 F18000 + # G0 X45 Y310 Z1 F3000 + + # Custom unload sequence + M118 Forming filament tip and Unloading Filament... + G91 + ERCF_FORM_TIP_STANDALONE + ERCF_HOME_EXTRUDER TOTAL_LENGTH={printer["gcode_macro ERCF_VAR"].sensor_to_nozzle} STEP_LENGTH=2.0 + ERCF_SERVO_DOWN + + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 + G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + + {% set ercf_params = printer.save_variables.variables %} + ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|string)]} + ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} + ERCF_UNSELECT_TOOL + + ERCF_LOAD_TOOL TOOL={nexttool|int} + ERCF_CHECK_IF_RESUME + {% else %} + M118 EndlessSpool mode not enabled, please do something + {% endif %} + {% endif %} + +[gcode_macro ERCF_CHECK_IF_RESUME] +description: Safety checks before resuming the print after an encoder event +gcode: + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + # Adapt the example below to your own setup + # The goal is just to clean the nozzle after the change + # In my case I have a purge bucket with a brush + # BRUSH_PURGE LENGTH=50 + # BRUSH_CLEAN + RESTORE_GCODE_STATE NAME=ERCF_Pre_Brush_init + RESUME + {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 + {% endif %} + {% endif %} + diff --git a/ercf/ercf_vars.cfg b/ercf/ercf_vars.cfg new file mode 100644 index 0000000..bfbf8f9 --- /dev/null +++ b/ercf/ercf_vars.cfg @@ -0,0 +1,15 @@ +[Variables] +ercf_calib_0 = 1.0 +ercf_calib_1 = 1.0 +ercf_calib_2 = 1.0 +ercf_calib_3 = 1.0 +ercf_calib_4 = 1.0 +ercf_calib_5 = 1.0 +ercf_calib_6 = 1.0 +ercf_calib_7 = 1.0 +ercf_calib_8 = 1.0 +ercf_calib_9 = 1.0 +ercf_calib_10 = 1.0 +ercf_calib_11 = 1.0 +ercf_calib_ref = 500.0 + From d287262e7271d9dffc222f625904cff157d8344d Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 25 Nov 2021 22:56:55 +0100 Subject: [PATCH 061/131] v2.4: update ercf --- ercf/.hardware.cfg.swp | Bin 0 -> 12288 bytes ercf/client_macros.cfg | 58 -------- ercf/ercf_hardware.cfg | 73 --------- ercf/hardware.cfg | 78 ++++++++++ ercf/{ercf_software.cfg => software.cfg} | 180 ++++++++++++----------- ercf/{ercf_vars.cfg => vars.cfg} | 12 +- 6 files changed, 180 insertions(+), 221 deletions(-) create mode 100644 ercf/.hardware.cfg.swp delete mode 100644 ercf/client_macros.cfg delete mode 100644 ercf/ercf_hardware.cfg create mode 100644 ercf/hardware.cfg rename ercf/{ercf_software.cfg => software.cfg} (88%) rename ercf/{ercf_vars.cfg => vars.cfg} (61%) diff --git a/ercf/.hardware.cfg.swp b/ercf/.hardware.cfg.swp new file mode 100644 index 0000000000000000000000000000000000000000..f7ca0b7628a2654f008f139976cea6810530145e GIT binary patch literal 12288 zcmeI2&2QX97>6fFh_qF~M1vulIbV~xj~ z1|e>hP*2=J<-iFE2?-9M_JG8V8{&$9!asln5)y|Be%^ILK3mZnFqWQVZI32247_{=~?i083z`1i$QI4Oj!#fHhzZSOeC8HDC=`1J-~wU=3IU z{}BTsVC?i$j9ov0fbjqS;%@-=o?+}R2!Ic+gAu^M{j-dH1wH}qfm`4e;DQ&ySug^A zKf~CM;0N#pxD8gobKptv+iAvr2H$|Y-~(_6yagg~4ZI8-@H}|%G-JPj@4>g=9=HqM z1vkI~m;^6?^WecL#(o0#!I$7;a0lE1A-DoA0}d{N?@luI8Tb_31_o?`c~A$Zz)5f) zp1ua3gO9*F;7w5YdllHj8n6be0c*e-_&*yUTI9S*MyWWIBA`wbi=IpjMM);LkpUZi z@VdSVq|1(NuVqj5(Ol<=%FRymY%4N;=%rEO(rYX8yv9Q2%p0C>GB!&4x}etTr8%#)bZL3EwdyS{uP-bwc?)Z6S6fWpG&&EYc4_Am z3#5_0iO_v4ldcI}s#Toh#)cIIJ)%JzR@2qmWLg!nuROG*YK3Mu;x0>s+$p5zo)HMgbSC>P0o~z0hc|TxjEo zAi&$8ix1EDj=xE}$0%jk^NLKMibLv3f$SPt?2Ba^rsr3y&J^`Tl8bofI--eDU~0D^ ze9I)ju+wr93@yz}G2#0%c4-3fg$mlcUY1IUkU6gOWvu+jY`av&StpN&J!D?7Cs!*Y zipm?_+&S|C*b#{j8FdGF^tCDmTLd|QF^G0Ns05cTl!@Y;1(6;OtGqVTEb>qewQM%U zHXa@0@!2~jc?VO)52mVlM1J?@&iMzqJD3&}{)X+|XhmdTJBy&lc#s4ry4=sEX=`s%XD~QMx2F21aw315yvW9`ms ziK2?E&_<=QSt)+t3u}~Gi56W{)v9Q>BSY?iV9Oq{un!l<;wz0>(`z?qW_6bO9J~Ji E0+TP{xc~qF literal 0 HcmV?d00001 diff --git a/ercf/client_macros.cfg b/ercf/client_macros.cfg deleted file mode 100644 index 6c1268c..0000000 --- a/ercf/client_macros.cfg +++ /dev/null @@ -1,58 +0,0 @@ -[gcode_macro CANCEL_PRINT] -rename_existing: BASE_CANCEL_PRINT -gcode: - TURN_OFF_HEATERS - CLEAR_PAUSE - SDCARD_RESET_FILE - {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 20.0) %} - {% set z_safe = 20.0 %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - G91 - G1 Z{z_safe} F900 - G90 - G0 X{x_park} Y{y_park} F6000 - BASE_CANCEL_PRINT - -[gcode_macro PAUSE] -rename_existing: BASE_PAUSE -gcode: - {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 5.0) %} - {% set z_safe = 5.0 %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} - G92 E0 - G1 E-1.0 F1500.0 - G90 - SAVE_GCODE_STATE NAME=PAUSE_state - BASE_PAUSE - G91 - G1 Z{z_safe} F900 - G90 - G0 X{x_park} Y{y_park} F6000 - -[gcode_macro RESUME] -rename_existing: BASE_RESUME -gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} - M118 You can't resume the print without unlocking the ERCF first. - M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again - {% else %} - RESTORE_GCODE_STATE NAME=PAUSE_state - G90 - {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 - {% endif %} - BASE_RESUME - {% endif %} diff --git a/ercf/ercf_hardware.cfg b/ercf/ercf_hardware.cfg deleted file mode 100644 index 111c986..0000000 --- a/ercf/ercf_hardware.cfg +++ /dev/null @@ -1,73 +0,0 @@ -## Enraged Rabbit : Carrot Feeder V1.1 hardware config file -# Values are an example for voron 2.4 with 2 SKR1.4 - -# Carrot Feeder 5mm D-cut shaft -# Example for an SKR 1.4 Board (E1 on the XY mcu) -[manual_stepper gear_stepper] -step_pin: P1.15 -dir_pin: P1.14 -enable_pin: !P1.16 -rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears -gear_ratio: 80:20 -microsteps: 16 -full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree -velocity: 35 -accel: 150 -#Right now no pin is used for the endstop, but we need to define one for klipper. So just use a random, not used pin -endstop_pin: P0.10 - -[tmc2209 manual_stepper gear_stepper] -# Adapt accordingly to your setup and desires -# The default values are tested with the BOM NEMA14 motor -# Please adapt those values to the motor you are using -# Example : for NEMA17 motors, you'll usually set the stealthchop_threshold to 0 -# and use higher current -uart_pin: P1.1 -interpolate: True -run_current: 0.40 -hold_current: 0.1 -sense_resistor: 0.110 -stealthchop_threshold: 500 - -# Carrot Feeder selector -# Example for an SKR 1.4 Board (Z1 on the XY mcu) -[manual_stepper selector_stepper] -step_pin: P0.22 -dir_pin: P2.11 -enable_pin: !P0.21 -microsteps: 16 -rotation_distance: 40 -full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree -velocity: 200 -accel: 600 -endstop_pin: P1.25 - -[tmc2209 manual_stepper selector_stepper] -uart_pin: P1.8 -run_current: 0.55 -interpolate: True -sense_resistor: 0.110 -stealthchop_threshold: 5000 - -# Values are for the MG90S servo -[servo ercf_servo] -pin: P1.26 -maximum_servo_angle: 180 -minimum_pulse_width: 0.00085 -maximum_pulse_width: 0.00215 - -[duplicate_pin_override] -pins: P1.0 -# Put there the pin used by the encoder and the filament_motion_sensor -# It has to be the same pin for those 3 - -[filament_motion_sensor encoder_sensor] -switch_pin: ^P1.0 -pause_on_runout: False -detection_length: 4.0 -extruder: extruder -# runout_gcode: ERCF_ENCODER_MOTION_ISSUE - -[filament_switch_sensor toolhead_sensor] -pause_on_runout: False -switch_pin: ^P1.27 diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg new file mode 100644 index 0000000..2311bf2 --- /dev/null +++ b/ercf/hardware.cfg @@ -0,0 +1,78 @@ +## Enraged Rabbit : Carrot Feeder config file for ERCF EASY BRD v1.1 + +# This config sample assume you set the two J6 jumpers on 1-2 and 4-5, i.e. [..].[..] + +[mcu ercf] +serial: /dev/serial/by-id/usb-Klipper_samd21g18a_D3EB9B384134555020312E30171117FF-if00 + +# Carrot Feeder 5mm D-cut shaft +[manual_stepper gear_stepper] +step_pin: ercf:PA4 +dir_pin: !ercf:PA10 +enable_pin: !ercf:PA2 +rotation_distance: 22.6789511 # Bondtech 5mm Drive Gears +gear_ratio: 80:20 +microsteps: 16 +full_steps_per_rotation: 200 +velocity: 35 +accel: 100 +endstop_pin: ^ercf:PA7 + +[tmc2209 manual_stepper gear_stepper] +# Adapt accordingly to your setup and desires +# The default values are tested with the BOM NEMA14 motor +uart_pin: ercf:PA8 # shared with selector_stepper +uart_address: 0 +interpolate: True +run_current: 0.8 +hold_current: 0.1 +sense_resistor: 0.110 +stealthchop_threshold: 500 + +[manual_stepper selector_stepper] +step_pin: ercf:PA9 +dir_pin: !ercf:PB8 +enable_pin: !ercf:PA11 +microsteps: 16 +rotation_distance: 40 +full_steps_per_rotation: 200 +velocity: 200 +homing_speed: 100 +accel: 600 +endstop_pin: ^ercf:PB9 + +[tmc2209 manual_stepper selector_stepper] +uart_pin: ercf:PA8 # shared with gear_stepper +uart_address: 1 +run_current: 0.55 +hold_current: 0.4 +interpolate: True +sense_resistor: 0.110 +stealthchop_threshold: 5000 + +# Values are for the MG90S servo +[servo ercf_servo] +pin: ercf:PA5 +maximum_servo_angle: 180 +minimum_pulse_width: 0.00085 +maximum_pulse_width: 0.00215 + +[duplicate_pin_override] +pins: ercf:PA6 +# Put there the pin used by the encoder and the filament_motion_sensor +# It has to be the same pin for those 3 + +[filament_motion_sensor encoder_sensor] +switch_pin: ^ercf:PA6 +pause_on_runout: False +detection_length: 3.0 +extruder: extruder +# runout_gcode: ERCF_ENCODER_MOTION_ISSUE + +[filament_switch_sensor toolhead_sensor] +pause_on_runout: False +switch_pin: ^PG13 +runout_gcode: + M118 toolhead filament removed +insert_gcode: + M118 toolhead filament inserted diff --git a/ercf/ercf_software.cfg b/ercf/software.cfg similarity index 88% rename from ercf/ercf_software.cfg rename to ercf/software.cfg index 49a8bba..20c52b4 100644 --- a/ercf/ercf_software.cfg +++ b/ercf/software.cfg @@ -3,14 +3,16 @@ ############################### [ercf] -# Encoder -encoder_pin: ^P1.0 -encoder_resolution: 1.365188 # in mm +# Encoder +# encoder_pin: ^P1.0 +encoder_pin: ercf:PA6 # easy brd +# encoder_resolution: 1.365188 # default +encoder_resolution: 1.349528 # from `ercf_calibrate_encoder` # Speeds and accels # Long moves are faster than the small ones # 100mm/s should be "quiet" with the NEMA14 motor or a NEMA17 pancake, but you can go lower if your really want it to be low noise # Tested without any issue at 200mm/s, but it's noisy. I'm running mine at 170mm/s for long moves and 50mm/s for short moves. -long_moves_speed: 100 # mm/s. Default value is 100mm/s. +long_moves_speed: 60 # mm/s. Default value is 100mm/s. long_moves_accel: 400 # mm/s². Default value is 400mm/s² short_moves_speed: 25 # mm/s. Default value is 25mm/s. short_moves_accel: 400 # mm/s². Default value is 400mm/s² @@ -27,7 +29,7 @@ short_moves_accel: 400 # mm/s². Default value is 400mm/s² # Galileo Clockwork with ERCF V1.1 sensor (hall effect) : 27.0 # LGX on AfterBurner with ERCF V1.1 sensor (hall effect) : 44.0 # AfterBurner Clockwork with ERCF V1.1 sensor (hall effect) : 36.0 -variable_end_of_bowden_to_sensor: 27.0 +variable_end_of_bowden_to_sensor: 40 # xk # Length from the sensor to the nozzle melt pool. # Reduce this value if there are blobs of filament on each load, before the purge on the tower. # Increase this value if there are big gaps on the purge tower (i.e. if it takes time for the filament to get pushed out after a swap) @@ -35,15 +37,16 @@ variable_end_of_bowden_to_sensor: 27.0 # Galileo Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 60.5 # LGX on AfterBurner with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 55.6 # AfterBurner Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 54.0 -variable_sensor_to_nozzle: 60.5 +variable_sensor_to_nozzle: 54 # -# ==== Values to tune ==== +# ==== Values to tune ==== # # Tool position for the selector. This has to be tuned manually. Please scale this array to the number of tools you have -variable_colorselector = [2.4, 24.0, 44.8, 71.2, 92.0, 113.6, 139.2, 160.8, 181.6] +# variable_colorselector = [ 2.4, 23.2, 44.0] # 3 tools +variable_colorselector = [2.4, 23.2, 44.0, 69.6, 91.2, 112.0] # 6 tools # Base value for the loading length used by the auto-calibration macro # Please use a value SMALLER than the real reverse bowden length (like 50mm less) -variable_min_bowden_length: 750.0 +variable_min_bowden_length: 850 # Servo angle for the Up position (i.e. tool disengaged). Refer to the manual to know how to properly tune this value # Default values: # MG90S servo : 30 @@ -53,8 +56,8 @@ variable_servo_up_angle: 30 # Default values: # MG90S servo : 140 # SAVOX SH0255MG : 30 -variable_servo_down_angle: 140 -# Options to use or not +variable_servo_down_angle: 130 +# Options to use or not # Beware that the clog detection and endless spool mode are in BETA mode for now # Use at your own risk (beware of the involved macros and the pause(s) and resume ones) # Put 0 to disable, 1 to enable @@ -67,14 +70,14 @@ variable_endless_spool_mode: 0 # Things that you shouldn't have to change variable_unload_modifier: 9.0 # Modifier to adjust the ERCF park position (where the filament ends when doing an unload) -variable_min_temp_extruder: 180 # Temp used during the auto-calibration macro, to ensure we can move the extruder (but not really extruding) +variable_min_temp_extruder: 210 # Temp used during the auto-calibration macro, to ensure we can move the extruder (but not really extruding) variable_extruder_eject_temp: 240 # Temp used during filament ejection (in the ERCF_HOME macro, if a filament is detected in the toolhead) variable_timeout_pause: 72000 # Time out used by the ERCF_PAUSE variable_disable_heater: 600 # Delay after which the hotend heater is disabled in the ERCF_PAUSE state gcode: [save_variables] -filename: /home/pi/klipper_config/ercf_vars.cfg +filename: /home/pi/klipper_config/ercf/vars.cfg ############################### # ERCF Calibration macros @@ -88,46 +91,46 @@ gcode: M118 Measuring the selector position for tool {params.TOOL} ERCF_GET_SELECTOR_POS REF={move_length|int} - + ERCF_MOTORS_OFF [gcode_macro ERCF_CALIBRATE] description: Complete calibration of all ERCF Tools gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - M118 Start the complete auto calibration... + M118 Start the complete auto calibration... M118 First home the ERCF - ERCF_HOME + ERCF_HOME - {% for chan in range(printer["gcode_macro ERCF_VAR"].colorselector|length) %} - ERCF_CALIBRATE_SINGLE TOOL={chan|int} - {% endfor %} + {% for chan in range(printer["gcode_macro ERCF_VAR"].colorselector|length) %} + ERCF_CALIBRATE_SINGLE TOOL={chan|int} + {% endfor %} - M118 End of the complete auto calibration! + M118 End of the complete auto calibration! M118 Please reload the firmware for the calibration to be active! [gcode_macro ERCF_CALIBRATE_SINGLE] description: Calibration of a single ERCF Tool gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - {% if params.TOOL|int >= 0 and params.TOOL|int < printer["gcode_macro ERCF_VAR"].colorselector|length %} - {% if printer["gcode_macro ERCF_HOME"].home == -1 %} - M118 First home the ERCF - ERCF_HOME - {% endif %} + {% if params.TOOL|int >= 0 and params.TOOL|int < printer["gcode_macro ERCF_VAR"].colorselector|length %} + {% if printer["gcode_macro ERCF_HOME"].home == -1 %} + M118 First home the ERCF + ERCF_HOME + {% endif %} ERCF_SELECT_TOOL TOOL={params.TOOL} ERCF_SET_STEPS RATIO=1.0 {% if params.TOOL|int == 0 %} {% if printer['extruder'].temperature < printer["gcode_macro ERCF_VAR"].min_temp_extruder %} - M109 S{printer["gcode_macro ERCF_VAR"].min_temp_extruder|int} + M109 S{printer["gcode_macro ERCF_VAR"].min_temp_extruder|int} {% endif %} M118 Calibrating reference tool {params.TOOL} ERCF_LOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length} ERCF_HOME_EXTRUDER TOTAL_LENGTH=400 STEP_LENGTH=0.5 - + ERCF_CALIB_SAVE_VAR TOOL={params.TOOL} G91 @@ -137,10 +140,10 @@ gcode: G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 ERCF_CALIB_UNLOAD - + ERCF_BUZZ_GEAR_MOTOR ERCF_IS_FILAMENT_STUCK_IN_ERCF - + ERCF_UNSELECT_TOOL {% else %} M118 Calibrating tool {params.TOOL} @@ -151,9 +154,9 @@ gcode: ERCF_CALIB_UNLOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0 + 27.0} {% endif %} - {% else %} - M118 Tool out of range - {% endif %} + {% else %} + M118 Tool out of range + {% endif %} [gcode_macro ERCF_CALIB_SAVE_VAR] description: Saving ERCF calibration values @@ -259,16 +262,20 @@ description: Pause the current print and lock the ERCF operations variable_is_paused: 0 variable_extruder_temp: 0 gcode: - SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=extruder_temp VALUE={printer.extruder.target} - SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=1 - SET_IDLE_TIMEOUT TIMEOUT={printer["gcode_macro ERCF_VAR"].timeout_pause} - UPDATE_DELAYED_GCODE ID=disable_heater DURATION={printer["gcode_macro ERCF_VAR"].disable_heater} - M118 An issue with the ERCF has been detected and the ERCF has been PAUSED - M118 When you intervene to fix the issue, first call the "ERCF_UNLOCK" Gcode - M118 Refer to the manual before resuming the print - SAVE_GCODE_STATE NAME=ERCF_state - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - PAUSE + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=extruder_temp VALUE={printer.extruder.target} + SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=1 + SET_IDLE_TIMEOUT TIMEOUT={printer["gcode_macro ERCF_VAR"].timeout_pause} + UPDATE_DELAYED_GCODE ID=disable_heater DURATION={printer["gcode_macro ERCF_VAR"].disable_heater} + M118 An issue with the ERCF has been detected and the ERCF has been PAUSED + M118 When you intervene to fix the issue, first call the "ERCF_UNLOCK" Gcode + M118 Refer to the manual before resuming the print + SAVE_GCODE_STATE NAME=ERCF_state + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + PAUSE + {% else %} + M118 already paused + {% endif %} ############################################ # Changing tool macros @@ -317,7 +324,7 @@ gcode: [gcode_macro ERCF_CHANGE_TOOL] description: Perform a tool swap gcode: - {% if printer.idle_timeout.state == "Printing" %} + {% if printer.idle_timeout.state == "Printing" %} ERCF_CHANGE_TOOL_SLICER TOOL={params.TOOL|int} {% else %} ERCF_CHANGE_TOOL_STANDALONE TOOL={params.TOOL|int} @@ -327,7 +334,7 @@ gcode: description: Perform a tool swap during a print gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} + {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} # Add a variable 'SwapCounter' in your PRINT_START macro to display this info # {% set newcounter = (printer["gcode_macro PRINT_START"].swapcounter|int + 1) %} # SET_GCODE_VARIABLE MACRO=PRINT_START VARIABLE=swapcounter VALUE={newcounter} @@ -337,7 +344,7 @@ gcode: ERCF_LOAD_TOOL TOOL={params.TOOL|int} ERCF_CHANGE_TOOL_SLICER_END {% endif %} - + [gcode_macro ERCF_CHANGE_TOOL_SLICER_END] gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} @@ -368,7 +375,7 @@ gcode: ERCF_LOAD_TOOL TOOL={params.TOOL|int} {% endif %} - + ############################################ # Unloading/Loading Macros ############################################ @@ -419,7 +426,7 @@ description: Eject the filament during a print and park it into the ERCF gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != -1 %} - M118 Unload tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... + M118 ERCF_UNLOAD_TOOL Unload tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... ERCF_HOME_EXTRUDER ERCF_SELECT_TOOL TOOL={printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} {% set ercf_params = printer.save_variables.variables %} @@ -427,10 +434,11 @@ gcode: G91 G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + 20.0} SPEED=25 ACCEL=0 SYNC=0 - G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + 20.0} F1500.0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 + M118 ERCF_UNLOAD_TOOL G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 {% set ercf_params = printer.save_variables.variables %} - ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float - 20.0} + ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} ERCF_UNSELECT_TOOL {% endif %} {% endif %} @@ -448,15 +456,15 @@ variable_color_selected: -1 gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_HOME"].home != -1 %} - M118 Select Tool {params.TOOL} ... + M118 ERCF_SELECT_TOOL Select Tool {params.TOOL} ... ERCF_SERVO_UP MANUAL_STEPPER STEPPER=selector_stepper MOVE={printer["gcode_macro ERCF_VAR"].colorselector[params.TOOL|int]} SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE={params.TOOL} SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE={params.TOOL} ERCF_SERVO_DOWN - M118 Tool {params.TOOL} Enabled + M118 ERCF_SELECT_TOOL Tool {params.TOOL} Enabled {% else %} - M118 Could not select tool, ERCF is not homed + M118 ERCF_SELECT_TOOL Could not select tool, ERCF is not homed {% endif %} {% endif %} @@ -473,7 +481,7 @@ gcode: {% endif %} ERCF_SET_STEPS RATIO=1.0 {% else %} - M118 Could not unselect tool, ERCF is not homed + M118 ERCF_UNSELECT_TOOL Could not unselect tool, ERCF is not homed {% endif %} {% endif %} @@ -488,23 +496,23 @@ description: Load filament from the toolhead entrance to the nozzle gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} - M118 Loading Filament... + M118 ERCF_LOAD_F_I_E Loading Filament... G91 G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE={printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} SPEED=25 ACCEL=0 SYNC=0 - G1 E{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} F1500.0 - G4 P100 + MANUAL_STEPPER STEPPER=gear_stepper MOVE={printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} SPEED=25 ACCEL=0 SYNC=0 + G1 E{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} F1500.0 + G4 P100 ERCF_HOME_EXTRUDER TOTAL_LENGTH=30.0 STEP_LENGTH=0.5 - ERCF_UNSELECT_TOOL - G1 E15 F1800 - G1 E{printer["gcode_macro ERCF_VAR"].sensor_to_nozzle - 20} F1800 - G1 E5 F600 - G92 E0 - G90 - M118 Load Complete + ERCF_UNSELECT_TOOL + G1 E15 F1800 + G1 E{printer["gcode_macro ERCF_VAR"].sensor_to_nozzle - 20} F1800 + G1 E5 F600 + G92 E0 + G90 + M118 ERCF_LOAD_F_I_E Load Complete {% else %} - M118 Extruder too cold + M118 ERCF_LOAD_F_I_E Extruder too cold ERCF_PAUSE {% endif %} {% endif %} @@ -616,7 +624,7 @@ gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} {% if printer["gcode_macro ERCF_SELECT_TOOL"].tool_selected|int == -1 %} - M118 Forming filament tip and Unloading Filament... + M118 ERCR_U_F_IEWTF Forming filament tip and Unloading Filament... G91 ERCF_FORM_TIP_STANDALONE G1 E-4.00 F1200.0 @@ -628,13 +636,13 @@ gcode: MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 - M118 Filament removed + M118 ERCF_U_F_FIEWTF Filament removed {% else %} M118 Tool selected, UNSELECT it ERCF_PAUSE {% endif %} {% else %} - M118 Extruder too cold + M118 ERCF_U_F_FIEWTF Extruder too cold ERCF_PAUSE {% endif %} {% endif %} @@ -647,9 +655,9 @@ gcode: [gcode_macro ERCF_IS_FILAMENT_IN_EXTRUDER] gcode: {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} - M118 Filament is in extruder + M118 ERCF_IS_F_IE Filament is in extruder {% else %} - M118 Filament not in extruder + M118 ERCF_IS_F_IE Filament not in extruder ERCF_PAUSE {% endif %} @@ -657,10 +665,10 @@ gcode: [gcode_macro ERCF_IS_FILAMENT_STUCK_IN_ERCF] gcode: {% if printer.ercf.encoder_pos|float != 0 %} - M118 Filament stuck in ERCF + M118 ERCF_IS_F_SIE Filament stuck in ERCF ERCF_PAUSE {% else %} - M118 Filament not in ERCF + M118 ERCF_IS_F_SIE Filament not in ERCF {% endif %} ############################################ @@ -671,12 +679,13 @@ gcode: [gcode_macro ERCF_EJECT_UNKNOW_STATE] description: Unload filament from an unknown position gcode: - M118 Eject Filament if loaded ... + M118 EJECT_US Eject Filament if loaded ... {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} - M118 Filament in extruder, trying to eject it .. - {% if printer['extruder'].temperature < 178 %} - M118 Preheat Nozzle - M109 S{printer["gcode_macro ERCF_VAR"].extruder_eject_temp} + M118 ERCF_EJECT_US Filament in extruder, trying to eject it .. + {% set extruder_eject_temp = printer["gcode_macro ERCF_VAR"].extruder_eject_temp %} + {% if printer['extruder'].temperature < extruder_eject_temp %} + M118 Preheat Nozzle to {extruder_eject_temp} + M109 S{extruder_eject_temp} {% endif %} ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING ERCF_UNLOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length - 50} UNKNOWN=1 @@ -693,9 +702,9 @@ description: Unload filament from the reverse bowden gcode: {% if printer.ercf.encoder_pos|float != 0 %} ERCF_UNLOAD HOMING=1 - M118 Filament ejected ! + M118 Filament ejected! {% else %} - M118 Filament already ejected ! + M118 Filament already ejected! {% endif %} ERCF_SERVO_UP @@ -718,8 +727,11 @@ gcode: {% endif %} M118 Homing ERCF ... QUERY_ENDSTOPS + M118 ERCF_EJECT_UNKNOW_STATE ERCF_EJECT_UNKNOW_STATE + M118 ERCF_HOME_SELECTOR ERCF_HOME_SELECTOR + M118 ERCF_HOME_ONLY ERCF_HOME_ONLY [gcode_macro ERCF_HOME_SELECTOR] @@ -803,7 +815,7 @@ gcode: {% else %} ERCF_SELECT_TOOL TOOL={load|int} {% endif %} - + ERCF_LOAD LENGTH=100 G4 P50 ERCF_UNLOAD LENGTH=100 @@ -815,7 +827,7 @@ gcode: ############################################### # Endless spool mode and clog detection ############################################### - + [gcode_macro ERCF_ENCODER_MOTION_ISSUE] description: Perform a test when the encoder sense an issue (clog or runout) gcode: @@ -828,7 +840,7 @@ gcode: ERCF_BUZZ_GEAR_MOTOR ERCF_SERVO_UP ERCF_CLOG_OR_RUNOUT - + [gcode_macro ERCF_CLOG_OR_RUNOUT] description: Actions taken if a clog or a runout is detected by the ERCF encoder gcode: @@ -891,4 +903,4 @@ gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 {% endif %} {% endif %} - + diff --git a/ercf/ercf_vars.cfg b/ercf/vars.cfg similarity index 61% rename from ercf/ercf_vars.cfg rename to ercf/vars.cfg index bfbf8f9..f33093e 100644 --- a/ercf/ercf_vars.cfg +++ b/ercf/vars.cfg @@ -1,15 +1,15 @@ [Variables] ercf_calib_0 = 1.0 -ercf_calib_1 = 1.0 -ercf_calib_2 = 1.0 -ercf_calib_3 = 1.0 +ercf_calib_1 = 1.00135110302 +ercf_calib_10 = 1.0 +ercf_calib_11 = 1.0 +ercf_calib_2 = 1.00374477099 +ercf_calib_3 = 1.17246806366 ercf_calib_4 = 1.0 ercf_calib_5 = 1.0 ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_10 = 1.0 -ercf_calib_11 = 1.0 -ercf_calib_ref = 500.0 +ercf_calib_ref = 976.383508 From 1694da09bcbd85a99662c62a2c6004334aa28a95 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 25 Nov 2021 22:57:41 +0100 Subject: [PATCH 062/131] v2.4: update things --- input_shaper.cfg | 4 +- macros/helpers.cfg | 94 ++++++++++++++++++------------- macros/print.cfg | 137 +++++++++++++++++++++++++++------------------ printer.cfg | 72 +++++++----------------- z_calibration.cfg | 8 +-- 5 files changed, 165 insertions(+), 150 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index a3adc25..27d5a2e 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -4,9 +4,9 @@ # is mzv input shaper. # shaper_type: mzv shaper_type_x: mzv -shaper_freq_x: 53 +shaper_freq_x: 52.8 shaper_type_y: mzv -shaper_freq_y: 53 +shaper_freq_y: 41.2 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/macros/helpers.cfg b/macros/helpers.cfg index 6bfda81..05ca004 100644 --- a/macros/helpers.cfg +++ b/macros/helpers.cfg @@ -1,55 +1,73 @@ #################################################################### # Helper macros # - MOVE_SPEED -# - ZES +# - ... #################################################################### [gcode_macro MOVE_SPEED] description: move along certain patterns with selected speed gcode: {% set F=params.F|default(3000)|int %} + {% set N=params.N|default(1)|int %} {% if printer.idle_timeout.state != "Printing" %} {% if "xyz" in printer.toolhead.homed_axes %} - {action_respond_info("moving with F%d" % F)} - ; square clockwise - M117 > square clockwise - G0 X275 Y275 F{F} - G0 Y25 - G0 X25 - G0 Y275 - G0 X275 - ; square counter-clockwise - M117 > square counter-clockwise - G0 X25 - G0 Y25 - G0 X275 - G0 Y275 - ; diagonal motor a - M117 > diagonal motor a - G0 X25 Y25 - G0 X275 Y275 - G0 X25 - ; diagonal motor b - M117 > diagonal motor b - G0 X275 Y25 - G0 X25 Y275 - G0 X275 Y275 + M118 moving {N}x with F{F} + {% set X0=275 %} + {% set X1=25 %} + {% set Y0=275 %} + {% set Y1=25 %} + ; start + G0 X{X0} Y{Y0} F3000 + G0 F{F} + {% for i in range(N) %} + M118 move {(i+1)}/{N} + ; move 1 + G0 X{X1} Y{Y0} + G0 X{X0} Y{Y1} + ; move 2 + G0 X{X0} Y{Y0} + G0 X{X1} Y{Y1} + ; move 3 + G0 X{X0} Y{Y1} + G0 X{X1} Y{Y0} + ; move 4 + G0 X{X1} Y{Y1} + G0 X{X0} Y{Y0} + {% endfor %} + M118 done {% else %} - {action_respond_info("Printer not homed")} + M118 Printer not homed {% endif %} {% else %} - {action_respond_info("Already printing")} + M118 Already printing {% endif %} - -[gcode_macro ZES] -description: Z_ENDSTOP_CALIBRATE + extras +[gcode_macro fes] +description: query filament sensor encoder_sensor gcode: - {% if printer.idle_timeout.state != "Printing" %} - G28 - G0 X150 Y150 Z10 F10000 - Z_ENDSTOP_CALIBRATE - TESTZ Z=-9 - {% else %} - {action_respond_info("Already printing")} - {% endif %} + QUERY_FILAMENT_SENSOR SENSOR=encoder_sensor + +[gcode_macro fts] +description: query filament sensor toolhead_sensor +gcode: + QUERY_FILAMENT_SENSOR SENSOR=toolhead_sensor + +[gcode_macro zc] +gcode: + {% set z_run = params.CUR|default(0.4)|float %} + {% set z_hold = z_run %} + {action_respond_info("zc: setting zcurrent to %.2f" % z_run)} + SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} + SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} + + +[gcode_macro zm] +gcode: + {% set speed = params.SPEED|default(300)|int %} + {action_respond_info("moving with F%d" % speed)} + G0 Z30 F{speed} + G0 Z10 F{speed} + + diff --git a/macros/print.cfg b/macros/print.cfg index 78d9963..98e0128 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -18,28 +18,32 @@ gcode: {% set x0=200 %} {% set x1=250 %} - {% set y0=310 %} - {% set z0=1 %} + {% set y0=309 %} + {% set z0=1.5 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} - M117 > brushie brushie brushie + M118 brushie brushie brushie G0 Z{z_hop} F1000 # move Z to travel height G0 X{x0} Y{y0} F6000 # move to x0/y0 G0 Z{z0} # lower - G0 X{x1} # back - G0 X{x0} # forth - G0 X{x1} # back + G0 X{x1} # 1 + G0 X{x0} # 2 + G0 X{x1} # 3 + G0 X{x0} # 4 G0 Z{z_hop} F300 # move Z to travel height {% else %} - {action_respond_info("Printer not homed")} + M118 Printer not homed {% endif %} -# CANCEL_PRINT +# # - CANCEL_PRINT [gcode_macro CANCEL_PRINT] description: Cancel the actual running print rename_existing: _CANCEL_PRINT_BASE gcode: + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + CLEAR_PAUSE + SDCARD_RESET_FILE TURN_OFF_HEATERS PARK _CANCEL_PRINT_BASE @@ -50,7 +54,7 @@ description: Change filament gcode: SAVE_GCODE_STATE NAME=M600_state PAUSE Y=15 - M117 > change filament + M118 M600 change filament RESTORE_GCODE_STATE NAME=M600_state [gcode_macro M900] @@ -72,43 +76,42 @@ gcode: {% set y_park = Y %} {% endif %} # calculate save lift position - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 20.0) %} - {% set z_safe = 20.0 %} - {% else %} - {% set z_safe = max_z - act_z %} + {% set z_max = printer.toolhead.axis_maximum.z|float %} + {% set z_act = printer.toolhead.position.z|float %} + {% set z_safe = z_act + 10 %} + {% if z_safe > z_max %} + {% set z_safe = z_max %} {% endif %} G91 G0 Z{z_safe} F1200 G90 G0 X{x_park} Y{y_park} F6000 {% else %} - {action_respond_info("Printer not homed")} + M118 Printer not homed {% endif %} -# PAUSE +# - PAUSE [gcode_macro PAUSE] description: Pause the actual running print rename_existing: _PAUSE_BASE # change this if you need more or less extrusion variable_extrude: 1.0 gcode: - {% set Y=params.Y|default(295) %} + {% set YMIN = printer.toolhead.axis_minimum.y|float + 5.0 %} + {% set Y=params.Y|default(YMIN) %} # read E from pause macro {% set E = printer["gcode_macro PAUSE"].extrude|float %} # end of definitions - M117 > pause + M118 pause _PAUSE_BASE {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E-{E} F2100 G90 {% else %} - {action_respond_info("Extruder not hot enough")} + M118 Extruder not hot enough {% endif %} - PARK Y={Y} # - PRINT_START @@ -118,15 +121,15 @@ gcode: {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set CHAMBER=params.CHAMBER|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} - {% set QGL=params.QGL|default(1)|int %} + {% set QGL=params.QGL|default(0)|int %} {% set BMC=params.BMC|default(0)|int %} {% set PURGE=params.PURGE|default(1)|int %} {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} - # TODO: ERCF - {% set ERCF=params.ERCF|default(0) %} - {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, SHEET=%s, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, CHAMBER, SHEET, QGL, BMC, PURGE, SOAK, Z_ADJUST))} - M117 > configuring + {% set ERCF=params.ERCF|default(0)|int %} + {% set ERCF_EXTRUDER=params.ERCF_EXTRUDER|default(0)|int %} + {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, SHEET=%s, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f, ERCF=%d, ERCF_EXTRUDER=%d" % (BED, EXTRUDER, CHAMBER, SHEET, QGL, BMC, PURGE, SOAK, Z_ADJUST, ERCF, ERCF_EXTRUDER))} + M118 configuring SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 G4 P2000 SET_GCODE_OFFSET Z=0.0 # reset z offset @@ -137,44 +140,56 @@ gcode: G90 # use absolute coordinates M83 # use relative distances for extrusion - M117 > homing G4 P2000 {% if BMC %} BED_MESH_CLEAR {% endif %} - M117 > home + M118 home G28 BRUSHIE - {% if QGL %} - M117 > qgl + {% if ERCF %} + M118 ercf home + ERCF_HOME + {% endif %} + {% if QGL or printer.quad_gantry_level.applied|lower == 'false' %} + M118 qgl QUAD_GANTRY_LEVEL PARK=false BRUSHIE {% endif %} - M117 > calibrate z + M118 calibrate z CALIBRATE_Z {% if BMC %} - M117 > bed mesh calibrate + M118 bed mesh calibrate BED_MESH_CALIBRATE {% else %} - M117 > bed mesh load {SHEET} + M118 bed mesh load {SHEET} BED_MESH_PROFILE LOAD={SHEET} {% endif %} - M117 > heating + M118 heating G4 P2000 G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature M109 S{EXTRUDER} # set and wait for nozzle temperature TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={CHAMBER} # wait for chamber temp {% if SOAK > 0 %} - M117 > soaking for {SOAK/1000/60|int} min + M118 soaking for {SOAK/1000/60|int} min G4 P{SOAK} {% endif %} - M117 > starting + M118 starting SET_PRESSURE_ADVANCE ADVANCE=0.05 SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 + + {% if ERCF %} + M118 ercf changing to tool {ERCF_EXTRUDER} + ERCF_CHANGE_TOOL_STANDALONE TOOL={ERCF_EXTRUDER} + {% endif %} G4 P2000 + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == False %} + M118 Insert filament and press resume + PAUSE + {% endif %} {% if PURGE %} PURGE_NOZZLE {% endif %} @@ -183,11 +198,15 @@ gcode: # - PRINT_END [gcode_macro PRINT_END] gcode: - M117 > finished + {% set UNLOAD_AT_END=params.UNLOAD_AT_END|default(0)|int %} + M118 finished PARK M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-10.0 F3600 ; retract filament + {% if UNLOAD_AT_END == 1 %} + ERCF_EJECT + {% endif %} TURN_OFF_HEATERS M107 ; turn off fan @@ -200,11 +219,11 @@ gcode: {% set y0=params.y0|default(2) %} {% set y1=params.y1|default(3) %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} - M117 > purge nozzle + M118 purge nozzle G0 Z{z_hop} F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 G0 Z0.24 F300 # lower Z - G0 X{x1} E20 # draw line + G0 X{x1} E20 F1500 # draw line G0 Y{y1} # move to y1 G0 X{x0} E10 # draw fine line G0 X{x0-10} # move a little further @@ -217,23 +236,33 @@ gcode: description: Resume the actual running print rename_existing: _RESUME_BASE gcode: - # read E from pause macro - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # get VELOCITY parameter if specified - {% if 'VELOCITY' in params|upper %} - {% set get_params = ('VELOCITY=' + params.VELOCITY) %} - {%else %} - {% set get_params = "" %} - {% endif %} - # end of definitions - M117 > resume - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E{E} F6000 + {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} + M118 You can't resume the print without unlocking the ERCF first. + M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again {% else %} - {action_respond_info("Extruder not hot enough")} + # read E from pause macro + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # get VELOCITY parameter if specified + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + # end of definitions + M118 resume + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F6000 + {% else %} + M118 Extruder not hot enough + {% endif %} + {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 + {% endif %} + M118 calling _RESUME_BASE + G4 P2000 + _RESUME_BASE {% endif %} - _RESUME_BASE {get_params} [gcode_macro PRINT_LAYER_CHANGE] diff --git a/printer.cfg b/printer.cfg index 0330fda..1b235e0 100644 --- a/printer.cfg +++ b/printer.cfg @@ -32,34 +32,9 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 ##-------------------------------------------------------------------- -[gcode_macro zc] -gcode: - {% set z_run = params.CUR|default(0.4)|float %} - {% set z_hold = z_run %} - {action_respond_info("zc: setting zcurrent to %.2f" % z_run)} - SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} - - -[gcode_macro zm] -gcode: - {% set speed = params.SPEED|default(300)|int %} - {action_respond_info("moving with F%d" % speed)} - G0 Z30 F{speed} - G0 Z10 F{speed} - - -[gcode_macro foo] -gcode: - {% set SENSOR = params.SENSOR|default("bme280 chamber")|string %} - {action_respond_info("sensor: %s, qgl: %s" % (SENSOR, printer.quad_gantry_level.applied))} - - [printer] kinematics: corexy -max_velocity: 500 +max_velocity: 600 ## regular max_accel: 3000 max_accel_to_decel: 1500 # default half of max_accel @@ -79,6 +54,8 @@ square_corner_velocity: 5.0 [include input_shaper.cfg] # [include resonance_test.cfg] [include z_calibration.cfg] +[include ercf/hardware.cfg] +[include ercf/software.cfg] ##################################################################### @@ -151,7 +128,7 @@ endstop_pin: PG10 position_endstop: 0.5 position_max: 290 position_min: -5 -homing_speed: 13.0 # speed: mm/sec, feedrate: mm/min +homing_speed: 8.0 # speed: mm/sec, feedrate: mm/min homing_retract_speed: 10 second_homing_speed: 2 homing_retract_dist: 3 @@ -223,7 +200,7 @@ stealthchop_threshold: 0 # E0 on MOTOR6 [extruder] step_pin: PE2 -dir_pin: !PE3 +dir_pin: PE3 enable_pin: !PD4 ## Update value below when you perform extruder calibration ## If you ask for 100mm of filament, but in reality it is 98mm: @@ -256,7 +233,14 @@ pressure_advance: 0.05 pressure_advance_smooth_time: 0.040 # Maximum length (in mm of raw filament) that a retraction or # extrude-only move may have, default: 50 -max_extrude_only_distance: 100 +max_extrude_only_distance: 200 +# Maximum area (in mm^2) of an extrusion cross section (eg, +# extrusion width multiplied by layer height). This setting prevents +# excessive amounts of extrusion during relatively small XY moves. +# If a move requests an extrusion rate that would exceed this value +# it will cause an error to be returned. The default is: 4.0 * +# nozzle_diameter^2 +max_extrude_cross_section: 50.0 # default 4 * 0.4 = 0.64 ## E0 on MOTOR6 [tmc2209 extruder] @@ -287,22 +271,6 @@ max_temp: 120 #pid_kd: 363.769 -##################################################################### -# Filament Sensor -##################################################################### - -[filament_switch_sensor filament_switch] -switch_pin: ^!PG12 -pause_on_runout: True -# runout_gcode is executed after pause_on_runout -runout_gcode: - M117 filament removed -insert_gcode: - M117 filament inserted -# event_delay: 3.0 -# pause_delay: 0.5 - - ##################################################################### # Enclosure Temp Sensor Section ##################################################################### @@ -416,13 +384,13 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.075000, 0.060000, 0.040000, 0.045000, 0.040000, 0.072500, 0.072500 -#*# 0.032500, 0.005000, 0.022500, 0.025000, 0.005000, 0.062500, 0.060000 -#*# -0.005000, -0.000000, -0.007500, -0.017500, -0.002500, 0.035000, 0.042500 -#*# -0.007500, 0.000000, 0.002500, 0.000000, 0.007500, 0.010000, 0.015000 -#*# -0.010000, 0.022500, 0.012500, -0.007500, 0.005000, 0.027500, 0.002500 -#*# 0.012500, 0.007500, 0.017500, -0.002500, 0.047500, 0.025000, 0.000000 -#*# 0.060000, 0.072500, 0.035000, 0.075000, 0.057500, 0.057500, 0.065000 +#*# 0.037500, 0.035000, 0.037500, 0.060000, 0.040000, 0.070000, 0.030000 +#*# 0.032500, 0.037500, 0.002500, 0.017500, 0.040000, 0.040000, 0.057500 +#*# 0.010000, -0.002500, 0.020000, -0.005000, -0.005000, 0.012500, 0.037500 +#*# 0.050000, -0.020000, 0.002500, 0.000000, 0.010000, 0.030000, 0.022500 +#*# -0.002500, 0.025000, 0.022500, 0.015000, 0.000000, 0.037500, 0.045000 +#*# 0.020000, 0.015000, 0.030000, 0.027500, 0.025000, 0.015000, 0.005000 +#*# 0.040000, 0.022500, 0.032500, 0.032500, 0.065000, 0.055000, 0.032500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic diff --git a/z_calibration.cfg b/z_calibration.cfg index fff2349..cc1d00a 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -5,13 +5,13 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 94.5 ; z Endstop x position inside right profile -variable_z_endstop_y: 310 ; z Endstop y position +variable_z_endstop_y: 309 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.5 ; reduced homing current for x and y variable_z_home_current: 0.4 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### -variable_probe_dock_x: 52 ; x toolhead position before docking probe +variable_probe_dock_x: 53 ; x toolhead position before docking probe variable_probe_dock_y: 250 ; y toolhead position before docking probe variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) variable_probe_undock_x: 110 ; x toolhead position after docking probe @@ -36,7 +36,7 @@ gcode: # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. probe_nozzle_x: 94.5 -probe_nozzle_y: 310 +probe_nozzle_y: 309 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.59 +switch_offset: 0.55 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From 243d45a3ed9acb6e676d5515b9198b7910c53fcf Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 26 Nov 2021 18:02:00 +0100 Subject: [PATCH 063/131] v2.4: remove old display config --- display.cfg | 286 ---------------------------------------------------- 1 file changed, 286 deletions(-) delete mode 100644 display.cfg diff --git a/display.cfg b/display.cfg deleted file mode 100644 index 5f80b7e..0000000 --- a/display.cfg +++ /dev/null @@ -1,286 +0,0 @@ -##################################################################### -# Displays -##################################################################### - -[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> - -[display] -# mini12864 LCD 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 -# display_group: __voron_display - -[neopixel btt_mini12864] -# To control Neopixel RGB in mini12864 display -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=0.50 GREEN=0.00 BLUE=0.00 INDEX=1 TRANSMIT=0 - SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=2 TRANSMIT=0 - SET_LED LED=btt_mini12864 RED=0.13 GREEN=0.16 BLUE=1.00 INDEX=3 - - -##################################################################### -# Display Menu definition -##################################################################### - -# Removed items -[menu __main __octoprint] -type: disabled - -## Control -[menu __main __control __home] -type: disabled - -[menu __main __control __homez] -type: disabled - -[menu __main __control __homexy] -type: disabled - -## PreHeat -[menu __main __temp __preheat_pla] -type: disabled - -[menu __main __temp __preheat_abs] -type: disabled - -## use own load and unload macro -[menu __main __filament __loadf] -type: disabled - -[menu __main __filament __loads] -type: disabled - -[menu __main __filament __unloadf] -type: disabled - -[menu __main __filament __unloads] -type: disabled - -## Control -[menu __main __control __home] -type: disabled - -[menu __main __control __homez] -type: disabled - -[menu __main __control __homexy] -type: disabled - - -# Bed Probe -[menu __main __setup __calib __bedprobe] -type: disabled - -## Delta Calibration -[menu __main __setup __calib __delta_calib_auto] -type: disabled - -[menu __main __setup __calib __delta_calib_man] -type: disabled - - -# Added Items to the Stock menu -## Control -[menu __main __control __home] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Home: {['noop', 'ALL', 'XY', 'Z'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 3 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - {[' ', 'G28', 'G28 XY', 'G28 Z'][menu.input|int]} - {%- endif -%} - -[menu __main __control __move] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Move: {['FRONT CENTER', 'CENTER', 'REAR CENTER'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 2 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - CENTER {['Y=15', '', 'Y=290'][menu.input|int]} - {%- endif -%} - - -## Filament -[menu __main __filament __preheat] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Preheat: {['Off', 'ABS', 'PLA', 'PET'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 3 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - M104 S{[0, 215, 190, 200][menu.input|int]} - {%- endif -%} - - -[menu __main __filament __filament_load] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Filament: {['noop', 'Load', 'Unload', 'Purge (10mm)'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 3 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - {% if printer.extruder.can_extrude|lower == 'true' %} - M83 - G1 {['E0', 'E50 F3000', 'E-75 F3000', 'E10 F300'][menu.input|int]} - G1 {['E0', 'E35 F300', 'E0', 'E0'][menu.input|int]} - M82 - {% else %} - {action_respond_info("extruder not hot enough")} - {%- endif -%} - {%- endif -%} - - -## Calibration -[menu __main __setup __calib __bedprobe] -type: command -enable: {not printer.idle_timeout.state == "Printing"} -name: Bed probe -gcode: - {%- if printer.toolhead.position.y|float < 270 -%} - PROBE - {%- else -%} - {action_respond_info("Won't probe inunsafe position")} - {%- endif -%} - - -## Probe & Endstop Z-Offset calibration -[menu __main __setup __calib __Z_offset] -type: list -enable: {not printer.idle_timeout.state == "Printing"} -name: Z offset - -[menu __main __setup __calib __Z_offset __start] -type: input -enable: {not printer.idle_timeout.state == "Printing"} -name: Calibrate: {['noop','Probe','Endstop'][menu.input|int]} -input: 0 -input_min: 0 -input_max: 2 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - {menu.back()} - {%- endif -%} - {%- if menu.input|int == 1 -%} - {% if "xyz" in printer.toolhead.homed_axes %} - {action_respond_info("Start Probe calibration")} - CENTER - PROBE_CALIBRATE - {%- else -%} - {action_respond_info("Printer not homed")} - {%- endif -%} - {%- elif menu.input|int == 2 -%} - {% if "xyz" in printer.toolhead.homed_axes %} - {action_respond_info(" Start Z-Endstop calibration")} - CENTER - Z_ENDSTOP_CALIBRATE - {%- else -%} - {action_respond_info("Printer not homed")} - {%- endif -%} - {%- endif -%} - - -[menu __main __setup __calib __Z_offset __move_z] -type: input -name: Move Z: {'%03.2f' % menu.input} -input: {printer.gcode_move.gcode_position.z} -input_step: 1 -realtime: True -gcode: - {%- if menu.event == 'change' -%} - G1 Z{'%.2f' % menu.input} - {%- elif menu.event == 'long_click' -%} - G1 Z{'%.2f' % menu.input} - SAVE_GCODE_STATE NAME=__move__axis - G91 - G1 Z2 - G1 Z-2 - RESTORE_GCODE_STATE NAME=__move__axis - {%- endif -%} - -[menu __main __setup __calib __Z_offset __test_z] -type: input -name: Test Z: {['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0.0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} -input: 5 -input_min: 0 -input_max: 10 -input_step: 1 -gcode: - {%- if menu.event == 'long_click' -%} - TESTZ Z={['-1.0', '-0.5', '-0.1', '-.05', '-.01', '0', '+0.01', '+0.05', '+0.1', '+0.5', '+1.0'][menu.input|int]} - {%- endif -%} - -[menu __main __setup __calib __Z_offset __test_z_live] -type: input -name: Test Z : {'%03.3f' % menu.input} -input: 0 -input_min: -5.0 -input_max: 5.0 -input_step: 0.01 -realtime: True -gcode: - {%- if menu.event == 'long_click' -%} - TESTZ Z={'%.3f' % menu.input} - {%- endif -%} - -[menu __main __setup __calib __Z_offset __accept] -type: command -name: Accept -gcode: ACCEPT - -[menu __main __setup __calib __Z_offset __abort] -type: command -name: Abort -gcode: ABORT - -[menu __main __setup __calib __Z_offset __saveconfig] -type: command -name: Save config -gcode: SAVE_CONFIG From a39b3d2fd42de8f43cd3f731579a0b417aa04bb2 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 6 Dec 2021 21:03:12 +0100 Subject: [PATCH 064/131] v2.4: change default neopixel settings, remove from macro --- macros/print.cfg | 2 -- neopixel.cfg | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index 98e0128..a5f960e 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -130,8 +130,6 @@ gcode: {% set ERCF_EXTRUDER=params.ERCF_EXTRUDER|default(0)|int %} {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, SHEET=%s, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f, ERCF=%d, ERCF_EXTRUDER=%d" % (BED, EXTRUDER, CHAMBER, SHEET, QGL, BMC, PURGE, SOAK, Z_ADJUST, ERCF, ERCF_EXTRUDER))} M118 configuring - SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 - G4 P2000 SET_GCODE_OFFSET Z=0.0 # reset z offset M140 S{BED} # start bed heating M104 S{EXTRUDER} # start extruder heating diff --git a/neopixel.cfg b/neopixel.cfg index 0fc6332..4b2831d 100644 --- a/neopixel.cfg +++ b/neopixel.cfg @@ -5,6 +5,6 @@ [neopixel caselight] pin: PB0 chain_count: 44 -initial_RED: 0.25 -initial_GREEN: 0.25 -initial_BLUE: 0.25 +initial_RED: 0.75 +initial_GREEN: 0.75 +initial_BLUE: 0.75 From ec8b3d97a67fd4ee2c7be2bacc3620a940f9c32d Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 6 Dec 2021 21:03:37 +0100 Subject: [PATCH 065/131] v2.4: hide more macros in KlipperScreen --- KlipperScreen.conf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index b19626f..95500dc 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -307,4 +307,35 @@ panel: settings #~# zc = False #~# _probe_action = False #~# zm = False +#~# ercf_calib_save_var = False +#~# ercf_calib_unload = False +#~# ercf_change_tool_slicer_end = False +#~# ercf_calibrate_single = False +#~# ercf_change_tool_standalone = False +#~# ercf_change_tool = False +#~# ercf_display_encoder_pos = False +#~# ercf_calib_selector = False +#~# ercf_check_if_resume = False +#~# ercf_encoder_motion_issue = False +#~# ercf_eject_unknow_state = False +#~# ercf_select_tool = False +#~# ercf_home_selector = False +#~# ercf_eject_from_bowden = False +#~# ercf_test_grip = False +#~# ercf_change_tool_slicer = False +#~# ercf_clog_or_runout = False +#~# ercf_test_servo = False +#~# ercf_is_filament_stuck_in_ercf = False +#~# ercf_load_tool = False +#~# ercf_unload_filament_in_extruder_with_tip_forming = False +#~# ercf_load_filament_in_extruder = False +#~# ercf_form_tip_standalone = False +#~# ercf_is_filament_in_extruder = False +#~# ercf_home_only = False +#~# purge_nozzle = False +#~# ercf_var = False +#~# ercf_pause = False +#~# ercf_unload_tool = False +#~# ercf_test_load_sequence = False +#~# ercf_test_move_gear = False #~# From 81cb8a50622c1b1f6c2f4a295f3577d79c6a377e Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 6 Dec 2021 21:04:46 +0100 Subject: [PATCH 066/131] v2.4: update ercf --- ercf/.hardware.cfg.swp | Bin 12288 -> 0 bytes ercf/hardware.cfg | 2 +- ercf/software.cfg | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 ercf/.hardware.cfg.swp diff --git a/ercf/.hardware.cfg.swp b/ercf/.hardware.cfg.swp deleted file mode 100644 index f7ca0b7628a2654f008f139976cea6810530145e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2&2QX97>6fFh_qF~M1vulIbV~xj~ z1|e>hP*2=J<-iFE2?-9M_JG8V8{&$9!asln5)y|Be%^ILK3mZnFqWQVZI32247_{=~?i083z`1i$QI4Oj!#fHhzZSOeC8HDC=`1J-~wU=3IU z{}BTsVC?i$j9ov0fbjqS;%@-=o?+}R2!Ic+gAu^M{j-dH1wH}qfm`4e;DQ&ySug^A zKf~CM;0N#pxD8gobKptv+iAvr2H$|Y-~(_6yagg~4ZI8-@H}|%G-JPj@4>g=9=HqM z1vkI~m;^6?^WecL#(o0#!I$7;a0lE1A-DoA0}d{N?@luI8Tb_31_o?`c~A$Zz)5f) zp1ua3gO9*F;7w5YdllHj8n6be0c*e-_&*yUTI9S*MyWWIBA`wbi=IpjMM);LkpUZi z@VdSVq|1(NuVqj5(Ol<=%FRymY%4N;=%rEO(rYX8yv9Q2%p0C>GB!&4x}etTr8%#)bZL3EwdyS{uP-bwc?)Z6S6fWpG&&EYc4_Am z3#5_0iO_v4ldcI}s#Toh#)cIIJ)%JzR@2qmWLg!nuROG*YK3Mu;x0>s+$p5zo)HMgbSC>P0o~z0hc|TxjEo zAi&$8ix1EDj=xE}$0%jk^NLKMibLv3f$SPt?2Ba^rsr3y&J^`Tl8bofI--eDU~0D^ ze9I)ju+wr93@yz}G2#0%c4-3fg$mlcUY1IUkU6gOWvu+jY`av&StpN&J!D?7Cs!*Y zipm?_+&S|C*b#{j8FdGF^tCDmTLd|QF^G0Ns05cTl!@Y;1(6;OtGqVTEb>qewQM%U zHXa@0@!2~jc?VO)52mVlM1J?@&iMzqJD3&}{)X+|XhmdTJBy&lc#s4ry4=sEX=`s%XD~QMx2F21aw315yvW9`ms ziK2?E&_<=QSt)+t3u}~Gi56W{)v9Q>BSY?iV9Oq{un!l<;wz0>(`z?qW_6bO9J~Ji E0+TP{xc~qF diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg index 2311bf2..607ca26 100644 --- a/ercf/hardware.cfg +++ b/ercf/hardware.cfg @@ -71,7 +71,7 @@ extruder: extruder [filament_switch_sensor toolhead_sensor] pause_on_runout: False -switch_pin: ^PG13 +switch_pin: ^PG12 runout_gcode: M118 toolhead filament removed insert_gcode: diff --git a/ercf/software.cfg b/ercf/software.cfg index 20c52b4..4e168e4 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -12,7 +12,7 @@ encoder_resolution: 1.349528 # from `ercf_calibrate_encoder` # Long moves are faster than the small ones # 100mm/s should be "quiet" with the NEMA14 motor or a NEMA17 pancake, but you can go lower if your really want it to be low noise # Tested without any issue at 200mm/s, but it's noisy. I'm running mine at 170mm/s for long moves and 50mm/s for short moves. -long_moves_speed: 60 # mm/s. Default value is 100mm/s. +long_moves_speed: 100 # mm/s. Default value is 100mm/s. long_moves_accel: 400 # mm/s². Default value is 400mm/s² short_moves_speed: 25 # mm/s. Default value is 25mm/s. short_moves_accel: 400 # mm/s². Default value is 400mm/s² From 147649caad0b61d210b8bbe8c75b741f2dead287 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 9 Dec 2021 21:12:02 +0100 Subject: [PATCH 067/131] v2.4: update ercf --- ercf/software.cfg | 4 ++-- ercf/vars.cfg | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index 4e168e4..6482b94 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -43,7 +43,7 @@ variable_sensor_to_nozzle: 54 # # Tool position for the selector. This has to be tuned manually. Please scale this array to the number of tools you have # variable_colorselector = [ 2.4, 23.2, 44.0] # 3 tools -variable_colorselector = [2.4, 23.2, 44.0, 69.6, 91.2, 112.0] # 6 tools +variable_colorselector = [2.4, 23.2, 44.0, 70.5, 91.2, 112.8] # 6 tools # Base value for the loading length used by the auto-calibration macro # Please use a value SMALLER than the real reverse bowden length (like 50mm less) variable_min_bowden_length: 850 @@ -205,7 +205,7 @@ gcode: SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro ERCF_VAR"].servo_down_angle} G4 P200 MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL=0 SYNC=0 - G4 P100 + G4 P105 # was P100 MANUAL_STEPPER STEPPER=gear_stepper MOVE=-0.5 SPEED=25 ACCEL=0 SYNC=0 G4 P100 MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL=0 diff --git a/ercf/vars.cfg b/ercf/vars.cfg index f33093e..2fc61dd 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -1,15 +1,15 @@ [Variables] ercf_calib_0 = 1.0 -ercf_calib_1 = 1.00135110302 +ercf_calib_1 = 1.00315859598 ercf_calib_10 = 1.0 ercf_calib_11 = 1.0 -ercf_calib_2 = 1.00374477099 -ercf_calib_3 = 1.17246806366 -ercf_calib_4 = 1.0 -ercf_calib_5 = 1.0 +ercf_calib_2 = 1.00406479164 +ercf_calib_3 = 1.00044979689 +ercf_calib_4 = 1.00135110302 +ercf_calib_5 = 1.00225403458 ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 976.383508 +ercf_calib_ref = 977.058272 From ca8d2bec0ed5d4242ab1f2b43d0afbd3e59927db Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 9 Dec 2021 21:12:35 +0100 Subject: [PATCH 068/131] v2.4: update printer with latest upstream klipper recommendations --- printer.cfg | 57 +++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/printer.cfg b/printer.cfg index 1b235e0..3363577 100644 --- a/printer.cfg +++ b/printer.cfg @@ -26,7 +26,8 @@ ## [E in MOTOR6] - Extruder ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify ##-------------------------------------------------------------------- -serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 +# serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 # octopus +serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_410015000250534E4E313120-if00 # octopus pro # serial: /dev/serial0 # restart_method: command ##-------------------------------------------------------------------- @@ -36,8 +37,11 @@ serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1E0030000E5053424E363620-if00 kinematics: corexy max_velocity: 600 ## regular -max_accel: 3000 -max_accel_to_decel: 1500 # default half of max_accel +max_accel: 4000 +max_accel_to_decel: 2000 +# resonance testing +# max_accel: 10000 +# max_accel_to_decel: 5000 ## max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 500 @@ -68,7 +72,7 @@ step_pin: PF13 dir_pin: !PF12 enable_pin: !PF14 rotation_distance: 40 -microsteps: 16 +microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG6 position_min: 0 @@ -80,9 +84,8 @@ homing_positive_dir: true [tmc2209 stepper_x] uart_pin: PC4 -interpolate: True +interpolate: False run_current: 0.8 -hold_current: 0.7 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -92,7 +95,7 @@ step_pin: PG0 dir_pin: !PG1 enable_pin: !PF15 rotation_distance: 40 -microsteps: 16 +microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 @@ -104,9 +107,8 @@ homing_positive_dir: true [tmc2209 stepper_y] uart_pin: PD11 -interpolate: True +interpolate: False run_current: 0.8 -hold_current: 0.7 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -122,7 +124,7 @@ dir_pin: PG3 enable_pin: !PG5 rotation_distance: 40 gear_ratio: 80:16 -microsteps: 16 +microsteps: 32 endstop_pin: PG10 ## actual_position = measured_position_endstop - position_endstop position_endstop: 0.5 @@ -135,9 +137,8 @@ homing_retract_dist: 3 [tmc2209 stepper_z] uart_pin: PC6 -interpolate: true +interpolate: False run_current: 0.8 -hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -148,13 +149,12 @@ dir_pin: !PC1 enable_pin: !PA0 rotation_distance: 40 gear_ratio: 80:16 -microsteps: 16 +microsteps: 32 [tmc2209 stepper_z1] uart_pin: PC7 -interpolate: true +interpolate: False run_current: 0.8 -hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -165,13 +165,12 @@ dir_pin: PF10 enable_pin: !PG2 rotation_distance: 40 gear_ratio: 80:16 -microsteps: 16 +microsteps: 32 [tmc2209 stepper_z2] uart_pin: PF2 -interpolate: true +interpolate: False run_current: 0.8 -hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -182,13 +181,12 @@ dir_pin: !PF0 enable_pin: !PF1 rotation_distance: 40 gear_ratio: 80:16 -microsteps: 16 +microsteps: 32 [tmc2209 stepper_z3] uart_pin: PE4 -interpolate: true +interpolate: False run_current: 0.8 -hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -211,7 +209,7 @@ rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears ## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio) ## Use 80:20 for M4, M3.1 gear_ratio: 50:17 # BMG Gear Ratio -microsteps: 16 +microsteps: 32 full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper nozzle_diameter: 0.400 filament_diameter: 1.75 @@ -247,7 +245,6 @@ max_extrude_cross_section: 50.0 # default 4 * 0.4 = 0.64 uart_pin: PE1 interpolate: false run_current: 0.5 -hold_current: 0.4 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -384,13 +381,13 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.037500, 0.035000, 0.037500, 0.060000, 0.040000, 0.070000, 0.030000 -#*# 0.032500, 0.037500, 0.002500, 0.017500, 0.040000, 0.040000, 0.057500 -#*# 0.010000, -0.002500, 0.020000, -0.005000, -0.005000, 0.012500, 0.037500 -#*# 0.050000, -0.020000, 0.002500, 0.000000, 0.010000, 0.030000, 0.022500 -#*# -0.002500, 0.025000, 0.022500, 0.015000, 0.000000, 0.037500, 0.045000 -#*# 0.020000, 0.015000, 0.030000, 0.027500, 0.025000, 0.015000, 0.005000 -#*# 0.040000, 0.022500, 0.032500, 0.032500, 0.065000, 0.055000, 0.032500 +#*# 0.035000, 0.012500, 0.025000, 0.020000, 0.020000, 0.042500, 0.042500 +#*# 0.022500, 0.002500, 0.015000, 0.007500, 0.025000, 0.042500, 0.037500 +#*# 0.002500, -0.015000, -0.000000, -0.000000, -0.000000, 0.017500, 0.017500 +#*# 0.015000, -0.005000, 0.005000, 0.000000, 0.007500, 0.030000, 0.022500 +#*# 0.010000, 0.005000, 0.010000, 0.005000, 0.010000, 0.032500, 0.022500 +#*# 0.007500, -0.002500, 0.005000, 0.002500, 0.005000, 0.025000, 0.010000 +#*# 0.037500, 0.022500, 0.032500, 0.032500, 0.030000, 0.045000, 0.037500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic From 16a476294fab05213147b9b2e371bbf08f2a9678 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 9 Dec 2021 21:12:59 +0100 Subject: [PATCH 069/131] v2.4: update input_shaper things --- input_shaper.cfg | 6 +++--- resonance_test.cfg | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index 27d5a2e..e8f55f3 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -4,9 +4,9 @@ # is mzv input shaper. # shaper_type: mzv shaper_type_x: mzv -shaper_freq_x: 52.8 -shaper_type_y: mzv -shaper_freq_y: 41.2 +shaper_freq_x: 53.0 +shaper_type_y: ei +shaper_freq_y: 53.4 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/resonance_test.cfg b/resonance_test.cfg index 733a8e6..da02f00 100644 --- a/resonance_test.cfg +++ b/resonance_test.cfg @@ -1,8 +1,3 @@ -# override printer -[printer] -max_accel: 10000 -max_accel_to_decel: 5000 - [mcu nano] serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 @@ -38,3 +33,11 @@ accel_chip: adxl345 probe_points: 150,150,20 # an example + +[gcode_macro TR] +gcode: + {% if not "xyz" in printer.toolhead.homed_axes %} + G28 + {% endif %} + TEST_RESONANCES AXIS=X + TEST_RESONANCES AXIS=Y From f397f1a7e226244a3922985689fbef9897322447 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 9 Dec 2021 21:13:54 +0100 Subject: [PATCH 070/131] v2.4: update macros --- macros/helpers.cfg | 12 +++++------- macros/print.cfg | 12 ++++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/macros/helpers.cfg b/macros/helpers.cfg index 05ca004..6320aa9 100644 --- a/macros/helpers.cfg +++ b/macros/helpers.cfg @@ -11,7 +11,7 @@ gcode: {% set N=params.N|default(1)|int %} {% if printer.idle_timeout.state != "Printing" %} {% if "xyz" in printer.toolhead.homed_axes %} - M118 moving {N}x with F{F} + M118 moving N={N} with F={F} {% set X0=275 %} {% set X1=25 %} {% set Y0=275 %} @@ -65,9 +65,7 @@ gcode: [gcode_macro zm] gcode: - {% set speed = params.SPEED|default(300)|int %} - {action_respond_info("moving with F%d" % speed)} - G0 Z30 F{speed} - G0 Z10 F{speed} - - + {% set F = params.SPEED|default(300)|int %} + {action_respond_info("moving with F=%d" % F)} + G0 Z30 F{F} + G0 Z10 F{F} diff --git a/macros/print.cfg b/macros/print.cfg index a5f960e..c4aadb3 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -16,8 +16,8 @@ # BRUSHIE [gcode_macro BRUSHIE] gcode: - {% set x0=200 %} - {% set x1=250 %} + {% set x0=250 %} + {% set x1=200 %} {% set y0=309 %} {% set z0=1.5 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} @@ -29,7 +29,6 @@ gcode: G0 X{x1} # 1 G0 X{x0} # 2 G0 X{x1} # 3 - G0 X{x0} # 4 G0 Z{z_hop} F300 # move Z to travel height {% else %} M118 Printer not homed @@ -121,7 +120,7 @@ gcode: {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set CHAMBER=params.CHAMBER|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} - {% set QGL=params.QGL|default(0)|int %} + {% set QGL=params.QGL|default(1)|int %} {% set BMC=params.BMC|default(0)|int %} {% set PURGE=params.PURGE|default(1)|int %} {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} @@ -184,10 +183,6 @@ gcode: ERCF_CHANGE_TOOL_STANDALONE TOOL={ERCF_EXTRUDER} {% endif %} G4 P2000 - {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == False %} - M118 Insert filament and press resume - PAUSE - {% endif %} {% if PURGE %} PURGE_NOZZLE {% endif %} @@ -251,6 +246,7 @@ gcode: {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F6000 + G90 {% else %} M118 Extruder not hot enough {% endif %} From 1b92c3b6322c1da1c04400f557444760af47222d Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 19 Dec 2021 20:09:29 +0100 Subject: [PATCH 071/131] v2.4: update ercf --- ercf/software.cfg | 25 +++++++++++++++++++++++++ ercf/vars.cfg | 10 +++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index 6482b94..41cd124 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -448,6 +448,31 @@ gcode: # move the selector (if needed) to the requested tool ############################################ +[gcode_macro S0] +gcode: + ERCF_SELECT_TOOL TOOL=0 + +[gcode_macro S1] +gcode: + ERCF_SELECT_TOOL TOOL=1 + +[gcode_macro S2] +gcode: + ERCF_SELECT_TOOL TOOL=2 + +[gcode_macro S3] +gcode: + ERCF_SELECT_TOOL TOOL=3 + +[gcode_macro S4] +gcode: + ERCF_SELECT_TOOL TOOL=4 + +[gcode_macro S5] +gcode: + ERCF_SELECT_TOOL TOOL=5 + + # Select a tool. move the idler and then move the color selector (if needed) [gcode_macro ERCF_SELECT_TOOL] description: Move the selector to the Tool and select it diff --git a/ercf/vars.cfg b/ercf/vars.cfg index 2fc61dd..af5f5d2 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -1,15 +1,15 @@ [Variables] ercf_calib_0 = 1.0 -ercf_calib_1 = 1.00315859598 +ercf_calib_1 = 0.992410468168 ercf_calib_10 = 1.0 ercf_calib_11 = 1.0 -ercf_calib_2 = 1.00406479164 +ercf_calib_2 = 1.00044979689 ercf_calib_3 = 1.00044979689 -ercf_calib_4 = 1.00135110302 -ercf_calib_5 = 1.00225403458 +ercf_calib_4 = 1.00044979689 +ercf_calib_5 = 0.999550111824 ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 977.058272 +ercf_calib_ref = 967.611576 From 70f41831dadf82ad24ce23a039227ab6860f71fa Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 19 Dec 2021 20:09:58 +0100 Subject: [PATCH 072/131] v2.4: moonraker: remove klipper_mcu, use mainsail beta --- moonraker.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/moonraker.conf b/moonraker.conf index 7d8b834..ec0b6de 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -41,14 +41,14 @@ repo: fluidd-core/fluidd path: ~/fluidd [update_manager client mainsail] -type: web -repo: meteyou/mainsail +type: web_beta +repo: mainsail-crew/mainsail path: ~/mainsail -[update_manager klipper-mcu-update] -type: git_repo -origin: https://github.com/Klipper3d/klipper.git -path: ~/klipper +# [update_manager klipper-mcu-update] +# type: git_repo +# origin: https://github.com/Klipper3d/klipper.git +# path: ~/klipper [update_manager KlipperScreen] type: git_repo From 03f4cc150bef6b284d8c1db8e00e178bc6fa4e3f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 19 Dec 2021 20:15:04 +0100 Subject: [PATCH 073/131] v2.4: update macros --- macros/print.cfg | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index c4aadb3..e25f198 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -129,13 +129,13 @@ gcode: {% set ERCF_EXTRUDER=params.ERCF_EXTRUDER|default(0)|int %} {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, SHEET=%s, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f, ERCF=%d, ERCF_EXTRUDER=%d" % (BED, EXTRUDER, CHAMBER, SHEET, QGL, BMC, PURGE, SOAK, Z_ADJUST, ERCF, ERCF_EXTRUDER))} M118 configuring - SET_GCODE_OFFSET Z=0.0 # reset z offset - M140 S{BED} # start bed heating - M104 S{EXTRUDER} # start extruder heating - G92 E0 # reset extruder - G21 # set units to millimeters - G90 # use absolute coordinates - M83 # use relative distances for extrusion + SET_GCODE_OFFSET Z=0.0 # reset z offset + M140 S{BED} # start bed heating + M104 S{EXTRUDER} # start extruder heating + G92 E0 # reset extruder + G21 # set units to millimeters + G90 # use absolute coordinates + M83 # use relative distances for extrusion G4 P2000 {% if BMC %} @@ -144,11 +144,7 @@ gcode: M118 home G28 BRUSHIE - {% if ERCF %} - M118 ercf home - ERCF_HOME - {% endif %} - {% if QGL or printer.quad_gantry_level.applied|lower == 'false' %} + {% if QGL %} M118 qgl QUAD_GANTRY_LEVEL PARK=false BRUSHIE @@ -175,14 +171,12 @@ gcode: {% endif %} M118 starting - SET_PRESSURE_ADVANCE ADVANCE=0.05 SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 - {% if ERCF %} M118 ercf changing to tool {ERCF_EXTRUDER} - ERCF_CHANGE_TOOL_STANDALONE TOOL={ERCF_EXTRUDER} + ERCF_CHANGE_TOOL_SLICER TOOL={ERCF_EXTRUDER} {% endif %} - G4 P2000 + BRUSHIE {% if PURGE %} PURGE_NOZZLE {% endif %} From e5c616777e21e299322b031c4c693109be2c962f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 23 Dec 2021 14:04:08 +0100 Subject: [PATCH 074/131] v2.4: update sensor due to match upstream --- printer.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index 3363577..6927b76 100644 --- a/printer.cfg +++ b/printer.cfg @@ -256,7 +256,7 @@ stealthchop_threshold: 0 [heater_bed] ## SSR Pin - BED_OUT heater_pin: PA1 -sensor_type: NTC 100K beta 3950 +sensor_type: Generic 3950 sensor_pin: PF3 ## Adjust Max Power so your heater doesn't warp your bed max_power: 0.8 # 0.4W per cm2, 360W for 300 build From ed685addb2c766f62729b334822c9b43f1000c69 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 23 Dec 2021 14:10:58 +0100 Subject: [PATCH 075/131] v2.4: switch XY to tmc5160 hv --- printer.cfg | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/printer.cfg b/printer.cfg index 6927b76..02de55c 100644 --- a/printer.cfg +++ b/printer.cfg @@ -69,7 +69,7 @@ square_corner_velocity: 5.0 ## X Stepper on MOTOR0(B Motor) [stepper_x] step_pin: PF13 -dir_pin: !PF12 +dir_pin: PF12 enable_pin: !PF14 rotation_distance: 40 microsteps: 32 @@ -82,8 +82,11 @@ homing_speed: 30 # speed: mm/sec, feedrate: mm/min homing_retract_dist: 5 homing_positive_dir: true -[tmc2209 stepper_x] -uart_pin: PC4 +[tmc5160 stepper_x] +cs_pin: PC4 +spi_software_miso_pin: PA6 +spi_software_mosi_pin: PA7 +spi_software_sclk_pin: PA5 interpolate: False run_current: 0.8 sense_resistor: 0.110 @@ -92,7 +95,7 @@ stealthchop_threshold: 0 ## Y Stepper on MOTOR1 (A Motor) [stepper_y] step_pin: PG0 -dir_pin: !PG1 +dir_pin: PG1 enable_pin: !PF15 rotation_distance: 40 microsteps: 32 @@ -105,8 +108,11 @@ homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true -[tmc2209 stepper_y] -uart_pin: PD11 +[tmc5160 stepper_y] +cs_pin: PD11 +spi_software_miso_pin: PA6 +spi_software_mosi_pin: PA7 +spi_software_sclk_pin: PA5 interpolate: False run_current: 0.8 sense_resistor: 0.110 From 784f74f5d67bd7a604ce16ccdaa6c9eb62df5129 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 23 Dec 2021 21:20:25 +0100 Subject: [PATCH 076/131] Revert "v2.4: switch XY to tmc5160 hv" This reverts commit ed685addb2c766f62729b334822c9b43f1000c69. --- printer.cfg | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/printer.cfg b/printer.cfg index 02de55c..6927b76 100644 --- a/printer.cfg +++ b/printer.cfg @@ -69,7 +69,7 @@ square_corner_velocity: 5.0 ## X Stepper on MOTOR0(B Motor) [stepper_x] step_pin: PF13 -dir_pin: PF12 +dir_pin: !PF12 enable_pin: !PF14 rotation_distance: 40 microsteps: 32 @@ -82,11 +82,8 @@ homing_speed: 30 # speed: mm/sec, feedrate: mm/min homing_retract_dist: 5 homing_positive_dir: true -[tmc5160 stepper_x] -cs_pin: PC4 -spi_software_miso_pin: PA6 -spi_software_mosi_pin: PA7 -spi_software_sclk_pin: PA5 +[tmc2209 stepper_x] +uart_pin: PC4 interpolate: False run_current: 0.8 sense_resistor: 0.110 @@ -95,7 +92,7 @@ stealthchop_threshold: 0 ## Y Stepper on MOTOR1 (A Motor) [stepper_y] step_pin: PG0 -dir_pin: PG1 +dir_pin: !PG1 enable_pin: !PF15 rotation_distance: 40 microsteps: 32 @@ -108,11 +105,8 @@ homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true -[tmc5160 stepper_y] -cs_pin: PD11 -spi_software_miso_pin: PA6 -spi_software_mosi_pin: PA7 -spi_software_sclk_pin: PA5 +[tmc2209 stepper_y] +uart_pin: PD11 interpolate: False run_current: 0.8 sense_resistor: 0.110 From 1776f5d726141e415be16634a7c1227d9723480b Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 12:51:48 +0100 Subject: [PATCH 077/131] v2.4: remove fluidd include and merge into printer.cfg --- fluidd.cfg | 7 ------- printer.cfg | 8 +++++++- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 fluidd.cfg diff --git a/fluidd.cfg b/fluidd.cfg deleted file mode 100644 index 382e149..0000000 --- a/fluidd.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[virtual_sdcard] -path: /home/pi/gcode_files - -[pause_resume] - -[display_status] - diff --git a/printer.cfg b/printer.cfg index 6927b76..07fdd54 100644 --- a/printer.cfg +++ b/printer.cfg @@ -47,11 +47,17 @@ max_z_velocity: 30 # Max 15 for 12V TMC Drivers, can increase for 24V max_z_accel: 500 square_corner_velocity: 5.0 +[virtual_sdcard] +path: /home/pi/gcode_files + +[pause_resume] + +[display_status] + ##################################################################### # includes ##################################################################### -[include fluidd.cfg] [include macros/_init.cfg] [include neopixel.cfg] [include fans.cfg] From c0a221b5d57d4030fedeef27579d3b00e233ebc6 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 12:53:04 +0100 Subject: [PATCH 078/131] v2.4: add timelapse --- KlipperScreen.conf | 9 + macros/_init.cfg | 1 + macros/timelapse.cfg | 417 +++++++++++++++++++++++++++++++++++++++++++ moonraker.conf | 19 ++ webcam.txt | 3 +- 5 files changed, 448 insertions(+), 1 deletion(-) create mode 100644 macros/timelapse.cfg diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 95500dc..395922d 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -338,4 +338,13 @@ panel: settings #~# ercf_unload_tool = False #~# ercf_test_load_sequence = False #~# ercf_test_move_gear = False +#~# _timelapse_new_frame = False +#~# timelapse_render = False +#~# _set_timelapse_setup = False +#~# test_stream_delay = False +#~# move_speed = False +#~# get_timelapse_setup = False +#~# ercf_unselect_tool = False +#~# hyperlapse = False +#~# ercf_calibrate = False #~# diff --git a/macros/_init.cfg b/macros/_init.cfg index c7ebc50..6831d62 100644 --- a/macros/_init.cfg +++ b/macros/_init.cfg @@ -8,3 +8,4 @@ [include print.cfg] [include probe.cfg] [include z_calibration.cfg] +[include timelapse.cfg] diff --git a/macros/timelapse.cfg b/macros/timelapse.cfg new file mode 100644 index 0000000..98eaa76 --- /dev/null +++ b/macros/timelapse.cfg @@ -0,0 +1,417 @@ +# Timelapse klipper macro definition +# +# Copyright (C) 2021 Christoph Frei +# Copyright (C) 2021 Alex Zellner +# +# This file may be distributed under the terms of the GNU GPLv3 license +# +# Macro version 1.7 +# + +##### DO NOT CHANGE ANY MACRO!!! ##### + +########################################################################## +# # +# GET_TIMELAPSE_SETUP: Print the Timelapse setup to console # +# # +########################################################################## + +[gcode_macro GET_TIMELAPSE_SETUP] +description: Print the Timelapse setup +gcode: + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + {% set output_txt = ["Timelapse Setup:"] %} + {% set _dummy = output_txt.append("enable: %s" % tl.enable) %} + {% set _dummy = output_txt.append("park: %s" % tl.park.enable) %} + {% if tl.park.enable|lower == 'true' %} + {% set _dummy = output_txt.append("park position: %s time: %s s" % (tl.park.pos, tl.park.time)) %} + {% if tl.park.pos|lower == 'custom' %} + {% set _dummy = output_txt.append("custom cord x:%s y:%s dz:%s" % (tl.custom.x, tl.custom.y, tl.custom.dz)) %} + {% endif %} + {% set _dummy = output_txt.append("travel speed: %s mm/s" % tl.speed.travel) %} + {% endif %} + {% set _dummy = output_txt.append("fw_retract: %s" % tl.extruder.fw_retract) %} + {% if tl.extruder.fw_retract|lower == 'false' %} + {% set _dummy = output_txt.append("retract: %s mm speed: %s mm/s" % (tl.extruder.retract, tl.speed.retract)) %} + {% set _dummy = output_txt.append("extrude: %s mm speed: %s mm/s" % (tl.extruder.extrude, tl.speed.extrude)) %} + {% endif %} + {% set _dummy = output_txt.append("verbose: %s" % tl.verbose) %} + {action_respond_info(output_txt|join("\n"))} + +################################################################################################ +# # +# Use _SET_TIMELAPSE_SETUP [ENABLE=value] [VERBOSE=value] [PARK_ENABLE=value] [PARK_POS=value] # +# [PARK_TIME=value] [CUSTOM_POS_X=value] [CUSTOM_POS_Y=value] # +# [CUSTOM_POS_DZ=value][TRAVEL_SPEED=value] [RETRACT_SPEED=value] # +# [EXTRUDE_SPEED=value] [EXTRUDE_DISTANCE=value] # +# [RETRACT_DISTANCE=value] [FW_RETRACT=value] # +# # +################################################################################################ + +[gcode_macro _SET_TIMELAPSE_SETUP] +description: Set user parameters for timelapse +gcode: + ##### get dictonaries ##### + {% set enable = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].enable %} + {% set verbose = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].verbose %} + {% set park = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].park %} + {% set custom = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].custom %} + {% set speed = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].speed %} + {% set extruder = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].extruder %} + ##### get min and max bed size ##### + {% set min = printer.toolhead.axis_minimum %} + {% set max = printer.toolhead.axis_maximum %} + ##### set new values ##### + {% if params.ENABLE is defined %} + {% if params.ENABLE|lower == 'true' or params.ENABLE|lower == 'false' %} + {% set enable = params.ENABLE|capitalize %} + {% else %} + {action_raise_error("ENABLE=%s not supported. Allowed values are [True, False]" % params.ENABLE)} + {% endif %} + {% endif %} + {% if params.VERBOSE is defined %} + {% if params.VERBOSE|lower == 'true' or params.VERBOSE|lower == 'false' %} + {% set verbose = params.VERBOSE|capitalize %} + {% else %} + {action_raise_error("VERBOSE=%s not supported. Allowed values are [True, False]" % params.VERBOSE)} + {% endif %} + {% endif %} + {% if params.PARK_ENABLE is defined %} + {% if params.PARK_ENABLE|lower == 'true' or params.PARK_ENABLE|lower == 'false' %} + {% set _dummy = park.update({'enable':params.PARK_ENABLE|capitalize}) %} + {% else %} + {action_raise_error("PARK_ENABLE=%s not supported. Allowed values are [True, False]" % params.PARK_ENABLE)} + {% endif %} + {% endif %} + {% if params.PARK_POS is defined %} + {% if params.PARK_POS|lower == 'center' or params.PARK_POS|lower == 'front_left' or params.PARK_POS|lower == 'front_right' + or params.PARK_POS|lower == 'back_left' or params.PARK_POS|lower == 'back_right' or params.PARK_POS|lower == 'custom' %} + {% set _dummy = park.update({'pos':params.PARK_POS|lower}) %} + {% else %} + {action_raise_error("PARK_POS=%s not supported. Allowed values are [CENTER, FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, CUSTOM]" + % params.PARK_POS)} + {% endif %} + {% endif %} + {% if params.PARK_TIME is defined %} + {% if params.PARK_TIME|float >= 0.0 %} + {% set _dummy = park.update({'time':params.PARK_TIME|float|round(3)}) %} + {% else %} + {action_raise_error("PARK_TIME=%s must be a positive number" % params.PARK_TIME)} + {% endif %} + {% endif %} + {% if params.CUSTOM_POS_X is defined %} + {% if params.CUSTOM_POS_X|float >= min.x and params.CUSTOM_POS_X|float <= max.x %} + {% set _dummy = custom.update({'x':params.CUSTOM_POS_X|float|round(3)}) %} + {% else %} + {action_raise_error("CUSTOM_POS_X=%s must be within [%s - %s]" % (params.CUSTOM_POS_X, min.x, max.x))} + {% endif %} + {% endif %} + {% if params.CUSTOM_POS_Y is defined %} + {% if params.CUSTOM_POS_Y|float >= min.y and params.CUSTOM_POS_Y|float <= max.y %} + {% set _dummy = custom.update({'y':params.CUSTOM_POS_Y|float|round(3)}) %} + {% else %} + {action_raise_error("CUSTOM_POS_Y=%s must be within [%s - %s]" % (params.CUSTOM_POS_Y, min.y, max.y))} + {% endif %} + {% endif %} + {% if params.CUSTOM_POS_DZ is defined %} + {% if params.CUSTOM_POS_DZ|float >= min.z and params.CUSTOM_POS_DZ|float <= max.z %} + {% set _dummy = custom.update({'dz':params.CUSTOM_POS_DZ|float|round(3)}) %} + {% else %} + {action_raise_error("CUSTOM_POS_DZ=%s must be within [%s - %s]" % (params.CUSTOM_POS_DZ, min.z, max.z))} + {% endif %} + {% endif %} + {% if params.TRAVEL_SPEED is defined %} + {% if params.TRAVEL_SPEED|float > 0.0 %} + {% set _dummy = speed.update({'travel':params.TRAVEL_SPEED|float|round(3)}) %} + {% else %} + {action_raise_error("TRAVEL_SPEED=%s must be larger than 0" % params.TRAVEL_SPEED)} + {% endif %} + {% endif %} + {% if params.RETRACT_SPEED is defined %} + {% if params.RETRACT_SPEED|float > 0.0 %} + {% set _dummy = speed.update({'retract':params.RETRACT_SPEED|float|round(3)}) %} + {% else %} + {action_raise_error("RETRACT_SPEED=%s must be larger than 0" % params.RETRACT_SPEED)} + {% endif %} + {% endif %} + {% if params.EXTRUDE_SPEED is defined %} + {% if params.EXTRUDE_SPEED|float > 0.0 %} + {% set _dummy = speed.update({'extrude':params.EXTRUDE_SPEED|float|round(3)}) %} + {% else %} + {action_raise_error("EXTRUDE_SPEED=%s must be larger than 0" % params.EXTRUDE_SPEED)} + {% endif %} + {% endif %} + {% if params.EXTRUDE_DISTANCE is defined %} + {% if params.EXTRUDE_DISTANCE|float >= 0.0 %} + {% set _dummy = extruder.update({'extrude':params.EXTRUDE_DISTANCE|float|round(3)}) %} + {% else %} + {action_raise_error("EXTRUDE_DISTANCE=%s must be specified as positiv number" % params.EXTRUDE_DISTANCE)} + {% endif %} + {% endif %} + {% if params.RETRACT_DISTANCE is defined %} + {% if params.RETRACT_DISTANCE|float >= 0.0 %} + {% set _dummy = extruder.update({'retract':params.RETRACT_DISTANCE|float|round(3)}) %} + {% else %} + {action_raise_error("RETRACT_DISTANCE=%s must be specified as positiv number" % params.RETRACT_DISTANCE)} + {% endif %} + {% endif %} + {% if params.FW_RETRACT is defined %} + {% if params.FW_RETRACT|lower == 'true' or params.FW_RETRACT|lower == 'false' %} + {% if 'firmware_retraction' in printer.configfile.settings %} + {% set _dummy = extruder.update({'fw_retract':params.FW_RETRACT|capitalize}) %} + {% else %} + {% set _dummy = extruder.update({'fw_retract':False}) %} + {% if params.FW_RETRACT|lower == 'true' %} + {action_raise_error("[firmware_retraction] not defined in printer.cfg. Can not enanble fw_retract")} + {% endif %} + {% endif %} + {% else %} + {action_raise_error("FW_RETRACT=%s not supported. Allowed values are [True, False]" % params.FW_RETRACT)} + {% endif %} + {% endif %} + ##### write values to variables ##### + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=enable VALUE='"{enable}"' + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=verbose VALUE='"{verbose}"' + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=park VALUE="{park}" + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=custom VALUE="{custom}" + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=speed VALUE="{speed}" + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=extruder VALUE="{extruder}" + +########################################################################## +# # +# TIMELAPSE_TAKE_FRAME: take the next picture # +# # +########################################################################## + +######################### definition ######################### +## enable: enable or disable the next frame. Valid inputs: [True, False] +## takingframe: internal use. Valid inputs: [True, False] +## +## park.enable: enable or disable to park the head while taking a picture. Valid inputs: [True, False] +## park.pos : used position for parking. Valid inputs: [center, front_left, front_right, back_left, back_right, custom] +## park.time : used for the debug macro. Time in s +## +## custom.x, custom.y: coordinates of the custom parkposition. Unit [mm] +## custom.dz : custom z hop for the picture. Unit [mm] +## +## extruder.fw_retract: enable disable fw retraction [True,False] +## extruder.extrude. : filament extruded at the end of park. Unit [mm] +## extruder.retract. : filament retract at the start of park. Unit [mm] +## +## speed.travel : used speed for travel from and to the park positon. Unit: [mm/min] +## speed.retract: used speed for retract [mm/min] +## speed.extrude: used speed for extrude [mm/min] +## +## verbose: Enable mesage output of TIMELAPSE_TAKE_FRAME +## +## restore.absolute.coordinates: internal use +## restore.absolute.extrude : internal use +## restore.speed : internal use +## restore.e : internal use +## +## is_paused: internal use +############################################################### +[gcode_macro TIMELAPSE_TAKE_FRAME] +description: Take Timelapse shoot +variable_enable: False +variable_takingframe: False +variable_park: {'enable': False, + 'pos' : 'center', + 'time' : 0.1} +variable_custom: {'x': 0, 'y': 0, 'dz': 0} +variable_extruder: {'fw_retract': False, + 'retract': 1.0, + 'extrude': 1.0} +variable_speed: {'travel': 100, + 'retract': 15, + 'extrude': 15} +variable_verbose: True +variable_restore: {'absolute': {'coordinates': True, 'extrude': True}, 'speed': 1500, 'e':0} +variable_is_paused: False +gcode: + ##### get input parameters ##### + {% set hyperlapse = params.HYPERLAPSE|default('false')|lower %} + ##### define park position ##### + {% set min = printer.toolhead.axis_minimum %} + {% set max = printer.toolhead.axis_maximum %} + {% set act = printer.toolhead.position %} + {% set pos_dic = {'center' : {'x': (max.x-(max.x-min.x)/2), 'y': (max.y-(max.y-min.y)/2), 'dz': 1 }, + 'front_left' : {'x': min.x , 'y': min.y , 'dz': 0 }, + 'front_right': {'x': max.x , 'y': min.y , 'dz': 0 }, + 'back_left' : {'x': min.x , 'y': max.y , 'dz': 0 }, + 'back_right' : {'x': max.x , 'y': max.y , 'dz': 0 }, + 'custom' : {'x': custom.x , 'y': custom.y , 'dz': custom.dz}} %} + ##### check z max ##### + {% if (act.z|float + pos_dic[park.pos].dz|float) < max.z|float %} + {% set pos = {'x': pos_dic[park.pos].x, 'y': pos_dic[park.pos].y, 'z': (act.z|float + pos_dic[park.pos].dz|float)} %} + {% else %} + {% set pos = {'x': pos_dic[park.pos].x, 'y': pos_dic[park.pos].y, 'z': max.z} %} + {% endif %} + ##### end of definition ##### + {% if enable|lower == 'true' %} + {% if (hyperlapse == 'true' and printer['gcode_macro HYPERLAPSE'].run|lower == 'true') or + (hyperlapse == 'false' and printer['gcode_macro HYPERLAPSE'].run|lower == 'false') %} + {% if park.enable|lower == 'true' %} + {% set restore = {'absolute': {'coordinates': printer.gcode_move.absolute_coordinates, + 'extrude' : printer.gcode_move.absolute_extrude}, + 'speed' : printer.gcode_move.speed, + 'e' : printer.gcode_move.gcode_position.e} %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=restore VALUE="{restore}" + {% if printer.extruder.can_extrude|lower == 'false' %} + {action_respond_info("Timelapse: Warning, minimum extruder temperature not reached!")} + {% else %} + {% if extruder.fw_retract|lower == 'true' %} + G10 + {% else %} + M83 ; insure relative extrusion + G0 E-{extruder.retract} F{speed.retract|int * 60} + {% endif %} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=True + {printer.configfile.settings['gcode_macro pause'].rename_existing} ; execute the klipper PAUSE command + G90 ; insure absolute move + {% if "xyz" not in printer.toolhead.homed_axes %} + {action_respond_info("Timelapse: Warning, axis not homed yet!")} + {% else %} + G0 X{pos.x} Y{pos.y} Z{pos.z} F{speed.travel|int * 60} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=takingframe VALUE=True + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5 + M400 + {% endif %} + _TIMELAPSE_NEW_FRAME HYPERLAPSE={hyperlapse} + {% endif %} + {% else %} + {% if verbose|lower == 'true' %} + {action_respond_info("Timelapse: disabled, take frame ignored")} + {% endif %} + {% endif %} + +[gcode_macro _TIMELAPSE_NEW_FRAME] +description: action call for timelapse shoot. must be a seperate macro +gcode: + {action_call_remote_method("timelapse_newframe", + macropark=printer['gcode_macro TIMELAPSE_TAKE_FRAME'].park, + hyperlapse=params.HYPERLAPSE)} + +[delayed_gcode _WAIT_TIMELAPSE_TAKE_FRAME] +gcode: + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + {% if tl.takingframe %} + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5 + {% else %} + {printer.configfile.settings['gcode_macro resume'].rename_existing} VELOCITY={tl.speed.travel} ; execute the klipper RESUME command + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=False + {% if printer.extruder.can_extrude|lower == 'false' %} + {action_respond_info("Timelapse: Warning minimum extruder temperature not reached!")} + {% else %} + {% if tl.extruder.fw_retract|lower == 'true' %} + G11 + {% else %} + G0 E{tl.extruder.extrude} F{tl.speed.extrude|int * 60} + G0 F{tl.restore.speed} + {% if tl.restore.absolute.extrude|lower == 'true' %} + M82 + G92 E{tl.restore.e} + {% endif %} + {% endif %} + {% endif %} + {% if tl.restore.absolute.coordinates|lower == 'false' %} G91 {% endif %} + {% endif %} + +#################################################################################################### +# # +# HYPERLAPSE: Starts or stops a Hyperlapse video # +# Usage: HYPERLAPSE ACTION=START [CYCLE=time] starts a hyperlapse with cycle time (default 30 sec) # +# HYPERLAPSE ACTION=STOP stops the hyperlapse recording # +# # +#################################################################################################### + +######################### definition ######################### +## cycle: cycle time in seconds +## run: internal use [True/False] +############################################################### +[gcode_macro HYPERLAPSE] +description: Start/Stop a hyperlapse recording +variable_cycle: 0 +variable_run: False +gcode: + {% set cycle = params.CYCLE|default(30)|int %} + {% if params.ACTION is defined and params.ACTION|lower == 'start' %} + {action_respond_info("Hyperlapse: frames started (Cycle %d sec)" % cycle)} + SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=True + SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=cycle VALUE={cycle} + UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={cycle} + TIMELAPSE_TAKE_FRAME HYPERLAPSE="True" + {% elif params.ACTION is defined and params.ACTION|lower == 'stop' %} + SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=False + {action_respond_info("Hyperlapse: frames stopped")} + UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION=0 + {% else %} + {action_respond_info("Hyperlapse: No valid input parameter + Use: + - HYPERLAPSE ACTION=START [CYCLE=time] + - HYPERLAPSE ACTION=STOP")} + {% endif %} + +[delayed_gcode _HYPERLAPSE_LOOP] +gcode: + UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={printer["gcode_macro HYPERLAPSE"].cycle} + TIMELAPSE_TAKE_FRAME HYPERLAPSE="True" + +########################################################################## +# # +# TIMELAPSE_RENDER: Render the video at print end # +# # +########################################################################## + +######################### definition ######################### +## render: internal use. Valid inputs: [True, False] +## run_identifier: internal use. Valid input [0 .. 3] +############################################################### +[gcode_macro TIMELAPSE_RENDER] +description: Render Timelapse video and wait for the result +variable_render: False +variable_run_identifier: 0 +gcode: + {action_respond_info("Timelapse: Rendering started")} + {action_call_remote_method("timelapse_render", byrendermacro="True")} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=render VALUE=True + {printer.configfile.settings['gcode_macro pause'].rename_existing} ; execute the klipper PAUSE command + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5 + +[delayed_gcode _WAIT_TIMELAPSE_RENDER] +gcode: + {% set ri = printer['gcode_macro TIMELAPSE_RENDER'].run_identifier|int % 4 %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=run_identifier VALUE={ri + 1} + {% if printer['gcode_macro TIMELAPSE_RENDER'].render %} + M117 Rendering {['-','\\','|','/'][ri]} + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5 + {% else %} + {action_respond_info("Timelapse: Rendering finished")} + M117 + {printer.configfile.settings['gcode_macro resume'].rename_existing} ; execute the klipper RESUME command + {% endif %} + +########################################################################## +# # +# TEST_STREAM_DELAY: Helper macro to find stream and park delay # +# # +########################################################################## + +[gcode_macro TEST_STREAM_DELAY] +description: Helper macro to find stream and park delay +gcode: + {% set min = printer.toolhead.axis_minimum %} + {% set max = printer.toolhead.axis_maximum %} + {% set act = printer.toolhead.position %} + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + {% if act.z > 5.0 %} + G0 X{min.x + 5.0} F{tl.speed.travel|int * 60} + G0 X{(max.x-min.x)/2} + G4 P{tl.park.time|float * 1000} + _TIMELAPSE_NEW_FRAME HYPERLAPSE=FALSE + G0 X{max.x - 5.0} + {% else %} + {action_raise_error("Toolhead z %.3f to low. Please place head above z = 5.0" % act.z)} + {% endif %} \ No newline at end of file diff --git a/moonraker.conf b/moonraker.conf index ec0b6de..209671d 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -64,6 +64,25 @@ path: /home/pi/klipper_z_calibration origin: https://github.com/protoloft/klipper_z_calibration.git install_script: install.sh +[update_manager timelapse] +type: git_repo +primary_branch: main +path: ~/moonraker-timelapse +origin: https://github.com/mainsail-crew/moonraker-timelapse.git + [power voron-v2.4] type: tplink_smartplug address: 192.168.11.91 + +[timelapse] +## Following basic configuration is default to most images and don't need +## to be changed in most scenarios. Only uncomment and change it if your +## Image differ from standard installations. In most common scenarios +## a User only need [timelapse] in there configuration. +## +## Directory where the generated video will be saved +output_path: ~/timelapse/ +## Directory where the temporary frames are saved +#frame_path: /tmp/timelapse/ +## Directory where ffmpeg is installed +#ffmpeg_binary_path: /usr/bin/ffmpeg diff --git a/webcam.txt b/webcam.txt index c21aae3..b42becf 100644 --- a/webcam.txt +++ b/webcam.txt @@ -54,7 +54,8 @@ camera_usb_options="-r 800x600 -f 10" # # camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1 -rot 180" # camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" -camera_raspi_options="-x 800 -y 600 -roi 0.0,0.0,0.998,1" +# camera_raspi_options="-x 800 -y 600 -roi 0.0,0.0,0.998,1" +camera_raspi_options="-x 1024 -y 768 -roi 0.0,0.0,0.998,1" ### Configuration of camera HTTP output # From bc630f84aa8dc62eea3189add98ff5628ef9bac3 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 12:54:00 +0100 Subject: [PATCH 079/131] v2.4: update ercf --- ercf/software.cfg | 55 ++++++++++++++++++++++------------------------- ercf/vars.cfg | 2 +- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index 41cd124..2776c89 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -4,7 +4,6 @@ [ercf] # Encoder -# encoder_pin: ^P1.0 encoder_pin: ercf:PA6 # easy brd # encoder_resolution: 1.365188 # default encoder_resolution: 1.349528 # from `ercf_calibrate_encoder` @@ -239,13 +238,17 @@ gcode: [gcode_macro ERCF_UNLOCK] description: Unlock ERCF operations gcode: - M118 Unlock the ERCF - SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=0 - UPDATE_DELAYED_GCODE ID=disable_heater DURATION=0 - ERCF_UNSELECT_TOOL - M104 S{printer["gcode_macro ERCF_PAUSE"].extruder_temp} - RESTORE_GCODE_STATE NAME=ERCF_state - M118 Refer to the manual before resuming the print + M118 Unlock the ERCF + SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=0 + UPDATE_DELAYED_GCODE ID=disable_heater DURATION=0 + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == False %} + ERCF_UNSELECT_TOOL + {% else %} + ERCF_UNSELECT_TOOL FORCED=0 + {% endif %} + M104 S{printer["gcode_macro ERCF_PAUSE"].extruder_temp} + RESTORE_GCODE_STATE NAME=ERCF_state + M118 Refer to the manual before resuming the print [delayed_gcode disable_heater] gcode: @@ -426,7 +429,7 @@ description: Eject the filament during a print and park it into the ERCF gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != -1 %} - M118 ERCF_UNLOAD_TOOL Unload tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... + M118 Unload tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... ERCF_HOME_EXTRUDER ERCF_SELECT_TOOL TOOL={printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} {% set ercf_params = printer.save_variables.variables %} @@ -435,7 +438,6 @@ gcode: G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 - M118 ERCF_UNLOAD_TOOL G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 {% set ercf_params = printer.save_variables.variables %} ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} @@ -481,15 +483,15 @@ variable_color_selected: -1 gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_HOME"].home != -1 %} - M118 ERCF_SELECT_TOOL Select Tool {params.TOOL} ... + M118 Select Tool {params.TOOL} ... ERCF_SERVO_UP MANUAL_STEPPER STEPPER=selector_stepper MOVE={printer["gcode_macro ERCF_VAR"].colorselector[params.TOOL|int]} SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE={params.TOOL} SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE={params.TOOL} ERCF_SERVO_DOWN - M118 ERCF_SELECT_TOOL Tool {params.TOOL} Enabled + M118 Tool {params.TOOL} Enabled {% else %} - M118 ERCF_SELECT_TOOL Could not select tool, ERCF is not homed + M118 Could not select tool, ERCF is not homed {% endif %} {% endif %} @@ -506,7 +508,7 @@ gcode: {% endif %} ERCF_SET_STEPS RATIO=1.0 {% else %} - M118 ERCF_UNSELECT_TOOL Could not unselect tool, ERCF is not homed + M118 Could not unselect tool, ERCF is not homed {% endif %} {% endif %} @@ -521,7 +523,6 @@ description: Load filament from the toolhead entrance to the nozzle gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} - M118 ERCF_LOAD_F_I_E Loading Filament... G91 G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 @@ -535,9 +536,8 @@ gcode: G1 E5 F600 G92 E0 G90 - M118 ERCF_LOAD_F_I_E Load Complete {% else %} - M118 ERCF_LOAD_F_I_E Extruder too cold + M118 Extruder too cold ERCF_PAUSE {% endif %} {% endif %} @@ -649,7 +649,7 @@ gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} {% if printer["gcode_macro ERCF_SELECT_TOOL"].tool_selected|int == -1 %} - M118 ERCR_U_F_IEWTF Forming filament tip and Unloading Filament... + M118 Forming filament tip and Unloading Filament... G91 ERCF_FORM_TIP_STANDALONE G1 E-4.00 F1200.0 @@ -661,13 +661,13 @@ gcode: MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 - M118 ERCF_U_F_FIEWTF Filament removed + M118 Filament removed {% else %} M118 Tool selected, UNSELECT it ERCF_PAUSE {% endif %} {% else %} - M118 ERCF_U_F_FIEWTF Extruder too cold + M118 Extruder too cold ERCF_PAUSE {% endif %} {% endif %} @@ -680,9 +680,9 @@ gcode: [gcode_macro ERCF_IS_FILAMENT_IN_EXTRUDER] gcode: {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} - M118 ERCF_IS_F_IE Filament is in extruder + M118 Filament is in extruder {% else %} - M118 ERCF_IS_F_IE Filament not in extruder + M118 Filament not in extruder ERCF_PAUSE {% endif %} @@ -690,10 +690,10 @@ gcode: [gcode_macro ERCF_IS_FILAMENT_STUCK_IN_ERCF] gcode: {% if printer.ercf.encoder_pos|float != 0 %} - M118 ERCF_IS_F_SIE Filament stuck in ERCF + M118 Filament stuck in ERCF ERCF_PAUSE {% else %} - M118 ERCF_IS_F_SIE Filament not in ERCF + M118 Filament not in ERCF {% endif %} ############################################ @@ -704,9 +704,9 @@ gcode: [gcode_macro ERCF_EJECT_UNKNOW_STATE] description: Unload filament from an unknown position gcode: - M118 EJECT_US Eject Filament if loaded ... + M118 Eject Filament if loaded ... {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} - M118 ERCF_EJECT_US Filament in extruder, trying to eject it .. + M118 Filament in extruder, trying to eject it .. {% set extruder_eject_temp = printer["gcode_macro ERCF_VAR"].extruder_eject_temp %} {% if printer['extruder'].temperature < extruder_eject_temp %} M118 Preheat Nozzle to {extruder_eject_temp} @@ -752,11 +752,8 @@ gcode: {% endif %} M118 Homing ERCF ... QUERY_ENDSTOPS - M118 ERCF_EJECT_UNKNOW_STATE ERCF_EJECT_UNKNOW_STATE - M118 ERCF_HOME_SELECTOR ERCF_HOME_SELECTOR - M118 ERCF_HOME_ONLY ERCF_HOME_ONLY [gcode_macro ERCF_HOME_SELECTOR] diff --git a/ercf/vars.cfg b/ercf/vars.cfg index af5f5d2..5d5d493 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -11,5 +11,5 @@ ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 967.611576 +ercf_calib_ref = 970.985396 From ef02359c32865dd2c0f3190e55edd1d8c82f4b72 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 18:23:38 +0100 Subject: [PATCH 080/131] v2.4: update calibration --- input_shaper.cfg | 6 +++--- printer.cfg | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index e8f55f3..fe69194 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -4,9 +4,9 @@ # is mzv input shaper. # shaper_type: mzv shaper_type_x: mzv -shaper_freq_x: 53.0 -shaper_type_y: ei -shaper_freq_y: 53.4 +shaper_freq_x: 55.4 +shaper_type_y: mzv +shaper_freq_y: 43.6 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/printer.cfg b/printer.cfg index 07fdd54..4962616 100644 --- a/printer.cfg +++ b/printer.cfg @@ -387,13 +387,13 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.035000, 0.012500, 0.025000, 0.020000, 0.020000, 0.042500, 0.042500 -#*# 0.022500, 0.002500, 0.015000, 0.007500, 0.025000, 0.042500, 0.037500 -#*# 0.002500, -0.015000, -0.000000, -0.000000, -0.000000, 0.017500, 0.017500 -#*# 0.015000, -0.005000, 0.005000, 0.000000, 0.007500, 0.030000, 0.022500 -#*# 0.010000, 0.005000, 0.010000, 0.005000, 0.010000, 0.032500, 0.022500 -#*# 0.007500, -0.002500, 0.005000, 0.002500, 0.005000, 0.025000, 0.010000 -#*# 0.037500, 0.022500, 0.032500, 0.032500, 0.030000, 0.045000, 0.037500 +#*# 0.003750, -0.005000, 0.001250, 0.000000, 0.000000, 0.025000, 0.020000 +#*# 0.007500, -0.005000, 0.003750, -0.008750, -0.003750, 0.018750, 0.007500 +#*# -0.007500, -0.027500, -0.005000, -0.013750, -0.010000, 0.000000, -0.003750 +#*# 0.005000, -0.001250, 0.006250, 0.000000, 0.000000, 0.010000, 0.001250 +#*# 0.003750, -0.000000, 0.003750, -0.002500, -0.000000, 0.013750, 0.001250 +#*# 0.008750, 0.005000, 0.008750, 0.006250, 0.007500, 0.018750, 0.007500 +#*# 0.035000, 0.027500, 0.032500, 0.037500, 0.038750, 0.055000, 0.042500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic From 8a9da3143e6b263c02aeaafe17224bef50043f7a Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 18:24:03 +0100 Subject: [PATCH 081/131] v2.4: update neopixel, add toolhead leds with arduino --- neopixel.cfg | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/neopixel.cfg b/neopixel.cfg index 4b2831d..0381559 100644 --- a/neopixel.cfg +++ b/neopixel.cfg @@ -5,6 +5,34 @@ [neopixel caselight] pin: PB0 chain_count: 44 -initial_RED: 0.75 -initial_GREEN: 0.75 -initial_BLUE: 0.75 +initial_RED: 0.6 +initial_GREEN: 0.5 +initial_BLUE: 0.4 + +[mcu toolhead] +serial: /dev/serial/by-id/usb-Klipper_atmega32u4_neopixel-if00 + +# arduino pro micro with atmega 32u4 +[board_pins toolhead] +mcu: toolhead +aliases: + ar0=PD2, ar1=PD3, ar2=PD1, ar3=PD0, ar4=PD4, + ar5=PC6, ar6=PD7, ar7=PE6, ar8=PB4, ar9=PB5, + ar10=PB6, ar11=PB7, ar12=PD6, ar13=PC7, ar14=PB3, + ar15=PB1, ar16=PB2, + analog0=PF7, analog1=PF6 + +[neopixel toolhead] +# pin: PB6 +pin: toolhead:ar2 +chain_count: 3 +color_order: GRBW +initial_RED: 0.3 +initial_GREEN: 0.3 +initial_BLUE: 0.3 +initial_WHITE: 0.2 + +[delayed_gcode toolhead_leds] +gcode: + SET_LED LED=toolhead INDEX=1 RED=0.0 BLUE=0.5 GREEN=0.0 WHITE=0.0 +initial_duration: 3 From e06e6385f4c1e9ed3a6d6e46867707ae0ce672d5 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 18:24:56 +0100 Subject: [PATCH 082/131] v2.4: update z_calibration parameters --- z_calibration.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/z_calibration.cfg b/z_calibration.cfg index cc1d00a..af8467e 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -5,7 +5,7 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 94.5 ; z Endstop x position inside right profile -variable_z_endstop_y: 309 ; z Endstop y position +variable_z_endstop_y: 307 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.5 ; reduced homing current for x and y variable_z_home_current: 0.4 ; reduced homing current for z @@ -36,11 +36,11 @@ gcode: # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. probe_nozzle_x: 94.5 -probe_nozzle_y: 309 +probe_nozzle_y: 307 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 -probe_switch_y: 290 +probe_switch_y: 287 # The X and Y coordinates (in mm) for probing on the print surface # (e.g. the center point) These coordinates will be adapted by the # probe's X and Y offsets. The default is the relative_reference_index @@ -74,7 +74,7 @@ max_deviation: 1.0 # configuration. #position_min: default from "stepper_z:position_min" section. # Extra clearance when moving -clearance: 12 +clearance: 10 # The moving speed in X and Y. The default is 50 mm/s. speed: 100 # Speed (in mm/s) of the Z axis when lifting the probe between From 988257a6f1598251c0e63d8342118a51fd07d871 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 6 Jan 2022 18:25:53 +0100 Subject: [PATCH 083/131] v2.4: update macros --- macros/helpers.cfg | 52 +++++++++++++++------------- macros/print.cfg | 73 ++++++++++++++++++++++------------------ macros/z_calibration.cfg | 11 ++++-- 3 files changed, 77 insertions(+), 59 deletions(-) diff --git a/macros/helpers.cfg b/macros/helpers.cfg index 6320aa9..254f610 100644 --- a/macros/helpers.cfg +++ b/macros/helpers.cfg @@ -1,7 +1,10 @@ #################################################################### # Helper macros # - MOVE_SPEED -# - ... +# - NOTIFY_BED +# - NOTIFY_EXTRUDER +# - ZC - calibrate z and move to front to measure +# - TZC - Test Z Calibration #################################################################### [gcode_macro MOVE_SPEED] @@ -42,30 +45,33 @@ gcode: M118 Already printing {% endif %} -[gcode_macro fes] -description: query filament sensor encoder_sensor -gcode: - QUERY_FILAMENT_SENSOR SENSOR=encoder_sensor -[gcode_macro fts] -description: query filament sensor toolhead_sensor +[gcode_macro NOTIFY_BED] gcode: - QUERY_FILAMENT_SENSOR SENSOR=toolhead_sensor - -[gcode_macro zc] -gcode: - {% set z_run = params.CUR|default(0.4)|float %} - {% set z_hold = z_run %} - {action_respond_info("zc: setting zcurrent to %.2f" % z_run)} - SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} + {% set BED=params.BED|default(0)|int %} + M117 HEATING BED from {printer.heater_bed.temperature} to {BED} + M118 HEATING BED from {printer.heater_bed.temperature} to {BED} -[gcode_macro zm] +[gcode_macro NOTIFY_EXTRUDER] gcode: - {% set F = params.SPEED|default(300)|int %} - {action_respond_info("moving with F=%d" % F)} - G0 Z30 F{F} - G0 Z10 F{F} + {% set EXTRUDER=params.EXTRUDER|default(0)|int %} + M117 HEATING EXTRUDER from {printer.extruder.temperature} to {EXTRUDER} + M118 HEATING EXTRUDER from {printer.extruder.temperature} to {EXTRUDER} + + +[gcode_macro ZC] +gcode: + G28 + CALIBRATE_Z + G0 X150 Y30 Z2 F10000 + G0 Z1 F300 + +[gcode_macro TZC] +gcode: + {% set N=params.N|default(1)|int %} + {% for i in range(N) %} + M118 move {(i+1)}/{N} + G28 + CALIBRATE_Z + {% endfor %} diff --git a/macros/print.cfg b/macros/print.cfg index e25f198..3ac267d 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -22,7 +22,6 @@ gcode: {% set z0=1.5 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} - M118 brushie brushie brushie G0 Z{z_hop} F1000 # move Z to travel height G0 X{x0} Y{y0} F6000 # move to x0/y0 G0 Z{z0} # lower @@ -118,17 +117,15 @@ gcode: gcode: {% set BED=params.BED|default(100)|int %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} - {% set CHAMBER=params.CHAMBER|default(0)|int %} - {% set SHEET=params.SHEET|default("default")|string %} - {% set QGL=params.QGL|default(1)|int %} {% set BMC=params.BMC|default(0)|int %} + {% set SHEET=params.SHEET|default("default")|string %} {% set PURGE=params.PURGE|default(1)|int %} - {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} {% set ERCF=params.ERCF|default(0)|int %} {% set ERCF_EXTRUDER=params.ERCF_EXTRUDER|default(0)|int %} - {action_respond_info("starting print BED=%d, EXTRUDER=%d, CHAMBER=%d, SHEET=%s, QGL=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f, ERCF=%d, ERCF_EXTRUDER=%d" % (BED, EXTRUDER, CHAMBER, SHEET, QGL, BMC, PURGE, SOAK, Z_ADJUST, ERCF, ERCF_EXTRUDER))} - M118 configuring + {action_respond_info("starting print BED=%d, EXTRUDER=%d, SHEET=%s, BMC=%d, PURGE=%d, Z_AJUST=%f, ERCF=%d, ERCF_EXTRUDER=%d" % (BED, EXTRUDER, SHEET, BMC, PURGE, Z_ADJUST, ERCF, ERCF_EXTRUDER))} + M117 CONFIGURING + M118 CONFIGURING SET_GCODE_OFFSET Z=0.0 # reset z offset M140 S{BED} # start bed heating M104 S{EXTRUDER} # start extruder heating @@ -137,49 +134,60 @@ gcode: G90 # use absolute coordinates M83 # use relative distances for extrusion - G4 P2000 - {% if BMC %} - BED_MESH_CLEAR + BED_MESH_CLEAR + {% if not "xyz" in printer.toolhead.homed_axes %} + M117 HOME + M118 HOME + G28 + {% else %} + M117 NO HOME + M118 NO HOME {% endif %} - M118 home - G28 - BRUSHIE - {% if QGL %} - M118 qgl + + {% if printer.quad_gantry_level.applied|lower == 'false' %} + M117 QGL + M118 QGL QUAD_GANTRY_LEVEL PARK=false - BRUSHIE + {% else %} + M117 NO QGL + M118 NO QGL {% endif %} - M118 calibrate z - CALIBRATE_Z + {% if BMC %} - M118 bed mesh calibrate + M117 BED MESH CALIBRATE + M118 BED MESH CALIBRATE BED_MESH_CALIBRATE {% else %} - M118 bed mesh load {SHEET} + M117 BED MESH LOAD {SHEET} + M118 BED MESH LOAD {SHEET} BED_MESH_PROFILE LOAD={SHEET} {% endif %} - M118 heating - G4 P2000 - G92 E0 # reset extruder - M190 S{BED} # set and wait for bed temperature - M109 S{EXTRUDER} # set and wait for nozzle temperature - TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={CHAMBER} # wait for chamber temp - {% if SOAK > 0 %} - M118 soaking for {SOAK/1000/60|int} min - G4 P{SOAK} - {% endif %} + M117 CALIBRATE_Z + M118 CALIBRATE_Z + BRUSHIE + G28 Z + CALIBRATE_Z + + G92 E0 # reset extruder + NOTIFY_BED BED={BED} + M190 S{BED} # set and wait for bed temperature + NOTIFY_EXTRUDER EXTRUDER={EXTRUDER} + M109 S{EXTRUDER} # set and wait for extruder temperature - M118 starting SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 {% if ERCF %} + M117 ercf changing to tool {ERCF_EXTRUDER} M118 ercf changing to tool {ERCF_EXTRUDER} + ERCF_HOME ERCF_CHANGE_TOOL_SLICER TOOL={ERCF_EXTRUDER} {% endif %} BRUSHIE {% if PURGE %} PURGE_NOZZLE {% endif %} + M117 STARTING + M118 STARTING # - PRINT_END @@ -209,7 +217,7 @@ gcode: M118 purge nozzle G0 Z{z_hop} F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 - G0 Z0.24 F300 # lower Z + G0 Z0.24 F300 # lower Z to 75% G0 X{x1} E20 F1500 # draw line G0 Y{y1} # move to y1 G0 X{x0} E10 # draw fine line @@ -247,7 +255,6 @@ gcode: {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 {% endif %} - M118 calling _RESUME_BASE G4 P2000 _RESUME_BASE {% endif %} diff --git a/macros/z_calibration.cfg b/macros/z_calibration.cfg index 210e6d9..874e732 100644 --- a/macros/z_calibration.cfg +++ b/macros/z_calibration.cfg @@ -88,14 +88,19 @@ gcode: {% set z_run = printer['gcode_macro _USER_VARIABLE'].z_home_current %} {% set z_hold = printer['gcode_macro _USER_VARIABLE'].z_home_current %} {% else %} - {% if 'tmc2209 stepper_z' in printer.configfile.settings %} + ## XY + {% if 'tmc2209 stepper_x' in printer.configfile.settings %} {% set xy_run = printer.configfile.settings['tmc2209 stepper_x'].run_current %} {% set xy_hold = printer.configfile.settings['tmc2209 stepper_x'].hold_current %} + {% elif 'tmc5160 stepper_x' in printer.configfile.settings %} + {% set xy_run = printer.configfile.settings['tmc5160 stepper_x'].run_current %} + {% set xy_hold = printer.configfile.settings['tmc5160 stepper_x'].hold_current %} + {% endif %} + ## Z + {% if 'tmc2209 stepper_z' in printer.configfile.settings %} {% set z_run = printer.configfile.settings['tmc2209 stepper_z'].run_current %} {% set z_hold = printer.configfile.settings['tmc2209 stepper_z'].hold_current %} {% elif 'tmc5160 stepper_z' in printer.configfile.settings %} - {% set xy_run = printer.configfile.settings['tmc5160 stepper_x'].run_current %} - {% set xy_hold = printer.configfile.settings['tmc5160 stepper_x'].hold_current %} {% set z_run = printer.configfile.settings['tmc5160 stepper_z'].run_current %} {% set z_hold = printer.configfile.settings['tmc5160 stepper_z'].hold_current %} {% endif %} From fa7a0cc7b2adb98bf5bfd847fd1d71138a3e330f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sat, 8 Jan 2022 09:52:05 +0100 Subject: [PATCH 084/131] v2.4: rather link to timelapse.cfg --- macros/timelapse.cfg | 418 +------------------------------------------ 1 file changed, 1 insertion(+), 417 deletions(-) mode change 100644 => 120000 macros/timelapse.cfg diff --git a/macros/timelapse.cfg b/macros/timelapse.cfg deleted file mode 100644 index 98eaa76..0000000 --- a/macros/timelapse.cfg +++ /dev/null @@ -1,417 +0,0 @@ -# Timelapse klipper macro definition -# -# Copyright (C) 2021 Christoph Frei -# Copyright (C) 2021 Alex Zellner -# -# This file may be distributed under the terms of the GNU GPLv3 license -# -# Macro version 1.7 -# - -##### DO NOT CHANGE ANY MACRO!!! ##### - -########################################################################## -# # -# GET_TIMELAPSE_SETUP: Print the Timelapse setup to console # -# # -########################################################################## - -[gcode_macro GET_TIMELAPSE_SETUP] -description: Print the Timelapse setup -gcode: - {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} - {% set output_txt = ["Timelapse Setup:"] %} - {% set _dummy = output_txt.append("enable: %s" % tl.enable) %} - {% set _dummy = output_txt.append("park: %s" % tl.park.enable) %} - {% if tl.park.enable|lower == 'true' %} - {% set _dummy = output_txt.append("park position: %s time: %s s" % (tl.park.pos, tl.park.time)) %} - {% if tl.park.pos|lower == 'custom' %} - {% set _dummy = output_txt.append("custom cord x:%s y:%s dz:%s" % (tl.custom.x, tl.custom.y, tl.custom.dz)) %} - {% endif %} - {% set _dummy = output_txt.append("travel speed: %s mm/s" % tl.speed.travel) %} - {% endif %} - {% set _dummy = output_txt.append("fw_retract: %s" % tl.extruder.fw_retract) %} - {% if tl.extruder.fw_retract|lower == 'false' %} - {% set _dummy = output_txt.append("retract: %s mm speed: %s mm/s" % (tl.extruder.retract, tl.speed.retract)) %} - {% set _dummy = output_txt.append("extrude: %s mm speed: %s mm/s" % (tl.extruder.extrude, tl.speed.extrude)) %} - {% endif %} - {% set _dummy = output_txt.append("verbose: %s" % tl.verbose) %} - {action_respond_info(output_txt|join("\n"))} - -################################################################################################ -# # -# Use _SET_TIMELAPSE_SETUP [ENABLE=value] [VERBOSE=value] [PARK_ENABLE=value] [PARK_POS=value] # -# [PARK_TIME=value] [CUSTOM_POS_X=value] [CUSTOM_POS_Y=value] # -# [CUSTOM_POS_DZ=value][TRAVEL_SPEED=value] [RETRACT_SPEED=value] # -# [EXTRUDE_SPEED=value] [EXTRUDE_DISTANCE=value] # -# [RETRACT_DISTANCE=value] [FW_RETRACT=value] # -# # -################################################################################################ - -[gcode_macro _SET_TIMELAPSE_SETUP] -description: Set user parameters for timelapse -gcode: - ##### get dictonaries ##### - {% set enable = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].enable %} - {% set verbose = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].verbose %} - {% set park = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].park %} - {% set custom = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].custom %} - {% set speed = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].speed %} - {% set extruder = printer['gcode_macro TIMELAPSE_TAKE_FRAME'].extruder %} - ##### get min and max bed size ##### - {% set min = printer.toolhead.axis_minimum %} - {% set max = printer.toolhead.axis_maximum %} - ##### set new values ##### - {% if params.ENABLE is defined %} - {% if params.ENABLE|lower == 'true' or params.ENABLE|lower == 'false' %} - {% set enable = params.ENABLE|capitalize %} - {% else %} - {action_raise_error("ENABLE=%s not supported. Allowed values are [True, False]" % params.ENABLE)} - {% endif %} - {% endif %} - {% if params.VERBOSE is defined %} - {% if params.VERBOSE|lower == 'true' or params.VERBOSE|lower == 'false' %} - {% set verbose = params.VERBOSE|capitalize %} - {% else %} - {action_raise_error("VERBOSE=%s not supported. Allowed values are [True, False]" % params.VERBOSE)} - {% endif %} - {% endif %} - {% if params.PARK_ENABLE is defined %} - {% if params.PARK_ENABLE|lower == 'true' or params.PARK_ENABLE|lower == 'false' %} - {% set _dummy = park.update({'enable':params.PARK_ENABLE|capitalize}) %} - {% else %} - {action_raise_error("PARK_ENABLE=%s not supported. Allowed values are [True, False]" % params.PARK_ENABLE)} - {% endif %} - {% endif %} - {% if params.PARK_POS is defined %} - {% if params.PARK_POS|lower == 'center' or params.PARK_POS|lower == 'front_left' or params.PARK_POS|lower == 'front_right' - or params.PARK_POS|lower == 'back_left' or params.PARK_POS|lower == 'back_right' or params.PARK_POS|lower == 'custom' %} - {% set _dummy = park.update({'pos':params.PARK_POS|lower}) %} - {% else %} - {action_raise_error("PARK_POS=%s not supported. Allowed values are [CENTER, FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, CUSTOM]" - % params.PARK_POS)} - {% endif %} - {% endif %} - {% if params.PARK_TIME is defined %} - {% if params.PARK_TIME|float >= 0.0 %} - {% set _dummy = park.update({'time':params.PARK_TIME|float|round(3)}) %} - {% else %} - {action_raise_error("PARK_TIME=%s must be a positive number" % params.PARK_TIME)} - {% endif %} - {% endif %} - {% if params.CUSTOM_POS_X is defined %} - {% if params.CUSTOM_POS_X|float >= min.x and params.CUSTOM_POS_X|float <= max.x %} - {% set _dummy = custom.update({'x':params.CUSTOM_POS_X|float|round(3)}) %} - {% else %} - {action_raise_error("CUSTOM_POS_X=%s must be within [%s - %s]" % (params.CUSTOM_POS_X, min.x, max.x))} - {% endif %} - {% endif %} - {% if params.CUSTOM_POS_Y is defined %} - {% if params.CUSTOM_POS_Y|float >= min.y and params.CUSTOM_POS_Y|float <= max.y %} - {% set _dummy = custom.update({'y':params.CUSTOM_POS_Y|float|round(3)}) %} - {% else %} - {action_raise_error("CUSTOM_POS_Y=%s must be within [%s - %s]" % (params.CUSTOM_POS_Y, min.y, max.y))} - {% endif %} - {% endif %} - {% if params.CUSTOM_POS_DZ is defined %} - {% if params.CUSTOM_POS_DZ|float >= min.z and params.CUSTOM_POS_DZ|float <= max.z %} - {% set _dummy = custom.update({'dz':params.CUSTOM_POS_DZ|float|round(3)}) %} - {% else %} - {action_raise_error("CUSTOM_POS_DZ=%s must be within [%s - %s]" % (params.CUSTOM_POS_DZ, min.z, max.z))} - {% endif %} - {% endif %} - {% if params.TRAVEL_SPEED is defined %} - {% if params.TRAVEL_SPEED|float > 0.0 %} - {% set _dummy = speed.update({'travel':params.TRAVEL_SPEED|float|round(3)}) %} - {% else %} - {action_raise_error("TRAVEL_SPEED=%s must be larger than 0" % params.TRAVEL_SPEED)} - {% endif %} - {% endif %} - {% if params.RETRACT_SPEED is defined %} - {% if params.RETRACT_SPEED|float > 0.0 %} - {% set _dummy = speed.update({'retract':params.RETRACT_SPEED|float|round(3)}) %} - {% else %} - {action_raise_error("RETRACT_SPEED=%s must be larger than 0" % params.RETRACT_SPEED)} - {% endif %} - {% endif %} - {% if params.EXTRUDE_SPEED is defined %} - {% if params.EXTRUDE_SPEED|float > 0.0 %} - {% set _dummy = speed.update({'extrude':params.EXTRUDE_SPEED|float|round(3)}) %} - {% else %} - {action_raise_error("EXTRUDE_SPEED=%s must be larger than 0" % params.EXTRUDE_SPEED)} - {% endif %} - {% endif %} - {% if params.EXTRUDE_DISTANCE is defined %} - {% if params.EXTRUDE_DISTANCE|float >= 0.0 %} - {% set _dummy = extruder.update({'extrude':params.EXTRUDE_DISTANCE|float|round(3)}) %} - {% else %} - {action_raise_error("EXTRUDE_DISTANCE=%s must be specified as positiv number" % params.EXTRUDE_DISTANCE)} - {% endif %} - {% endif %} - {% if params.RETRACT_DISTANCE is defined %} - {% if params.RETRACT_DISTANCE|float >= 0.0 %} - {% set _dummy = extruder.update({'retract':params.RETRACT_DISTANCE|float|round(3)}) %} - {% else %} - {action_raise_error("RETRACT_DISTANCE=%s must be specified as positiv number" % params.RETRACT_DISTANCE)} - {% endif %} - {% endif %} - {% if params.FW_RETRACT is defined %} - {% if params.FW_RETRACT|lower == 'true' or params.FW_RETRACT|lower == 'false' %} - {% if 'firmware_retraction' in printer.configfile.settings %} - {% set _dummy = extruder.update({'fw_retract':params.FW_RETRACT|capitalize}) %} - {% else %} - {% set _dummy = extruder.update({'fw_retract':False}) %} - {% if params.FW_RETRACT|lower == 'true' %} - {action_raise_error("[firmware_retraction] not defined in printer.cfg. Can not enanble fw_retract")} - {% endif %} - {% endif %} - {% else %} - {action_raise_error("FW_RETRACT=%s not supported. Allowed values are [True, False]" % params.FW_RETRACT)} - {% endif %} - {% endif %} - ##### write values to variables ##### - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=enable VALUE='"{enable}"' - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=verbose VALUE='"{verbose}"' - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=park VALUE="{park}" - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=custom VALUE="{custom}" - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=speed VALUE="{speed}" - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=extruder VALUE="{extruder}" - -########################################################################## -# # -# TIMELAPSE_TAKE_FRAME: take the next picture # -# # -########################################################################## - -######################### definition ######################### -## enable: enable or disable the next frame. Valid inputs: [True, False] -## takingframe: internal use. Valid inputs: [True, False] -## -## park.enable: enable or disable to park the head while taking a picture. Valid inputs: [True, False] -## park.pos : used position for parking. Valid inputs: [center, front_left, front_right, back_left, back_right, custom] -## park.time : used for the debug macro. Time in s -## -## custom.x, custom.y: coordinates of the custom parkposition. Unit [mm] -## custom.dz : custom z hop for the picture. Unit [mm] -## -## extruder.fw_retract: enable disable fw retraction [True,False] -## extruder.extrude. : filament extruded at the end of park. Unit [mm] -## extruder.retract. : filament retract at the start of park. Unit [mm] -## -## speed.travel : used speed for travel from and to the park positon. Unit: [mm/min] -## speed.retract: used speed for retract [mm/min] -## speed.extrude: used speed for extrude [mm/min] -## -## verbose: Enable mesage output of TIMELAPSE_TAKE_FRAME -## -## restore.absolute.coordinates: internal use -## restore.absolute.extrude : internal use -## restore.speed : internal use -## restore.e : internal use -## -## is_paused: internal use -############################################################### -[gcode_macro TIMELAPSE_TAKE_FRAME] -description: Take Timelapse shoot -variable_enable: False -variable_takingframe: False -variable_park: {'enable': False, - 'pos' : 'center', - 'time' : 0.1} -variable_custom: {'x': 0, 'y': 0, 'dz': 0} -variable_extruder: {'fw_retract': False, - 'retract': 1.0, - 'extrude': 1.0} -variable_speed: {'travel': 100, - 'retract': 15, - 'extrude': 15} -variable_verbose: True -variable_restore: {'absolute': {'coordinates': True, 'extrude': True}, 'speed': 1500, 'e':0} -variable_is_paused: False -gcode: - ##### get input parameters ##### - {% set hyperlapse = params.HYPERLAPSE|default('false')|lower %} - ##### define park position ##### - {% set min = printer.toolhead.axis_minimum %} - {% set max = printer.toolhead.axis_maximum %} - {% set act = printer.toolhead.position %} - {% set pos_dic = {'center' : {'x': (max.x-(max.x-min.x)/2), 'y': (max.y-(max.y-min.y)/2), 'dz': 1 }, - 'front_left' : {'x': min.x , 'y': min.y , 'dz': 0 }, - 'front_right': {'x': max.x , 'y': min.y , 'dz': 0 }, - 'back_left' : {'x': min.x , 'y': max.y , 'dz': 0 }, - 'back_right' : {'x': max.x , 'y': max.y , 'dz': 0 }, - 'custom' : {'x': custom.x , 'y': custom.y , 'dz': custom.dz}} %} - ##### check z max ##### - {% if (act.z|float + pos_dic[park.pos].dz|float) < max.z|float %} - {% set pos = {'x': pos_dic[park.pos].x, 'y': pos_dic[park.pos].y, 'z': (act.z|float + pos_dic[park.pos].dz|float)} %} - {% else %} - {% set pos = {'x': pos_dic[park.pos].x, 'y': pos_dic[park.pos].y, 'z': max.z} %} - {% endif %} - ##### end of definition ##### - {% if enable|lower == 'true' %} - {% if (hyperlapse == 'true' and printer['gcode_macro HYPERLAPSE'].run|lower == 'true') or - (hyperlapse == 'false' and printer['gcode_macro HYPERLAPSE'].run|lower == 'false') %} - {% if park.enable|lower == 'true' %} - {% set restore = {'absolute': {'coordinates': printer.gcode_move.absolute_coordinates, - 'extrude' : printer.gcode_move.absolute_extrude}, - 'speed' : printer.gcode_move.speed, - 'e' : printer.gcode_move.gcode_position.e} %} - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=restore VALUE="{restore}" - {% if printer.extruder.can_extrude|lower == 'false' %} - {action_respond_info("Timelapse: Warning, minimum extruder temperature not reached!")} - {% else %} - {% if extruder.fw_retract|lower == 'true' %} - G10 - {% else %} - M83 ; insure relative extrusion - G0 E-{extruder.retract} F{speed.retract|int * 60} - {% endif %} - {% endif %} - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=True - {printer.configfile.settings['gcode_macro pause'].rename_existing} ; execute the klipper PAUSE command - G90 ; insure absolute move - {% if "xyz" not in printer.toolhead.homed_axes %} - {action_respond_info("Timelapse: Warning, axis not homed yet!")} - {% else %} - G0 X{pos.x} Y{pos.y} Z{pos.z} F{speed.travel|int * 60} - {% endif %} - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=takingframe VALUE=True - UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5 - M400 - {% endif %} - _TIMELAPSE_NEW_FRAME HYPERLAPSE={hyperlapse} - {% endif %} - {% else %} - {% if verbose|lower == 'true' %} - {action_respond_info("Timelapse: disabled, take frame ignored")} - {% endif %} - {% endif %} - -[gcode_macro _TIMELAPSE_NEW_FRAME] -description: action call for timelapse shoot. must be a seperate macro -gcode: - {action_call_remote_method("timelapse_newframe", - macropark=printer['gcode_macro TIMELAPSE_TAKE_FRAME'].park, - hyperlapse=params.HYPERLAPSE)} - -[delayed_gcode _WAIT_TIMELAPSE_TAKE_FRAME] -gcode: - {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} - {% if tl.takingframe %} - UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5 - {% else %} - {printer.configfile.settings['gcode_macro resume'].rename_existing} VELOCITY={tl.speed.travel} ; execute the klipper RESUME command - SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=False - {% if printer.extruder.can_extrude|lower == 'false' %} - {action_respond_info("Timelapse: Warning minimum extruder temperature not reached!")} - {% else %} - {% if tl.extruder.fw_retract|lower == 'true' %} - G11 - {% else %} - G0 E{tl.extruder.extrude} F{tl.speed.extrude|int * 60} - G0 F{tl.restore.speed} - {% if tl.restore.absolute.extrude|lower == 'true' %} - M82 - G92 E{tl.restore.e} - {% endif %} - {% endif %} - {% endif %} - {% if tl.restore.absolute.coordinates|lower == 'false' %} G91 {% endif %} - {% endif %} - -#################################################################################################### -# # -# HYPERLAPSE: Starts or stops a Hyperlapse video # -# Usage: HYPERLAPSE ACTION=START [CYCLE=time] starts a hyperlapse with cycle time (default 30 sec) # -# HYPERLAPSE ACTION=STOP stops the hyperlapse recording # -# # -#################################################################################################### - -######################### definition ######################### -## cycle: cycle time in seconds -## run: internal use [True/False] -############################################################### -[gcode_macro HYPERLAPSE] -description: Start/Stop a hyperlapse recording -variable_cycle: 0 -variable_run: False -gcode: - {% set cycle = params.CYCLE|default(30)|int %} - {% if params.ACTION is defined and params.ACTION|lower == 'start' %} - {action_respond_info("Hyperlapse: frames started (Cycle %d sec)" % cycle)} - SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=True - SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=cycle VALUE={cycle} - UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={cycle} - TIMELAPSE_TAKE_FRAME HYPERLAPSE="True" - {% elif params.ACTION is defined and params.ACTION|lower == 'stop' %} - SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=False - {action_respond_info("Hyperlapse: frames stopped")} - UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION=0 - {% else %} - {action_respond_info("Hyperlapse: No valid input parameter - Use: - - HYPERLAPSE ACTION=START [CYCLE=time] - - HYPERLAPSE ACTION=STOP")} - {% endif %} - -[delayed_gcode _HYPERLAPSE_LOOP] -gcode: - UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={printer["gcode_macro HYPERLAPSE"].cycle} - TIMELAPSE_TAKE_FRAME HYPERLAPSE="True" - -########################################################################## -# # -# TIMELAPSE_RENDER: Render the video at print end # -# # -########################################################################## - -######################### definition ######################### -## render: internal use. Valid inputs: [True, False] -## run_identifier: internal use. Valid input [0 .. 3] -############################################################### -[gcode_macro TIMELAPSE_RENDER] -description: Render Timelapse video and wait for the result -variable_render: False -variable_run_identifier: 0 -gcode: - {action_respond_info("Timelapse: Rendering started")} - {action_call_remote_method("timelapse_render", byrendermacro="True")} - SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=render VALUE=True - {printer.configfile.settings['gcode_macro pause'].rename_existing} ; execute the klipper PAUSE command - UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5 - -[delayed_gcode _WAIT_TIMELAPSE_RENDER] -gcode: - {% set ri = printer['gcode_macro TIMELAPSE_RENDER'].run_identifier|int % 4 %} - SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=run_identifier VALUE={ri + 1} - {% if printer['gcode_macro TIMELAPSE_RENDER'].render %} - M117 Rendering {['-','\\','|','/'][ri]} - UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5 - {% else %} - {action_respond_info("Timelapse: Rendering finished")} - M117 - {printer.configfile.settings['gcode_macro resume'].rename_existing} ; execute the klipper RESUME command - {% endif %} - -########################################################################## -# # -# TEST_STREAM_DELAY: Helper macro to find stream and park delay # -# # -########################################################################## - -[gcode_macro TEST_STREAM_DELAY] -description: Helper macro to find stream and park delay -gcode: - {% set min = printer.toolhead.axis_minimum %} - {% set max = printer.toolhead.axis_maximum %} - {% set act = printer.toolhead.position %} - {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} - {% if act.z > 5.0 %} - G0 X{min.x + 5.0} F{tl.speed.travel|int * 60} - G0 X{(max.x-min.x)/2} - G4 P{tl.park.time|float * 1000} - _TIMELAPSE_NEW_FRAME HYPERLAPSE=FALSE - G0 X{max.x - 5.0} - {% else %} - {action_raise_error("Toolhead z %.3f to low. Please place head above z = 5.0" % act.z)} - {% endif %} \ No newline at end of file diff --git a/macros/timelapse.cfg b/macros/timelapse.cfg new file mode 120000 index 0000000..982e949 --- /dev/null +++ b/macros/timelapse.cfg @@ -0,0 +1 @@ +/home/pi/moonraker-timelapse/klipper_macro/timelapse.cfg \ No newline at end of file From 46da9479bca80f4a7e76ed4d82084d3e5ab0cd1b Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 12 Jan 2022 14:58:20 +0100 Subject: [PATCH 085/131] v2.4: use dragon hotend --- printer.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/printer.cfg b/printer.cfg index 4962616..e98c5ea 100644 --- a/printer.cfg +++ b/printer.cfg @@ -380,9 +380,9 @@ max_adjust: 10 #*# #*# [extruder] #*# control = pid -#*# pid_kp = 27.483 -#*# pid_ki = 1.762 -#*# pid_kd = 107.182 +#*# pid_kp = 27.862 +#*# pid_ki = 1.548 +#*# pid_kd = 125.379 #*# #*# [bed_mesh default] #*# version = 1 From a1b863421310c411c12550b842fd7a0c5584e66f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 12 Jan 2022 14:59:17 +0100 Subject: [PATCH 086/131] v2.4: change run_currents --- printer.cfg | 4 ++-- z_calibration.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/printer.cfg b/printer.cfg index e98c5ea..16b9a29 100644 --- a/printer.cfg +++ b/printer.cfg @@ -91,7 +91,7 @@ homing_positive_dir: true [tmc2209 stepper_x] uart_pin: PC4 interpolate: False -run_current: 0.8 +run_current: 1.0 sense_resistor: 0.110 stealthchop_threshold: 0 @@ -114,7 +114,7 @@ homing_positive_dir: true [tmc2209 stepper_y] uart_pin: PD11 interpolate: False -run_current: 0.8 +run_current: 1.0 sense_resistor: 0.110 stealthchop_threshold: 0 diff --git a/z_calibration.cfg b/z_calibration.cfg index af8467e..25584c3 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -8,7 +8,7 @@ variable_z_endstop_x: 94.5 ; z Endstop x position inside right profil variable_z_endstop_y: 307 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.5 ; reduced homing current for x and y -variable_z_home_current: 0.4 ; reduced homing current for z +variable_z_home_current: 0.5 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### variable_probe_dock_x: 53 ; x toolhead position before docking probe From 33a906f2e69bd178b69ea6d11dad11ab27c07d08 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 13 Feb 2022 17:02:29 +0100 Subject: [PATCH 087/131] v2.4: update KlipperScreen --- KlipperScreen.conf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 395922d..3435cb8 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -1,6 +1,7 @@ [main] moonraker_host: 127.0.0.1 moonraker_port: 7125 +service: KlipperScreen [z_calibrate_position] calibrate_x_position: 150 @@ -14,6 +15,10 @@ extruder = 200 bed = 100 extruder = 250 +[preheat PETG] +bed = 80 +extruder = 240 + [menu __main] name: {{ gettext('Main Menu') }} @@ -21,10 +26,10 @@ name: {{ gettext('Main Menu') }} name: {{ gettext('Homing') }} icon: home -[menu __main preheat] -name: {{ gettext('Preheat') }} +[menu __main temperature] +name: {{ gettext('Temperature') }} icon: heat-up -panel: preheat +panel: temperature [menu __main actions] name: {{ gettext('Actions') }} @@ -332,7 +337,6 @@ panel: settings #~# ercf_form_tip_standalone = False #~# ercf_is_filament_in_extruder = False #~# ercf_home_only = False -#~# purge_nozzle = False #~# ercf_var = False #~# ercf_pause = False #~# ercf_unload_tool = False @@ -347,4 +351,7 @@ panel: settings #~# ercf_unselect_tool = False #~# hyperlapse = False #~# ercf_calibrate = False +#~# t6 = False +#~# t7 = False +#~# t8 = False #~# From f497c4a85687fab8a5a28f8e00765fef644002e9 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 14 Feb 2022 20:04:53 +0100 Subject: [PATCH 088/131] v2.4: try to improve heating sequence in print_start --- macros/print.cfg | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index 3ac267d..0474253 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -116,6 +116,7 @@ gcode: [gcode_macro PRINT_START] gcode: {% set BED=params.BED|default(100)|int %} + {% set BED10=params.BED|default(100)|int - 10 %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set BMC=params.BMC|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} @@ -127,8 +128,8 @@ gcode: M117 CONFIGURING M118 CONFIGURING SET_GCODE_OFFSET Z=0.0 # reset z offset - M140 S{BED} # start bed heating - M104 S{EXTRUDER} # start extruder heating + M140 S{BED10} # start bed heating to bed-10 + # M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder G21 # set units to millimeters G90 # use absolute coordinates @@ -166,14 +167,17 @@ gcode: M117 CALIBRATE_Z M118 CALIBRATE_Z BRUSHIE - G28 Z CALIBRATE_Z - G92 E0 # reset extruder - NOTIFY_BED BED={BED} - M190 S{BED} # set and wait for bed temperature + G92 E0 # reset extruder + NOTIFY_BED BED={BED10} + M190 S{BED10} # set and wait for bed-10 temperature + NOTIFY_EXTRUDER EXTRUDER={EXTRUDER} - M109 S{EXTRUDER} # set and wait for extruder temperature + M104 S{EXTRUDER} # start extruder heating + NOTIFY_BED BED={BED} + M190 S{BED} # set and wait for actual bed temperature + M109 S{EXTRUDER} # set and wait for extruder temperature SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 {% if ERCF %} @@ -222,7 +226,7 @@ gcode: G0 Y{y1} # move to y1 G0 X{x0} E10 # draw fine line G0 X{x0-10} # move a little further - G0 E-3 # retract filament + G0 E-5 # retract filament G0 Z{z_hop} F300 # move Z to travel height From e20b2823d13fa20a325d33d091ae0ee8978ff7c2 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 15 Feb 2022 18:25:42 +0100 Subject: [PATCH 089/131] v2.4: minor changes --- ercf/vars.cfg | 2 +- printer.cfg | 17 +++++++++-------- z_calibration.cfg | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ercf/vars.cfg b/ercf/vars.cfg index 5d5d493..eb170ad 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -4,7 +4,7 @@ ercf_calib_1 = 0.992410468168 ercf_calib_10 = 1.0 ercf_calib_11 = 1.0 ercf_calib_2 = 1.00044979689 -ercf_calib_3 = 1.00044979689 +ercf_calib_3 = 0.999550111824 ercf_calib_4 = 1.00044979689 ercf_calib_5 = 0.999550111824 ercf_calib_6 = 1.0 diff --git a/printer.cfg b/printer.cfg index 16b9a29..c75235e 100644 --- a/printer.cfg +++ b/printer.cfg @@ -135,7 +135,7 @@ endstop_pin: PG10 ## actual_position = measured_position_endstop - position_endstop position_endstop: 0.5 position_max: 290 -position_min: -5 +position_min: -1 homing_speed: 8.0 # speed: mm/sec, feedrate: mm/min homing_retract_speed: 10 second_homing_speed: 2 @@ -324,6 +324,7 @@ pin: ^PG11 x_offset: 0 y_offset: 30 z_offset: 12 +speed: 5.0 lift_speed: 20 samples: 3 samples_result: median @@ -387,13 +388,13 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.003750, -0.005000, 0.001250, 0.000000, 0.000000, 0.025000, 0.020000 -#*# 0.007500, -0.005000, 0.003750, -0.008750, -0.003750, 0.018750, 0.007500 -#*# -0.007500, -0.027500, -0.005000, -0.013750, -0.010000, 0.000000, -0.003750 -#*# 0.005000, -0.001250, 0.006250, 0.000000, 0.000000, 0.010000, 0.001250 -#*# 0.003750, -0.000000, 0.003750, -0.002500, -0.000000, 0.013750, 0.001250 -#*# 0.008750, 0.005000, 0.008750, 0.006250, 0.007500, 0.018750, 0.007500 -#*# 0.035000, 0.027500, 0.032500, 0.037500, 0.038750, 0.055000, 0.042500 +#*# -0.005000, -0.018750, -0.012500, -0.015000, -0.015000, 0.002500, 0.002500 +#*# 0.008750, -0.006250, 0.000000, -0.012500, -0.008750, 0.015000, 0.007500 +#*# -0.005000, -0.020000, -0.006250, -0.011250, -0.007500, 0.007500, 0.005000 +#*# 0.007500, -0.006250, 0.010000, 0.000000, 0.005000, 0.018750, 0.011250 +#*# 0.006250, -0.006250, 0.006250, 0.011250, 0.015000, 0.025000, 0.018750 +#*# 0.003750, -0.005000, 0.001250, -0.001250, 0.003750, 0.017500, 0.008750 +#*# 0.026250, 0.018750, 0.016250, 0.020000, 0.025000, 0.032500, 0.025000 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic diff --git a/z_calibration.cfg b/z_calibration.cfg index 25584c3..1c9c04c 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -7,7 +7,7 @@ description: Helper: Contains User defined printer variables variable_z_endstop_x: 94.5 ; z Endstop x position inside right profile variable_z_endstop_y: 307 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing -variable_xy_home_current: 0.5 ; reduced homing current for x and y +variable_xy_home_current: 0.6 ; reduced homing current for x and y variable_z_home_current: 0.5 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.55 +switch_offset: 0.50 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From 20800d282da123d02e9eed4cdd4617e990614ecc Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 20 Feb 2022 22:15:25 +0100 Subject: [PATCH 090/131] v2.4: neopixel: works with octopus since adding 100 Ohm resistor on signal line --- neopixel.cfg | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/neopixel.cfg b/neopixel.cfg index 0381559..693a230 100644 --- a/neopixel.cfg +++ b/neopixel.cfg @@ -9,22 +9,8 @@ initial_RED: 0.6 initial_GREEN: 0.5 initial_BLUE: 0.4 -[mcu toolhead] -serial: /dev/serial/by-id/usb-Klipper_atmega32u4_neopixel-if00 - -# arduino pro micro with atmega 32u4 -[board_pins toolhead] -mcu: toolhead -aliases: - ar0=PD2, ar1=PD3, ar2=PD1, ar3=PD0, ar4=PD4, - ar5=PC6, ar6=PD7, ar7=PE6, ar8=PB4, ar9=PB5, - ar10=PB6, ar11=PB7, ar12=PD6, ar13=PC7, ar14=PB3, - ar15=PB1, ar16=PB2, - analog0=PF7, analog1=PF6 - [neopixel toolhead] -# pin: PB6 -pin: toolhead:ar2 +pin: PB6 # Octopus BL_Touch chain_count: 3 color_order: GRBW initial_RED: 0.3 @@ -36,3 +22,4 @@ initial_WHITE: 0.2 gcode: SET_LED LED=toolhead INDEX=1 RED=0.0 BLUE=0.5 GREEN=0.0 WHITE=0.0 initial_duration: 3 + From 4d8332de6f97e5083bf0e3f2866ba2ece33f99c7 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 1 Mar 2022 10:45:50 +0100 Subject: [PATCH 091/131] ercf: update macros from upstream, vars --- ercf/software.cfg | 6 +++--- ercf/vars.cfg | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index 2776c89..ed7259c 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -362,7 +362,7 @@ gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 {% if printer["gcode_macro ERCF_HOME"].home == -1 %} M118 ERCF not homed, homing it... - ERCF_HOME + ERCF_HOME TOOL={params.TOOL|int} M117 Change Tool T{params.TOOL|int} ERCF_LOAD_TOOL TOOL={params.TOOL|int} {% elif printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} @@ -754,7 +754,7 @@ gcode: QUERY_ENDSTOPS ERCF_EJECT_UNKNOW_STATE ERCF_HOME_SELECTOR - ERCF_HOME_ONLY + ERCF_HOME_ONLY TOOL={params.TOOL|default(0)|int} [gcode_macro ERCF_HOME_SELECTOR] description: Home the ERCF selector @@ -782,7 +782,7 @@ gcode: gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} M118 Test load filament 1 - ERCF_SELECT_TOOL TOOL=0 + ERCF_SELECT_TOOL TOOL={params.TOOL|default(0)|int} ERCF_SET_STEPS RATIO=1.0 M118 Loading filament to ERCF... ERCF_LOAD LENGTH=45 diff --git a/ercf/vars.cfg b/ercf/vars.cfg index eb170ad..1d0c04b 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -11,5 +11,5 @@ ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 970.985396 +ercf_calib_ref = 979.757328 From e00ae5ca530e05b48d76ef1acffcda5d9ab7f6d1 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 1 Mar 2022 10:46:15 +0100 Subject: [PATCH 092/131] KlipperScreen: update config --- KlipperScreen.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 3435cb8..15e5bcb 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -275,7 +275,7 @@ panel: settings #~# #~# [main] -#~# move_speed = 50 +#~# move_speed_xy = 50 #~# print_sort_dir = date_desc #~# #~# [displayed_macros Printer] From 94e0fd09517695fa2687f7e408f030235b56d4c2 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 1 Mar 2022 10:48:12 +0100 Subject: [PATCH 093/131] gitignore: update --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d71bf9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.bkp From 811ff69e2415578b3282e059156ab987417cd941 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 28 Apr 2022 10:50:43 +0200 Subject: [PATCH 094/131] moonraker: update to latest config --- moonraker.conf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/moonraker.conf b/moonraker.conf index 209671d..22b7b05 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -2,10 +2,6 @@ host: 0.0.0.0 port: 7125 enable_debug_logging: False -config_path: ~/klipper_config -temperature_store_size: 600 -gcode_store_size: 1000 -log_path: ~/klipper_logs [authorization] force_logins: True @@ -25,6 +21,14 @@ trusted_clients: FE80::/10 ::1/128 +[file_manager] +config_path: ~/klipper_config +log_path: ~/klipper_logs + +[data_store] +temperature_store_size: 600 +gcode_store_size: 1000 + # enables partial support of Octoprint API [octoprint_compat] @@ -41,7 +45,8 @@ repo: fluidd-core/fluidd path: ~/fluidd [update_manager client mainsail] -type: web_beta +type: web +channel: beta repo: mainsail-crew/mainsail path: ~/mainsail From 5659912ae9a6f98063a0a34ede5e38d7d17d27ac Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 28 Apr 2022 10:51:06 +0200 Subject: [PATCH 095/131] ercf: update to match latest module --- ercf/hardware.cfg | 27 +- ercf/software.cfg | 631 +++++++++++++++++++++++++--------------------- 2 files changed, 353 insertions(+), 305 deletions(-) diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg index 607ca26..0254ca9 100644 --- a/ercf/hardware.cfg +++ b/ercf/hardware.cfg @@ -24,11 +24,23 @@ endstop_pin: ^ercf:PA7 uart_pin: ercf:PA8 # shared with selector_stepper uart_address: 0 interpolate: True -run_current: 0.8 +run_current: 0.6 hold_current: 0.1 sense_resistor: 0.110 stealthchop_threshold: 500 +[tmc2209 manual_stepper selector_stepper] +uart_pin: ercf:PA8 # shared with gear_stepper +uart_address: 1 +run_current: 0.55 +hold_current: 0.4 +interpolate: True +sense_resistor: 0.110 +stealthchop_threshold: 5000 +# Uncomment the lines below if you want to use sensorless homing for the selector +#diag_pin: ^P1.27 # Set to MCU pin connected to TMC DIAG pin +#driver_SGTHRS: 75 # 255 is most sensitive value, 0 is least sensitive + [manual_stepper selector_stepper] step_pin: ercf:PA9 dir_pin: !ercf:PB8 @@ -41,15 +53,6 @@ homing_speed: 100 accel: 600 endstop_pin: ^ercf:PB9 -[tmc2209 manual_stepper selector_stepper] -uart_pin: ercf:PA8 # shared with gear_stepper -uart_address: 1 -run_current: 0.55 -hold_current: 0.4 -interpolate: True -sense_resistor: 0.110 -stealthchop_threshold: 5000 - # Values are for the MG90S servo [servo ercf_servo] pin: ercf:PA5 @@ -65,9 +68,9 @@ pins: ercf:PA6 [filament_motion_sensor encoder_sensor] switch_pin: ^ercf:PA6 pause_on_runout: False -detection_length: 3.0 +detection_length: 10.0 extruder: extruder -# runout_gcode: ERCF_ENCODER_MOTION_ISSUE +# runout_gcode: _ERCF_ENCODER_MOTION_ISSUE [filament_switch_sensor toolhead_sensor] pause_on_runout: False diff --git a/ercf/software.cfg b/ercf/software.cfg index ed7259c..dab6ec4 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -5,7 +5,7 @@ [ercf] # Encoder encoder_pin: ercf:PA6 # easy brd -# encoder_resolution: 1.365188 # default +# encoder_resolution: 1.365188 # in mm encoder_resolution: 1.349528 # from `ercf_calibrate_encoder` # Speeds and accels # Long moves are faster than the small ones @@ -16,7 +16,8 @@ long_moves_accel: 400 # mm/s². Default value is 400mm/s² short_moves_speed: 25 # mm/s. Default value is 25mm/s. short_moves_accel: 400 # mm/s². Default value is 400mm/s² -[gcode_macro ERCF_VAR] +[gcode_macro _ERCF_VAR] +description: Empty macro to store ERCF variables # ======================================================= # ================== VALUES TO ADJUST =================== # ======================================================= @@ -36,16 +37,15 @@ variable_end_of_bowden_to_sensor: 40 # xk # Galileo Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 60.5 # LGX on AfterBurner with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 55.6 # AfterBurner Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 54.0 -variable_sensor_to_nozzle: 54 +variable_sensor_to_nozzle: 54 # xk # # ==== Values to tune ==== # # Tool position for the selector. This has to be tuned manually. Please scale this array to the number of tools you have -# variable_colorselector = [ 2.4, 23.2, 44.0] # 3 tools -variable_colorselector = [2.4, 23.2, 44.0, 70.5, 91.2, 112.8] # 6 tools +variable_colorselector = [2.4, 23.2, 44.0, 70.5, 91.2, 112.8] # 6 tools # xk # Base value for the loading length used by the auto-calibration macro # Please use a value SMALLER than the real reverse bowden length (like 50mm less) -variable_min_bowden_length: 850 +variable_min_bowden_length: 850 # xk # Servo angle for the Up position (i.e. tool disengaged). Refer to the manual to know how to properly tune this value # Default values: # MG90S servo : 30 @@ -55,13 +55,17 @@ variable_servo_up_angle: 30 # Default values: # MG90S servo : 140 # SAVOX SH0255MG : 30 -variable_servo_down_angle: 130 +variable_servo_down_angle: 130 # xk +# Threshold for the final load check (i.e. the move from the toolhead sensor to the nozzle) +# Check the _ERCF_GET_LOAD_THRESHOLD command to get the proper value for your setup +variable_final_load_check_threshold: 10.0 # Options to use or not # Beware that the clog detection and endless spool mode are in BETA mode for now # Use at your own risk (beware of the involved macros and the pause(s) and resume ones) # Put 0 to disable, 1 to enable variable_clog_detection: 0 variable_endless_spool_mode: 0 +variable_sensorless_selector: 0 # ======================================================= # ============ END OF VALUES TO ADJUST ================== # ======================================================= @@ -69,10 +73,13 @@ variable_endless_spool_mode: 0 # Things that you shouldn't have to change variable_unload_modifier: 9.0 # Modifier to adjust the ERCF park position (where the filament ends when doing an unload) -variable_min_temp_extruder: 210 # Temp used during the auto-calibration macro, to ensure we can move the extruder (but not really extruding) +variable_min_temp_extruder: 210 # xk # Temp used during the auto-calibration macro, to ensure we can move the extruder (but not really extruding) variable_extruder_eject_temp: 240 # Temp used during filament ejection (in the ERCF_HOME macro, if a filament is detected in the toolhead) -variable_timeout_pause: 72000 # Time out used by the ERCF_PAUSE -variable_disable_heater: 600 # Delay after which the hotend heater is disabled in the ERCF_PAUSE state +variable_timeout_pause: 72000 # Time out used by the _ERCF_PAUSE +variable_disable_heater: 600 # Delay after which the hotend heater is disabled in the _ERCF_PAUSE state +variable_gear_stepper_accel: 0 # The acceleration value applied to the gear stepper on moves, standard is to use 0 +variable_extra_servo_dwell_up: 0 # Additional dwell time in ms to apply to dwell prior to turning off the servo +variable_extra_servo_dwell_down: 0 # Additional dwell time in ms to apply to dwell prior to turning off the servo gcode: [save_variables] @@ -81,19 +88,19 @@ filename: /home/pi/klipper_config/ercf/vars.cfg ############################### # ERCF Calibration macros ############################### -[gcode_macro ERCF_CALIB_SELECTOR] +[gcode_macro _ERCF_CALIB_SELECTOR] description: Calibration of the selector position for a defined Tool gcode: - ERCF_SERVO_UP + _ERCF_SERVO_UP {% set move_length=(20.0 + (params.TOOL|int + 1)*21.0 + ((params.TOOL|int + 1)/3)*5.0) %} M118 Measuring the selector position for tool {params.TOOL} ERCF_GET_SELECTOR_POS REF={move_length|int} - ERCF_MOTORS_OFF + _ERCF_MOTORS_OFF -[gcode_macro ERCF_CALIBRATE] +[gcode_macro _ERCF_CALIBRATE] description: Complete calibration of all ERCF Tools gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 @@ -101,86 +108,85 @@ gcode: M118 First home the ERCF ERCF_HOME - {% for chan in range(printer["gcode_macro ERCF_VAR"].colorselector|length) %} - ERCF_CALIBRATE_SINGLE TOOL={chan|int} + {% for chan in range(printer["gcode_macro _ERCF_VAR"].colorselector|length) %} + _ERCF_CALIBRATE_SINGLE TOOL={chan|int} {% endfor %} M118 End of the complete auto calibration! M118 Please reload the firmware for the calibration to be active! -[gcode_macro ERCF_CALIBRATE_SINGLE] +[gcode_macro _ERCF_CALIBRATE_SINGLE] description: Calibration of a single ERCF Tool gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - {% if params.TOOL|int >= 0 and params.TOOL|int < printer["gcode_macro ERCF_VAR"].colorselector|length %} + {% if params.TOOL|int >= 0 and params.TOOL|int < printer["gcode_macro _ERCF_VAR"].colorselector|length %} {% if printer["gcode_macro ERCF_HOME"].home == -1 %} M118 First home the ERCF ERCF_HOME {% endif %} - ERCF_SELECT_TOOL TOOL={params.TOOL} + _ERCF_SELECT_TOOL TOOL={params.TOOL} ERCF_SET_STEPS RATIO=1.0 {% if params.TOOL|int == 0 %} - {% if printer['extruder'].temperature < printer["gcode_macro ERCF_VAR"].min_temp_extruder %} - M109 S{printer["gcode_macro ERCF_VAR"].min_temp_extruder|int} + {% if printer['extruder'].temperature < printer["gcode_macro _ERCF_VAR"].min_temp_extruder %} + M109 S{printer["gcode_macro _ERCF_VAR"].min_temp_extruder|int} {% endif %} M118 Calibrating reference tool {params.TOOL} - ERCF_LOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length} + ERCF_LOAD LENGTH={printer["gcode_macro _ERCF_VAR"].min_bowden_length} ERCF_HOME_EXTRUDER TOTAL_LENGTH=400 STEP_LENGTH=0.5 - ERCF_CALIB_SAVE_VAR TOOL={params.TOOL} + _ERCF_CALIB_SAVE_VAR TOOL={params.TOOL} G91 G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 - G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 - - ERCF_CALIB_UNLOAD + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0 + G1 E-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + _ERCF_CALIB_UNLOAD ERCF_BUZZ_GEAR_MOTOR - ERCF_IS_FILAMENT_STUCK_IN_ERCF + _ERCF_IS_FILAMENT_STUCK_IN_ERCF - ERCF_UNSELECT_TOOL + _ERCF_UNSELECT_TOOL {% else %} M118 Calibrating tool {params.TOOL} - ERCF_LOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0} - ERCF_CALIB_SAVE_VAR tool={params.TOOL} + ERCF_LOAD LENGTH={printer["gcode_macro _ERCF_VAR"].min_bowden_length|float - 100.0} + _ERCF_CALIB_SAVE_VAR tool={params.TOOL} - ERCF_CALIB_UNLOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0 + 27.0} + _ERCF_CALIB_UNLOAD LENGTH={printer["gcode_macro _ERCF_VAR"].min_bowden_length|float - 100.0 + 27.0} {% endif %} {% else %} M118 Tool out of range {% endif %} -[gcode_macro ERCF_CALIB_SAVE_VAR] +[gcode_macro _ERCF_CALIB_SAVE_VAR] description: Saving ERCF calibration values gcode: {% if params.TOOL|int == 0 %} M118 Tool {params.TOOL} calibration value is {printer['ercf'].encoder_pos|float} SAVE_VARIABLE VARIABLE=ercf_calib_ref VALUE={printer['ercf'].encoder_pos|float} # this is the reference value SAVE_VARIABLE VARIABLE=ercf_calib_{params.TOOL|int} VALUE=1.0 - SET_GCODE_VARIABLE MACRO=ERCF_CALIB_UNLOAD VARIABLE=ref VALUE={printer['ercf'].encoder_pos|float} - SET_GCODE_VARIABLE MACRO=ERCF_CALIB_UNLOAD VARIABLE=ratio VALUE=1.0 + SET_GCODE_VARIABLE MACRO=_ERCF_CALIB_UNLOAD VARIABLE=ref VALUE={printer['ercf'].encoder_pos|float} + SET_GCODE_VARIABLE MACRO=_ERCF_CALIB_UNLOAD VARIABLE=ratio VALUE=1.0 {% else %} - {% set ratio = (printer["gcode_macro ERCF_VAR"].min_bowden_length|float - 100.0) / printer['ercf'].encoder_pos|float %} + {% set ratio = (printer["gcode_macro _ERCF_VAR"].min_bowden_length|float - 100.0) / printer['ercf'].encoder_pos|float %} M118 Tool {params.TOOL} ratio is {ratio|float} SAVE_VARIABLE VARIABLE=ercf_calib_{params.TOOL|int} VALUE={ratio|float} - SET_GCODE_VARIABLE MACRO=ERCF_CALIB_UNLOAD VARIABLE=ratio VALUE={ratio|float} + SET_GCODE_VARIABLE MACRO=_ERCF_CALIB_UNLOAD VARIABLE=ratio VALUE={ratio|float} {% endif %} -[gcode_macro ERCF_CALIB_UNLOAD] +[gcode_macro _ERCF_CALIB_UNLOAD] description: Filament unload during ERCF calibration variable_ratio: 0.0 variable_ref: 0.0 gcode: {% set unload_length = params.LENGTH|default(0.0)|float %} {% if unload_length|float == 0.0 %} - ERCF_UNLOAD LENGTH={(ref|float)*(ratio|float) - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + 27.0} + ERCF_UNLOAD LENGTH={(ref|float)*(ratio|float) - printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float + 27.0} {% else %} {% if ratio|float < 1.0 %} # No correction move is done in case of "over targeting", hence the correction ratio is not applied during this unload sequence ERCF_UNLOAD LENGTH={(unload_length|float)} @@ -189,6 +195,11 @@ gcode: {% endif %} {% endif %} +[gcode_macro _ERCF_GET_LOAD_THRESHOLD] +description: Measure the encoder threshold for the last part of the load +gcode: + _ERCF_CHANGE_TOOL_STANDALONE TOOL=0 TUNE=1 + [respond] default_type: command @@ -196,32 +207,32 @@ default_type: command # ERCF servo ############################### # Push the top hat down (enable the bondtech gears) while "buzzing" the gear motor to ensure proper BMG gear meshing -[gcode_macro ERCF_SERVO_DOWN] +[gcode_macro _ERCF_SERVO_DOWN] description: Engage the ERCF gear gcode: MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.5 SPEED=25 ACCEL=0 SYNC=0 - SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro ERCF_VAR"].servo_down_angle} + MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.5 SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0 + SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro _ERCF_VAR"].servo_down_angle} G4 P200 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL=0 SYNC=0 - G4 P105 # was P100 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=-0.5 SPEED=25 ACCEL=0 SYNC=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0 G4 P100 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-0.5 SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0 + G4 P{100 + printer["gcode_macro _ERCF_VAR"].extra_servo_dwell_down|int} + MANUAL_STEPPER STEPPER=gear_stepper MOVE=0.0 SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SET_SERVO SERVO=ercf_servo WIDTH=0.0 # Pull the top hat up (disengage the bondtech gears) -[gcode_macro ERCF_SERVO_UP] +[gcode_macro _ERCF_SERVO_UP] description: Disengage the ERCF gear gcode: - SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro ERCF_VAR"].servo_up_angle} - G4 P250 + SET_SERVO SERVO=ercf_servo ANGLE={printer["gcode_macro _ERCF_VAR"].servo_up_angle} + G4 P{250 + printer["gcode_macro _ERCF_VAR"].extra_servo_dwell_up|int} SET_SERVO SERVO=ercf_servo WIDTH=0.0 ############################### # ERCF motors ############################### -[gcode_macro ERCF_MOTORS_OFF] +[gcode_macro _ERCF_MOTORS_OFF] description: Turn off both ERCF motors gcode: MANUAL_STEPPER STEPPER=gear_stepper ENABLE=0 @@ -229,7 +240,7 @@ gcode: ############################### # PAUSE MACROS -# ERCF_PAUSE is called when an human intervention is needed +# _ERCF_PAUSE is called when an human intervention is needed # use ERCF_UNLOCK to start the manual intervention # and use RESUME when the intervention is over to resume the current print ############################### @@ -239,20 +250,20 @@ gcode: description: Unlock ERCF operations gcode: M118 Unlock the ERCF - SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=0 + SET_GCODE_VARIABLE MACRO=_ERCF_PAUSE VARIABLE=is_paused VALUE=0 UPDATE_DELAYED_GCODE ID=disable_heater DURATION=0 {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == False %} - ERCF_UNSELECT_TOOL + _ERCF_UNSELECT_TOOL {% else %} - ERCF_UNSELECT_TOOL FORCED=0 + _ERCF_UNSELECT_TOOL FORCED=0 {% endif %} - M104 S{printer["gcode_macro ERCF_PAUSE"].extruder_temp} + M104 S{printer["gcode_macro _ERCF_PAUSE"].extruder_temp} RESTORE_GCODE_STATE NAME=ERCF_state M118 Refer to the manual before resuming the print [delayed_gcode disable_heater] gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int != 0 %} M118 Disable extruder heater M104 S0 {% endif %} @@ -260,123 +271,123 @@ gcode: # Pause the ERCF, park the extruder at the parking position # Save the current state and start the delayed stop of the heated # modify the timeout of the printer accordingly to timeout_pause -[gcode_macro ERCF_PAUSE] +[gcode_macro _ERCF_PAUSE] description: Pause the current print and lock the ERCF operations variable_is_paused: 0 variable_extruder_temp: 0 gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=extruder_temp VALUE={printer.extruder.target} - SET_GCODE_VARIABLE MACRO=ERCF_PAUSE VARIABLE=is_paused VALUE=1 - SET_IDLE_TIMEOUT TIMEOUT={printer["gcode_macro ERCF_VAR"].timeout_pause} - UPDATE_DELAYED_GCODE ID=disable_heater DURATION={printer["gcode_macro ERCF_VAR"].disable_heater} - M118 An issue with the ERCF has been detected and the ERCF has been PAUSED - M118 When you intervene to fix the issue, first call the "ERCF_UNLOCK" Gcode - M118 Refer to the manual before resuming the print - SAVE_GCODE_STATE NAME=ERCF_state - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - PAUSE - {% else %} - M118 already paused - {% endif %} + SET_GCODE_VARIABLE MACRO=_ERCF_PAUSE VARIABLE=extruder_temp VALUE={printer.extruder.target} + SET_GCODE_VARIABLE MACRO=_ERCF_PAUSE VARIABLE=is_paused VALUE=1 + SET_IDLE_TIMEOUT TIMEOUT={printer["gcode_macro _ERCF_VAR"].timeout_pause} + UPDATE_DELAYED_GCODE ID=disable_heater DURATION={printer["gcode_macro _ERCF_VAR"].disable_heater} + M118 An issue with the ERCF has been detected and the ERCF has been PAUSED + M118 When you intervene to fix the issue, first call the "ERCF_UNLOCK" Gcode + M118 Refer to the manual before resuming the print + SAVE_GCODE_STATE NAME=ERCF_state + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + PAUSE ############################################ # Changing tool macros -# ERCF_CHANGE_TOOL_STANDALONE TOOL=XX to change filament outside of a print -# ERCF_CHANGE_TOOL_SLICER TOOL=XX will be called automatically (from the ACTIVATE_EXTRUDER gcode from SuperSlicer), don't use that for "manual" filament swap +# _ERCF_CHANGE_TOOL_STANDALONE TOOL=XX to change filament outside of a print +# _ERCF_CHANGE_TOOL_SLICER TOOL=XX will be called automatically (from the ACTIVATE_EXTRUDER gcode from SuperSlicer), don't use that for "manual" filament swap # if the new extruder is different from the current extruder : # eject the filament if needed # load the new one ########################################### [gcode_macro T0] gcode: - ERCF_CHANGE_TOOL TOOL=0 + _ERCF_CHANGE_TOOL TOOL=0 [gcode_macro T1] gcode: - ERCF_CHANGE_TOOL TOOL=1 + _ERCF_CHANGE_TOOL TOOL=1 [gcode_macro T2] gcode: - ERCF_CHANGE_TOOL TOOL=2 + _ERCF_CHANGE_TOOL TOOL=2 [gcode_macro T3] gcode: - ERCF_CHANGE_TOOL TOOL=3 + _ERCF_CHANGE_TOOL TOOL=3 [gcode_macro T4] gcode: - ERCF_CHANGE_TOOL TOOL=4 + _ERCF_CHANGE_TOOL TOOL=4 [gcode_macro T5] gcode: - ERCF_CHANGE_TOOL TOOL=5 + _ERCF_CHANGE_TOOL TOOL=5 [gcode_macro T6] gcode: - ERCF_CHANGE_TOOL TOOL=6 + _ERCF_CHANGE_TOOL TOOL=6 [gcode_macro T7] gcode: - ERCF_CHANGE_TOOL TOOL=7 + _ERCF_CHANGE_TOOL TOOL=7 [gcode_macro T8] gcode: - ERCF_CHANGE_TOOL TOOL=8 + _ERCF_CHANGE_TOOL TOOL=8 -[gcode_macro ERCF_CHANGE_TOOL] +[gcode_macro _ERCF_CHANGE_TOOL] description: Perform a tool swap gcode: + {% set initial_tool_string = 'unknown tool' %} + {% if printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int != -1 %} + {% set initial_tool_string = 'T' + printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|string %} + {% endif %} + M118 Tool swap request, from {initial_tool_string} to T{params.TOOL|int} + M117 {initial_tool_string} -> T{params.TOOL|int} {% if printer.idle_timeout.state == "Printing" %} - ERCF_CHANGE_TOOL_SLICER TOOL={params.TOOL|int} + _ERCF_CHANGE_TOOL_SLICER TOOL={params.TOOL|int} {% else %} - ERCF_CHANGE_TOOL_STANDALONE TOOL={params.TOOL|int} + _ERCF_CHANGE_TOOL_STANDALONE TOOL={params.TOOL|int} {% endif %} -[gcode_macro ERCF_CHANGE_TOOL_SLICER] +[gcode_macro _ERCF_CHANGE_TOOL_SLICER] description: Perform a tool swap during a print gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} + {% if printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} # Add a variable 'SwapCounter' in your PRINT_START macro to display this info # {% set newcounter = (printer["gcode_macro PRINT_START"].swapcounter|int + 1) %} # SET_GCODE_VARIABLE MACRO=PRINT_START VARIABLE=swapcounter VALUE={newcounter} # M118 Swap {newcounter|int} - M117 Change Tool T{params.TOOL|int} - ERCF_UNLOAD_TOOL - ERCF_LOAD_TOOL TOOL={params.TOOL|int} - ERCF_CHANGE_TOOL_SLICER_END + _ERCF_UNLOAD_TOOL + _ERCF_LOAD_TOOL TOOL={params.TOOL|int} + _ERCF_CHANGE_TOOL_SLICER_END {% endif %} -[gcode_macro ERCF_CHANGE_TOOL_SLICER_END] +[gcode_macro _ERCF_CHANGE_TOOL_SLICER_END] gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 - {% endif %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro _ERCF_VAR"].clog_detection|int == 1 %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 {% endif %} + {% endif %} -[gcode_macro ERCF_CHANGE_TOOL_STANDALONE] +[gcode_macro _ERCF_CHANGE_TOOL_STANDALONE] description: Perform a tool swap out of a print gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 + {% set tune = params.TUNE|default(0)|int %} {% if printer["gcode_macro ERCF_HOME"].home == -1 %} M118 ERCF not homed, homing it... - ERCF_HOME TOOL={params.TOOL|int} - M117 Change Tool T{params.TOOL|int} - ERCF_LOAD_TOOL TOOL={params.TOOL|int} - {% elif printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} - M117 Change Tool T{params.TOOL|int} + ERCF_HOME + _ERCF_LOAD_TOOL TOOL={params.TOOL|int} TUNE={tune} + {% elif printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int != params.TOOL|int %} {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} M118 Unloading current filament {% if printer['extruder'].temperature < 178 %} M118 Preheat Nozzle - M109 S{printer["gcode_macro ERCF_VAR"].extruder_eject_temp} + M109 S{printer["gcode_macro _ERCF_VAR"].extruder_eject_temp} {% endif %} ERCF_EJECT {% endif %} - ERCF_LOAD_TOOL TOOL={params.TOOL|int} + _ERCF_LOAD_TOOL TOOL={params.TOOL|int} TUNE={tune} {% endif %} ############################################ @@ -384,132 +395,160 @@ gcode: ############################################ # Load filament from ERCF to nozzle -[gcode_macro ERCF_LOAD_TOOL] +[gcode_macro _ERCF_LOAD_TOOL] description: Load the filament from the ERCF to the toolhead gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_HOME"].home == -1 %} M118 ERCF not homed, homing it... ERCF_HOME {% endif %} + {% set tune = params.TUNE|default(0)|int %} M118 Loading tool {params.TOOL|int} ... - ERCF_SELECT_TOOL TOOL={params.TOOL|int} + _ERCF_SELECT_TOOL TOOL={params.TOOL|int} {% set ercf_params = printer.save_variables.variables %} ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (params.TOOL|string)]} M118 Loading filament from ERCF to extruder ... {% set ercf_params = printer.save_variables.variables %} - ERCF_LOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} - ERCF_LOAD_FILAMENT_IN_EXTRUDER + ERCF_LOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float} + _ERCF_LOAD_FILAMENT_IN_EXTRUDER TUNE={tune} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} # Unload filament from nozzle to ERCF, using built-in tip forming macro [gcode_macro ERCF_EJECT] description: Eject the filament out of a print and park it into the ERCF gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != -1 %} - M118 Unloading tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int != -1 %} + M118 Unloading tool {printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int} ... {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} - ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING + _ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING {% set ercf_params = printer.save_variables.variables %} - ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|string)]} - ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} - ERCF_UNSELECT_TOOL + ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|string)]} + ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float + printer["gcode_macro _ERCF_VAR"].unload_modifier|float - 60.0} + _ERCF_UNSELECT_TOOL {% else %} - ERCF_EJECT_UNKNOW_STATE + _ERCF_EJECT_UNKNOW_STATE {% endif %} {% else %} - ERCF_EJECT_UNKNOW_STATE + _ERCF_EJECT_UNKNOW_STATE {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} # Unload filament from nozzle to ERCF, using SuperSlicer ramming -[gcode_macro ERCF_UNLOAD_TOOL] +[gcode_macro _ERCF_UNLOAD_TOOL] description: Eject the filament during a print and park it into the ERCF gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int != -1 %} - M118 Unload tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} ... - ERCF_HOME_EXTRUDER - ERCF_SELECT_TOOL TOOL={printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int != -1 %} + M118 Unload tool {printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int} ... + G1 E-10.00 F1200.0 + G1 E-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float + 20.0} F2000 + _ERCF_SELECT_TOOL TOOL={printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int} {% set ercf_params = printer.save_variables.variables %} - ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|string)]} - G91 - G92 E0 - MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 - G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|string)]} + G4 P100 + _ERCF_EXTRACT_FROM_EXTRUDER {% set ercf_params = printer.save_variables.variables %} - ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} - ERCF_UNSELECT_TOOL + ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float + printer["gcode_macro _ERCF_VAR"].unload_modifier|float - 60.0} + _ERCF_UNSELECT_TOOL {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} +# Unload filament from nozzle to ERCF, using SuperSlicer ramming +[gcode_macro _ERCF_EXTRACT_FROM_EXTRUDER] +description: Extract the tip at the parking position from the extruder +gcode: + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} + M118 Filament still below the extruder... Trying extraction again... + G1 E-5.00 F1200.0 + G1 E-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float + 25.0} F2000 + G4 P100 + _ERCF_RETRY_EXTRACT_FROM_EXTRUDER + {% else %} + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-20 SPEED=25 ACCEL=0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-10 SPEED=25 ACCEL=0 SYNC=0 + G1 E10 F2000.0 + {% endif %} + +# Unload filament from nozzle to ERCF, using SuperSlicer ramming +[gcode_macro _ERCF_RETRY_EXTRACT_FROM_EXTRUDER] +description: Check if extraction retry went properly or not +gcode: + {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} + M118 Filament is stuck below the extruder... + M118 Calling ERCF_PAUSE + _ERCF_PAUSE + {% else %} + G91 + G92 E0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-20 SPEED=25 ACCEL=0 + MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-10 SPEED=25 ACCEL=0 SYNC=0 + G1 E10 F2000.0 + {% endif %} + + ############################################ # Select/Unselect a tool # move the selector (if needed) to the requested tool ############################################ -[gcode_macro S0] -gcode: - ERCF_SELECT_TOOL TOOL=0 - -[gcode_macro S1] -gcode: - ERCF_SELECT_TOOL TOOL=1 - -[gcode_macro S2] -gcode: - ERCF_SELECT_TOOL TOOL=2 - -[gcode_macro S3] -gcode: - ERCF_SELECT_TOOL TOOL=3 - -[gcode_macro S4] -gcode: - ERCF_SELECT_TOOL TOOL=4 - -[gcode_macro S5] -gcode: - ERCF_SELECT_TOOL TOOL=5 - - # Select a tool. move the idler and then move the color selector (if needed) -[gcode_macro ERCF_SELECT_TOOL] +[gcode_macro _ERCF_SELECT_TOOL] description: Move the selector to the Tool and select it variable_tool_selected: -1 variable_color_selected: -1 gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_HOME"].home != -1 %} M118 Select Tool {params.TOOL} ... - ERCF_SERVO_UP - MANUAL_STEPPER STEPPER=selector_stepper MOVE={printer["gcode_macro ERCF_VAR"].colorselector[params.TOOL|int]} - SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE={params.TOOL} - SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE={params.TOOL} - ERCF_SERVO_DOWN + _ERCF_SERVO_UP + {% if printer["gcode_macro _ERCF_VAR"].sensorless_selector|int == 1 %} + ERCF_MOVE_SELECTOR TARGET={printer["gcode_macro _ERCF_VAR"].colorselector[params.TOOL|int]} + {% else %} + MANUAL_STEPPER STEPPER=selector_stepper MOVE={printer["gcode_macro _ERCF_VAR"].colorselector[params.TOOL|int]} + {% endif %} + SET_GCODE_VARIABLE MACRO=_ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE={params.TOOL} + SET_GCODE_VARIABLE MACRO=_ERCF_SELECT_TOOL VARIABLE=color_selected VALUE={params.TOOL} + _ERCF_SERVO_DOWN M118 Tool {params.TOOL} Enabled {% else %} M118 Could not select tool, ERCF is not homed {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} # Unselect a tool -[gcode_macro ERCF_UNSELECT_TOOL] +[gcode_macro _ERCF_UNSELECT_TOOL] description: Unselect current Tool gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% set unselect_color = params.FORCED|default(1)|int %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} {% if printer["gcode_macro ERCF_HOME"].home != -1 %} - ERCF_SERVO_UP - SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE=-1 - {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == False %} - SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE=-1 + _ERCF_SERVO_UP + SET_GCODE_VARIABLE MACRO=_ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE=-1 + {% if unselect_color == 1 %} + SET_GCODE_VARIABLE MACRO=_ERCF_SELECT_TOOL VARIABLE=color_selected VALUE=-1 {% endif %} ERCF_SET_STEPS RATIO=1.0 {% else %} M118 Could not unselect tool, ERCF is not homed {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} ############################################ @@ -517,33 +556,35 @@ gcode: ############################################ # Load the filament into the extruder -# Call ERCF_PAUSE if the filament is not detected by the toolhead sensor -[gcode_macro ERCF_LOAD_FILAMENT_IN_EXTRUDER] +# Call _ERCF_PAUSE if the filament is not detected by the toolhead sensor +[gcode_macro _ERCF_LOAD_FILAMENT_IN_EXTRUDER] description: Load filament from the toolhead entrance to the nozzle gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} + {% set tune = params.TUNE|default(0)|int %} + {% if printer.extruder.temperature > printer["gcode_macro _ERCF_VAR"].min_temp_extruder %} + M118 Loading Filament... G91 G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE={printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} SPEED=25 ACCEL=0 SYNC=0 - G1 E{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float - 7} F1500.0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE={printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float - 7} SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0 + G1 E{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float - 7} F1500.0 G4 P100 ERCF_HOME_EXTRUDER TOTAL_LENGTH=30.0 STEP_LENGTH=0.5 - ERCF_UNSELECT_TOOL - G1 E15 F1800 - G1 E{printer["gcode_macro ERCF_VAR"].sensor_to_nozzle - 20} F1800 - G1 E5 F600 + _ERCF_UNSELECT_TOOL FORCED=0 + ERCF_FINALIZE_LOAD LENGTH={printer["gcode_macro _ERCF_VAR"].sensor_to_nozzle|float} TUNE={tune} G92 E0 G90 {% else %} M118 Extruder too cold - ERCF_PAUSE + _ERCF_PAUSE {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} # StandAlone cooling moves to extract proper filament tip -[gcode_macro ERCF_FORM_TIP_STANDALONE] +[gcode_macro _ERCF_FORM_TIP_STANDALONE] description: Generic tip forming macro gcode: {% set COOLING_TUBE_LENGTH = params.COOLING_TUBE_LENGTH|default(15) %} # Dragon ST: 15, Dragon HF: 10, Mosquito: 20 @@ -552,7 +593,7 @@ gcode: {% set FINAL_COOLING_SPEED = params.FINAL_COOLING_SPEED|default(50) %} {% set COOLING_MOVES = params.COOLING_MOVES|default(5) %} {% set TOOLCHANGE_TEMP = params.TOOLCHANGE_TEMP|default(0) %} - {% set USE_SKINNYDIP = params.USE_SKINNYDIP|default(1) %} + {% set USE_SKINNYDIP = params.USE_SKINNYDIP|default(0) %} {% set USE_FAST_SKINNYDIP = params.USE_FAST_SKINNYDIP|default(1) %} {% set SKINNYDIP_DISTANCE = params.SKINNYDIP_DISTANCE|default(26) %} {% set DIP_INSERTION_SPEED = params.DIP_INSERTION_SPEED|default(33) %} @@ -643,55 +684,43 @@ gcode: G92 E0 # Unload from extruder with tip forming sequence -[gcode_macro ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING] +[gcode_macro _ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING] description: Unload filament from the nozzle to the toolhead entrance using generic tip forming macro gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - {% if printer.extruder.temperature > printer["gcode_macro ERCF_VAR"].min_temp_extruder %} - {% if printer["gcode_macro ERCF_SELECT_TOOL"].tool_selected|int == -1 %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer.extruder.temperature > printer["gcode_macro _ERCF_VAR"].min_temp_extruder %} + {% if printer["gcode_macro _ERCF_SELECT_TOOL"].tool_selected|int == -1 %} M118 Forming filament tip and Unloading Filament... G91 - ERCF_FORM_TIP_STANDALONE - G1 E-4.00 F1200.0 - G1 E-15.00 F2000 - ERCF_HOME_EXTRUDER - ERCF_SERVO_DOWN - G91 - G92 E0 - MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 - G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + _ERCF_FORM_TIP_STANDALONE + G1 E-10.00 F1200.0 + G1 E-{printer["gcode_macro _ERCF_VAR"].sensor_to_nozzle|float - 10.00} F2000 + G1 E-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float + 20.00} F2000 + _ERCF_SERVO_DOWN + G4 P100 + _ERCF_EXTRACT_FROM_EXTRUDER M118 Filament removed {% else %} M118 Tool selected, UNSELECT it - ERCF_PAUSE + _ERCF_PAUSE {% endif %} {% else %} M118 Extruder too cold - ERCF_PAUSE + _ERCF_PAUSE {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} ############################################ # Endstop check macros ############################################ - -# Call ERCF_PAUSE if the filament is not detected by the toolhead sensor -[gcode_macro ERCF_IS_FILAMENT_IN_EXTRUDER] -gcode: - {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} - M118 Filament is in extruder - {% else %} - M118 Filament not in extruder - ERCF_PAUSE - {% endif %} - -# Call ERCF_PAUSE if the filament is stuck in the ERCF -[gcode_macro ERCF_IS_FILAMENT_STUCK_IN_ERCF] +# Call _ERCF_PAUSE if the filament is stuck in the ERCF +[gcode_macro _ERCF_IS_FILAMENT_STUCK_IN_ERCF] gcode: {% if printer.ercf.encoder_pos|float != 0 %} M118 Filament stuck in ERCF - ERCF_PAUSE + _ERCF_PAUSE {% else %} M118 Filament not in ERCF {% endif %} @@ -701,37 +730,35 @@ gcode: ############################################ # Eject from extruder gear to the ERCF -[gcode_macro ERCF_EJECT_UNKNOW_STATE] +[gcode_macro _ERCF_EJECT_UNKNOW_STATE] description: Unload filament from an unknown position gcode: M118 Eject Filament if loaded ... {% if printer['filament_switch_sensor toolhead_sensor'].filament_detected == True %} M118 Filament in extruder, trying to eject it .. - {% set extruder_eject_temp = printer["gcode_macro ERCF_VAR"].extruder_eject_temp %} - {% if printer['extruder'].temperature < extruder_eject_temp %} - M118 Preheat Nozzle to {extruder_eject_temp} - M109 S{extruder_eject_temp} + {% if printer['extruder'].temperature < 178 %} + M118 Preheat Nozzle + M109 S{printer["gcode_macro _ERCF_VAR"].extruder_eject_temp} {% endif %} - ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING - ERCF_UNLOAD LENGTH={printer["gcode_macro ERCF_VAR"].min_bowden_length - 50} UNKNOWN=1 + _ERCF_UNLOAD_FILAMENT_IN_EXTRUDER_WITH_TIP_FORMING + ERCF_UNLOAD LENGTH={printer["gcode_macro _ERCF_VAR"].min_bowden_length - 50} UNKNOWN=1 {% else %} - ERCF_SERVO_DOWN + _ERCF_SERVO_DOWN + ERCF_BUZZ_GEAR_MOTOR + _ERCF_EJECT_FROM_BOWDEN {% endif %} - ERCF_BUZZ_GEAR_MOTOR - G4 P200 - ERCF_EJECT_FROM_BOWDEN # Eject from the bowden to the ERCF -[gcode_macro ERCF_EJECT_FROM_BOWDEN] +[gcode_macro _ERCF_EJECT_FROM_BOWDEN] description: Unload filament from the reverse bowden gcode: {% if printer.ercf.encoder_pos|float != 0 %} ERCF_UNLOAD HOMING=1 - M118 Filament ejected! + M118 Filament ejected ! {% else %} - M118 Filament already ejected! + M118 Filament already ejected ! {% endif %} - ERCF_SERVO_UP + _ERCF_SERVO_UP ############################################ # Homing macros @@ -739,58 +766,71 @@ gcode: ############################################ # Home the ERCF -# eject filament if loaded with ERCF_EJECT_UNKNOW_STATE -# next home the ERCF with ERCF_HOME_ONLY +# eject filament if loaded with _ERCF_EJECT_UNKNOW_STATE +# next home the ERCF with _ERCF_HOME_ONLY [gcode_macro ERCF_HOME] description: Home the ERCF variable_home: -1 gcode: SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 SET_GCODE_VARIABLE MACRO=ERCF_HOME VARIABLE=home VALUE=1 - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 1 %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 1 %} ERCF_UNLOCK {% endif %} M118 Homing ERCF ... QUERY_ENDSTOPS - ERCF_EJECT_UNKNOW_STATE - ERCF_HOME_SELECTOR - ERCF_HOME_ONLY TOOL={params.TOOL|default(0)|int} + _ERCF_EJECT_UNKNOW_STATE + _ERCF_HOME_SELECTOR + _ERCF_HOME_ONLY TOOL={params.TOOL|default(0)|int} -[gcode_macro ERCF_HOME_SELECTOR] +[gcode_macro _ERCF_HOME_SELECTOR] description: Home the ERCF selector gcode: M118 Homing selector - ERCF_SERVO_UP + _ERCF_UNSELECT_TOOL - {% set number_of_chan=printer["gcode_macro ERCF_VAR"].colorselector|length %} + {% set number_of_chan=printer["gcode_macro _ERCF_VAR"].colorselector|length %} {% set selector_length=(20.0 + number_of_chan*21.0 + (number_of_chan/3)*5.0) %} - MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=selector_stepper SPEED=100 MOVE=-{selector_length|float} STOP_ON_ENDSTOP=1 - MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=selector_stepper SPEED=100 MOVE=5.0 - MANUAL_STEPPER STEPPER=selector_stepper SPEED=10 MOVE=-10.0 STOP_ON_ENDSTOP=1 - MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 - SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=tool_selected VALUE=-1 - SET_GCODE_VARIABLE MACRO=ERCF_SELECT_TOOL VARIABLE=color_selected VALUE=-1 + {% if printer["gcode_macro _ERCF_VAR"].sensorless_selector|int == 1 %} + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=60 MOVE=-{selector_length|float} STOP_ON_ENDSTOP=1 + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + {% else %} + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=100 MOVE=-{selector_length|float} STOP_ON_ENDSTOP=1 + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=100 MOVE=5.0 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=10 MOVE=-10.0 STOP_ON_ENDSTOP=1 + MANUAL_STEPPER STEPPER=selector_stepper SET_POSITION=0 + {% endif %} + QUERY_ENDSTOPS + M400 + MANUAL_STEPPER STEPPER=selector_stepper SPEED=50 MOVE=3.0 + M400 -# Home the ERCF: -# 1) home the color selector (if needed) -# 2) try to load filament 0 to ERCF and then unload it. Used to verify the ERCF gear -# if all is ok, the ERCF is ready to be used -[gcode_macro ERCF_HOME_ONLY] +# Home the ERCF (home the color selector if needed) +# if everything is ok, the ERCF is ready to be used +[gcode_macro _ERCF_HOME_ONLY] gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} - M118 Test load filament 1 - ERCF_SELECT_TOOL TOOL={params.TOOL|default(0)|int} - ERCF_SET_STEPS RATIO=1.0 - M118 Loading filament to ERCF... - ERCF_LOAD LENGTH=45 - G4 P50 - ERCF_UNLOAD LENGTH=68 - ERCF_UNSELECT_TOOL - SET_GCODE_VARIABLE MACRO=ERCF_HOME VARIABLE=home VALUE=1 - M118 Homing ERCF ended ... + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} + {% set selector_homed = 0 %} + {% if printer["gcode_macro _ERCF_VAR"].sensorless_selector|int == 1 %} + {% if printer.query_endstops.last_query["manual_stepper gear_stepper"] == 1 %} + {% set selector_homed = 1 %} + {% endif %} + {% else %} + {% if printer.query_endstops.last_query["manual_stepper selector_stepper"] == 1 %} + {% set selector_homed = 1 %} + {% endif %} + {% endif %} + {% if selector_homed != 1 %} + M118 Homing ERCF selector failed, check what is blocking the selector + M118 Pausing the ERCF, run "ERCF_UNLOCK" to unlock it ... + _ERCF_PAUSE + {% else %} + M118 Homing ERCF ended ... + {% endif %} {% else %} M118 Homing ERCF failed, ERCF is paused, run "ERCF_UNLOCK" to unlock it ... {% endif %} @@ -798,12 +838,12 @@ gcode: ############################################### # Test Macros ############################################### -[gcode_macro ERCF_DISPLAY_ENCODER_POS] +[gcode_macro _ERCF_DISPLAY_ENCODER_POS] description: Display current value of the ERCF encoder gcode: M118 Encoder value is {printer['ercf'].encoder_pos|float} -[gcode_macro ERCF_TEST_MOVE_GEAR] +[gcode_macro _ERCF_TEST_MOVE_GEAR] description: Move the ERCF gear gcode: {% set move_length = params.LENGTH|default(200.0)|float %} @@ -812,36 +852,36 @@ gcode: MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 MANUAL_STEPPER STEPPER=gear_stepper MOVE={move_length|float} SPEED={move_speed|float} ACCEL={move_accel|float} -[gcode_macro ERCF_TEST_SERVO] +[gcode_macro _ERCF_TEST_SERVO] description: Test the servo angle gcode: SET_SERVO SERVO=ercf_servo ANGLE={params.VALUE|float} - G4 P250 + G4 P{250 + printer["gcode_macro _ERCF_VAR"].extra_servo_dwell_up|int} SET_SERVO SERVO=ercf_servo WIDTH=0.0 -[gcode_macro ERCF_TEST_GRIP] +[gcode_macro _ERCF_TEST_GRIP] description: Test the ERCF grip for a Tool gcode: - ERCF_SERVO_DOWN - ERCF_MOTORS_OFF + _ERCF_SERVO_DOWN + _ERCF_MOTORS_OFF -[gcode_macro ERCF_TEST_LOAD_SEQUENCE] +[gcode_macro _ERCF_TEST_LOAD_SEQUENCE] description: Test sequence gcode: {% set loop_number = params.LOOP|default(10)|int %} {% set use_rand = params.RAND|default(0)|int %} {% for iteration in range(loop_number|int) %} - {% for load in range((printer["gcode_macro ERCF_VAR"].colorselector|length)|int) %} + {% for load in range((printer["gcode_macro _ERCF_VAR"].colorselector|length)|int) %} {% if use_rand|int == 1 %} - ERCF_SELECT_TOOL TOOL={range(0, printer["gcode_macro ERCF_VAR"].colorselector|length)|random} + _ERCF_SELECT_TOOL TOOL={range(0, printer["gcode_macro _ERCF_VAR"].colorselector|length)|random} {% else %} - ERCF_SELECT_TOOL TOOL={load|int} + _ERCF_SELECT_TOOL TOOL={load|int} {% endif %} ERCF_LOAD LENGTH=100 G4 P50 ERCF_UNLOAD LENGTH=100 - ERCF_UNSELECT_TOOL + _ERCF_UNSELECT_TOOL G4 P200 {% endfor %} {% endfor %} @@ -850,31 +890,33 @@ gcode: # Endless spool mode and clog detection ############################################### -[gcode_macro ERCF_ENCODER_MOTION_ISSUE] +[gcode_macro _ERCF_ENCODER_MOTION_ISSUE] description: Perform a test when the encoder sense an issue (clog or runout) gcode: - M118 Issue on tool {printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int} + M118 Issue on tool {printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int} M118 Checking if this is a clog or a runout... SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 - ERCF_SERVO_DOWN + _ERCF_SERVO_DOWN ERCF_BUZZ_GEAR_MOTOR - ERCF_SERVO_UP - ERCF_CLOG_OR_RUNOUT + _ERCF_SERVO_UP + _ERCF_CLOG_OR_RUNOUT -[gcode_macro ERCF_CLOG_OR_RUNOUT] +[gcode_macro _ERCF_CLOG_OR_RUNOUT] description: Actions taken if a clog or a runout is detected by the ERCF encoder gcode: {% if printer.ercf.encoder_pos|float != 0 %} M118 Clog detected, please check the ERCF and the printer {% else %} M118 Runout detected ! - {% if printer["gcode_macro ERCF_VAR"].endless_spool_mode|int == 1 %} - {% if printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int >= (printer["gcode_macro ERCF_VAR"].colorselector|length -1) %} + {% if printer["gcode_macro _ERCF_VAR"].endless_spool_mode|int == 1 %} + {% set pre_change_PA = printer.extruder.pressure_advance %} + M118 EndlessSpool mode is ON! + {% if printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int >= (printer["gcode_macro _ERCF_VAR"].colorselector|length -1) %} {% set nexttool = 0 %} {% else %} - {% set nexttool = (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|int + 1) %} + {% set nexttool = (printer["gcode_macro _ERCF_SELECT_TOOL"].color_selected|int + 1) %} {% endif %} M118 Loading tool {nexttool|int} @@ -886,34 +928,35 @@ gcode: # G0 X45 Y310 Z1 F3000 # Custom unload sequence - M118 Forming filament tip and Unloading Filament... + M118 Unloading Filament... G91 - ERCF_FORM_TIP_STANDALONE - ERCF_HOME_EXTRUDER TOTAL_LENGTH={printer["gcode_macro ERCF_VAR"].sensor_to_nozzle} STEP_LENGTH=2.0 - ERCF_SERVO_DOWN + _ERCF_FORM_TIP_STANDALONE + ERCF_HOME_EXTRUDER TOTAL_LENGTH={printer["gcode_macro _ERCF_VAR"].sensor_to_nozzle} STEP_LENGTH=2.0 + _ERCF_SERVO_DOWN G91 G92 E0 MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0 - MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL=0 SYNC=0 - G1 E-{printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 + MANUAL_STEPPER STEPPER=gear_stepper MOVE=-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float} SPEED=25 ACCEL={printer["gcode_macro _ERCF_VAR"].gear_stepper_accel|int} SYNC=0 + G1 E-{printer["gcode_macro _ERCF_VAR"].end_of_bowden_to_sensor|float} F1500.0 {% set ercf_params = printer.save_variables.variables %} ERCF_SET_STEPS RATIO={ercf_params['ercf_calib_%s' % (printer["gcode_macro ERCF_SELECT_TOOL"].color_selected|string)]} ERCF_UNLOAD LENGTH={ercf_params.ercf_calib_ref|float - printer["gcode_macro ERCF_VAR"].end_of_bowden_to_sensor|float + printer["gcode_macro ERCF_VAR"].unload_modifier|float} ERCF_UNSELECT_TOOL - ERCF_LOAD_TOOL TOOL={nexttool|int} - ERCF_CHECK_IF_RESUME + _ERCF_LOAD_TOOL TOOL={nexttool|int} + SET_PRESSURE_ADVANCE ADVANCE={pre_change_PA} + _ERCF_CHECK_IF_RESUME {% else %} M118 EndlessSpool mode not enabled, please do something {% endif %} {% endif %} -[gcode_macro ERCF_CHECK_IF_RESUME] +[gcode_macro _ERCF_CHECK_IF_RESUME] description: Safety checks before resuming the print after an encoder event gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int == 0 %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %} # Adapt the example below to your own setup # The goal is just to clean the nozzle after the change # In my case I have a purge bucket with a brush @@ -921,8 +964,10 @@ gcode: # BRUSH_CLEAN RESTORE_GCODE_STATE NAME=ERCF_Pre_Brush_init RESUME - {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} + {% if printer["gcode_macro _ERCF_VAR"].clog_detection|int == 1 %} SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 {% endif %} + {% else %} + M118 ERCF is currently paused. Please use ERCF_UNLOCK {% endif %} From 8ceb08e917381eb06bb0dca7ff30e9cde99ac1d0 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 28 Apr 2022 10:52:01 +0200 Subject: [PATCH 096/131] printer: update some variables --- printer.cfg | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/printer.cfg b/printer.cfg index c75235e..2854a76 100644 --- a/printer.cfg +++ b/printer.cfg @@ -39,7 +39,7 @@ max_velocity: 600 ## regular max_accel: 4000 max_accel_to_decel: 2000 -# resonance testing +## resonance testing # max_accel: 10000 # max_accel_to_decel: 5000 ## @@ -105,7 +105,7 @@ microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 -position_endstop: 307 +position_endstop: 308 position_max: 310 homing_speed: 30 # Max 100 homing_retract_dist: 5 @@ -133,7 +133,7 @@ gear_ratio: 80:16 microsteps: 32 endstop_pin: PG10 ## actual_position = measured_position_endstop - position_endstop -position_endstop: 0.5 +position_endstop: 0 position_max: 290 position_min: -1 homing_speed: 8.0 # speed: mm/sec, feedrate: mm/min @@ -220,11 +220,10 @@ full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper nozzle_diameter: 0.400 filament_diameter: 1.75 heater_pin: PA2 -## Validate the following thermistor type to make sure it is correct -sensor_type: ATC Semitec 104GT-2 +sensor_type: ATC Semitec 104NT-4-R025H42G sensor_pin: PF4 min_temp: 10 -max_temp: 270 +max_temp: 280 # specified to 300 max_power: 1.0 min_extrude_temp: 170 #control = pid @@ -232,7 +231,7 @@ min_extrude_temp: 170 #pid_ki = 1.304 #pid_kd = 131.721 ## Try to keep pressure_advance below 1.0 -pressure_advance: 0.05 +# pressure_advance: 0.05 ## Default is 0.040, leave stock pressure_advance_smooth_time: 0.040 # Maximum length (in mm of raw filament) that a retraction or @@ -308,7 +307,7 @@ timeout: 1800 ## replaced with homing_override in klicky-probe.cfg # [safe_z_home] # ## XY Location of the Z Endstop Switch -# home_xy_position: 94.5, 305 +# home_xy_position: 94, 306 # speed: 100 # z_hop: 10 # z_hop_speed: 25 @@ -381,20 +380,20 @@ max_adjust: 10 #*# #*# [extruder] #*# control = pid -#*# pid_kp = 27.862 -#*# pid_ki = 1.548 -#*# pid_kd = 125.379 +#*# pid_kp = 19.058 +#*# pid_ki = 1.495 +#*# pid_kd = 60.749 #*# #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.005000, -0.018750, -0.012500, -0.015000, -0.015000, 0.002500, 0.002500 -#*# 0.008750, -0.006250, 0.000000, -0.012500, -0.008750, 0.015000, 0.007500 -#*# -0.005000, -0.020000, -0.006250, -0.011250, -0.007500, 0.007500, 0.005000 -#*# 0.007500, -0.006250, 0.010000, 0.000000, 0.005000, 0.018750, 0.011250 -#*# 0.006250, -0.006250, 0.006250, 0.011250, 0.015000, 0.025000, 0.018750 -#*# 0.003750, -0.005000, 0.001250, -0.001250, 0.003750, 0.017500, 0.008750 -#*# 0.026250, 0.018750, 0.016250, 0.020000, 0.025000, 0.032500, 0.025000 +#*# 0.053750, 0.030000, 0.036250, 0.028750, 0.031250, 0.055000, 0.053750 +#*# 0.031250, 0.011250, 0.022500, 0.008750, 0.012500, 0.037500, 0.026250 +#*# 0.008750, -0.012500, -0.002500, 0.008750, -0.008750, 0.001250, -0.005000 +#*# -0.000000, -0.011250, 0.008750, 0.000000, 0.002500, 0.006250, -0.007500 +#*# 0.012500, 0.001250, 0.005000, -0.006250, -0.003750, 0.006250, -0.006250 +#*# 0.002500, -0.005000, 0.001250, -0.002500, -0.000000, 0.008750, -0.000000 +#*# 0.035000, 0.026250, 0.026250, 0.031250, 0.026250, 0.040000, 0.025000 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic From 08b6abb178f6859af70e178860ea54054b9d231a Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 16 May 2022 10:10:22 +0200 Subject: [PATCH 097/131] minor update --- input_shaper.cfg | 4 ++-- macros/print.cfg | 17 ++++++----------- z_calibration.cfg | 12 ++++++------ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index fe69194..6a5c041 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -4,9 +4,9 @@ # is mzv input shaper. # shaper_type: mzv shaper_type_x: mzv -shaper_freq_x: 55.4 +shaper_freq_x: 53.6 shaper_type_y: mzv -shaper_freq_y: 43.6 +shaper_freq_y: 43.2 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/macros/print.cfg b/macros/print.cfg index 0474253..7d4a81b 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -18,8 +18,8 @@ gcode: {% set x0=250 %} {% set x1=200 %} - {% set y0=309 %} - {% set z0=1.5 %} + {% set y0=309.5 %} + {% set z0=1.0 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} G0 Z{z_hop} F1000 # move Z to travel height @@ -116,7 +116,6 @@ gcode: [gcode_macro PRINT_START] gcode: {% set BED=params.BED|default(100)|int %} - {% set BED10=params.BED|default(100)|int - 10 %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} {% set BMC=params.BMC|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} @@ -128,8 +127,8 @@ gcode: M117 CONFIGURING M118 CONFIGURING SET_GCODE_OFFSET Z=0.0 # reset z offset - M140 S{BED10} # start bed heating to bed-10 - # M104 S{EXTRUDER} # start extruder heating + M140 S{BED} # start bed heating to bed + M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder G21 # set units to millimeters G90 # use absolute coordinates @@ -166,15 +165,11 @@ gcode: M117 CALIBRATE_Z M118 CALIBRATE_Z + G28 Z BRUSHIE CALIBRATE_Z - G92 E0 # reset extruder - NOTIFY_BED BED={BED10} - M190 S{BED10} # set and wait for bed-10 temperature - - NOTIFY_EXTRUDER EXTRUDER={EXTRUDER} - M104 S{EXTRUDER} # start extruder heating + G92 E0 # reset extruder NOTIFY_BED BED={BED} M190 S{BED} # set and wait for actual bed temperature M109 S{EXTRUDER} # set and wait for extruder temperature diff --git a/z_calibration.cfg b/z_calibration.cfg index 1c9c04c..4440a69 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -4,8 +4,8 @@ [gcode_macro _USER_VARIABLE] description: Helper: Contains User defined printer variables ##### Homing and general movement ##### -variable_z_endstop_x: 94.5 ; z Endstop x position inside right profile -variable_z_endstop_y: 307 ; z Endstop y position +variable_z_endstop_x: 94 ; z Endstop x position inside right profile +variable_z_endstop_y: 308 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.6 ; reduced homing current for x and y variable_z_home_current: 0.5 ; reduced homing current for z @@ -35,12 +35,12 @@ gcode: [z_calibration] # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. -probe_nozzle_x: 94.5 -probe_nozzle_y: 307 +probe_nozzle_x: 94 +probe_nozzle_y: 308 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 -probe_switch_y: 287 +probe_switch_y: 288 # The X and Y coordinates (in mm) for probing on the print surface # (e.g. the center point) These coordinates will be adapted by the # probe's X and Y offsets. The default is the relative_reference_index @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.50 +switch_offset: 0.66 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From ef4335b67816e0802e606b3575d106d53c83be28 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 16 May 2022 10:11:01 +0200 Subject: [PATCH 098/131] gitignore: add .swp --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8d71bf9..79db84c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.bkp +*.swp From 752733b175014393021862dedb1f9d2b9cdfec8e Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 31 May 2022 21:40:44 +0200 Subject: [PATCH 099/131] ercf: enable encoder motion issue detection --- ercf/hardware.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg index 0254ca9..bb40c17 100644 --- a/ercf/hardware.cfg +++ b/ercf/hardware.cfg @@ -70,12 +70,12 @@ switch_pin: ^ercf:PA6 pause_on_runout: False detection_length: 10.0 extruder: extruder -# runout_gcode: _ERCF_ENCODER_MOTION_ISSUE +runout_gcode: _ERCF_ENCODER_MOTION_ISSUE [filament_switch_sensor toolhead_sensor] pause_on_runout: False switch_pin: ^PG12 -runout_gcode: - M118 toolhead filament removed -insert_gcode: - M118 toolhead filament inserted +# runout_gcode: +# M118 toolhead filament removed +# insert_gcode: +# M118 toolhead filament inserted From 685139afc7632628dbff203e99f6bdfed35ed988 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 31 May 2022 21:41:51 +0200 Subject: [PATCH 100/131] macros: fix pause/resume, add load/unload --- macros/print.cfg | 135 +++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 64 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index 7d4a81b..b5680de 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -2,12 +2,16 @@ # Macros used for printing # - BRUSHIE # - CANCEL_PRINT +# - LOAD_FILAMENT +# - UNLOAD_FILAMENT # - M600 +# - M601 # - M900 # - PARK # - PAUSE # - PRINT_START # - PRINT_END +# - PRINT_LAYER_CHANGE # - PURGE_NOZZLE # - RESUME #################################################################### @@ -18,7 +22,7 @@ gcode: {% set x0=250 %} {% set x1=200 %} - {% set y0=309.5 %} + {% set y0=308 %} {% set z0=1.0 %} {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% if "xyz" in printer.toolhead.homed_axes %} @@ -30,7 +34,7 @@ gcode: G0 X{x1} # 3 G0 Z{z_hop} F300 # move Z to travel height {% else %} - M118 Printer not homed + M118 printer not homed {% endif %} @@ -47,14 +51,29 @@ gcode: _CANCEL_PRINT_BASE +[gcode_macro LOAD_FILAMENT] +gcode: + T0 + + +[gcode_macro UNLOAD_FILAMENT] +gcode: + ERCF_EJECT + + [gcode_macro M600] description: Change filament gcode: SAVE_GCODE_STATE NAME=M600_state - PAUSE Y=15 + PAUSE M118 M600 change filament RESTORE_GCODE_STATE NAME=M600_state +[gcode_macro M601] +description: Pause print +gcode: + PAUSE + [gcode_macro M900] description: Set pressure advance gcode: @@ -85,30 +104,38 @@ gcode: G90 G0 X{x_park} Y{y_park} F6000 {% else %} - M118 Printer not homed + M118 printer not homed {% endif %} # - PAUSE [gcode_macro PAUSE] -description: Pause the actual running print rename_existing: _PAUSE_BASE -# change this if you need more or less extrusion -variable_extrude: 1.0 gcode: - {% set YMIN = printer.toolhead.axis_minimum.y|float + 5.0 %} - {% set Y=params.Y|default(YMIN) %} - # read E from pause macro - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # end of definitions - M118 pause - _PAUSE_BASE - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E-{E} F2100 + {% if printer.pause_resume.is_paused|lower == 'false' %} + {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 5.0) %} + {% set z_safe = 5.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + G92 E0 + {% if printer.extruder.can_extrude %} + G1 E-1.0 F1500.0 + {% endif %} G90 + SAVE_GCODE_STATE NAME=PAUSE_state + _PAUSE_BASE + G91 + G1 Z{z_safe} F900 + G90 + G0 X{x_park} Y{y_park} F6000 {% else %} - M118 Extruder not hot enough + M117 already paused + M118 already paused {% endif %} @@ -135,24 +162,15 @@ gcode: M83 # use relative distances for extrusion BED_MESH_CLEAR - {% if not "xyz" in printer.toolhead.homed_axes %} - M117 HOME - M118 HOME - G28 - {% else %} - M117 NO HOME - M118 NO HOME - {% endif %} - - {% if printer.quad_gantry_level.applied|lower == 'false' %} - M117 QGL - M118 QGL - QUAD_GANTRY_LEVEL PARK=false - {% else %} - M117 NO QGL - M118 NO QGL - {% endif %} - + # HOME + M117 HOME + M118 HOME + G28 + # QGL + M117 QGL + M118 QGL + QUAD_GANTRY_LEVEL PARK=false + # BMC {% if BMC %} M117 BED MESH CALIBRATE M118 BED MESH CALIBRATE @@ -162,10 +180,10 @@ gcode: M118 BED MESH LOAD {SHEET} BED_MESH_PROFILE LOAD={SHEET} {% endif %} - + # CALIBRATE_Z M117 CALIBRATE_Z M118 CALIBRATE_Z - G28 Z + # G28 Z # irrelevant? BRUSHIE CALIBRATE_Z @@ -230,33 +248,22 @@ gcode: description: Resume the actual running print rename_existing: _RESUME_BASE gcode: - {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} - M118 You can't resume the print without unlocking the ERCF first. - M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again - {% else %} - # read E from pause macro - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - # get VELOCITY parameter if specified - {% if 'VELOCITY' in params|upper %} - {% set get_params = ('VELOCITY=' + params.VELOCITY) %} - {%else %} - {% set get_params = "" %} - {% endif %} - # end of definitions - M118 resume - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E{E} F6000 - G90 + {% if printer.pause_resume.is_paused|lower == 'true' %} + {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int != 0 %} + M118 You can't resume the print without unlocking the ERCF first. + M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again + {% else %} + RESTORE_GCODE_STATE NAME=PAUSE_state + G90 + {% if printer["gcode_macro _ERCF_VAR"].clog_detection|int == 1 %} + SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 + {% endif %} + _RESUME_BASE + {% endif %} {% else %} - M118 Extruder not hot enough + M117 not paused + M118 not paused {% endif %} - {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 - {% endif %} - G4 P2000 - _RESUME_BASE - {% endif %} [gcode_macro PRINT_LAYER_CHANGE] @@ -264,4 +271,4 @@ gcode: {% set layer=params.LAYER|default(0)|int %} {% set layer_z=params.LAYER_Z|default(0) %} {% set total_layer_count=params.TOTAL_LAYER_COUNT|default(0) %} - M117 > layer {layer+1}/{total_layer_count} {layer_z}mm + M117 layer {layer+1}/{total_layer_count} {layer_z}mm From ee4f55f1eb1b66338a48024215825338be01c0e9 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 31 May 2022 21:43:33 +0200 Subject: [PATCH 101/131] printer: change Y position, 9x9 mesh, calibrate --- printer.cfg | 36 +++++++++++++++++++----------------- z_calibration.cfg | 8 ++++---- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/printer.cfg b/printer.cfg index 2854a76..414598a 100644 --- a/printer.cfg +++ b/printer.cfg @@ -105,8 +105,8 @@ microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 -position_endstop: 308 -position_max: 310 +position_endstop: 306 +position_max: 308 homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -349,10 +349,10 @@ algorithm: bicubic # relative_reference_index: 4 # probe_count: 5,5 # relative_reference_index: 12 -probe_count: 7,7 -relative_reference_index: 24 -# probe_count: 9,9 -# relative_reference_index: 40 +# probe_count: 7,7 +# relative_reference_index: 24 +probe_count: 9,9 +relative_reference_index: 40 [quad_gantry_level] speed: 150 @@ -387,20 +387,22 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.053750, 0.030000, 0.036250, 0.028750, 0.031250, 0.055000, 0.053750 -#*# 0.031250, 0.011250, 0.022500, 0.008750, 0.012500, 0.037500, 0.026250 -#*# 0.008750, -0.012500, -0.002500, 0.008750, -0.008750, 0.001250, -0.005000 -#*# -0.000000, -0.011250, 0.008750, 0.000000, 0.002500, 0.006250, -0.007500 -#*# 0.012500, 0.001250, 0.005000, -0.006250, -0.003750, 0.006250, -0.006250 -#*# 0.002500, -0.005000, 0.001250, -0.002500, -0.000000, 0.008750, -0.000000 -#*# 0.035000, 0.026250, 0.026250, 0.031250, 0.026250, 0.040000, 0.025000 +#*# 0.006250, 0.002500, -0.003750, -0.011250, -0.007500, -0.006250, 0.002500, 0.005000, 0.007500 +#*# 0.005000, -0.003750, 0.005000, -0.010000, -0.008750, 0.000000, -0.001250, 0.015000, 0.007500 +#*# 0.003750, -0.011250, -0.006250, -0.006250, -0.003750, -0.005000, -0.007500, 0.006250, 0.006250 +#*# -0.011250, -0.025000, -0.005000, -0.006250, -0.006250, 0.003750, -0.003750, -0.002500, -0.003750 +#*# -0.006250, -0.008750, -0.003750, 0.002500, 0.000000, 0.008750, 0.007500, 0.005000, -0.000000 +#*# -0.005000, -0.003750, -0.002500, -0.005000, -0.005000, 0.007500, 0.008750, 0.012500, 0.006250 +#*# -0.021250, -0.026250, -0.027500, -0.017500, -0.013750, -0.007500, -0.007500, -0.006250, -0.010000 +#*# -0.005000, -0.007500, -0.007500, -0.007500, -0.006250, -0.003750, -0.001250, -0.001250, -0.002500 +#*# 0.005000, -0.002500, 0.001250, -0.006250, -0.000000, 0.003750, 0.006250, 0.015000, 0.003750 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic -#*# y_count = 7 +#*# y_count = 9 #*# mesh_y_pps = 2 #*# min_y = 70.0 -#*# x_count = 7 -#*# max_y = 289.96 +#*# x_count = 9 +#*# max_y = 290.0 #*# mesh_x_pps = 2 -#*# max_x = 259.96 +#*# max_x = 260.0 diff --git a/z_calibration.cfg b/z_calibration.cfg index 4440a69..2008b0c 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -5,7 +5,7 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 94 ; z Endstop x position inside right profile -variable_z_endstop_y: 308 ; z Endstop y position +variable_z_endstop_y: 306 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.6 ; reduced homing current for x and y variable_z_home_current: 0.5 ; reduced homing current for z @@ -15,7 +15,7 @@ variable_probe_dock_x: 53 ; x toolhead position before docking probe variable_probe_dock_y: 250 ; y toolhead position before docking probe variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) variable_probe_undock_x: 110 ; x toolhead position after docking probe -variable_probe_undock_y: 309 ; y toolhead position after docking probe +variable_probe_undock_y: 307 ; y toolhead position after docking probe variable_probe_undock_z: 12 ; z toolhead position after docking probe (only for bed dock) variable_probe_z_min: 12 ; z minimum height to avoid crash variable_probe_travel_speed: 100 ; dock moves travel speed @@ -36,7 +36,7 @@ gcode: # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. probe_nozzle_x: 94 -probe_nozzle_y: 308 +probe_nozzle_y: 306 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.66 +switch_offset: 0.60 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From 8a60955e0573441fd10ee0f6a0f153476f61ad84 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Tue, 31 May 2022 21:43:54 +0200 Subject: [PATCH 102/131] webcam: add config for webcam-multi --- webcam-multi.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 webcam-multi.txt diff --git a/webcam-multi.txt b/webcam-multi.txt new file mode 100644 index 0000000..5880078 --- /dev/null +++ b/webcam-multi.txt @@ -0,0 +1,11 @@ +# vim: ft=conf + +### Additional options to supply to MJPG Streamer for the cameras +camera_usb=1 +camera_raspi=1 +camera_usb_options="-d /dev/v4l/by-id/usb-Vimicro_Corp._HBVCAM_FHD_CAMERA-video-index0 -r 1280x960 -f 10" +camera_raspi_options="-d /dev/v4l/by-path/platform-bcm2835-isp-video-index0 -x 1024 -y 768 -roi 0.0,0.0,0.998,1" + +### Configuration of camera HTTP output +camera_http_options="-p 8080" + From ae4e37e1086a92b1531593393b093305bc0771ab Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 15 Jul 2022 08:53:01 +0200 Subject: [PATCH 103/131] ercf: disable encoder motion issue detection --- ercf/hardware.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg index bb40c17..18907f5 100644 --- a/ercf/hardware.cfg +++ b/ercf/hardware.cfg @@ -70,7 +70,7 @@ switch_pin: ^ercf:PA6 pause_on_runout: False detection_length: 10.0 extruder: extruder -runout_gcode: _ERCF_ENCODER_MOTION_ISSUE +# runout_gcode: _ERCF_ENCODER_MOTION_ISSUE [filament_switch_sensor toolhead_sensor] pause_on_runout: False From 278cff5784bde3671a7df6fe83bfdb91e943583c Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 1 Aug 2022 10:52:34 +0200 Subject: [PATCH 104/131] ercf: update values --- ercf/software.cfg | 4 ++-- ercf/vars.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index dab6ec4..2a571bc 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -45,12 +45,12 @@ variable_sensor_to_nozzle: 54 # xk variable_colorselector = [2.4, 23.2, 44.0, 70.5, 91.2, 112.8] # 6 tools # xk # Base value for the loading length used by the auto-calibration macro # Please use a value SMALLER than the real reverse bowden length (like 50mm less) -variable_min_bowden_length: 850 # xk +variable_min_bowden_length: 730 # xk # Servo angle for the Up position (i.e. tool disengaged). Refer to the manual to know how to properly tune this value # Default values: # MG90S servo : 30 # SAVOX SH0255MG : 140 -variable_servo_up_angle: 30 +variable_servo_up_angle: 20 # Servo angle for the Down position (i.e. tool engaged). Refer to the manual to know how to properly tune this value # Default values: # MG90S servo : 140 diff --git a/ercf/vars.cfg b/ercf/vars.cfg index 1d0c04b..32cc5ed 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -11,5 +11,5 @@ ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 979.757328 +ercf_calib_ref = 775.9786 From 152687fa734505fb8c1d8edda99bebed22d088eb Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 1 Aug 2022 10:53:02 +0200 Subject: [PATCH 105/131] printer: calibrate --- printer.cfg | 18 +++++++++--------- z_calibration.cfg | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/printer.cfg b/printer.cfg index 414598a..0afdfa7 100644 --- a/printer.cfg +++ b/printer.cfg @@ -387,15 +387,15 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.006250, 0.002500, -0.003750, -0.011250, -0.007500, -0.006250, 0.002500, 0.005000, 0.007500 -#*# 0.005000, -0.003750, 0.005000, -0.010000, -0.008750, 0.000000, -0.001250, 0.015000, 0.007500 -#*# 0.003750, -0.011250, -0.006250, -0.006250, -0.003750, -0.005000, -0.007500, 0.006250, 0.006250 -#*# -0.011250, -0.025000, -0.005000, -0.006250, -0.006250, 0.003750, -0.003750, -0.002500, -0.003750 -#*# -0.006250, -0.008750, -0.003750, 0.002500, 0.000000, 0.008750, 0.007500, 0.005000, -0.000000 -#*# -0.005000, -0.003750, -0.002500, -0.005000, -0.005000, 0.007500, 0.008750, 0.012500, 0.006250 -#*# -0.021250, -0.026250, -0.027500, -0.017500, -0.013750, -0.007500, -0.007500, -0.006250, -0.010000 -#*# -0.005000, -0.007500, -0.007500, -0.007500, -0.006250, -0.003750, -0.001250, -0.001250, -0.002500 -#*# 0.005000, -0.002500, 0.001250, -0.006250, -0.000000, 0.003750, 0.006250, 0.015000, 0.003750 +#*# 0.005000, -0.007500, -0.010000, -0.020000, -0.020000, -0.023750, -0.007500, -0.010000, -0.010000 +#*# 0.016250, 0.000000, 0.007500, -0.013750, -0.025000, -0.017500, -0.027500, -0.012500, -0.036250 +#*# 0.015000, -0.003750, -0.003750, -0.006250, -0.007500, -0.015000, -0.022500, -0.013750, -0.017500 +#*# 0.012500, -0.003750, 0.002500, 0.000000, -0.001250, 0.000000, -0.026250, -0.032500, -0.042500 +#*# 0.016250, 0.005000, 0.007500, 0.008750, 0.000000, 0.010000, -0.001250, -0.007500, -0.022500 +#*# 0.028750, 0.020000, 0.015000, 0.010000, 0.002500, 0.006250, 0.005000, -0.002500, -0.021250 +#*# 0.021250, 0.011250, 0.003750, 0.005000, 0.002500, 0.003750, -0.000000, -0.003750, -0.021250 +#*# 0.040000, 0.032500, 0.025000, 0.020000, 0.015000, 0.013750, 0.011250, 0.008750, 0.001250 +#*# 0.065000, 0.046250, 0.057500, 0.027500, 0.033750, 0.032500, 0.033750, 0.035000, 0.015000 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic diff --git a/z_calibration.cfg b/z_calibration.cfg index 2008b0c..06de692 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -5,7 +5,7 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 94 ; z Endstop x position inside right profile -variable_z_endstop_y: 306 ; z Endstop y position +variable_z_endstop_y: 307 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.6 ; reduced homing current for x and y variable_z_home_current: 0.5 ; reduced homing current for z @@ -36,7 +36,7 @@ gcode: # The X and Y coordinates (in mm) for clicking the nozzle on the # Z endstop. probe_nozzle_x: 94 -probe_nozzle_y: 306 +probe_nozzle_y: 307 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.60 +switch_offset: 0.50 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From e411781c53980c2fccb20dcd139d9f8c1988c1b7 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 23 Dec 2021 14:10:58 +0100 Subject: [PATCH 106/131] v2.4: switch XY to tmc5160 hv --- printer.cfg | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/printer.cfg b/printer.cfg index 0afdfa7..e71fb78 100644 --- a/printer.cfg +++ b/printer.cfg @@ -88,8 +88,11 @@ homing_speed: 30 # speed: mm/sec, feedrate: mm/min homing_retract_dist: 5 homing_positive_dir: true -[tmc2209 stepper_x] -uart_pin: PC4 +[tmc5160 stepper_x] +cs_pin: PC4 +spi_software_miso_pin: PA6 +spi_software_mosi_pin: PA7 +spi_software_sclk_pin: PA5 interpolate: False run_current: 1.0 sense_resistor: 0.110 @@ -111,8 +114,11 @@ homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true -[tmc2209 stepper_y] -uart_pin: PD11 +[tmc5160 stepper_y] +cs_pin: PD11 +spi_software_miso_pin: PA6 +spi_software_mosi_pin: PA7 +spi_software_sclk_pin: PA5 interpolate: False run_current: 1.0 sense_resistor: 0.110 From 21ade1e03d91d15fe8471c575439e553a232ad8f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 5 Aug 2022 12:47:39 +0200 Subject: [PATCH 107/131] ercf: calibrate --- ercf/vars.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ercf/vars.cfg b/ercf/vars.cfg index 32cc5ed..d648965 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -1,15 +1,15 @@ [Variables] ercf_calib_0 = 1.0 -ercf_calib_1 = 0.992410468168 +ercf_calib_1 = 0.999635726394 ercf_calib_10 = 1.0 ercf_calib_11 = 1.0 -ercf_calib_2 = 1.00044979689 -ercf_calib_3 = 0.999550111824 -ercf_calib_4 = 1.00044979689 -ercf_calib_5 = 0.999550111824 +ercf_calib_2 = 1.00178086744 +ercf_calib_3 = 1.00070714732 +ercf_calib_4 = 1.00070714732 +ercf_calib_5 = 0.999635726394 ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 775.9786 +ercf_calib_ref = 779.35242 From a41585f88466f36b1dae56503b776f0b73cdf9a4 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 5 Aug 2022 12:48:02 +0200 Subject: [PATCH 108/131] z: update config for clicky ng --- z_calibration.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/z_calibration.cfg b/z_calibration.cfg index 06de692..5eb8218 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -5,17 +5,17 @@ description: Helper: Contains User defined printer variables ##### Homing and general movement ##### variable_z_endstop_x: 94 ; z Endstop x position inside right profile -variable_z_endstop_y: 307 ; z Endstop y position +variable_z_endstop_y: 306 ; z Endstop y position variable_z_hop: 12 ; z hop for moves e.g homing variable_xy_home_current: 0.6 ; reduced homing current for x and y variable_z_home_current: 0.5 ; reduced homing current for z variable_home_accel: 1000 ; reduced ACCEL for homing ##### Mag Probe ##### variable_probe_dock_x: 53 ; x toolhead position before docking probe -variable_probe_dock_y: 250 ; y toolhead position before docking probe +variable_probe_dock_y: 246 ; y toolhead position before docking probe variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) -variable_probe_undock_x: 110 ; x toolhead position after docking probe -variable_probe_undock_y: 307 ; y toolhead position after docking probe +variable_probe_undock_x: 103 ; x toolhead position after docking probe +variable_probe_undock_y: 305 ; y toolhead position after docking probe variable_probe_undock_z: 12 ; z toolhead position after docking probe (only for bed dock) variable_probe_z_min: 12 ; z minimum height to avoid crash variable_probe_travel_speed: 100 ; dock moves travel speed From 87a32ec1481547f87024521dcfb14fed222cbf28 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 5 Aug 2022 12:48:24 +0200 Subject: [PATCH 109/131] neopixel: swap leds --- neopixel.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neopixel.cfg b/neopixel.cfg index 693a230..cc87245 100644 --- a/neopixel.cfg +++ b/neopixel.cfg @@ -3,14 +3,15 @@ ##################################################################### [neopixel caselight] -pin: PB0 +pin: PB6 # Octopus BL_Touch chain_count: 44 initial_RED: 0.6 initial_GREEN: 0.5 initial_BLUE: 0.4 [neopixel toolhead] -pin: PB6 # Octopus BL_Touch +# pin: PB6 # Octopus BL_Touch +pin: PB0 # Octopus LED chain_count: 3 color_order: GRBW initial_RED: 0.3 From e5f8e7216488df0ad85e482d25eac81be319bb3c Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 5 Aug 2022 12:48:49 +0200 Subject: [PATCH 110/131] printer: update for cw2 --- printer.cfg | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/printer.cfg b/printer.cfg index e71fb78..18aeb94 100644 --- a/printer.cfg +++ b/printer.cfg @@ -210,7 +210,7 @@ stealthchop_threshold: 0 # E0 on MOTOR6 [extruder] step_pin: PE2 -dir_pin: PE3 +dir_pin: !PE3 enable_pin: !PD4 ## Update value below when you perform extruder calibration ## If you ask for 100mm of filament, but in reality it is 98mm: @@ -218,11 +218,12 @@ enable_pin: !PD4 ## 22.6789511 is a good starting point rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears ## Update Gear Ratio depending on your Extruder Type -## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio) -## Use 80:20 for M4, M3.1 -gear_ratio: 50:17 # BMG Gear Ratio +## - 50:17 for Afterburner/Clockwork +## - 50:10 for Stealthburner/Clockwork2 +## - 80:20 for M4, M3.1 +gear_ratio: 50:10 # SB BMG microsteps: 32 -full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper +full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper: 400 nozzle_diameter: 0.400 filament_diameter: 1.75 heater_pin: PA2 @@ -295,12 +296,13 @@ max_temp: 100 # gcode_id: C -[temperature_sensor chamber] -sensor_type: chamber -sensor_pin: PF5 -min_temp: 0 -max_temp: 100 -gcode_id: C +## replaced, there is no thermistor on the stealthburner pcb +# [temperature_sensor chamber] +# sensor_type: chamber +# sensor_pin: PF5 +# min_temp: 0 +# max_temp: 100 +# gcode_id: C [temperature_sensor RPI] sensor_type: temperature_host From a1626c1ac3cc313b58897a98ffd17f1cc73770bb Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 16 Nov 2022 22:23:46 +0100 Subject: [PATCH 111/131] KlipperScreen: update --- KlipperScreen.conf | 342 +-------------------------------------------- 1 file changed, 1 insertion(+), 341 deletions(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 15e5bcb..f0f36c2 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -1,357 +1,17 @@ -[main] -moonraker_host: 127.0.0.1 -moonraker_port: 7125 -service: KlipperScreen - -[z_calibrate_position] -calibrate_x_position: 150 -calibrate_y_position: 250 - [preheat PLA] bed = 50 extruder = 200 [preheat ABS] -bed = 100 +bed = 105 extruder = 250 [preheat PETG] bed = 80 extruder = 240 - -[menu __main] -name: {{ gettext('Main Menu') }} - -[menu __main homing] -name: {{ gettext('Homing') }} -icon: home - -[menu __main temperature] -name: {{ gettext('Temperature') }} -icon: heat-up -panel: temperature - -[menu __main actions] -name: {{ gettext('Actions') }} -icon: move - -[menu __main config] -name: {{ gettext('Configuration') }} -icon: settings - -[menu __main print] -name: {{ gettext('Print') }} -icon: print -panel: print - -[menu __main homing homeall] -name: {{ gettext('Home All') }} -icon: home -method: printer.gcode.script -params: {"script":"G28"} - -[menu __main homing homex] -name: {{ gettext('Home X') }} -icon: home-x -method: printer.gcode.script -params: {"script":"G28 X"} - -[menu __main homing homey] -name: {{ gettext('Home Y') }} -icon: home-y -method: printer.gcode.script -params: {"script":"G28 Y"} - -[menu __main homing homez] -name: {{ gettext('Home Z') }} -icon: home-z -method: printer.gcode.script -params: {"script":"G28 Z"} - -[menu __main homing homexy] -name: {{ gettext('Home XY') }} -icon: home -method: printer.gcode.script -params: {"script":"G28 X Y"} - -[menu __main homing quad_gantry_level] -name: {{ gettext('Quad Gantry Level') }} -icon: home-z -method: printer.gcode.script -params: {"script":"QUAD_GANTRY_LEVEL"} -enable: {{ printer.quad_gantry_level is defined }} - -[menu __main homing bed_mesh_calibrate] -name: {{ gettext('Bed Mesh') }} -icon: bed-level -panel: bed_mesh -enable: {{ printer.bed_mesh is defined }} - -[menu __main homing calibrate_z] -name: {{ gettext('Calibrate Z') }} -icon: home-z -method: printer.gcode.script -params: {"script":"CALIBRATE_Z"} -enable: {{ printer.probe is defined }} - -[menu __main homing Z-Tilt] -name: {{ gettext('Z Tilt') }} -icon: z-tilt -method: printer.gcode.script -params: {"script":"Z_TILT_ADJUST"} -enable: {{ printer.z_tilt is defined }} - - -[menu __main actions move] -name: {{ gettext('Move') }} -icon: move -panel: move - -[menu __main actions extrude] -name: {{ gettext('Extrude') }} -icon: filament -panel: extrude - -[menu __main actions fan] -name: {{ gettext('Fan') }} -icon: fan -panel: fan - -[menu __main actions temperature] -name: {{ gettext('Temperature') }} -icon: heat-up -panel: temperature - -[menu __main actions macros] -name: {{ gettext('Macros') }} -icon: custom-script -panel: gcode_macros -enable: {{ printer.gcode_macros.count > 0 }} - -[menu __main actions power] -name: {{ gettext('Power') }} -icon: shutdown -panel: power -enable: {{ printer.power_devices.count > 0 }} - -[menu __main actions disablemotors] -name: {{ gettext('Disable Motors') }} -icon: motor-off -method: printer.gcode.script -params: {"script":"M18"} - -[menu __main actions console] -name: {{ gettext('Console') }} -icon: console -panel: console - -[menu __main config bedlevel] -name: {{ gettext('Bed Level') }} -icon: bed-level -panel: bed_level - -[menu __main config bedmesh] -name: {{ gettext('Bed Mesh') }} -icon: bed-level -panel: bed_mesh -enable: {{ printer.bed_mesh is defined }} - -[menu __main config zoffset] -name: {{ gettext('Z Calibrate') }} -icon: z-farther -panel: zcalibrate -enable: {{ ((printer.bltouch != False) or (printer.probe != False)) }} - -[menu __main config limits] -name: {{ gettext('Limits') }} -icon: fine-tune -panel: limits - -[menu __main config network] -name: {{ gettext('Network') }} -icon: network -panel: network - -[menu __main config system] -name: {{ gettext('System') }} -icon: info -panel: system - -[menu __main config save] -name: {{ gettext('Save Config') }} -icon: complete -method: printer.gcode.script -params: {"script":"SAVE_CONFIG"} -confirm: - {{ gettext('Save configuration.') }} - - {{ gettext('Klipper will reboot') }} - -[menu __main config settings] -name: {{ gettext('Settings') }} -icon: settings -panel: settings - -[menu __print] -name: {{ gettext('Print Control') }} - -[menu __print temperature] -name: {{ gettext('Temperature') }} -icon: heat-up -panel: temperature - -[menu __print fan] -name: {{ gettext('Fan') }} -icon: fan -panel: fan - -[menu __print extrude] -name: {{ gettext('Extrude') }} -icon: filament -panel: extrude -enable: {{ printer.pause_resume.is_paused == True }} - -[menu __print power] -name: {{ gettext('Power') }} -icon: shutdown -panel: power -enable: {{ printer.power_devices.count > 0 }} - -[menu __print macros] -name: {{ gettext('Macros') }} -icon: custom-script -panel: gcode_macros -enable: {{ printer.gcode_macros.count > 0 }} - -[menu __print console] -name: {{ gettext('Console') }} -icon: console -panel: console - -[menu __print limits] -name: {{ gettext('Limits') }} -icon: fine-tune -panel: limits - -[menu __print network] -name: {{ gettext('Network') }} -icon: network -panel: network - -[menu __print system] -name: {{ gettext('System') }} -icon: info -panel: system - -[menu __print settings] -name: {{ gettext('Settings') }} -icon: settings -panel: settings - -[menu __splashscreen] -name: {{ gettext('Menu') }} - -[menu __splashscreen power] -name: {{ gettext('Power') }} -icon: shutdown -panel: power -enable: {{ printer.power_devices.count > 0 }} - -[menu __splashscreen network] -name: {{ gettext('Network') }} -icon: network -panel: network - -[menu __splashscreen system] -name: {{ gettext('System') }} -icon: info -panel: system - -[menu __splashscreen settings] -name: {{ gettext('Settings') }} -icon: settings -panel: settings #~# --- Do not edit below this line. This section is auto generated --- #~# #~# #~# [main] -#~# move_speed_xy = 50 #~# print_sort_dir = date_desc -#~# -#~# [displayed_macros Printer] -#~# g32 = False -#~# park = False -#~# cancel_print = False -#~# print_start = False -#~# print_end = False -#~# pause = False -#~# print_layer_change = False -#~# probe = False -#~# resume = False -#~# probe_calibrate = False -#~# dump_warnings = False -#~# dump_parameters = False -#~# dump_settings = False -#~# g0 = False -#~# m900 = False -#~# dump_config = False -#~# get_probe_status = False -#~# probe_abort = False -#~# probe_accept = False -#~# probe_accuracy = False -#~# _set_current = False -#~# _attach_probe = False -#~# query_probe = False -#~# set_probe_status = False -#~# _cg28 = False -#~# _user_variable = False -#~# _set_acc = False -#~# _mag_probe = False -#~# _dock_probe = False -#~# _z_move_check = False -#~# zc = False -#~# _probe_action = False -#~# zm = False -#~# ercf_calib_save_var = False -#~# ercf_calib_unload = False -#~# ercf_change_tool_slicer_end = False -#~# ercf_calibrate_single = False -#~# ercf_change_tool_standalone = False -#~# ercf_change_tool = False -#~# ercf_display_encoder_pos = False -#~# ercf_calib_selector = False -#~# ercf_check_if_resume = False -#~# ercf_encoder_motion_issue = False -#~# ercf_eject_unknow_state = False -#~# ercf_select_tool = False -#~# ercf_home_selector = False -#~# ercf_eject_from_bowden = False -#~# ercf_test_grip = False -#~# ercf_change_tool_slicer = False -#~# ercf_clog_or_runout = False -#~# ercf_test_servo = False -#~# ercf_is_filament_stuck_in_ercf = False -#~# ercf_load_tool = False -#~# ercf_unload_filament_in_extruder_with_tip_forming = False -#~# ercf_load_filament_in_extruder = False -#~# ercf_form_tip_standalone = False -#~# ercf_is_filament_in_extruder = False -#~# ercf_home_only = False -#~# ercf_var = False -#~# ercf_pause = False -#~# ercf_unload_tool = False -#~# ercf_test_load_sequence = False -#~# ercf_test_move_gear = False -#~# _timelapse_new_frame = False -#~# timelapse_render = False -#~# _set_timelapse_setup = False -#~# test_stream_delay = False -#~# move_speed = False -#~# get_timelapse_setup = False -#~# ercf_unselect_tool = False -#~# hyperlapse = False -#~# ercf_calibrate = False -#~# t6 = False -#~# t7 = False -#~# t8 = False #~# From 50118c83d4781422bf59abf58753e82c26d70afc Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 16 Nov 2022 22:24:42 +0100 Subject: [PATCH 112/131] printer: update calibration --- input_shaper.cfg | 2 +- printer.cfg | 18 +++++++++--------- z_calibration.cfg | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/input_shaper.cfg b/input_shaper.cfg index 6a5c041..5e00103 100644 --- a/input_shaper.cfg +++ b/input_shaper.cfg @@ -6,7 +6,7 @@ shaper_type_x: mzv shaper_freq_x: 53.6 shaper_type_y: mzv -shaper_freq_y: 43.2 +shaper_freq_y: 41.0 # Damping ratios of vibrations of X and Y axes used by input shapers # to improve vibration suppression. Default value is 0.1 which is a # good all-round value for most printers. In most circumstances this diff --git a/printer.cfg b/printer.cfg index 18aeb94..649dd2d 100644 --- a/printer.cfg +++ b/printer.cfg @@ -395,15 +395,15 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.005000, -0.007500, -0.010000, -0.020000, -0.020000, -0.023750, -0.007500, -0.010000, -0.010000 -#*# 0.016250, 0.000000, 0.007500, -0.013750, -0.025000, -0.017500, -0.027500, -0.012500, -0.036250 -#*# 0.015000, -0.003750, -0.003750, -0.006250, -0.007500, -0.015000, -0.022500, -0.013750, -0.017500 -#*# 0.012500, -0.003750, 0.002500, 0.000000, -0.001250, 0.000000, -0.026250, -0.032500, -0.042500 -#*# 0.016250, 0.005000, 0.007500, 0.008750, 0.000000, 0.010000, -0.001250, -0.007500, -0.022500 -#*# 0.028750, 0.020000, 0.015000, 0.010000, 0.002500, 0.006250, 0.005000, -0.002500, -0.021250 -#*# 0.021250, 0.011250, 0.003750, 0.005000, 0.002500, 0.003750, -0.000000, -0.003750, -0.021250 -#*# 0.040000, 0.032500, 0.025000, 0.020000, 0.015000, 0.013750, 0.011250, 0.008750, 0.001250 -#*# 0.065000, 0.046250, 0.057500, 0.027500, 0.033750, 0.032500, 0.033750, 0.035000, 0.015000 +#*# -0.055000, -0.057500, -0.058750, -0.061250, -0.060000, -0.052500, -0.042500, -0.031250, -0.032500 +#*# -0.033750, -0.043750, -0.036250, -0.045000, -0.047500, -0.038750, -0.038750, -0.021250, -0.038750 +#*# -0.040000, -0.047500, -0.040000, -0.031250, -0.025000, -0.018750, -0.020000, -0.005000, -0.003750 +#*# -0.037500, -0.043750, -0.023750, -0.006250, -0.010000, 0.008750, -0.008750, -0.008750, -0.006250 +#*# -0.035000, -0.036250, -0.023750, 0.020000, 0.000000, 0.046250, 0.021250, 0.031250, 0.032500 +#*# -0.027500, -0.020000, -0.018750, 0.003750, -0.008750, 0.020000, 0.021250, 0.031250, 0.026250 +#*# -0.046250, -0.036250, -0.031250, -0.021250, -0.007500, 0.011250, 0.020000, 0.033750, 0.036250 +#*# -0.031250, -0.022500, -0.018750, -0.008750, 0.006250, 0.018750, 0.027500, 0.042500, 0.046250 +#*# -0.018750, -0.012500, 0.032500, 0.006250, 0.021250, 0.035000, 0.052500, 0.063750, 0.068750 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic diff --git a/z_calibration.cfg b/z_calibration.cfg index 5eb8218..39abef9 100644 --- a/z_calibration.cfg +++ b/z_calibration.cfg @@ -40,7 +40,7 @@ probe_nozzle_y: 307 # The X and Y coordinates (in mm) for clicking the probe's switch # on the Z endstop. probe_switch_x: 90 -probe_switch_y: 288 +probe_switch_y: 283 # The X and Y coordinates (in mm) for probing on the print surface # (e.g. the center point) These coordinates will be adapted by the # probe's X and Y offsets. The default is the relative_reference_index @@ -52,7 +52,7 @@ probe_bed_y: 150 # The trigger point offset of the used mag-probe switch. # This needs to be fined out manually. More on this later # in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.50 +switch_offset: 0.59 # The maximum allowed deviation of the calculated offset. # If the offset exceeds this value, it will stop! # The default is 1.0 mm. From c1b03b6080a1629da0fedc1dde64ad80baf49f4a Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 16 Nov 2022 22:24:52 +0100 Subject: [PATCH 113/131] ercf: update calibration --- ercf/vars.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ercf/vars.cfg b/ercf/vars.cfg index d648965..6c63e75 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -11,5 +11,5 @@ ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 779.35242 +ercf_calib_ref = 802.294396 From c4e0b01274deb42d7a37a6f0f67cfe28a10ac29d Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 16 Nov 2022 22:25:10 +0100 Subject: [PATCH 114/131] moonraker: update --- moonraker.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/moonraker.conf b/moonraker.conf index 22b7b05..2b4c95e 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -1,7 +1,6 @@ [server] host: 0.0.0.0 port: 7125 -enable_debug_logging: False [authorization] force_logins: True @@ -22,8 +21,6 @@ trusted_clients: ::1/128 [file_manager] -config_path: ~/klipper_config -log_path: ~/klipper_logs [data_store] temperature_store_size: 600 From 1a502753ea192277036e50c53c2a4d880428f715 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 29 Dec 2022 14:18:19 +0100 Subject: [PATCH 115/131] printer/ercf: calibrate --- ercf/vars.cfg | 2 +- printer.cfg | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ercf/vars.cfg b/ercf/vars.cfg index 6c63e75..674b332 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -11,5 +11,5 @@ ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 802.294396 +ercf_calib_ref = 796.22152 diff --git a/printer.cfg b/printer.cfg index 649dd2d..2f2cfbe 100644 --- a/printer.cfg +++ b/printer.cfg @@ -395,15 +395,15 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.055000, -0.057500, -0.058750, -0.061250, -0.060000, -0.052500, -0.042500, -0.031250, -0.032500 -#*# -0.033750, -0.043750, -0.036250, -0.045000, -0.047500, -0.038750, -0.038750, -0.021250, -0.038750 -#*# -0.040000, -0.047500, -0.040000, -0.031250, -0.025000, -0.018750, -0.020000, -0.005000, -0.003750 -#*# -0.037500, -0.043750, -0.023750, -0.006250, -0.010000, 0.008750, -0.008750, -0.008750, -0.006250 -#*# -0.035000, -0.036250, -0.023750, 0.020000, 0.000000, 0.046250, 0.021250, 0.031250, 0.032500 -#*# -0.027500, -0.020000, -0.018750, 0.003750, -0.008750, 0.020000, 0.021250, 0.031250, 0.026250 -#*# -0.046250, -0.036250, -0.031250, -0.021250, -0.007500, 0.011250, 0.020000, 0.033750, 0.036250 -#*# -0.031250, -0.022500, -0.018750, -0.008750, 0.006250, 0.018750, 0.027500, 0.042500, 0.046250 -#*# -0.018750, -0.012500, 0.032500, 0.006250, 0.021250, 0.035000, 0.052500, 0.063750, 0.068750 +#*# 0.063750, 0.050000, 0.041250, 0.030000, 0.022500, 0.021250, 0.011250, 0.011250, -0.003750 +#*# 0.060000, 0.036250, 0.038750, 0.022500, -0.002500, 0.005000, -0.012500, -0.006250, -0.026250 +#*# 0.052500, 0.027500, 0.028750, 0.023750, -0.001250, -0.010000, -0.022500, -0.028750, -0.045000 +#*# 0.031250, 0.007500, 0.001250, -0.006250, -0.003750, -0.002500, -0.028750, -0.041250, -0.061250 +#*# 0.033750, 0.015000, 0.001250, 0.023750, 0.000000, -0.005000, -0.038750, -0.041250, -0.071250 +#*# 0.030000, 0.020000, -0.000000, -0.011250, -0.020000, -0.016250, -0.028750, -0.040000, -0.071250 +#*# 0.012500, 0.003750, -0.011250, -0.017500, -0.023750, -0.032500, -0.045000, -0.052500, -0.086250 +#*# 0.030000, 0.022500, 0.001250, -0.006250, -0.012500, -0.015000, -0.023750, -0.035000, -0.056250 +#*# 0.053750, 0.038750, 0.057500, 0.008750, 0.002500, -0.002500, -0.007500, -0.012500, -0.033750 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic From 0dd6d6b370957c9b7b22a07d042379bbe7ecff77 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Thu, 29 Dec 2022 20:42:02 +0100 Subject: [PATCH 116/131] printer: use voron-tap instead of magprobe --- macros/_init.cfg | 3 - macros/helpers.cfg | 16 -- macros/override.cfg | 147 ------------- macros/print.cfg | 31 ++- macros/probe.cfg | 440 --------------------------------------- macros/z_calibration.cfg | 121 ----------- printer.cfg | 73 ++++--- z_calibration.cfg | 164 --------------- 8 files changed, 57 insertions(+), 938 deletions(-) delete mode 100644 macros/override.cfg delete mode 100644 macros/probe.cfg delete mode 100644 macros/z_calibration.cfg delete mode 100644 z_calibration.cfg diff --git a/macros/_init.cfg b/macros/_init.cfg index 6831d62..609e796 100644 --- a/macros/_init.cfg +++ b/macros/_init.cfg @@ -4,8 +4,5 @@ ##################################################################### [include debug.cfg] [include helpers.cfg] -[include override.cfg] [include print.cfg] -[include probe.cfg] -[include z_calibration.cfg] [include timelapse.cfg] diff --git a/macros/helpers.cfg b/macros/helpers.cfg index 254f610..b8e91c8 100644 --- a/macros/helpers.cfg +++ b/macros/helpers.cfg @@ -59,19 +59,3 @@ gcode: M117 HEATING EXTRUDER from {printer.extruder.temperature} to {EXTRUDER} M118 HEATING EXTRUDER from {printer.extruder.temperature} to {EXTRUDER} - -[gcode_macro ZC] -gcode: - G28 - CALIBRATE_Z - G0 X150 Y30 Z2 F10000 - G0 Z1 F300 - -[gcode_macro TZC] -gcode: - {% set N=params.N|default(1)|int %} - {% for i in range(N) %} - M118 move {(i+1)}/{N} - G28 - CALIBRATE_Z - {% endfor %} diff --git a/macros/override.cfg b/macros/override.cfg deleted file mode 100644 index b728df7..0000000 --- a/macros/override.cfg +++ /dev/null @@ -1,147 +0,0 @@ -##################################################################### -# Customized standard macros -##################################################################### -# -# !!! Caution !!! -# -# PROBE_CALIBRATE can not dock the Magprobe automatically, as it -# start's a scripting process we need to stop at the execution -# of the base macro. Use -# - PROBE_ABORT -# - PROBE_ACCEPT -# instead of the original ABORT and ACCEPT to also dock the probe -# -# - BED_MESH_CALIBRATE -# - G0 -# - G1 -# - QUAD_GANTRY_LEVEL -##################################################################### - - -## BED_MESH_CALIBRATE -[gcode_macro BED_MESH_CALIBRATE] -description: Perform QGL and bed mesh leveling -rename_existing: _BED_MESH_CALIBRATE_BASE -gcode: - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - _CG28 - BED_MESH_CLEAR - ## check if QGL was already executed - {% if printer.quad_gantry_level.applied|lower == 'false' %} - QUAD_GANTRY_LEVEL PARK=false - {% endif %} - ATTACH_PROBE - _BED_MESH_CALIBRATE_BASE {get_params|join(" ")} - DETACH_PROBE - -## GO -# If your probe needs a Z move for attach/detach use either -# G0 .... FORCE -[gcode_macro G0] -description: Move gcode that prevents moves lower than the limit when probe attached -rename_existing: G0.1 -gcode: - ##### set manual override ##### - {% if 'FORCE' in params|upper %} - {% set force = 1 %} - {% else %} - {% set force = 0 %} - {% endif %} - ##### get params ##### - {% set get_params = [] %} - {% for key in params %} - {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endif %} - {% endfor %} - ##### add caller ##### - {% set tmp = get_params.append("CALLER=G0") %} ;hack to append list objects outside of a loop - ##### add force ##### - {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop - ##### end of definition ##### - {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} - _MAG_PROBE ACTION=GET_STATUS RESPOND=0 - {% endif %} - _Z_MOVE_CHECK {get_params|join(" ")} - -## TODO -## G1 -# If your probe needs a Z move for attach/detach use either -# G1 .... FORCE -# [gcode_macro G1] -# description: Move gcode that prevents moves lower than the limit when probe attached -# rename_existing: G1.1 -# gcode: -# ##### set manual override ##### -# {% if 'FORCE' in params|upper %} -# {% set force = 1 %} -# {% else %} -# {% set force = 0 %} -# {% endif %} -# ##### get params ##### -# {% set get_params = [] %} -# {% for key in params %} -# {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter -# {% set get_params = get_params.append(key + "=" + params[key]) %} -# {% endif %} -# {% endfor %} -# ##### add caller ##### -# {% set tmp = get_params.append("CALLER=G1") %} ;hack to append list objects outside of a loop -# ##### add force ##### -# {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop -# ##### end of definition ##### -# {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} -# _MAG_PROBE ACTION=GET_STATUS RESPOND=0 -# {% endif %} -# _Z_MOVE_CHECK {get_params|join(" ")} - - -## QUAD_GANTRY_LEVEL -[gcode_macro QUAD_GANTRY_LEVEL] -description: Level a flying gantry to a stationary bed -rename_existing: _QUAD_GANTRY_LEVEL -gcode: - ##### get user defines ##### - {% set park_pos = printer['gcode_macro _USER_VARIABLE'].park_bed %} - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|float %} - ##### get toolhead position ##### - {% set act_z = printer.toolhead.position.z|float %} - ##### set default ##### - {% set park = params.PARK|default('true') %} - ##### end of definitions ##### - # home all axes if not already - {% if "xyz" not in printer.toolhead.homed_axes %} - _CG28 - {% endif %} - SAVE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL - _SET_ACC VAL=HOME - _SET_CURRENT VAL=HOME - _CG28 RESET_SETTINGS=false - {% if act_z < z_hop %} - G1 Z{z_hop} F900 ; move head up to insure Probe is not triggered in error case - {% endif %} - ATTACH_PROBE - _QUAD_GANTRY_LEVEL - {% if params.CALIBRATE|default('false') == 'true' %} - CALIBRATE_Z RESET_SETTINGS=false - {% else %} - DETACH_PROBE - {% endif %} - #G28 Z - {% if params.RESET_SETTINGS|default('true') == 'true' %} - _SET_CURRENT - _SET_ACC - {% endif %} - {% if park|lower == 'true' %} - G90 - G0 Z{park_pos[2]} F1800 ; move nozzle to z high first - G0 X{park_pos[0]} Y{park_pos[1]} F18000 ; home to get toolhead in the middle - {% endif %} - RESTORE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL - - diff --git a/macros/print.cfg b/macros/print.cfg index b5680de..9c8c373 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -22,9 +22,10 @@ gcode: {% set x0=250 %} {% set x1=200 %} - {% set y0=308 %} + {% set y0=printer.toolhead.axis_maximum.y %} {% set z0=1.0 %} - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} + # {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} + {% set z_hop = 10 %} {% if "xyz" in printer.toolhead.homed_axes %} G0 Z{z_hop} F1000 # move Z to travel height G0 X{x0} Y{y0} F6000 # move to x0/y0 @@ -99,9 +100,9 @@ gcode: {% if z_safe > z_max %} {% set z_safe = z_max %} {% endif %} - G91 + G91 # use relative coordinates G0 Z{z_safe} F1200 - G90 + G90 # use absolute coordinates G0 X{x_park} Y{y_park} F6000 {% else %} M118 printer not homed @@ -126,12 +127,12 @@ gcode: {% if printer.extruder.can_extrude %} G1 E-1.0 F1500.0 {% endif %} - G90 + G90 # use absolute coordinates SAVE_GCODE_STATE NAME=PAUSE_state _PAUSE_BASE - G91 + G91 # use relative coordinates G1 Z{z_safe} F900 - G90 + G90 # use absolute coordinates G0 X{x_park} Y{y_park} F6000 {% else %} M117 already paused @@ -155,7 +156,7 @@ gcode: M118 CONFIGURING SET_GCODE_OFFSET Z=0.0 # reset z offset M140 S{BED} # start bed heating to bed - M104 S{EXTRUDER} # start extruder heating + # M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder G21 # set units to millimeters G90 # use absolute coordinates @@ -180,14 +181,9 @@ gcode: M118 BED MESH LOAD {SHEET} BED_MESH_PROFILE LOAD={SHEET} {% endif %} - # CALIBRATE_Z - M117 CALIBRATE_Z - M118 CALIBRATE_Z - # G28 Z # irrelevant? - BRUSHIE - CALIBRATE_Z - G92 E0 # reset extruder + G92 E0 # reset extruder + G90 # use absolute coordinates NOTIFY_BED BED={BED} M190 S{BED} # set and wait for actual bed temperature M109 S{EXTRUDER} # set and wait for extruder temperature @@ -230,7 +226,8 @@ gcode: {% set x1=params.x1|default(200) %} {% set y0=params.y0|default(2) %} {% set y1=params.y1|default(3) %} - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} + # {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} + {% set z_hop = 10 %} M118 purge nozzle G0 Z{z_hop} F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 @@ -239,7 +236,7 @@ gcode: G0 Y{y1} # move to y1 G0 X{x0} E10 # draw fine line G0 X{x0-10} # move a little further - G0 E-5 # retract filament + # G0 E-5 # retract filament G0 Z{z_hop} F300 # move Z to travel height diff --git a/macros/probe.cfg b/macros/probe.cfg deleted file mode 100644 index 8fd6b41..0000000 --- a/macros/probe.cfg +++ /dev/null @@ -1,440 +0,0 @@ -##################################################################### -# Macros for mag probe -# - ATTACH_PROBE -# - DETACH_PROBE -# - GET_PROBE_STATUS -# - QUERY_PROBE -# - PROBE -# - PROBE_ABORT -# - PROBE_ACCURACY -# - PROBE_ACCEPT -# - PROBE_CALIBRATE -# - SET_PROBE_STATUS -# - _ATTACH_PROBE -# - _DOCK_PROBE -# - _MAG_PROBE -# - _PROBE_ACTION -# - _Z_MOVE_CHECK -##################################################################### - - -## ATTACH_PROBE -[gcode_macro ATTACH_PROBE] -description: Attaching the MagProbe if not already attached -gcode: - _MAG_PROBE ACTION=ATTACH - _MAG_PROBE ACTION=CHECK_ATTACH - - -## DETACH_PROBE -[gcode_macro DETACH_PROBE] -description: Dock the MagProbe if not already docked -gcode: - _MAG_PROBE ACTION=DOCK - _MAG_PROBE ACTION=CHECK_DOCK - - -## GET_PROBE_STATUS -[gcode_macro GET_PROBE_STATUS] -description: Prints the current MagProbe state, valid probe states are UNKNOWN, ATTACHED and DOCKED -gcode: - _MAG_PROBE ACTION=GET_STATUS RESPOND=1 - - -## QUERY_PROBE -[gcode_macro QUERY_PROBE] -description: Return the status of the z-probe and store ID -rename_existing: _QUERY_PROBE_BASE -variable_id: 0 -gcode: - {% set id = params.ID|default(0) %} ; call id 0 means invalid - _QUERY_PROBE_BASE - SET_GCODE_VARIABLE MACRO=QUERY_PROBE VARIABLE=id VALUE={id} - - -## PROBE -[gcode_macro PROBE] -description: Probe Z-height at current XY position and dock/undock MagProbe -rename_existing: _PROBE_BASE -gcode: - ##### get new parameter. ##### - {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking - ##### get user defines ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - # as we need to return to the position with the probe we need to be at least at z_min - G90 ; absolute positioning - {% if act_z < z_min %} - {action_respond_info("PROBE: High must be above %.2f" % z_min)} - G1 Z{z_min} F900 ; move head up - {% endif %} - M400 ; get the buffer cleared first - SAVE_GCODE_STATE NAME=STATE_PROBE - ATTACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} - {% if printer.toolhead.position.y|float > 270 %} - G0 Y270 - {% endif %} - _PROBE_BASE {get_params|join(" ")} - G1 Z{z_min} F900 ; move head up to remove trigger - {% if dock == 1 %} - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} - {% endif %} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - - -## PROBE_ABORT -[gcode_macro PROBE_ABORT] -description: Abort manual Z probing tool for Probe and dock MagProbe -variable_caller: 'unknown' -variable_absolute_coordinates: False -gcode: - ##### get user defines ##### - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### end of definitions ##### - {% if caller|lower|string == 'calib' %} - ABORT - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' - {% else %} - {action_respond_info("PROBE_ABORT: Executed while PROBE_CALIBRATE is not running")} - {% endif %} - - -## PROBE_ACCURACY -[gcode_macro PROBE_ACCURACY] -description: Probe Z-height accuracy at current XY position and dock/undock MagProbe -rename_existing: _PROBE_ACCURACY_BASE -gcode: - ##### get new parameter. ##### - {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking - ##### get user defines ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - # as we need to return to the position with the probe we need to be at least at z_min - G90 ; absolute positioning - {% if act_z < z_min %} - {action_respond_info("PROBE_ACCURACY: High must be above %.2f" % z_min)} - G1 Z{z_min} F900 ; move head up - {% endif %} - M400 ; get the buffer cleared first - SAVE_GCODE_STATE NAME=STATE_PROBE_ACCURACY - ATTACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} - _PROBE_ACCURACY_BASE {get_params|join(" ")} - {% if dock == 1 %} - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} - {% endif %} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - - -## PROBE_ACCEPT -[gcode_macro PROBE_ACCEPT] -description: Accept the current Z position for Probe and dock MagProbe -gcode: - ##### get variables from ABORT ##### - {% set caller = printer['gcode_macro PROBE_ABORT'].caller %} - {% set absolute_coordinates = printer['gcode_macro PROBE_ABORT'].absolute_coordinates %} - ##### get user defines ##### - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### end of definitions ##### - {% if caller|lower|string == 'calib' %} - ACCEPT - DETACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} - {% if absolute_coordinates == 'false' %} G91 {% endif %} - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' - {% else %} - {action_respond_info("PROBE_ACCEPT: Executed while PROBE_CALIBRATE is not running")} - {% endif %} - - - - -## PROBE_CALIBRATE -[gcode_macro PROBE_CALIBRATE] -description: Calibrate the probes z_offset and undock MagProbe -rename_existing: _PROBE_CALIBRATE_BASE -gcode: - ##### get user defines ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% set get_params = get_params.append(key + "=" + params[key]) %} - {% endfor %} - ##### end of definitions ##### - # as we need to return to the position with the probe we need to be at least at z_min - G90 ; absolute positioning - {% if act_z < z_min %} - {action_respond_info("PROBE_CALIBRATE: High must be above %.2f" % z_min)} - G1 Z{z_min} F900 ; move head up - {% endif %} - M400 ; get the buffer cleared first - SAVE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE - ATTACH_PROBE - RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"calib"' - SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=absolute_coordinates VALUE='"{absolute_coordinates}"' - _PROBE_CALIBRATE_BASE {get_params|join(" ")} - - -## SET_PROBE_STATUS -[gcode_macro SET_PROBE_STATUS] -description: Manually specify MagProbe status, valid probe states are UNKNOWN, ATTACHED and DOCKED -variable_state: 'unknown' -gcode: - {% if 'STATE' in params|upper and - (params.STATE|lower == 'unknown' or params.STATE|lower == 'attached' or params.STATE|lower == 'docked') %} - SET_GCODE_VARIABLE MACRO=SET_PROBE_STATUS VARIABLE=state VALUE='"{params.STATE|lower}"' - SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=state VALUE='"{params.STATE|lower}"' - {% else %} - {% set state = params.STATE|default('none') %} - {action_raise_error("Invalid probe state: %s. Valid probe states are [UNKNOWN, ATTACHED, DOCKED]" % state|upper)} - {% endif %} - - -## _ATTACH_PROBE -[gcode_macro _ATTACH_PROBE] -description: Helper: Attach MagProbe -gcode: - ##### Get user defines ##### - {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} - {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} - {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} - {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} - {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} - {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} - ##### get toolhead position ##### - {% set act_z = printer.toolhead.position.z|float %} - ##### end of definitions ##### - SAVE_GCODE_STATE NAME=STATE_ATTACH_PROBE - SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored - G90 ; absolute positioning - {% if act_z < z_min %} - G0 Z{z_min} F1500 ; move head up - {% endif %} - - ##### gantry dock: - G0 X{undock_x} Y{undock_y} F{t_speed} ; move next to mag-probe - G0 X{dock_x} F{d_speed} ; move sideways to attach probe - G0 Y{dock_y} F{d_speed} ; move out of holder - - RESTORE_GCODE_STATE NAME=STATE_ATTACH_PROBE - - -## _DOCK_PROBE -[gcode_macro _DOCK_PROBE] -description: Helper: Dock MagProbe -gcode: - ##### Get user defines ##### - {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} - {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} - {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} - {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} - {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} - {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} - {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} - ##### get toolhead position ##### - {% set act_z = printer.toolhead.position.z|float %} - ##### end of definitions ##### - SAVE_GCODE_STATE NAME=STATE_DOCK_PROBE - SET_GCODE_OFFSET Z=0.0 ; reset offset - will be restored - G90 ; absolute positioning - {% if act_z < z_min %} - G0 Z{z_min} F900 ; move head up - {% endif %} - - ################################################################### - # !!! Caution !!! - # - # Adapt for your needs if needed !! - ################################################################### - - ##### Example for a bed dock: - #G0 X{dock_x} Y{dock_y} F{t_speed} ; move to mag-probe - #G0 Z{dock_z} F1500 FORCE ; move down to probe - #G0 Y{undock_y} F{d_speed} ; move into the holder - #G0 Z{undock_z} F1500 ; move upwards to remove probe - - ##### Example for a gantry dock: - G0 X{dock_x} Y{dock_y} F{t_speed} ; move in front of mag-probe - G0 Y{undock_y} F{d_speed} ; move into the holder - G0 X{undock_x} F{d_speed} ; move sideways to remove probe - - RESTORE_GCODE_STATE NAME=STATE_DOCK_PROBE - - -## MAG_PROBE -# QUERY_PROBE must run direct before _PROBE_ACTION -# that relation is insured by the caller id -[gcode_macro _MAG_PROBE] -description: Helper: Query MagProbe state and request action -variable_state: 'unknown' -variable_id: 0 -gcode: - ##### add RESPOND if specified ##### - {% if 'RESPOND' in params|upper %} - {% set respond = "RESPOND=" + params.RESPOND %} - {% else %} - {% set respond = "" %} - {% endif %} - ##### generate an id not equal to 0 ##### - {% if id == 0 %} - {% set id = 1 %} - {% else %} - {% set id = id + 1 %} - {% endif %} - ##### end of definition ##### - QUERY_PROBE ID={id} - _PROBE_ACTION ACTION={params.ACTION} ID={id} {respond} - SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=id VALUE={id} - M400 - - -## _PROBE_ACTION -[gcode_macro _PROBE_ACTION] -description: Helper: Perform MagProbe action -gcode: - ##### get params and defaults ##### - {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_probe_action|default(1)|int %} - {% set respond = params.RESPOND|default(default_respond)|int %} - {% set action = params.ACTION|lower %} - {% set id = params.ID|default(0)|int %} ; call id 0 means invalid - ##### get probe variables ##### - {% set probe_id = printer['gcode_macro QUERY_PROBE'].id|default(0)|int %} - {% set man_state = printer['gcode_macro SET_PROBE_STATUS'].state|lower %} - ##### generate state ##### - {% if man_state != 'unknown' %} - SET_GCODE_VARIABLE MACRO=SET_PROBE_STATUS VARIABLE=state VALUE='"unknown"' - {% set state = man_state %} - {% if respond == 1 %} - {action_respond_info("MagProbe: State was set to %s by SET_PROBE_STATUS"% man_state|upper)} - {% endif %} - {% elif id == 0 or id != probe_id %} - {action_raise_error("MagProbe: Call ID invalid or does not match QUERY_PROBE call ID")} - {% elif printer.probe.last_query|lower == 'false' %} - {action_raise_error("MagProbe: Please execute QUERY_PROBE first")} - {% else %} - {% if printer.probe.last_query|int == 0 %} - {% set state = 'attached' %} - {% else %} - {% set state = 'docked' %} - {% endif %} - {% endif %} - ##### end of defines ##### - SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=state VALUE='"{state}"' - {% if action == 'attach' %} - {% if state == 'docked' %} - {% if respond == 1 %} - {action_respond_info("MagProbe: Attach Probe")} - {% endif %} - _ATTACH_PROBE - {% else %} - {% if respond == 1 %} - {action_respond_info("MagProbe: already attached")} - {% endif %} - {% endif %} - {% elif action == 'dock' %} - {% if state == 'attached' %} - {% if respond == 1 %} - {action_respond_info("MagProbe: Dock Probe")} - {% endif %} - _DOCK_PROBE - {% else %} - {% if respond == 1 %} - {action_respond_info("MagProbe: already docked")} - {% endif %} - {% endif %} - {% elif action == 'check_dock' %} - {% if state != 'docked' %} - {action_raise_error("MagProbe: dock failed!")} - {% endif %} - {% elif action == 'check_attach' %} - {% if state != 'attached' %} - {action_raise_error("MagProbe: attach failed!")} - {% endif %} - {% elif action == 'get_status' %} - {% if respond == 1 %} - {action_respond_info("MagProbe Status: %s" % state)} - {% endif %} - {% else %} - {action_raise_error("MagProbe: action not defined")} - {% endif %} - - -## _Z_MOVE_CHECK -[gcode_macro _Z_MOVE_CHECK] -description: Helper: Check limit and perform move -gcode: - ##### define defaults ###### - {% set caller = params.CALLER|default('G0')|upper %} - {% set force = params.FORCE|default(0)|int %} - ##### z values ##### - {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - {% set z_act = printer.toolhead.position.z|float %} - ##### MagProbe state ##### - {% set probe_state = printer['gcode_macro _MAG_PROBE'].state|lower %} - ##### get params and prepare to send them to the base macro ##### - {% set get_params = [] %} - {% for key in params %} - {% if key is not in ['Z', 'CALLER', 'FORCE'] %} - {% set get_params = get_params.append(key + params[key]) %} - {% elif key is in ['Z'] %} - {% if force == 1 %} ;manual override of probe check - {% set get_params = get_params.append(key + params[key]) %} - {% elif probe_state == 'unknown' %} - {action_raise_error("%s: MagProbe state %s run \"_MAG_PROBE ACTION=GET_STATUS\"" % (caller, probe_state|upper))} - {% elif probe_state == 'docked' %} - {% set get_params = get_params.append(key + params[key]) %} - {% elif probe_state == 'attached' %} - ##### define move target position depending on absolute_coordinates ##### - {% if printer.gcode_move.absolute_coordinates|lower == 'true' %} - {% set z_target = params.Z|float %} - {% else %} - {% set z_target = z_act + params.Z|float %} - {% endif %} - ##### decide if a Z move can be executed ##### - {% if z_target > z_min or z_act < z_target %} - {% set get_params = get_params.append(key + params[key]) %} - {% else %} - {action_respond_info("%s: Z Moves lower than %.1fmm not allowed with installed probe" % (caller,z_min))} - {% endif %} - {% else %} - {action_raise_error("%s: MagProbe state %s not valid" % (caller, probe_state|upper))} - {% endif %} - {% endif %} - {% endfor %} - ##### end of definitions ##### - {caller}.1 {get_params|join(" ")} diff --git a/macros/z_calibration.cfg b/macros/z_calibration.cfg deleted file mode 100644 index 874e732..0000000 --- a/macros/z_calibration.cfg +++ /dev/null @@ -1,121 +0,0 @@ -##################################################################### -# Macros for z-calibration -# - CALIBRATE_Z -# - _CG28 -# - _SET_CURRENT -# - _SET_ACC -##################################################################### - - -## CALIBRATE_Z -[gcode_macro CALIBRATE_Z] -description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe -rename_existing: _CALIBRATE_Z_BASE -gcode: - ##### get user defines ##### - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} - ##### get toolhead parameters ##### - {% set act_z = printer.gcode_move.gcode_position.z|float %} - #### end of definitions ##### - ## reduce current of motors - _SET_ACC VAL=HOME - _SET_CURRENT VAL=HOME - _CG28 RESET_SETTINGS=false - {% if act_z < z_hop %} - G90 ; absolute positioning - {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} - G1 Z{z_hop} F900 ; move head up - {% endif %} - {% if printer.quad_gantry_level.applied|lower == 'false' %} - QUAD_GANTRY_LEVEL PARK=false - {% endif %} - #ATTACH_PROBE ; if not using start_gcode - _CALIBRATE_Z_BASE - #DETACH_PROBE ; if not using end_gcode - {% if params.RESET_SETTINGS|default('true') == 'true' %} - ## return to org current settings - _SET_CURRENT - _SET_ACC - {% endif %} - - -## _CG28 -[gcode_macro _CG28] -description: conditional home -gcode: - {% if "xyz" not in printer.toolhead.homed_axes %} - G28 RESET_SETTINGS={ params.RESET_SETTINGS|default('true') } - {% endif %} - -## _SET_ACC -[gcode_macro _SET_ACC] -description: Helper: Set accel and accel_to_decel value -variable_last_val: 'CONFIG' -gcode: - ##### set default value ##### - {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_acc|int %} - {% set val = params.VAL|default('CONFIG') %} - {% set respond = params.RESPOND|default(default_respond)|int %} - {% if val == 'HOME' %} - {% set accel = printer['gcode_macro _USER_VARIABLE'].home_accel %} - {% set accel_to_decel = printer['gcode_macro _USER_VARIABLE'].home_accel|int / 2 %} - {% else %} - {% set accel = printer.configfile.settings.printer.max_accel %} - {% set accel_to_decel = printer.configfile.settings.printer.max_accel_to_decel %} - {% endif %} - ##### end of definition ##### - {% if val != last_val %} - SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{val}"' - {% if respond == 1 %} - {action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))} - {% endif %} - SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel} RESPOND=0 - {% endif %} - - -## _SET_CURRENT -[gcode_macro _SET_CURRENT] -description: Helper: Set Z-drive motor current -variable_last_val: 'CONFIG' -gcode: - ###### set default values ##### - {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_current|int %} - {% set val = params.VAL|default('CONFIG') %} - {% set respond = params.Z_RESPOND|default(default_respond)|int %} - {% if val == 'HOME' %} - {% set xy_run = printer['gcode_macro _USER_VARIABLE'].xy_home_current %} - {% set xy_hold = printer['gcode_macro _USER_VARIABLE'].xy_home_current %} - {% set z_run = printer['gcode_macro _USER_VARIABLE'].z_home_current %} - {% set z_hold = printer['gcode_macro _USER_VARIABLE'].z_home_current %} - {% else %} - ## XY - {% if 'tmc2209 stepper_x' in printer.configfile.settings %} - {% set xy_run = printer.configfile.settings['tmc2209 stepper_x'].run_current %} - {% set xy_hold = printer.configfile.settings['tmc2209 stepper_x'].hold_current %} - {% elif 'tmc5160 stepper_x' in printer.configfile.settings %} - {% set xy_run = printer.configfile.settings['tmc5160 stepper_x'].run_current %} - {% set xy_hold = printer.configfile.settings['tmc5160 stepper_x'].hold_current %} - {% endif %} - ## Z - {% if 'tmc2209 stepper_z' in printer.configfile.settings %} - {% set z_run = printer.configfile.settings['tmc2209 stepper_z'].run_current %} - {% set z_hold = printer.configfile.settings['tmc2209 stepper_z'].hold_current %} - {% elif 'tmc5160 stepper_z' in printer.configfile.settings %} - {% set z_run = printer.configfile.settings['tmc5160 stepper_z'].run_current %} - {% set z_hold = printer.configfile.settings['tmc5160 stepper_z'].hold_current %} - {% endif %} - {% endif %} - ##### end of definition ##### - {% if val != last_val %} - SET_GCODE_VARIABLE MACRO=_SET_CURRENT VARIABLE=last_val VALUE='"{val}"' - {% if respond == 1 %} - {action_respond_info("Home&Probe: RunCur %.2fA rms HoldCur %.2fA rms" % (z_run|float, z_hold|float))} - {% endif %} - SET_TMC_CURRENT STEPPER=stepper_x CURRENT={xy_run} HOLDCURRENT={xy_hold} - SET_TMC_CURRENT STEPPER=stepper_y CURRENT={xy_run} HOLDCURRENT={xy_hold} - SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} - SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} - M400 - {% endif %} diff --git a/printer.cfg b/printer.cfg index 2f2cfbe..2b75a52 100644 --- a/printer.cfg +++ b/printer.cfg @@ -63,7 +63,6 @@ path: /home/pi/gcode_files [include fans.cfg] [include input_shaper.cfg] # [include resonance_test.cfg] -[include z_calibration.cfg] [include ercf/hardware.cfg] [include ercf/software.cfg] @@ -108,8 +107,8 @@ microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 -position_endstop: 306 -position_max: 308 +position_endstop: 303 +position_max: 305 homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -137,15 +136,13 @@ enable_pin: !PG5 rotation_distance: 40 gear_ratio: 80:16 microsteps: 32 -endstop_pin: PG10 -## actual_position = measured_position_endstop - position_endstop -position_endstop: 0 +endstop_pin: probe:z_virtual_endstop position_max: 290 -position_min: -1 -homing_speed: 8.0 # speed: mm/sec, feedrate: mm/min +position_min: -2 +homing_speed: 5.0 # speed: mm/sec, feedrate: mm/min homing_retract_speed: 10 second_homing_speed: 2 -homing_retract_dist: 3 +homing_retract_dist: 5 [tmc2209 stepper_z] uart_pin: PC6 @@ -312,13 +309,9 @@ max_temp: 100 [idle_timeout] timeout: 1800 -## replaced with homing_override in klicky-probe.cfg -# [safe_z_home] -# ## XY Location of the Z Endstop Switch -# home_xy_position: 94, 306 -# speed: 100 -# z_hop: 10 -# z_hop_speed: 25 +[safe_z_home] +home_xy_position: 150, 150 +z_hop: 10 ##################################################################### @@ -326,19 +319,36 @@ timeout: 1800 ##################################################################### [probe] -## Microswitch probe +## Voron-Tap pin: ^PG11 x_offset: 0 -y_offset: 30 -z_offset: 12 +y_offset: 0 +#z_offset: 0 speed: 5.0 -lift_speed: 20 +lift_speed: 10 samples: 3 samples_result: median -sample_retract_dist: 2 +sample_retract_dist: 3 samples_tolerance: 0.01 samples_tolerance_retries: 5 +activate_gcode: + {% set PROBE_TEMP = 150 %} + {% set MAX_TEMP = PROBE_TEMP + 5 %} + {% set ACTUAL_TEMP = printer.extruder.temperature %} + {% set TARGET_TEMP = printer.extruder.target %} + + {% if TARGET_TEMP > PROBE_TEMP %} + { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) } + M109 S{ PROBE_TEMP } + {% else %} + # Temperature target is already low enough, but nozzle may still be too hot. + {% if ACTUAL_TEMP > MAX_TEMP %} + { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) } + TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP } + {% endif %} + {% endif %} + [bed_mesh] speed: 500 @@ -395,15 +405,15 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# 0.063750, 0.050000, 0.041250, 0.030000, 0.022500, 0.021250, 0.011250, 0.011250, -0.003750 -#*# 0.060000, 0.036250, 0.038750, 0.022500, -0.002500, 0.005000, -0.012500, -0.006250, -0.026250 -#*# 0.052500, 0.027500, 0.028750, 0.023750, -0.001250, -0.010000, -0.022500, -0.028750, -0.045000 -#*# 0.031250, 0.007500, 0.001250, -0.006250, -0.003750, -0.002500, -0.028750, -0.041250, -0.061250 -#*# 0.033750, 0.015000, 0.001250, 0.023750, 0.000000, -0.005000, -0.038750, -0.041250, -0.071250 -#*# 0.030000, 0.020000, -0.000000, -0.011250, -0.020000, -0.016250, -0.028750, -0.040000, -0.071250 -#*# 0.012500, 0.003750, -0.011250, -0.017500, -0.023750, -0.032500, -0.045000, -0.052500, -0.086250 -#*# 0.030000, 0.022500, 0.001250, -0.006250, -0.012500, -0.015000, -0.023750, -0.035000, -0.056250 -#*# 0.053750, 0.038750, 0.057500, 0.008750, 0.002500, -0.002500, -0.007500, -0.012500, -0.033750 +#*# -0.010000, -0.012500, -0.016250, -0.006250, -0.013750, 0.018750, -0.003750, 0.008750, 0.005000 +#*# -0.010000, -0.016250, -0.012500, -0.010000, -0.028750, -0.013750, -0.017500, 0.000000, -0.007500 +#*# -0.026250, -0.031250, -0.018750, -0.013750, -0.001250, -0.005000, -0.008750, 0.008750, 0.005000 +#*# -0.007500, -0.025000, -0.013750, -0.008750, -0.002500, 0.000000, -0.010000, -0.002500, -0.006250 +#*# -0.010000, 0.000000, -0.005000, 0.002500, 0.000000, 0.028750, -0.001250, 0.010000, 0.020000 +#*# -0.027500, -0.026250, -0.032500, -0.022500, -0.028750, -0.016250, -0.015000, -0.018750, -0.028750 +#*# -0.021250, -0.011250, -0.011250, -0.015000, -0.016250, -0.006250, -0.012500, -0.008750, -0.002500 +#*# -0.005000, -0.002500, -0.007500, -0.007500, 0.006250, 0.007500, -0.003750, 0.010000, -0.008750 +#*# -0.002500, 0.027500, 0.053750, 0.021250, 0.016250, 0.038750, 0.021250, 0.012500, -0.011250 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic @@ -414,3 +424,6 @@ max_adjust: 10 #*# max_y = 290.0 #*# mesh_x_pps = 2 #*# max_x = 260.0 +#*# +#*# [probe] +#*# z_offset = -0.710 diff --git a/z_calibration.cfg b/z_calibration.cfg deleted file mode 100644 index 39abef9..0000000 --- a/z_calibration.cfg +++ /dev/null @@ -1,164 +0,0 @@ -##################################################################### -# User Variables -##################################################################### -[gcode_macro _USER_VARIABLE] -description: Helper: Contains User defined printer variables -##### Homing and general movement ##### -variable_z_endstop_x: 94 ; z Endstop x position inside right profile -variable_z_endstop_y: 306 ; z Endstop y position -variable_z_hop: 12 ; z hop for moves e.g homing -variable_xy_home_current: 0.6 ; reduced homing current for x and y -variable_z_home_current: 0.5 ; reduced homing current for z -variable_home_accel: 1000 ; reduced ACCEL for homing -##### Mag Probe ##### -variable_probe_dock_x: 53 ; x toolhead position before docking probe -variable_probe_dock_y: 246 ; y toolhead position before docking probe -variable_probe_dock_z: 12 ; z toolhead position before docking probe (only for bed dock) -variable_probe_undock_x: 103 ; x toolhead position after docking probe -variable_probe_undock_y: 305 ; y toolhead position after docking probe -variable_probe_undock_z: 12 ; z toolhead position after docking probe (only for bed dock) -variable_probe_z_min: 12 ; z minimum height to avoid crash -variable_probe_travel_speed: 100 ; dock moves travel speed -variable_probe_dock_speed: 100 ; dock speed for attach/dock -##### Respond defaults ##### -variable_respond_set_current: 0 ; default of RESPOND if not set in the call -variable_respond_set_acc: 0 ; default of RESPOND if not set in the call -variable_respond_probe_action: 1 ; default of RESPOND if not set in the call -##### Park Position ##### -variable_park_bed: [280,280,30] ; different park position -gcode: - - -##################################################################### -# Z Calibration -##################################################################### -[z_calibration] -# The X and Y coordinates (in mm) for clicking the nozzle on the -# Z endstop. -probe_nozzle_x: 94 -probe_nozzle_y: 307 -# The X and Y coordinates (in mm) for clicking the probe's switch -# on the Z endstop. -probe_switch_x: 90 -probe_switch_y: 283 -# The X and Y coordinates (in mm) for probing on the print surface -# (e.g. the center point) These coordinates will be adapted by the -# probe's X and Y offsets. The default is the relative_reference_index -# of the configured bed_mesh. It will raise an error if there is no -# probe_bed site and no bed_mesh with a relative_reference_index -# configured. -probe_bed_x: 150 -probe_bed_y: 150 -# The trigger point offset of the used mag-probe switch. -# This needs to be fined out manually. More on this later -# in this section. smaller switch_offset -> more distance to the build plate -switch_offset: 0.59 -# The maximum allowed deviation of the calculated offset. -# If the offset exceeds this value, it will stop! -# The default is 1.0 mm. -max_deviation: 1.0 -# The number of times to probe each point. The probed z-values -# will be averaged. The default is from the probe's configuration. -#samples: default from "probe:samples" section -# The maximum Z distance (in mm) that a sample may differ from other -# samples. The default is from the probe's configuration. -#samples_tolerance: default from "probe:samples_tolerance" section -# The number of times to retry if a sample is found that exceeds -# samples_tolerance. The default is from the probe's configuration. -#samples_tolerance_retries: default from "probe:samples_tolerance_retries" section -# The calculation method when sampling more than once - either -# "median" or "average". The default is from the probe's configuration. -#samples_result: default from "probe:samples_result" section -# The distance in mm to move up before moving to the next -# position. The default is two times the z_offset from the probe's -# configuration. -#position_min: default from "stepper_z:position_min" section. -# Extra clearance when moving -clearance: 10 -# The moving speed in X and Y. The default is 50 mm/s. -speed: 100 -# Speed (in mm/s) of the Z axis when lifting the probe between -# samples and clearance moves. The default is from the probe's -# configuration. -#lift_speed: default from "probe:lift_speed" section -# The fast probing speed (in mm/s) used, when probing_first_fast -# is activated. The default is from the Z rail configuration. -#probing_speed: default from "stepper_z:homing_speed" section. -# The slower speed (in mm/s) for probing the recorded samples. -# The default is second_homing_speed of the Z rail configuration. -#probing_second_speed: default from "stepper_z:second_homing_speed" section. -# Distance to back off (in mm) before probing the next sample. -# The default is homing_retract_dist from the Z rail configuration. -#probing_retract_dist: default from "stepper_z:homing_retract_dist" section. -# If true, the first probing is done faster by the probing speed. -# This is to get faster down and the result is not recorded as a -# probing sample. The default is false. -probing_first_fast: true -# A list of G-Code commands to execute prior to each calibration command. -# See docs/Command_Templates.md for G-Code format. -# This can be used to attach the probe. -start_gcode: ATTACH_PROBE -# A list of G-Code commands to execute prior to each probing on the -# mag-probe. See docs/Command_Templates.md for G-Code format. -# This can be used to attach the probe after probing on the nozzle and -# before probing on the mag-probe. -before_switch_gcode: ATTACH_PROBE -# A list of G-Code commands to execute after each calibration command. -# See docs/Command_Templates.md for G-Code format. This can be used to -# detach the probe afterwards. -end_gcode: DETACH_PROBE - - -##################################################################### -# Homing definition -##################################################################### -[homing_override] -axes: z -set_position_z: 0 -gcode: - ##### get user defines ##### - # use -10 as default to insure it error in case the variable is not existing - {% set z_endstop_x = printer['gcode_macro _USER_VARIABLE'].z_endstop_x|default(-10) %} - {% set z_endstop_y = printer['gcode_macro _USER_VARIABLE'].z_endstop_y|default(-10) %} - {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop %} - ##### end of definitions ##### - SAVE_GCODE_STATE NAME=HOMING_state - - ## reduce current of Z motors - _SET_ACC VAL=HOME - _SET_CURRENT VAL=HOME - - G91 ; relative positioning - G0 Z10 F1500 ; move z 10 up - G90 ; absolute positioning - - # Home X and Y only for G28 or G28 XYZ - {% if 'Z' in params %} - {% if "x" not in printer.toolhead.homed_axes %} - G28 X - {% endif %} - {% if "y" not in printer.toolhead.homed_axes %} - G28 Y - {% endif %} - {% else %} - G28 X Y - {% endif %} - - ## XY Location of the Z Endstop Switch - G0 X{z_endstop_x} Y{z_endstop_y} F6000 - G28 Z ; home Z - G0 Z3 F1500 ; move up - - ## return to org current settings - {% if params.RESET_SETTINGS|default('true') == 'true' %} - DETACH_PROBE - _SET_CURRENT - _SET_ACC - {% endif %} - - # Lift Z - # TODO check speed - # G0 Z{z_hop} F1800 - G0 Z{z_hop} F1300 - - RESTORE_GCODE_STATE NAME=HOMING_state From 991c3266e1a0459adc640d6f21b0c2418e8ffc78 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 22 Jan 2023 13:53:06 +0100 Subject: [PATCH 117/131] ercf: update calibration --- ercf/software.cfg | 2 +- ercf/vars.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index 2a571bc..42bb38e 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -37,7 +37,7 @@ variable_end_of_bowden_to_sensor: 40 # xk # Galileo Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 60.5 # LGX on AfterBurner with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 55.6 # AfterBurner Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 54.0 -variable_sensor_to_nozzle: 54 # xk +variable_sensor_to_nozzle: 60 # xk # # ==== Values to tune ==== # diff --git a/ercf/vars.cfg b/ercf/vars.cfg index 674b332..cc21fda 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -11,5 +11,5 @@ ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 796.22152 +ercf_calib_ref = 774.629072 From 8e18789e1c3047db0220382d94325d82002a3591 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 22 Jan 2023 13:53:32 +0100 Subject: [PATCH 118/131] printer: update --- macros/print.cfg | 54 ++++++++++++++++++++++-------------------------- printer.cfg | 34 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 46 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index 9c8c373..dbbc51c 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -23,7 +23,7 @@ gcode: {% set x0=250 %} {% set x1=200 %} {% set y0=printer.toolhead.axis_maximum.y %} - {% set z0=1.0 %} + {% set z0=2.5 %} # {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% set z_hop = 10 %} {% if "xyz" in printer.toolhead.homed_axes %} @@ -85,25 +85,23 @@ gcode: [gcode_macro PARK] gcode: {% set Y=params.Y|default(295) %} + {% set X=params.X|default(295) %} + {% set Z=params.Z|default(-1) %} {% if "xyz" in printer.toolhead.homed_axes %} - # set park positon for x and y - ## close to max - {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} - {% if Y != y_park %} - {% set y_park = Y %} - {% endif %} # calculate save lift position {% set z_max = printer.toolhead.axis_maximum.z|float %} {% set z_act = printer.toolhead.position.z|float %} - {% set z_safe = z_act + 10 %} + {% set z_safe = z_act + 5 %} {% if z_safe > z_max %} {% set z_safe = z_max %} {% endif %} + {% if Z != - 1 %} + {% set z_safe = Z %} + {% endif %} G91 # use relative coordinates G0 Z{z_safe} F1200 G90 # use absolute coordinates - G0 X{x_park} Y{y_park} F6000 + G0 X{X} Y{Y} F6000 {% else %} M118 printer not homed {% endif %} @@ -114,15 +112,6 @@ gcode: rename_existing: _PAUSE_BASE gcode: {% if printer.pause_resume.is_paused|lower == 'false' %} - {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 5.0) %} - {% set z_safe = 5.0 %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} G92 E0 {% if printer.extruder.can_extrude %} G1 E-1.0 F1500.0 @@ -130,10 +119,7 @@ gcode: G90 # use absolute coordinates SAVE_GCODE_STATE NAME=PAUSE_state _PAUSE_BASE - G91 # use relative coordinates - G1 Z{z_safe} F900 - G90 # use absolute coordinates - G0 X{x_park} Y{y_park} F6000 + PARK {% else %} M117 already paused M118 already paused @@ -145,6 +131,7 @@ gcode: gcode: {% set BED=params.BED|default(100)|int %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} + {% set QGL=params.QGL|default(1)|int %} {% set BMC=params.BMC|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} {% set PURGE=params.PURGE|default(1)|int %} @@ -167,10 +154,17 @@ gcode: M117 HOME M118 HOME G28 + BRUSHIE + G28 Z # QGL - M117 QGL - M118 QGL - QUAD_GANTRY_LEVEL PARK=false + {% if QGL %} + M117 QGL + M118 QGL + QUAD_GANTRY_LEVEL + {% else %} + M117 NO QGL + M118 NO QGL + {% endif %} # BMC {% if BMC %} M117 BED MESH CALIBRATE @@ -181,11 +175,13 @@ gcode: M118 BED MESH LOAD {SHEET} BED_MESH_PROFILE LOAD={SHEET} {% endif %} + PARK Z=10 G92 E0 # reset extruder G90 # use absolute coordinates NOTIFY_BED BED={BED} M190 S{BED} # set and wait for actual bed temperature + NOTIFY_EXTRUDER EXTRUDER={BED} M109 S{EXTRUDER} # set and wait for extruder temperature SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 @@ -196,9 +192,9 @@ gcode: ERCF_CHANGE_TOOL_SLICER TOOL={ERCF_EXTRUDER} {% endif %} BRUSHIE - {% if PURGE %} - PURGE_NOZZLE - {% endif %} + # {% if PURGE %} + # PURGE_NOZZLE + # {% endif %} M117 STARTING M118 STARTING diff --git a/printer.cfg b/printer.cfg index 2b75a52..0b3612a 100644 --- a/printer.cfg +++ b/printer.cfg @@ -107,8 +107,8 @@ microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper endstop_pin: PG9 position_min: 0 -position_endstop: 303 -position_max: 305 +position_endstop: 302.5 +position_max: 306 homing_speed: 30 # Max 100 homing_retract_dist: 5 homing_positive_dir: true @@ -138,7 +138,7 @@ gear_ratio: 80:16 microsteps: 32 endstop_pin: probe:z_virtual_endstop position_max: 290 -position_min: -2 +position_min: -3 homing_speed: 5.0 # speed: mm/sec, feedrate: mm/min homing_retract_speed: 10 second_homing_speed: 2 @@ -333,7 +333,7 @@ samples_tolerance: 0.01 samples_tolerance_retries: 5 activate_gcode: - {% set PROBE_TEMP = 150 %} + {% set PROBE_TEMP = 200 %} {% set MAX_TEMP = PROBE_TEMP + 5 %} {% set ACTUAL_TEMP = printer.extruder.temperature %} {% set TARGET_TEMP = printer.extruder.target %} @@ -352,7 +352,7 @@ activate_gcode: [bed_mesh] speed: 500 -horizontal_move_z: 12 +horizontal_move_z: 10 # 40, 40 --> 40 + probe.x_offset, 40 + probe.y_offset mesh_min: 40, 70 # 260, 260 --> 260 + probe.x_offset, 260 + probe.y_offset @@ -373,8 +373,8 @@ probe_count: 9,9 relative_reference_index: 40 [quad_gantry_level] -speed: 150 -horizontal_move_z: 12 +speed: 500 +horizontal_move_z: 10 gantry_corners: -60,-10 360,370 @@ -405,15 +405,15 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.010000, -0.012500, -0.016250, -0.006250, -0.013750, 0.018750, -0.003750, 0.008750, 0.005000 -#*# -0.010000, -0.016250, -0.012500, -0.010000, -0.028750, -0.013750, -0.017500, 0.000000, -0.007500 -#*# -0.026250, -0.031250, -0.018750, -0.013750, -0.001250, -0.005000, -0.008750, 0.008750, 0.005000 -#*# -0.007500, -0.025000, -0.013750, -0.008750, -0.002500, 0.000000, -0.010000, -0.002500, -0.006250 -#*# -0.010000, 0.000000, -0.005000, 0.002500, 0.000000, 0.028750, -0.001250, 0.010000, 0.020000 -#*# -0.027500, -0.026250, -0.032500, -0.022500, -0.028750, -0.016250, -0.015000, -0.018750, -0.028750 -#*# -0.021250, -0.011250, -0.011250, -0.015000, -0.016250, -0.006250, -0.012500, -0.008750, -0.002500 -#*# -0.005000, -0.002500, -0.007500, -0.007500, 0.006250, 0.007500, -0.003750, 0.010000, -0.008750 -#*# -0.002500, 0.027500, 0.053750, 0.021250, 0.016250, 0.038750, 0.021250, 0.012500, -0.011250 +#*# -0.010000, -0.012500, -0.016250, -0.006250, -0.013750, 0.018750, -0.003750, 0.008750, 0.005000 +#*# -0.010000, -0.016250, -0.012500, -0.010000, -0.028750, -0.013750, -0.017500, 0.000000, -0.007500 +#*# -0.026250, -0.031250, -0.018750, -0.013750, -0.001250, -0.005000, -0.008750, 0.008750, 0.005000 +#*# -0.007500, -0.025000, -0.013750, -0.008750, -0.002500, 0.000000, -0.010000, -0.002500, -0.006250 +#*# -0.010000, 0.000000, -0.005000, 0.002500, 0.000000, 0.028750, -0.001250, 0.010000, 0.020000 +#*# -0.027500, -0.026250, -0.032500, -0.022500, -0.028750, -0.016250, -0.015000, -0.018750, -0.028750 +#*# -0.021250, -0.011250, -0.011250, -0.015000, -0.016250, -0.006250, -0.012500, -0.008750, -0.002500 +#*# -0.005000, -0.002500, -0.007500, -0.007500, 0.006250, 0.007500, -0.003750, 0.010000, -0.008750 +#*# -0.002500, 0.027500, 0.053750, 0.021250, 0.016250, 0.038750, 0.021250, 0.012500, -0.011250 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic @@ -426,4 +426,4 @@ max_adjust: 10 #*# max_x = 260.0 #*# #*# [probe] -#*# z_offset = -0.710 +#*# z_offset = -0.860 From 25907719e4ebd7c9673dde0020f8e4f57190f2ef Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 22 Jan 2023 13:53:51 +0100 Subject: [PATCH 119/131] webcam: update --- webcam-multi.txt => webcam-xk.txt | 2 +- webcam.txt | 79 ------------------------------- 2 files changed, 1 insertion(+), 80 deletions(-) rename webcam-multi.txt => webcam-xk.txt (96%) delete mode 100644 webcam.txt diff --git a/webcam-multi.txt b/webcam-xk.txt similarity index 96% rename from webcam-multi.txt rename to webcam-xk.txt index 5880078..e6af7ca 100644 --- a/webcam-multi.txt +++ b/webcam-xk.txt @@ -1,7 +1,7 @@ # vim: ft=conf ### Additional options to supply to MJPG Streamer for the cameras -camera_usb=1 +camera_usb=0 camera_raspi=1 camera_usb_options="-d /dev/v4l/by-id/usb-Vimicro_Corp._HBVCAM_FHD_CAMERA-video-index0 -r 1280x960 -f 10" camera_raspi_options="-d /dev/v4l/by-path/platform-bcm2835-isp-video-index0 -x 1024 -y 768 -roi 0.0,0.0,0.998,1" diff --git a/webcam.txt b/webcam.txt deleted file mode 100644 index b42becf..0000000 --- a/webcam.txt +++ /dev/null @@ -1,79 +0,0 @@ -# vim: ft=conf - -### Configure which camera to use -# -# Available options are: -# - auto: tries first usb webcam, if that's not available tries raspi cam -# - usb: only tries usb webcam -# - raspi: only tries raspi cam -# -# Defaults to auto -# -camera="raspi" - -### Additional options to supply to MJPG Streamer for the USB camera -# -# See https://faq.octoprint.org/mjpg-streamer-config for available options -# -# Defaults to a resolution of 640x480 px and a framerate of 10 fps -# -#camera_usb_options="-r 640x480 -f 10" -camera_usb_options="-r 800x600 -f 10" - -### Additional webcam devices known to cause problems with -f -# -# Apparently there a some devices out there that with the current -# mjpg_streamer release do not support the -f parameter (for specifying -# the capturing framerate) and will just refuse to output an image if it -# is supplied. -# -# The webcam daemon will detect those devices by their USB Vendor and Product -# ID and remove the -f parameter from the options provided to mjpg_streamer. -# -# By default, this is done for the following devices: -# Logitech C170 (046d:082b) -# GEMBIRD (1908:2310) -# Genius F100 (0458:708c) -# Cubeternet GL-UPC822 UVC WebCam (1e4e:0102) -# -# Using the following option it is possible to add additional devices. If -# your webcam happens to show above symptoms, try determining your cam's -# vendor and product id via lsusb, activating the line below by removing # and -# adding it, e.g. for two broken cameras "aabb:ccdd" and "aabb:eeff" -# -# additional_brokenfps_usb_devices=("aabb:ccdd" "aabb:eeff") -# -# -#additional_brokenfps_usb_devices=() - -### Additional options to supply to MJPG Streamer for the RasPi Cam -# -# See https://faq.octoprint.org/mjpg-streamer-config for available options -# -# Defaults to 10fps -# -# camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1 -rot 180" -# camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" -# camera_raspi_options="-x 800 -y 600 -roi 0.0,0.0,0.998,1" -camera_raspi_options="-x 1024 -y 768 -roi 0.0,0.0,0.998,1" - -### Configuration of camera HTTP output -# -# Usually you should NOT need to change this at all! Only touch if you -# know what you are doing and what the parameters mean. -# -# Below settings are used in the mjpg-streamer call like this: -# -# -o "output_http.so -w $camera_http_webroot $camera_http_options" -# -# Current working directory is the mjpg-streamer base directory. -# -#camera_http_webroot="./www-fluidd" -#camera_http_options="-n" - -### EXPERIMENTAL -# Support for different streamer types. -# -# Available options: -# mjpeg [default] - stable MJPG-streamer -#camera_streamer=mjpeg From aecd049a28b02c9e57a8fceabd7bad19fe965142 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 29 Jan 2023 21:32:02 +0100 Subject: [PATCH 120/131] use kiauh, replace mjpg_streamer with crowsnest, update some paths --- crowsnest.conf | 10 ++++++++++ ercf/software.cfg | 2 +- moonraker.conf | 33 +++++++++++++++++++++------------ printer.cfg | 20 ++++++++++---------- webcam-xk.txt | 11 ----------- 5 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 crowsnest.conf delete mode 100644 webcam-xk.txt diff --git a/crowsnest.conf b/crowsnest.conf new file mode 100644 index 0000000..9d0e9e9 --- /dev/null +++ b/crowsnest.conf @@ -0,0 +1,10 @@ +[crowsnest] +log_path: ~/printer_data/logs/crowsnest.log +log_level: quiet + +[cam 1] +mode: mjpg +port: 8080 +device: /dev/video0 +resolution: 1280x960 +max_fps: 15 diff --git a/ercf/software.cfg b/ercf/software.cfg index 42bb38e..b622561 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -83,7 +83,7 @@ variable_extra_servo_dwell_down: 0 gcode: [save_variables] -filename: /home/pi/klipper_config/ercf/vars.cfg +filename: /home/pi/printer_data/config/ercf/vars.cfg ############################### # ERCF Calibration macros diff --git a/moonraker.conf b/moonraker.conf index 2b4c95e..f11790e 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -1,6 +1,7 @@ [server] host: 0.0.0.0 port: 7125 +klippy_uds_address: /home/pi/printer_data/comms/klippy.sock [authorization] force_logins: True @@ -41,11 +42,11 @@ type: web repo: fluidd-core/fluidd path: ~/fluidd -[update_manager client mainsail] -type: web -channel: beta -repo: mainsail-crew/mainsail -path: ~/mainsail +# [update_manager client mainsail] +# type: web +# channel: beta +# repo: mainsail-crew/mainsail +# path: ~/mainsail # [update_manager klipper-mcu-update] # type: git_repo @@ -60,18 +61,18 @@ env: ~/.KlipperScreen-env/bin/python requirements: scripts/KlipperScreen-requirements.txt install_script: scripts/KlipperScreen-install.sh -[update_manager client z_calibration] -type: git_repo -path: /home/pi/klipper_z_calibration -origin: https://github.com/protoloft/klipper_z_calibration.git -install_script: install.sh - [update_manager timelapse] type: git_repo primary_branch: main path: ~/moonraker-timelapse origin: https://github.com/mainsail-crew/moonraker-timelapse.git +[update_manager ercf] +type: git_repo +primary_branch: main +path: ~/EnragedRabbitProject +origin: https://github.com/EtteGit/EnragedRabbitProject.git + [power voron-v2.4] type: tplink_smartplug address: 192.168.11.91 @@ -85,6 +86,14 @@ address: 192.168.11.91 ## Directory where the generated video will be saved output_path: ~/timelapse/ ## Directory where the temporary frames are saved -#frame_path: /tmp/timelapse/ +frame_path: /tmp/timelapse/ ## Directory where ffmpeg is installed #ffmpeg_binary_path: /usr/bin/ffmpeg + +# Crowsnest update_manager entry +[update_manager crowsnest] +type: git_repo +path: ~/crowsnest +origin: https://github.com/mainsail-crew/crowsnest.git +managed_services: crowsnest +install_script: tools/install.sh diff --git a/printer.cfg b/printer.cfg index 0b3612a..7c5fe39 100644 --- a/printer.cfg +++ b/printer.cfg @@ -48,7 +48,7 @@ max_z_accel: 500 square_corner_velocity: 5.0 [virtual_sdcard] -path: /home/pi/gcode_files +path: /home/pi/printer_data/gcodes [pause_resume] @@ -405,15 +405,15 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.010000, -0.012500, -0.016250, -0.006250, -0.013750, 0.018750, -0.003750, 0.008750, 0.005000 -#*# -0.010000, -0.016250, -0.012500, -0.010000, -0.028750, -0.013750, -0.017500, 0.000000, -0.007500 -#*# -0.026250, -0.031250, -0.018750, -0.013750, -0.001250, -0.005000, -0.008750, 0.008750, 0.005000 -#*# -0.007500, -0.025000, -0.013750, -0.008750, -0.002500, 0.000000, -0.010000, -0.002500, -0.006250 -#*# -0.010000, 0.000000, -0.005000, 0.002500, 0.000000, 0.028750, -0.001250, 0.010000, 0.020000 -#*# -0.027500, -0.026250, -0.032500, -0.022500, -0.028750, -0.016250, -0.015000, -0.018750, -0.028750 -#*# -0.021250, -0.011250, -0.011250, -0.015000, -0.016250, -0.006250, -0.012500, -0.008750, -0.002500 -#*# -0.005000, -0.002500, -0.007500, -0.007500, 0.006250, 0.007500, -0.003750, 0.010000, -0.008750 -#*# -0.002500, 0.027500, 0.053750, 0.021250, 0.016250, 0.038750, 0.021250, 0.012500, -0.011250 +#*# -0.001250, -0.002500, -0.006250, -0.017500, -0.005000, 0.005000, 0.016250, 0.022500, 0.006250 +#*# 0.001250, -0.000000, -0.017500, -0.015000, -0.020000, 0.007500, -0.002500, 0.022500, 0.011250 +#*# -0.012500, -0.020000, 0.006250, -0.000000, 0.005000, 0.003750, -0.008750, 0.002500, -0.012500 +#*# -0.013750, 0.003750, 0.005000, 0.023750, 0.008750, 0.030000, 0.012500, 0.028750, 0.008750 +#*# 0.002500, 0.001250, 0.025000, 0.023750, 0.000000, 0.022500, 0.011250, 0.023750, 0.010000 +#*# -0.036250, -0.033750, -0.037500, -0.026250, -0.025000, -0.002500, -0.003750, -0.018750, -0.028750 +#*# -0.036250, -0.027500, -0.028750, -0.033750, -0.027500, -0.025000, -0.041250, -0.027500, -0.048750 +#*# -0.025000, -0.022500, -0.020000, -0.018750, -0.025000, -0.022500, -0.031250, -0.032500, -0.041250 +#*# -0.016250, -0.012500, 0.015000, -0.020000, -0.030000, -0.002500, -0.032500, -0.045000, -0.065000 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic diff --git a/webcam-xk.txt b/webcam-xk.txt deleted file mode 100644 index e6af7ca..0000000 --- a/webcam-xk.txt +++ /dev/null @@ -1,11 +0,0 @@ -# vim: ft=conf - -### Additional options to supply to MJPG Streamer for the cameras -camera_usb=0 -camera_raspi=1 -camera_usb_options="-d /dev/v4l/by-id/usb-Vimicro_Corp._HBVCAM_FHD_CAMERA-video-index0 -r 1280x960 -f 10" -camera_raspi_options="-d /dev/v4l/by-path/platform-bcm2835-isp-video-index0 -x 1024 -y 768 -roi 0.0,0.0,0.998,1" - -### Configuration of camera HTTP output -camera_http_options="-p 8080" - From 556b32e0f68ccdb0cb722a3709abf64d0e9550b3 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 22 Feb 2023 22:25:21 +0100 Subject: [PATCH 121/131] printer: update macros and ercf config --- ercf/software.cfg | 4 ++-- macros/print.cfg | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ercf/software.cfg b/ercf/software.cfg index b622561..5ddf8c2 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -29,7 +29,7 @@ description: Empty macro to store ERCF variables # Galileo Clockwork with ERCF V1.1 sensor (hall effect) : 27.0 # LGX on AfterBurner with ERCF V1.1 sensor (hall effect) : 44.0 # AfterBurner Clockwork with ERCF V1.1 sensor (hall effect) : 36.0 -variable_end_of_bowden_to_sensor: 40 # xk +variable_end_of_bowden_to_sensor: 44 # xk # Length from the sensor to the nozzle melt pool. # Reduce this value if there are blobs of filament on each load, before the purge on the tower. # Increase this value if there are big gaps on the purge tower (i.e. if it takes time for the filament to get pushed out after a swap) @@ -37,7 +37,7 @@ variable_end_of_bowden_to_sensor: 40 # xk # Galileo Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 60.5 # LGX on AfterBurner with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 55.6 # AfterBurner Clockwork with ERCF 1.1 sensor (hall effect) & Dragon Normal Flow : 54.0 -variable_sensor_to_nozzle: 60 # xk +variable_sensor_to_nozzle: 65 # xk # # ==== Values to tune ==== # diff --git a/macros/print.cfg b/macros/print.cfg index dbbc51c..372b364 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -155,7 +155,6 @@ gcode: M118 HOME G28 BRUSHIE - G28 Z # QGL {% if QGL %} M117 QGL @@ -181,7 +180,11 @@ gcode: G90 # use absolute coordinates NOTIFY_BED BED={BED} M190 S{BED} # set and wait for actual bed temperature - NOTIFY_EXTRUDER EXTRUDER={BED} + # final home z + G28 Z + PARK Z=10 + # heat extruder + NOTIFY_EXTRUDER EXTRUDER={EXTRUDER} M109 S{EXTRUDER} # set and wait for extruder temperature SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 From 3b6ad1b9f8acd441d873e047d32b748ee78193c9 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 10 Mar 2023 21:19:16 +0100 Subject: [PATCH 122/131] printer: add ebb36 with sensorless homing --- ebb36.cfg | 82 ++++++++++++++++++++++++++++++++++++++ fans.cfg | 34 ---------------- macros/_init.cfg | 1 + macros/sensorless.cfg | 76 +++++++++++++++++++++++++++++++++++ neopixel.cfg | 3 +- printer.cfg | 92 +++++++++++-------------------------------- 6 files changed, 183 insertions(+), 105 deletions(-) create mode 100644 ebb36.cfg create mode 100644 macros/sensorless.cfg diff --git a/ebb36.cfg b/ebb36.cfg new file mode 100644 index 0000000..e6373f9 --- /dev/null +++ b/ebb36.cfg @@ -0,0 +1,82 @@ +# This file contains common pin mappings for the BIGTREETECH EBBCan +# Canbus board. To use this config, the firmware should be compiled for the +# STM32G0B1 with "8 MHz crystal" and "USB (on PA11/PA12)" or "CAN bus (on PB0/PB1)". +# The "EBB Can" micro-controller will be used to control the components on the nozzle. + +# See docs/Config_Reference.md for a description of parameters. + +[mcu EBBCan] +# serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 8192d675a56e + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: x,y,z + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: EBBCan: PD1 +enable_pin: !EBBCan: PD2 +## Update value below when you perform extruder calibration +## If you ask for 100mm of filament, but in reality it is 98mm: +## rotation_distance = * / 100 +## 22.6789511 is a good starting point +rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears +## Update Gear Ratio depending on your Extruder Type +## - 50:17 for Afterburner/Clockwork +## - 50:10 for Stealthburner/Clockwork2 +## - 80:20 for M4, M3.1 +gear_ratio: 50:10 # SB BMG +microsteps: 32 +full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper: 400 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: ATC Semitec 104NT-4-R025H42G +sensor_pin: EBBCan: PA3 +max_power: 1.0 +min_extrude_temp: 180 +min_temp: 0 +max_temp: 280 # specified to 300 +## Try to keep pressure_advance below 1.0 +# pressure_advance: 0.05 +## Default is 0.040, leave stock +pressure_advance_smooth_time: 0.040 +# Maximum length (in mm of raw filament) that a retraction or +# extrude-only move may have, default: 50 +max_extrude_only_distance: 200 +# Maximum area (in mm^2) of an extrusion cross section (eg, +# extrusion width multiplied by layer height). This setting prevents +# excessive amounts of extrusion during relatively small XY moves. +# If a move requests an extrusion rate that would exceed this value +# it will cause an error to be returned. The default is: 4.0 * +# nozzle_diameter^2 +max_extrude_cross_section: 50.0 # default 4 * 0.4 = 0.64 +control: pid +pid_Kp: 21.527 +pid_Ki: 1.063 +pid_Kd: 108.982 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.650 +stealthchop_threshold: 999999 + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +[filament_switch_sensor toolhead_sensor] +pause_on_runout: False +switch_pin: ^EBBCan: PB3 +# runout_gcode: +# M118 toolhead filament removed +# insert_gcode: +# M118 toolhead filament inserted diff --git a/fans.cfg b/fans.cfg index 9682105..d0cdec8 100644 --- a/fans.cfg +++ b/fans.cfg @@ -2,23 +2,6 @@ # Fan Control ##################################################################### -[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 - -[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 - # [fan_generic nevermore1] [heater_fan nevermore1] pin: PD12 @@ -51,20 +34,3 @@ heater: heater_bed heater_temp: 40.0 fan_speed: 0.40 -# ## exhaust automatic -# [heater_fan exhaust_fan] -# pin: PD14 -# max_power: 1.0 -# shutdown_speed: 0.0 -# kick_start_time: 0.5 -# heater: heater_bed -# heater_temp: 40 -# fan_speed: 0.6 - -# ## exhaust manual -# [fan_generic exhaust_fan] -# pin: PD14 -# max_power: 1.0 -# shutdown_speed: 0.0 -# kick_start_time: 0.5 - diff --git a/macros/_init.cfg b/macros/_init.cfg index 609e796..5549dce 100644 --- a/macros/_init.cfg +++ b/macros/_init.cfg @@ -5,4 +5,5 @@ [include debug.cfg] [include helpers.cfg] [include print.cfg] +[include sensorless.cfg] [include timelapse.cfg] diff --git a/macros/sensorless.cfg b/macros/sensorless.cfg new file mode 100644 index 0000000..5854a5d --- /dev/null +++ b/macros/sensorless.cfg @@ -0,0 +1,76 @@ +[gcode_macro _HOME_X] +gcode: + # Always use consistent run_current on A/B steppers during sensorless homing + {% set RUN_CURRENT_X = printer.configfile.settings['tmc5160 stepper_x'].run_current|float %} + {% set RUN_CURRENT_Y = printer.configfile.settings['tmc5160 stepper_y'].run_current|float %} + {% set HOME_CURRENT = 0.5 %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT} + + # Home + G28 X + # Move away + G91 + G1 X-10 F1200 + G90 + + # Wait just a moment + G4 P500 + # Set current during print + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y} + +[gcode_macro _HOME_Y] +gcode: + # Set current for sensorless homing + {% set RUN_CURRENT_X = printer.configfile.settings['tmc5160 stepper_x'].run_current|float %} + {% set RUN_CURRENT_Y = printer.configfile.settings['tmc5160 stepper_y'].run_current|float %} + {% set HOME_CURRENT = 0.5 %} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT} + + # Home + G28 Y + # Move away + G91 + G1 Y-10 F1200 + G90 + + # Wait just a moment + G4 P500 + # Set current during print + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y} + +[homing_override] +axes: xyz +set_position_z: 0 +gcode: + {% set home_all = 'X' not in params and 'Y' not in params or 'Z' in params %} + + # set_position_z does home z + # but if x and y are not, guess that z is not really either z + {% if not "x" in printer.toolhead.homed_axes and not "y" in printer.toolhead.homed_axes %} + # move up 5 + G91 + G0 Z5 + G90 + {% else %} + # or to 5 + G0 Z5 + {% 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 %} + G0 X150 Y150 F6000 + G28 Z + G1 Z10 + {% endif %} + diff --git a/neopixel.cfg b/neopixel.cfg index cc87245..29ba872 100644 --- a/neopixel.cfg +++ b/neopixel.cfg @@ -11,7 +11,8 @@ initial_BLUE: 0.4 [neopixel toolhead] # pin: PB6 # Octopus BL_Touch -pin: PB0 # Octopus LED +# pin: PB0 # Octopus LED +pin: EBBCan: PD3 chain_count: 3 color_order: GRBW initial_RED: 0.3 diff --git a/printer.cfg b/printer.cfg index 7c5fe39..b95b015 100644 --- a/printer.cfg +++ b/printer.cfg @@ -58,6 +58,7 @@ path: /home/pi/printer_data/gcodes # includes ##################################################################### +[include ebb36.cfg] [include macros/_init.cfg] [include neopixel.cfg] [include fans.cfg] @@ -77,14 +78,16 @@ step_pin: PF13 dir_pin: !PF12 enable_pin: !PF14 rotation_distance: 40 +homing_speed: 20 microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper -endstop_pin: PG6 +# endstop_pin: PG6 # octopus +endstop_pin: tmc5160_stepper_x:virtual_endstop position_min: 0 position_endstop: 300 position_max: 300 -homing_speed: 30 # speed: mm/sec, feedrate: mm/min -homing_retract_dist: 5 +# homing_retract_dist: 5 +homing_retract_dist: 0 homing_positive_dir: true [tmc5160 stepper_x] @@ -96,6 +99,8 @@ interpolate: False run_current: 1.0 sense_resistor: 0.110 stealthchop_threshold: 0 +diag0_pin: ^!PG6 +driver_SGT: 1 # -64 most sensitive, 63 least sensitive ## Y Stepper on MOTOR1 (A Motor) [stepper_y] @@ -103,14 +108,16 @@ step_pin: PG0 dir_pin: !PG1 enable_pin: !PF15 rotation_distance: 40 +homing_speed: 20 microsteps: 32 full_steps_per_rotation: 400 # 200: 1.8 deg stepper, 400: 0.9 deg stepper -endstop_pin: PG9 +# endstop_pin: PG9 # octopus +endstop_pin: tmc5160_stepper_y:virtual_endstop position_min: 0 -position_endstop: 302.5 -position_max: 306 -homing_speed: 30 # Max 100 -homing_retract_dist: 5 +position_endstop: 303 +position_max: 303 +# homing_retract_dist: 5 +homing_retract_dist: 0 homing_positive_dir: true [tmc5160 stepper_y] @@ -122,6 +129,8 @@ interpolate: False run_current: 1.0 sense_resistor: 0.110 stealthchop_threshold: 0 +diag0_pin: ^!PG9 +driver_SGT: 1 # -64 most sensitive, 63 least sensitive ##################################################################### @@ -200,64 +209,6 @@ sense_resistor: 0.110 stealthchop_threshold: 0 -##################################################################### -# Extruder -##################################################################### - -# E0 on MOTOR6 -[extruder] -step_pin: PE2 -dir_pin: !PE3 -enable_pin: !PD4 -## Update value below when you perform extruder calibration -## If you ask for 100mm of filament, but in reality it is 98mm: -## rotation_distance = * / 100 -## 22.6789511 is a good starting point -rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears -## Update Gear Ratio depending on your Extruder Type -## - 50:17 for Afterburner/Clockwork -## - 50:10 for Stealthburner/Clockwork2 -## - 80:20 for M4, M3.1 -gear_ratio: 50:10 # SB BMG -microsteps: 32 -full_steps_per_rotation: 200 # 1.8 deg stepper: 200, 0.9 deg stepper: 400 -nozzle_diameter: 0.400 -filament_diameter: 1.75 -heater_pin: PA2 -sensor_type: ATC Semitec 104NT-4-R025H42G -sensor_pin: PF4 -min_temp: 10 -max_temp: 280 # specified to 300 -max_power: 1.0 -min_extrude_temp: 170 -#control = pid -#pid_kp = 26.213 -#pid_ki = 1.304 -#pid_kd = 131.721 -## Try to keep pressure_advance below 1.0 -# pressure_advance: 0.05 -## Default is 0.040, leave stock -pressure_advance_smooth_time: 0.040 -# Maximum length (in mm of raw filament) that a retraction or -# extrude-only move may have, default: 50 -max_extrude_only_distance: 200 -# Maximum area (in mm^2) of an extrusion cross section (eg, -# extrusion width multiplied by layer height). This setting prevents -# excessive amounts of extrusion during relatively small XY moves. -# If a move requests an extrusion rate that would exceed this value -# it will cause an error to be returned. The default is: 4.0 * -# nozzle_diameter^2 -max_extrude_cross_section: 50.0 # default 4 * 0.4 = 0.64 - -## E0 on MOTOR6 -[tmc2209 extruder] -uart_pin: PE1 -interpolate: false -run_current: 0.5 -sense_resistor: 0.110 -stealthchop_threshold: 0 - - ##################################################################### # Bed Heater ##################################################################### @@ -309,9 +260,9 @@ max_temp: 100 [idle_timeout] timeout: 1800 -[safe_z_home] -home_xy_position: 150, 150 -z_hop: 10 +# [safe_z_home] +# home_xy_position: 150, 150 +# z_hop: 5 ##################################################################### @@ -320,7 +271,8 @@ z_hop: 10 [probe] ## Voron-Tap -pin: ^PG11 +# pin: ^PG11 +pin: EBBCan: PB9 x_offset: 0 y_offset: 0 #z_offset: 0 From 9cde779fec381d414a57834a95fbc8ff402f3372 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 10 Mar 2023 21:19:33 +0100 Subject: [PATCH 123/131] webcam: use crowsnest --- crowsnest.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crowsnest.conf b/crowsnest.conf index 9d0e9e9..985a5f7 100644 --- a/crowsnest.conf +++ b/crowsnest.conf @@ -7,4 +7,4 @@ mode: mjpg port: 8080 device: /dev/video0 resolution: 1280x960 -max_fps: 15 +max_fps: 10 From 651f74b016d783e00fb8b845159463ec7c593866 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 10 Mar 2023 21:30:20 +0100 Subject: [PATCH 124/131] ercf: switch to Ercf Easy Brd Can --- ercf.cfg | 7 ++++++ ercf/hardware.cfg | 64 +++++++++++++++++++++-------------------------- ercf/software.cfg | 2 +- printer.cfg | 3 +-- 4 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 ercf.cfg diff --git a/ercf.cfg b/ercf.cfg new file mode 100644 index 0000000..2d9a09a --- /dev/null +++ b/ercf.cfg @@ -0,0 +1,7 @@ +[include ercf/hardware.cfg] +[include ercf/software.cfg] + +[mcu ercf] +# serial: /dev/serial/by-id/usb-Klipper_samd21g18a_D3EB9B384134555020312E30171117FF-if00 +canbus_uuid: 092fcd32b788 + diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg index 18907f5..4f0ac54 100644 --- a/ercf/hardware.cfg +++ b/ercf/hardware.cfg @@ -2,80 +2,74 @@ # This config sample assume you set the two J6 jumpers on 1-2 and 4-5, i.e. [..].[..] -[mcu ercf] -serial: /dev/serial/by-id/usb-Klipper_samd21g18a_D3EB9B384134555020312E30171117FF-if00 - # Carrot Feeder 5mm D-cut shaft [manual_stepper gear_stepper] -step_pin: ercf:PA4 -dir_pin: !ercf:PA10 -enable_pin: !ercf:PA2 +step_pin: ercf:gpio7 +dir_pin: !ercf:gpio8 +enable_pin: !ercf:gpio6 rotation_distance: 22.6789511 # Bondtech 5mm Drive Gears gear_ratio: 80:20 microsteps: 16 full_steps_per_rotation: 200 velocity: 35 accel: 100 -endstop_pin: ^ercf:PA7 +endstop_pin: ercf:gpio13 [tmc2209 manual_stepper gear_stepper] # Adapt accordingly to your setup and desires # The default values are tested with the BOM NEMA14 motor -uart_pin: ercf:PA8 # shared with selector_stepper -uart_address: 0 +uart_pin: ercf:gpio9 interpolate: True run_current: 0.6 hold_current: 0.1 sense_resistor: 0.110 stealthchop_threshold: 500 - -[tmc2209 manual_stepper selector_stepper] -uart_pin: ercf:PA8 # shared with gear_stepper -uart_address: 1 -run_current: 0.55 -hold_current: 0.4 -interpolate: True -sense_resistor: 0.110 -stealthchop_threshold: 5000 -# Uncomment the lines below if you want to use sensorless homing for the selector -#diag_pin: ^P1.27 # Set to MCU pin connected to TMC DIAG pin -#driver_SGTHRS: 75 # 255 is most sensitive value, 0 is least sensitive +# diag_pin: ercf:gpio23 [manual_stepper selector_stepper] -step_pin: ercf:PA9 -dir_pin: !ercf:PB8 -enable_pin: !ercf:PA11 +step_pin: ercf:gpio2 +dir_pin: !ercf:gpio1 +enable_pin: !ercf:gpio3 microsteps: 16 rotation_distance: 40 full_steps_per_rotation: 200 velocity: 200 homing_speed: 100 accel: 600 -endstop_pin: ^ercf:PB9 +# Select the endstop you want depending if you are using sensorless homing +# endstop_pin: ^ercf:PB9 +endstop_pin: ercf:gpio20 +#endstop_pin: tmc2209_selector_stepper:virtual_endstop +#endstop_pin: tmc5160_selector_stepper:virtual_endstop + +[tmc2209 manual_stepper selector_stepper] +uart_pin: ercf:gpio0 +run_current: 0.55 +hold_current: 0.4 +interpolate: True +sense_resistor: 0.110 +stealthchop_threshold: 5000 +# Uncomment the lines below if you want to use sensorless homing for the selector +# diag_pin: ^ercf:gpio22 # Set to MCU pin connected to TMC DIAG pin +# driver_SGTHRS: 75 # 255 is most sensitive value, 0 is least sensitive + # Values are for the MG90S servo [servo ercf_servo] -pin: ercf:PA5 +pin: ercf:gpio21 maximum_servo_angle: 180 minimum_pulse_width: 0.00085 maximum_pulse_width: 0.00215 [duplicate_pin_override] -pins: ercf:PA6 +pins: ercf:gpio15 # Put there the pin used by the encoder and the filament_motion_sensor # It has to be the same pin for those 3 [filament_motion_sensor encoder_sensor] -switch_pin: ^ercf:PA6 +switch_pin: ^ercf:gpio15 pause_on_runout: False detection_length: 10.0 extruder: extruder # runout_gcode: _ERCF_ENCODER_MOTION_ISSUE -[filament_switch_sensor toolhead_sensor] -pause_on_runout: False -switch_pin: ^PG12 -# runout_gcode: -# M118 toolhead filament removed -# insert_gcode: -# M118 toolhead filament inserted diff --git a/ercf/software.cfg b/ercf/software.cfg index 5ddf8c2..4fc6e2c 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -4,7 +4,7 @@ [ercf] # Encoder -encoder_pin: ercf:PA6 # easy brd +encoder_pin: ercf:gpio15 # easy brd # encoder_resolution: 1.365188 # in mm encoder_resolution: 1.349528 # from `ercf_calibrate_encoder` # Speeds and accels diff --git a/printer.cfg b/printer.cfg index b95b015..1b5349f 100644 --- a/printer.cfg +++ b/printer.cfg @@ -64,8 +64,7 @@ path: /home/pi/printer_data/gcodes [include fans.cfg] [include input_shaper.cfg] # [include resonance_test.cfg] -[include ercf/hardware.cfg] -[include ercf/software.cfg] +[include ercf.cfg] ##################################################################### From 3e692cac7bb4fc06f4719dcc0b4a961ae8804884 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Fri, 10 Mar 2023 21:30:38 +0100 Subject: [PATCH 125/131] moonraker: replace power plug with tasmota --- moonraker.conf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moonraker.conf b/moonraker.conf index f11790e..8b85337 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -74,8 +74,11 @@ path: ~/EnragedRabbitProject origin: https://github.com/EtteGit/EnragedRabbitProject.git [power voron-v2.4] -type: tplink_smartplug -address: 192.168.11.91 +# type: tplink_smartplug +# address: 192.168.11.91 +type: tasmota +address: 192.168.11.92 +# password: mypassword [timelapse] ## Following basic configuration is default to most images and don't need From 310b46245ef52784da771e634c2fdfd68657fc9f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 12 Mar 2023 18:56:57 +0100 Subject: [PATCH 126/131] ercf: calibrate --- ercf/hardware.cfg | 6 ++++-- ercf/software.cfg | 4 ++-- ercf/vars.cfg | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ercf/hardware.cfg b/ercf/hardware.cfg index 4f0ac54..2fdd503 100644 --- a/ercf/hardware.cfg +++ b/ercf/hardware.cfg @@ -58,8 +58,10 @@ stealthchop_threshold: 5000 [servo ercf_servo] pin: ercf:gpio21 maximum_servo_angle: 180 -minimum_pulse_width: 0.00085 -maximum_pulse_width: 0.00215 +# minimum_pulse_width: 0.00085 +# maximum_pulse_width: 0.00215 +minimum_pulse_width: 0.001 +maximum_pulse_width: 0.002 [duplicate_pin_override] pins: ercf:gpio15 diff --git a/ercf/software.cfg b/ercf/software.cfg index 4fc6e2c..7983ebd 100644 --- a/ercf/software.cfg +++ b/ercf/software.cfg @@ -4,7 +4,7 @@ [ercf] # Encoder -encoder_pin: ercf:gpio15 # easy brd +encoder_pin: ^ercf:gpio15 # easy brd # encoder_resolution: 1.365188 # in mm encoder_resolution: 1.349528 # from `ercf_calibrate_encoder` # Speeds and accels @@ -55,7 +55,7 @@ variable_servo_up_angle: 20 # Default values: # MG90S servo : 140 # SAVOX SH0255MG : 30 -variable_servo_down_angle: 130 # xk +variable_servo_down_angle: 120 # xk # Threshold for the final load check (i.e. the move from the toolhead sensor to the nozzle) # Check the _ERCF_GET_LOAD_THRESHOLD command to get the proper value for your setup variable_final_load_check_threshold: 10.0 diff --git a/ercf/vars.cfg b/ercf/vars.cfg index cc21fda..59a9861 100644 --- a/ercf/vars.cfg +++ b/ercf/vars.cfg @@ -1,15 +1,15 @@ [Variables] ercf_calib_0 = 1.0 -ercf_calib_1 = 0.999635726394 +ercf_calib_1 = 1.0017808674381732 ercf_calib_10 = 1.0 ercf_calib_11 = 1.0 -ercf_calib_2 = 1.00178086744 -ercf_calib_3 = 1.00070714732 -ercf_calib_4 = 1.00070714732 +ercf_calib_2 = 1.0007071473230196 +ercf_calib_3 = 0.9996357263944082 +ercf_calib_4 = 1.0050158971500294 ercf_calib_5 = 0.999635726394 ercf_calib_6 = 1.0 ercf_calib_7 = 1.0 ercf_calib_8 = 1.0 ercf_calib_9 = 1.0 -ercf_calib_ref = 774.629072 +ercf_calib_ref = 782.7262400000001 From 6b333385c5c08743a29ca10e55704521c2fd5175 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 3 Jul 2023 19:04:18 +0200 Subject: [PATCH 127/131] printer: update --- macros/print.cfg | 33 ++-- macros/timelapse.cfg | 425 ++++++++++++++++++++++++++++++++++++++++++- moonraker.conf | 2 + printer.cfg | 26 ++- 4 files changed, 459 insertions(+), 27 deletions(-) mode change 120000 => 100644 macros/timelapse.cfg diff --git a/macros/print.cfg b/macros/print.cfg index 372b364..2b2b325 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -2,6 +2,8 @@ # Macros used for printing # - BRUSHIE # - CANCEL_PRINT +# - EXCLUDE_OBJECT_END +# - EXCLUDE_OBJECT_START # - LOAD_FILAMENT # - UNLOAD_FILAMENT # - M600 @@ -21,9 +23,9 @@ [gcode_macro BRUSHIE] gcode: {% set x0=250 %} - {% set x1=200 %} - {% set y0=printer.toolhead.axis_maximum.y %} - {% set z0=2.5 %} + {% set x1=190 %} + {% set y0=printer.toolhead.axis_maximum.y - 1 %} + {% set z0=2.0 %} # {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} {% set z_hop = 10 %} {% if "xyz" in printer.toolhead.homed_axes %} @@ -52,6 +54,16 @@ gcode: _CANCEL_PRINT_BASE +[gcode_macro EXCLUDE_OBJECT_END] +description: fix unknown command +gcode: + + +[gcode_macro EXCLUDE_OBJECT_START] +description: fix unknown command +gcode: + + [gcode_macro LOAD_FILAMENT] gcode: T0 @@ -98,9 +110,8 @@ gcode: {% if Z != - 1 %} {% set z_safe = Z %} {% endif %} - G91 # use relative coordinates + M118 Parking X{X} Y{Y} Z{z_safe} G0 Z{z_safe} F1200 - G90 # use absolute coordinates G0 X{X} Y{Y} F6000 {% else %} M118 printer not homed @@ -119,7 +130,7 @@ gcode: G90 # use absolute coordinates SAVE_GCODE_STATE NAME=PAUSE_state _PAUSE_BASE - PARK + PARK Y=5 {% else %} M117 already paused M118 already paused @@ -134,7 +145,7 @@ gcode: {% set QGL=params.QGL|default(1)|int %} {% set BMC=params.BMC|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} - {% set PURGE=params.PURGE|default(1)|int %} + {% set PURGE=params.PURGE|default(0)|int %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} {% set ERCF=params.ERCF|default(0)|int %} {% set ERCF_EXTRUDER=params.ERCF_EXTRUDER|default(0)|int %} @@ -192,12 +203,12 @@ gcode: M117 ercf changing to tool {ERCF_EXTRUDER} M118 ercf changing to tool {ERCF_EXTRUDER} ERCF_HOME - ERCF_CHANGE_TOOL_SLICER TOOL={ERCF_EXTRUDER} + _ERCF_CHANGE_TOOL_SLICER TOOL={ERCF_EXTRUDER} {% endif %} BRUSHIE - # {% if PURGE %} - # PURGE_NOZZLE - # {% endif %} + {% if PURGE %} + PURGE_NOZZLE + {% endif %} M117 STARTING M118 STARTING diff --git a/macros/timelapse.cfg b/macros/timelapse.cfg deleted file mode 120000 index 982e949..0000000 --- a/macros/timelapse.cfg +++ /dev/null @@ -1 +0,0 @@ -/home/pi/moonraker-timelapse/klipper_macro/timelapse.cfg \ No newline at end of file diff --git a/macros/timelapse.cfg b/macros/timelapse.cfg new file mode 100644 index 0000000..134243f --- /dev/null +++ b/macros/timelapse.cfg @@ -0,0 +1,424 @@ +# Timelapse klipper macro definition +# +# Copyright (C) 2021 Christoph Frei +# Copyright (C) 2021 Alex Zellner +# +# This file may be distributed under the terms of the GNU GPLv3 license +# +# Macro version 1.14 +# + +##### DO NOT CHANGE ANY MACRO!!! ##### + +########################################################################## +# # +# GET_TIMELAPSE_SETUP: Print the Timelapse setup to console # +# # +########################################################################## + +[gcode_macro GET_TIMELAPSE_SETUP] +description: Print the Timelapse setup +gcode: + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + {% set output_txt = ["Timelapse Setup:"] %} + {% set _dummy = output_txt.append("enable: %s" % tl.enable) %} + {% set _dummy = output_txt.append("park: %s" % tl.park.enable) %} + {% if tl.park.enable %} + {% set _dummy = output_txt.append("park position: %s time: %s s" % (tl.park.pos, tl.park.time)) %} + {% set _dummy = output_txt.append("park cord x:%s y:%s dz:%s" % (tl.park.coord.x, tl.park.coord.y, tl.park.coord.dz)) %} + {% set _dummy = output_txt.append("travel speed: %s mm/s" % tl.speed.travel) %} + {% endif %} + {% set _dummy = output_txt.append("fw_retract: %s" % tl.extruder.fw_retract) %} + {% if not tl.extruder.fw_retract %} + {% set _dummy = output_txt.append("retract: %s mm speed: %s mm/s" % (tl.extruder.retract, tl.speed.retract)) %} + {% set _dummy = output_txt.append("extrude: %s mm speed: %s mm/s" % (tl.extruder.extrude, tl.speed.extrude)) %} + {% endif %} + {% set _dummy = output_txt.append("verbose: %s" % tl.verbose) %} + {action_respond_info(output_txt|join("\n"))} + +################################################################################################ +# # +# Use _SET_TIMELAPSE_SETUP [ENABLE=value] [VERBOSE=value] [PARK_ENABLE=value] [PARK_POS=value] # +# [PARK_TIME=value] [CUSTOM_POS_X=value] [CUSTOM_POS_Y=value] # +# [CUSTOM_POS_DZ=value][TRAVEL_SPEED=value] [RETRACT_SPEED=value] # +# [EXTRUDE_SPEED=value] [EXTRUDE_DISTANCE=value] # +# [RETRACT_DISTANCE=value] [FW_RETRACT=value] # +# # +################################################################################################ + +[gcode_macro _SET_TIMELAPSE_SETUP] +description: Set user parameters for timelapse +gcode: + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + ##### get min and max bed size ##### + {% set min = printer.toolhead.axis_minimum %} + {% set max = printer.toolhead.axis_maximum %} + {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] + else False %} + {% set park = {'min' : {'x': (min.x / 1.42)|round(3) if round_bed else min.x|round(3), + 'y': (min.y / 1.42)|round(3) if round_bed else min.y|round(3)}, + 'max' : {'x': (max.x / 1.42)|round(3) if round_bed else max.x|round(3), + 'y': (max.y / 1.42)|round(3) if round_bed else max.y|round(3)}, + 'center': {'x': (max.x-(max.x-min.x)/2)|round(3), + 'y': (max.y-(max.y-min.y)/2)|round(3)}} %} + ##### set new values ##### + {% if params.ENABLE %} + {% if params.ENABLE|lower is in ['true', 'false'] %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=enable VALUE={True if params.ENABLE|lower == 'true' else False} + {% else %} + {action_raise_error("ENABLE=%s not supported. Allowed values are [True, False]" % params.ENABLE|capitalize)} + {% endif %} + {% endif %} + {% if params.VERBOSE %} + {% if params.VERBOSE|lower is in ['true', 'false'] %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=verbose VALUE={True if params.VERBOSE|lower == 'true' else False} + {% else %} + {action_raise_error("VERBOSE=%s not supported. Allowed values are [True, False]" % params.VERBOSE|capitalize)} + {% endif %} + {% endif %} + {% if params.CUSTOM_POS_X %} + {% if params.CUSTOM_POS_X|float >= min.x and params.CUSTOM_POS_X|float <= max.x %} + {% set _dummy = tl.park.custom.update({'x':params.CUSTOM_POS_X|float|round(3)}) %} + {% else %} + {action_raise_error("CUSTOM_POS_X=%s must be within [%s - %s]" % (params.CUSTOM_POS_X, min.x, max.x))} + {% endif %} + {% endif %} + {% if params.CUSTOM_POS_Y %} + {% if params.CUSTOM_POS_Y|float >= min.y and params.CUSTOM_POS_Y|float <= max.y %} + {% set _dummy = tl.park.custom.update({'y':params.CUSTOM_POS_Y|float|round(3)}) %} + {% else %} + {action_raise_error("CUSTOM_POS_Y=%s must be within [%s - %s]" % (params.CUSTOM_POS_Y, min.y, max.y))} + {% endif %} + {% endif %} + {% if params.CUSTOM_POS_DZ %} + {% if params.CUSTOM_POS_DZ|float >= min.z and params.CUSTOM_POS_DZ|float <= max.z %} + {% set _dummy = tl.park.custom.update({'dz':params.CUSTOM_POS_DZ|float|round(3)}) %} + {% else %} + {action_raise_error("CUSTOM_POS_DZ=%s must be within [%s - %s]" % (params.CUSTOM_POS_DZ, min.z, max.z))} + {% endif %} + {% endif %} + {% if params.PARK_ENABLE %} + {% if params.PARK_ENABLE|lower is in ['true', 'false'] %} + {% set _dummy = tl.park.update({'enable':True if params.PARK_ENABLE|lower == 'true' else False}) %} + {% else %} + {action_raise_error("PARK_ENABLE=%s not supported. Allowed values are [True, False]" % params.PARK_ENABLE|capitalize)} + {% endif %} + {% endif %} + {% if params.PARK_POS %} + {% if params.PARK_POS|lower is in ['center','front_left','front_right','back_left','back_right','custom','x_only','y_only'] %} + {% set dic = {'center' : {'x': park.center.x , 'y': park.center.y , 'dz': 1 }, + 'front_left' : {'x': park.min.x , 'y': park.min.y , 'dz': 0 }, + 'front_right' : {'x': park.max.x , 'y': park.min.y , 'dz': 0 }, + 'back_left' : {'x': park.min.x , 'y': park.max.y , 'dz': 0 }, + 'back_right' : {'x': park.max.x , 'y': park.max.y , 'dz': 0 }, + 'custom' : {'x': tl.park.custom.x, 'y': tl.park.custom.y, 'dz': tl.park.custom.dz}, + 'x_only' : {'x': tl.park.custom.x, 'y': 'none' , 'dz': tl.park.custom.dz}, + 'y_only' : {'x': 'none' , 'y': tl.park.custom.y, 'dz': tl.park.custom.dz}} %} + {% set _dummy = tl.park.update({'pos':params.PARK_POS|lower}) %} + {% set _dummy = tl.park.update({'coord':dic[tl.park.pos]}) %} + {% else %} + {action_raise_error("PARK_POS=%s not supported. Allowed values are [CENTER, FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, CUSTOM, X_ONLY, Y_ONLY]" + % params.PARK_POS|upper)} + {% endif %} + {% endif %} + {% if params.PARK_TIME %} + {% if params.PARK_TIME|float >= 0.0 %} + {% set _dummy = tl.park.update({'time':params.PARK_TIME|float|round(3)}) %} + {% else %} + {action_raise_error("PARK_TIME=%s must be a positive number" % params.PARK_TIME)} + {% endif %} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=park VALUE="{tl.park}" + {% if params.TRAVEL_SPEED %} + {% if params.TRAVEL_SPEED|float > 0.0 %} + {% set _dummy = tl.speed.update({'travel':params.TRAVEL_SPEED|float|round(3)}) %} + {% else %} + {action_raise_error("TRAVEL_SPEED=%s must be larger than 0" % params.TRAVEL_SPEED)} + {% endif %} + {% endif %} + {% if params.RETRACT_SPEED %} + {% if params.RETRACT_SPEED|float > 0.0 %} + {% set _dummy = tl.speed.update({'retract':params.RETRACT_SPEED|float|round(3)}) %} + {% else %} + {action_raise_error("RETRACT_SPEED=%s must be larger than 0" % params.RETRACT_SPEED)} + {% endif %} + {% endif %} + {% if params.EXTRUDE_SPEED %} + {% if params.EXTRUDE_SPEED|float > 0.0 %} + {% set _dummy = tl.speed.update({'extrude':params.EXTRUDE_SPEED|float|round(3)}) %} + {% else %} + {action_raise_error("EXTRUDE_SPEED=%s must be larger than 0" % params.EXTRUDE_SPEED)} + {% endif %} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=speed VALUE="{tl.speed}" + {% if params.EXTRUDE_DISTANCE %} + {% if params.EXTRUDE_DISTANCE|float >= 0.0 %} + {% set _dummy = tl.extruder.update({'extrude':params.EXTRUDE_DISTANCE|float|round(3)}) %} + {% else %} + {action_raise_error("EXTRUDE_DISTANCE=%s must be specified as positiv number" % params.EXTRUDE_DISTANCE)} + {% endif %} + {% endif %} + {% if params.RETRACT_DISTANCE %} + {% if params.RETRACT_DISTANCE|float >= 0.0 %} + {% set _dummy = tl.extruder.update({'retract':params.RETRACT_DISTANCE|float|round(3)}) %} + {% else %} + {action_raise_error("RETRACT_DISTANCE=%s must be specified as positiv number" % params.RETRACT_DISTANCE)} + {% endif %} + {% endif %} + {% if params.FW_RETRACT %} + {% if params.FW_RETRACT|lower is in ['true', 'false'] %} + {% if 'firmware_retraction' in printer.configfile.settings %} + {% set _dummy = tl.extruder.update({'fw_retract': True if params.FW_RETRACT|lower == 'true' else False}) %} + {% else %} + {% set _dummy = tl.extruder.update({'fw_retract':False}) %} + {% if params.FW_RETRACT|capitalize == 'True' %} + {action_raise_error("[firmware_retraction] not defined in printer.cfg. Can not enable fw_retract")} + {% endif %} + {% endif %} + {% else %} + {action_raise_error("FW_RETRACT=%s not supported. Allowed values are [True, False]" % params.FW_RETRACT|capitalize)} + {% endif %} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=extruder VALUE="{tl.extruder}" + {% if printer.configfile.settings['gcode_macro pause'] is defined %} + {% set _dummy = tl.macro.update({'pause': printer.configfile.settings['gcode_macro pause'].rename_existing}) %} + {% endif %} + {% if printer.configfile.settings['gcode_macro resume'] is defined %} + {% set _dummy = tl.macro.update({'resume': printer.configfile.settings['gcode_macro resume'].rename_existing}) %} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=macro VALUE="{tl.macro}" + +########################################################################## +# # +# TIMELAPSE_TAKE_FRAME: take the next picture # +# # +########################################################################## + +######################### definition ######################### +## enable: enable or disable the next frame. Valid inputs: [True, False] +## takingframe: internal use. Valid inputs: [True, False] +## +## park.enable: enable or disable to park the head while taking a picture. Valid inputs: [True, False] +## park.pos : used position for parking. Valid inputs: [center, front_left, front_right, back_left, back_right, custom, x_only, y_only] +## park.time : used for the debug macro. Time in s +## park.custom.x, park.custom.y: coordinates of the custom parkposition. Unit [mm] +## park.custom.dz : custom z hop for the picture. Unit [mm] +## park.coord : internal use +## +## extruder.fw_retract: enable disable fw retraction [True,False] +## extruder.extrude : filament extruded at the end of park. Unit [mm] +## extruder.retract : filament retract at the start of park. Unit [mm] +## +## speed.travel : used speed for travel from and to the park positon. Unit: [mm/min] +## speed.retract: used speed for retract [mm/min] +## speed.extrude: used speed for extrude [mm/min] +## +## verbose: Enable mesage output of TIMELAPSE_TAKE_FRAME +## +## restore.absolute.coordinates: internal use +## restore.absolute.extrude : internal use +## restore.speed : internal use +## restore.e : internal use +## restore.factor.speed : internal use +## restore.factor.extrude : internal use +## +## macro.pause : internal use +## macro.resume : internal use +## +## is_paused: internal use +############################################################### +[gcode_macro TIMELAPSE_TAKE_FRAME] +description: Take Timelapse shoot +variable_enable: False +variable_takingframe: False +variable_park: {'enable': False, + 'pos' : 'center', + 'time' : 0.1, + 'custom': {'x': 0, 'y': 0, 'dz': 0}, + 'coord' : {'x': 0, 'y': 0, 'dz': 0}} +variable_extruder: {'fw_retract': False, + 'retract': 1.0, + 'extrude': 1.0} +variable_speed: {'travel': 100, + 'retract': 15, + 'extrude': 15} +variable_verbose: True +variable_restore: {'absolute': {'coordinates': True, 'extrude': True}, 'speed': 1500, 'e':0, 'factor': {'speed': 1.0, 'extrude': 1.0}} +variable_macro: {'pause': 'PAUSE', 'resume': 'RESUME'} +variable_is_paused: False +gcode: + {% set hyperlapse = True if params.HYPERLAPSE and params.HYPERLAPSE|lower =='true' else False %} + {% if enable %} + {% if (hyperlapse and printer['gcode_macro HYPERLAPSE'].run) or + (not hyperlapse and not printer['gcode_macro HYPERLAPSE'].run) %} + {% if park.enable %} + {% set pos = {'x': 'X' + park.coord.x|string if park.pos != 'y_only' else '', + 'y': 'Y' + park.coord.y|string if park.pos != 'x_only' else '', + 'z': 'Z'+ [printer.gcode_move.gcode_position.z + park.coord.dz, printer.toolhead.axis_maximum.z]|min|string} %} + {% set restore = {'absolute': {'coordinates': printer.gcode_move.absolute_coordinates, + 'extrude' : printer.gcode_move.absolute_extrude}, + 'speed' : printer.gcode_move.speed, + 'e' : printer.gcode_move.gcode_position.e, + 'factor' : {'speed' : printer.gcode_move.speed_factor, + 'extrude': printer.gcode_move.extrude_factor}} %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=restore VALUE="{restore}" + {% if not printer[printer.toolhead.extruder].can_extrude %} + {% if verbose %}{action_respond_info("Timelapse: Warning, minimum extruder temperature not reached!")}{% endif %} + {% else %} + {% if extruder.fw_retract %} + G10 + {% else %} + M83 ; insure relative extrusion + G0 E-{extruder.retract} F{speed.retract * 60} + {% endif %} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=True + {macro.pause} ; execute the klipper PAUSE command + SET_GCODE_OFFSET X=0 Y=0 ; this will insure that the head parks always at the same position in a multi setup + G90 ; insure absolute move + {% if "xyz" not in printer.toolhead.homed_axes %} + {% if verbose %}{action_respond_info("Timelapse: Warning, axis not homed yet!")}{% endif %} + {% else %} + G0 {pos.x} {pos.y} {pos.z} F{speed.travel * 60} + {% endif %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=takingframe VALUE=True + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5 + M400 + {% endif %} + _TIMELAPSE_NEW_FRAME HYPERLAPSE={hyperlapse} + {% endif %} + {% else %} + {% if verbose %}{action_respond_info("Timelapse: disabled, take frame ignored")}{% endif %} + {% endif %} + +[gcode_macro _TIMELAPSE_NEW_FRAME] +description: action call for timelapse shoot. must be a seperate macro +gcode: + {action_call_remote_method("timelapse_newframe", + macropark=printer['gcode_macro TIMELAPSE_TAKE_FRAME'].park, + hyperlapse=params.HYPERLAPSE)} + +[delayed_gcode _WAIT_TIMELAPSE_TAKE_FRAME] +gcode: + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + {% set factor = {'speed': printer.gcode_move.speed_factor, 'extrude': printer.gcode_move.extrude_factor} %} + {% if tl.takingframe %} + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5 + {% else %} + {tl.macro.resume} VELOCITY={tl.speed.travel} ; execute the klipper RESUME command + SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=False + {% if not printer[printer.toolhead.extruder].can_extrude %} + {action_respond_info("Timelapse: Warning minimum extruder temperature not reached!")} + {% else %} + {% if tl.extruder.fw_retract %} + G11 + {% else %} + G0 E{tl.extruder.extrude} F{tl.speed.extrude * 60} + G0 F{tl.restore.speed} + {% if tl.restore.absolute.extrude %} + M82 + G92 E{tl.restore.e} + {% endif %} + {% endif %} + {% endif %} + {% if tl.restore.factor.speed != factor.speed %} M220 S{(factor.speed*100)|round(0)} {% endif %} + {% if tl.restore.factor.extrude != factor.extrude %} M221 S{(factor.extrude*100)|round(0)} {% endif %} + {% if not tl.restore.absolute.coordinates %} G91 {% endif %} + {% endif %} + +#################################################################################################### +# # +# HYPERLAPSE: Starts or stops a Hyperlapse video # +# Usage: HYPERLAPSE ACTION=START [CYCLE=time] starts a hyperlapse with cycle time (default 30 sec) # +# HYPERLAPSE ACTION=STOP stops the hyperlapse recording # +# # +#################################################################################################### + +######################### definition ######################### +## cycle: cycle time in seconds +## run: internal use [True/False] +############################################################### +[gcode_macro HYPERLAPSE] +description: Start/Stop a hyperlapse recording +variable_cycle: 0 +variable_run: False +gcode: + {% set cycle = params.CYCLE|default(30)|int %} + {% if params.ACTION and params.ACTION|lower == 'start' %} + {action_respond_info("Hyperlapse: frames started (Cycle %d sec)" % cycle)} + SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=True + SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=cycle VALUE={cycle} + UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={cycle} + TIMELAPSE_TAKE_FRAME HYPERLAPSE=True + {% elif params.ACTION and params.ACTION|lower == 'stop' %} + {% if run %}{action_respond_info("Hyperlapse: frames stopped")}{% endif %} + SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=False + UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION=0 + {% else %} + {action_raise_error("Hyperlapse: No valid input parameter + Use: + - HYPERLAPSE ACTION=START [CYCLE=time] + - HYPERLAPSE ACTION=STOP")} + {% endif %} + +[delayed_gcode _HYPERLAPSE_LOOP] +gcode: + UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={printer["gcode_macro HYPERLAPSE"].cycle} + TIMELAPSE_TAKE_FRAME HYPERLAPSE=True + +########################################################################## +# # +# TIMELAPSE_RENDER: Render the video at print end # +# # +########################################################################## + +######################### definition ######################### +## render: internal use. Valid inputs: [True, False] +## run_identifier: internal use. Valid input [0 .. 3] +############################################################### +[gcode_macro TIMELAPSE_RENDER] +description: Render Timelapse video and wait for the result +variable_render: False +variable_run_identifier: 0 +gcode: + {action_respond_info("Timelapse: Rendering started")} + {action_call_remote_method("timelapse_render", byrendermacro="True")} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=render VALUE=True + {printer.configfile.settings['gcode_macro pause'].rename_existing} ; execute the klipper PAUSE command + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5 + +[delayed_gcode _WAIT_TIMELAPSE_RENDER] +gcode: + {% set ri = printer['gcode_macro TIMELAPSE_RENDER'].run_identifier % 4 %} + SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=run_identifier VALUE={ri + 1} + {% if printer['gcode_macro TIMELAPSE_RENDER'].render %} + M117 Rendering {['-','\\','|','/'][ri]} + UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5 + {% else %} + {action_respond_info("Timelapse: Rendering finished")} + M117 + {printer.configfile.settings['gcode_macro resume'].rename_existing} ; execute the klipper RESUME command + {% endif %} + +########################################################################## +# # +# TEST_STREAM_DELAY: Helper macro to find stream and park delay # +# # +########################################################################## + +[gcode_macro TEST_STREAM_DELAY] +description: Helper macro to find stream and park delay +gcode: + {% set min = printer.toolhead.axis_minimum %} + {% set max = printer.toolhead.axis_maximum %} + {% set act = printer.toolhead.position %} + {% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %} + {% if act.z > 5.0 %} + G0 X{min.x + 5.0} F{tl.speed.travel|int * 60} + G0 X{(max.x-min.x)/2} + G4 P{tl.park.time|float * 1000} + _TIMELAPSE_NEW_FRAME HYPERLAPSE=FALSE + G0 X{max.x - 5.0} + {% else %} + {action_raise_error("Toolhead z %.3f to low. Please place head above z = 5.0" % act.z)} + {% endif %} diff --git a/moonraker.conf b/moonraker.conf index 8b85337..3329989 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -64,12 +64,14 @@ install_script: scripts/KlipperScreen-install.sh [update_manager timelapse] type: git_repo primary_branch: main +is_system_service: false path: ~/moonraker-timelapse origin: https://github.com/mainsail-crew/moonraker-timelapse.git [update_manager ercf] type: git_repo primary_branch: main +is_system_service: false path: ~/EnragedRabbitProject origin: https://github.com/EtteGit/EnragedRabbitProject.git diff --git a/printer.cfg b/printer.cfg index 1b5349f..527a22d 100644 --- a/printer.cfg +++ b/printer.cfg @@ -145,7 +145,7 @@ rotation_distance: 40 gear_ratio: 80:16 microsteps: 32 endstop_pin: probe:z_virtual_endstop -position_max: 290 +position_max: 240 position_min: -3 homing_speed: 5.0 # speed: mm/sec, feedrate: mm/min homing_retract_speed: 10 @@ -348,23 +348,19 @@ max_adjust: 10 #*# pid_kd = 288.283 #*# #*# [extruder] -#*# control = pid -#*# pid_kp = 19.058 -#*# pid_ki = 1.495 -#*# pid_kd = 60.749 #*# #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.001250, -0.002500, -0.006250, -0.017500, -0.005000, 0.005000, 0.016250, 0.022500, 0.006250 -#*# 0.001250, -0.000000, -0.017500, -0.015000, -0.020000, 0.007500, -0.002500, 0.022500, 0.011250 -#*# -0.012500, -0.020000, 0.006250, -0.000000, 0.005000, 0.003750, -0.008750, 0.002500, -0.012500 -#*# -0.013750, 0.003750, 0.005000, 0.023750, 0.008750, 0.030000, 0.012500, 0.028750, 0.008750 -#*# 0.002500, 0.001250, 0.025000, 0.023750, 0.000000, 0.022500, 0.011250, 0.023750, 0.010000 -#*# -0.036250, -0.033750, -0.037500, -0.026250, -0.025000, -0.002500, -0.003750, -0.018750, -0.028750 -#*# -0.036250, -0.027500, -0.028750, -0.033750, -0.027500, -0.025000, -0.041250, -0.027500, -0.048750 -#*# -0.025000, -0.022500, -0.020000, -0.018750, -0.025000, -0.022500, -0.031250, -0.032500, -0.041250 -#*# -0.016250, -0.012500, 0.015000, -0.020000, -0.030000, -0.002500, -0.032500, -0.045000, -0.065000 +#*# -0.035000, -0.030000, -0.013750, -0.032500, -0.018750, -0.023750, -0.022500, -0.020000, -0.027500 +#*# -0.030000, -0.028750, -0.022500, -0.028750, -0.027500, -0.028750, -0.022500, -0.017500, -0.026250 +#*# -0.026250, -0.031250, -0.025000, -0.027500, -0.031250, -0.027500, -0.028750, -0.038750, -0.050000 +#*# -0.036250, -0.025000, -0.017500, -0.017500, -0.018750, -0.005000, 0.005000, 0.002500, -0.002500 +#*# -0.016250, -0.017500, -0.021250, -0.013750, 0.000000, -0.010000, -0.003750, -0.015000, -0.016250 +#*# -0.036250, -0.043750, -0.040000, -0.047500, -0.032500, -0.031250, -0.038750, -0.031250, -0.032500 +#*# -0.058750, -0.031250, -0.030000, -0.026250, -0.027500, -0.027500, -0.020000, -0.036250, -0.052500 +#*# -0.050000, -0.053750, -0.038750, -0.046250, -0.035000, -0.025000, -0.023750, -0.035000, -0.047500 +#*# -0.063750, -0.045000, -0.041250, -0.038750, -0.032500, -0.031250, -0.028750, -0.037500, -0.042500 #*# tension = 0.2 #*# min_x = 40.0 #*# algo = bicubic @@ -377,4 +373,4 @@ max_adjust: 10 #*# max_x = 260.0 #*# #*# [probe] -#*# z_offset = -0.860 +#*# z_offset = -0.913 From d9f92ea58f031e7e37011000ec56a2dcce9f8192 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 26 Nov 2023 14:21:46 +0100 Subject: [PATCH 128/131] KlipperScreen: update --- KlipperScreen.conf | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index f0f36c2..b65b537 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -10,8 +10,26 @@ extruder = 250 bed = 80 extruder = 240 #~# --- Do not edit below this line. This section is auto generated --- #~# - #~# #~# [main] +#~# move_speed_xy = 100 #~# print_sort_dir = date_desc +#~# +#~# [displayed_macros Printer] +#~# dump_parameters = False +#~# dump_warnings = False +#~# get_timelapse_setup = False +#~# hyperlapse = False +#~# m601 = False +#~# m900 = False +#~# t6 = False +#~# t7 = False +#~# t8 = False +#~# print_layer_change = False +#~# print_start = False +#~# notify_bed = False +#~# notify_extruder = False +#~# test_stream_delay = False +#~# timelapse_render = False +#~# timelapse_take_frame = False #~# From c1e5a770d5a041639c7759e8933f5ccca2ef163f Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 26 Nov 2023 14:26:11 +0100 Subject: [PATCH 129/131] printer: update --- input_shaper.cfg | 15 -------- macros/print.cfg | 19 +++------- moonraker.conf | 6 ++-- printer.cfg | 90 +++++++++++++++++++++++++--------------------- resonance_test.cfg | 33 +++-------------- 5 files changed, 63 insertions(+), 100 deletions(-) delete mode 100644 input_shaper.cfg diff --git a/input_shaper.cfg b/input_shaper.cfg deleted file mode 100644 index 5e00103..0000000 --- a/input_shaper.cfg +++ /dev/null @@ -1,15 +0,0 @@ -[input_shaper] -# A type of the input shaper to use for both X and Y axes. Supported -# shapers are zv, mzv, zvd, ei, 2hump_ei, and 3hump_ei. The default -# is mzv input shaper. -# shaper_type: mzv -shaper_type_x: mzv -shaper_freq_x: 53.6 -shaper_type_y: mzv -shaper_freq_y: 41.0 -# Damping ratios of vibrations of X and Y axes used by input shapers -# to improve vibration suppression. Default value is 0.1 which is a -# good all-round value for most printers. In most circumstances this -# parameter requires no tuning and should not be changed. -damping_ratio_x: 0.1 -damping_ratio_y: 0.1 diff --git a/macros/print.cfg b/macros/print.cfg index 2b2b325..400c11b 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -2,8 +2,6 @@ # Macros used for printing # - BRUSHIE # - CANCEL_PRINT -# - EXCLUDE_OBJECT_END -# - EXCLUDE_OBJECT_START # - LOAD_FILAMENT # - UNLOAD_FILAMENT # - M600 @@ -54,16 +52,6 @@ gcode: _CANCEL_PRINT_BASE -[gcode_macro EXCLUDE_OBJECT_END] -description: fix unknown command -gcode: - - -[gcode_macro EXCLUDE_OBJECT_START] -description: fix unknown command -gcode: - - [gcode_macro LOAD_FILAMENT] gcode: T0 @@ -167,7 +155,7 @@ gcode: G28 BRUSHIE # QGL - {% if QGL %} + {% if QGL or not printer['quad_gantry_level'].applied %} M117 QGL M118 QGL QUAD_GANTRY_LEVEL @@ -189,6 +177,7 @@ gcode: G92 E0 # reset extruder G90 # use absolute coordinates + M104 S{EXTRUDER} # start extruder heating NOTIFY_BED BED={BED} M190 S{BED} # set and wait for actual bed temperature # final home z @@ -268,8 +257,8 @@ gcode: _RESUME_BASE {% endif %} {% else %} - M117 not paused - M118 not paused + M117 not paused + M118 not paused {% endif %} diff --git a/moonraker.conf b/moonraker.conf index 3329989..5688cf8 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -22,6 +22,7 @@ trusted_clients: ::1/128 [file_manager] +enable_object_processing: True [data_store] temperature_store_size: 600 @@ -48,7 +49,7 @@ path: ~/fluidd # repo: mainsail-crew/mainsail # path: ~/mainsail -# [update_manager klipper-mcu-update] +# [update_manager klipper] # type: git_repo # origin: https://github.com/Klipper3d/klipper.git # path: ~/klipper @@ -79,7 +80,7 @@ origin: https://github.com/EtteGit/EnragedRabbitProject.git # type: tplink_smartplug # address: 192.168.11.91 type: tasmota -address: 192.168.11.92 +address: pcu-eg-office-voronberry.nom # password: mypassword [timelapse] @@ -100,5 +101,6 @@ frame_path: /tmp/timelapse/ type: git_repo path: ~/crowsnest origin: https://github.com/mainsail-crew/crowsnest.git +primary_branch: legacy/v3 managed_services: crowsnest install_script: tools/install.sh diff --git a/printer.cfg b/printer.cfg index 527a22d..5a411f7 100644 --- a/printer.cfg +++ b/printer.cfg @@ -54,6 +54,8 @@ path: /home/pi/printer_data/gcodes [display_status] +[exclude_object] + ##################################################################### # includes ##################################################################### @@ -62,8 +64,7 @@ path: /home/pi/printer_data/gcodes [include macros/_init.cfg] [include neopixel.cfg] [include fans.cfg] -[include input_shaper.cfg] -# [include resonance_test.cfg] +[include resonance_test.cfg] [include ercf.cfg] @@ -283,31 +284,33 @@ sample_retract_dist: 3 samples_tolerance: 0.01 samples_tolerance_retries: 5 -activate_gcode: - {% set PROBE_TEMP = 200 %} - {% set MAX_TEMP = PROBE_TEMP + 5 %} - {% set ACTUAL_TEMP = printer.extruder.temperature %} - {% set TARGET_TEMP = printer.extruder.target %} - - {% if TARGET_TEMP > PROBE_TEMP %} - { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) } - M109 S{ PROBE_TEMP } - {% else %} - # Temperature target is already low enough, but nozzle may still be too hot. - {% if ACTUAL_TEMP > MAX_TEMP %} - { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) } - TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP } - {% endif %} - {% endif %} +# activate_gcode: +# # impatient +# # {% set PROBE_TEMP = 200 %} +# {% set PROBE_TEMP = 250 %} +# {% set MAX_TEMP = PROBE_TEMP + 5 %} +# {% set ACTUAL_TEMP = printer.extruder.temperature %} +# {% set TARGET_TEMP = printer.extruder.target %} +# +# {% if TARGET_TEMP > PROBE_TEMP %} +# { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) } +# M109 S{ PROBE_TEMP } +# {% else %} +# # Temperature target is already low enough, but nozzle may still be too hot. +# {% if ACTUAL_TEMP > MAX_TEMP %} +# { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) } +# TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP } +# {% endif %} +# {% endif %} [bed_mesh] speed: 500 horizontal_move_z: 10 # 40, 40 --> 40 + probe.x_offset, 40 + probe.y_offset -mesh_min: 40, 70 +mesh_min: 40, 40 # 260, 260 --> 260 + probe.x_offset, 260 + probe.y_offset -mesh_max: 260,290 +mesh_max: 260, 260 # fade_start: 1 # fade_end: 10 # fade_target: 0 @@ -321,7 +324,8 @@ algorithm: bicubic # probe_count: 7,7 # relative_reference_index: 24 probe_count: 9,9 -relative_reference_index: 40 +# relative_reference_index: 40 +zero_reference_position: 150.00, 150.00 [quad_gantry_level] speed: 500 @@ -349,28 +353,34 @@ max_adjust: 10 #*# #*# [extruder] #*# +#*# [probe] +#*# z_offset = -0.850 +#*# +#*# [input_shaper] +#*# shaper_type_x = 3hump_ei +#*# shaper_freq_x = 89.2 +#*# shaper_type_y = mzv +#*# shaper_freq_y = 30.6 +#*# #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.035000, -0.030000, -0.013750, -0.032500, -0.018750, -0.023750, -0.022500, -0.020000, -0.027500 -#*# -0.030000, -0.028750, -0.022500, -0.028750, -0.027500, -0.028750, -0.022500, -0.017500, -0.026250 -#*# -0.026250, -0.031250, -0.025000, -0.027500, -0.031250, -0.027500, -0.028750, -0.038750, -0.050000 -#*# -0.036250, -0.025000, -0.017500, -0.017500, -0.018750, -0.005000, 0.005000, 0.002500, -0.002500 -#*# -0.016250, -0.017500, -0.021250, -0.013750, 0.000000, -0.010000, -0.003750, -0.015000, -0.016250 -#*# -0.036250, -0.043750, -0.040000, -0.047500, -0.032500, -0.031250, -0.038750, -0.031250, -0.032500 -#*# -0.058750, -0.031250, -0.030000, -0.026250, -0.027500, -0.027500, -0.020000, -0.036250, -0.052500 -#*# -0.050000, -0.053750, -0.038750, -0.046250, -0.035000, -0.025000, -0.023750, -0.035000, -0.047500 -#*# -0.063750, -0.045000, -0.041250, -0.038750, -0.032500, -0.031250, -0.028750, -0.037500, -0.042500 +#*# -0.057500, -0.073750, -0.055000, -0.015000, -0.026250, -0.012500, -0.021250, -0.048750, -0.062500 +#*# -0.028750, -0.053750, -0.048750, -0.041250, -0.046250, -0.025000, -0.028750, -0.028750, -0.040000 +#*# -0.077500, -0.053750, -0.091250, -0.076250, -0.051250, -0.035000, -0.050000, -0.087500, -0.063750 +#*# -0.048750, -0.042500, -0.071250, -0.011250, -0.073750, -0.041250, -0.075000, -0.090000, -0.118750 +#*# -0.081250, -0.052500, -0.061250, -0.046250, 0.000000, -0.037500, -0.062500, -0.100000, -0.120000 +#*# -0.095000, -0.116250, -0.037500, -0.020000, -0.075000, -0.068750, -0.048750, -0.111250, -0.121250 +#*# -0.118750, -0.078750, -0.083750, -0.116250, -0.087500, -0.133750, -0.117500, -0.122500, -0.162500 +#*# -0.126250, -0.110000, -0.087500, -0.107500, -0.083750, -0.128750, -0.107500, -0.138750, -0.155000 +#*# -0.055000, -0.088750, -0.083750, -0.130000, -0.121250, -0.111250, -0.106250, -0.128750, -0.141250 +#*# x_count = 9 +#*# y_count = 9 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = bicubic #*# tension = 0.2 #*# min_x = 40.0 -#*# algo = bicubic -#*# y_count = 9 -#*# mesh_y_pps = 2 -#*# min_y = 70.0 -#*# x_count = 9 -#*# max_y = 290.0 -#*# mesh_x_pps = 2 #*# max_x = 260.0 -#*# -#*# [probe] -#*# z_offset = -0.913 +#*# min_y = 40.0 +#*# max_y = 260.0 diff --git a/resonance_test.cfg b/resonance_test.cfg index da02f00..e4e8b5c 100644 --- a/resonance_test.cfg +++ b/resonance_test.cfg @@ -1,39 +1,16 @@ -[mcu nano] -serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 - -# [mcu pico] -# serial: /dev/serial/by-id/usb-Klipper_rp2040_E660583883511936-if00 - -[board_pins arduino] -mcu: nano -aliases: - ar0=PD0, ar1=PD1, ar2=PD2, ar3=PD3, ar4=PD4, - ar5=PD5, ar6=PD6, ar7=PD7, ar8=PB0, ar9=PB1, - ar10=PB2, ar11=PB3, ar12=PB4, ar13=PB5, ar14=PC0, - ar15=PC1, ar16=PC2, ar17=PC3, ar18=PC4, ar19=PC5, - analog0=PC0, analog1=PC1, analog2=PC2, analog3=PC3, analog4=PC4, - analog5=PC5, analog6=PE2, analog7=PE3 - -## arduino nano +## EBB36 [adxl345] -cs_pin: nano:ar10 -spi_software_sclk_pin: nano:ar13 -spi_software_mosi_pin: nano:ar11 -spi_software_miso_pin: nano:ar12 +cs_pin: EBBCan:PB12 +spi_software_sclk_pin: EBBCan:PB10 +spi_software_mosi_pin: EBBCan:PB11 +spi_software_miso_pin: EBBCan:PB2 axes_map: x,y,z -# ## rpi pico -# [adxl345] -# cs_pin: pico:gpio1 -# spi_bus: spi0a -# axes_map: x,y,z - [resonance_tester] accel_chip: adxl345 probe_points: 150,150,20 # an example - [gcode_macro TR] gcode: {% if not "xyz" in printer.toolhead.homed_axes %} From 1e0d04f2abae102cf416955cd7adeb838014b601 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 26 Nov 2023 14:27:58 +0100 Subject: [PATCH 130/131] ercf: remove --- macros/print.cfg | 42 +++++------------------------------------- moonraker.conf | 12 ++++++------ printer.cfg | 1 - 3 files changed, 11 insertions(+), 44 deletions(-) diff --git a/macros/print.cfg b/macros/print.cfg index 400c11b..961d8b1 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -44,7 +44,6 @@ gcode: description: Cancel the actual running print rename_existing: _CANCEL_PRINT_BASE gcode: - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 CLEAR_PAUSE SDCARD_RESET_FILE TURN_OFF_HEATERS @@ -52,16 +51,6 @@ gcode: _CANCEL_PRINT_BASE -[gcode_macro LOAD_FILAMENT] -gcode: - T0 - - -[gcode_macro UNLOAD_FILAMENT] -gcode: - ERCF_EJECT - - [gcode_macro M600] description: Change filament gcode: @@ -124,25 +113,21 @@ gcode: M118 already paused {% endif %} - # - PRINT_START [gcode_macro PRINT_START] gcode: {% set BED=params.BED|default(100)|int %} {% set EXTRUDER=params.EXTRUDER|default(250)|int %} - {% set QGL=params.QGL|default(1)|int %} + {% set QGL=params.QGL|default(0)|int %} {% set BMC=params.BMC|default(0)|int %} {% set SHEET=params.SHEET|default("default")|string %} {% set PURGE=params.PURGE|default(0)|int %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} - {% set ERCF=params.ERCF|default(0)|int %} - {% set ERCF_EXTRUDER=params.ERCF_EXTRUDER|default(0)|int %} - {action_respond_info("starting print BED=%d, EXTRUDER=%d, SHEET=%s, BMC=%d, PURGE=%d, Z_AJUST=%f, ERCF=%d, ERCF_EXTRUDER=%d" % (BED, EXTRUDER, SHEET, BMC, PURGE, Z_ADJUST, ERCF, ERCF_EXTRUDER))} + {action_respond_info("starting print BED=%d, EXTRUDER=%d, SHEET=%s, BMC=%d, PURGE=%d, Z_AJUST=%f" % (BED, EXTRUDER, SHEET, BMC, PURGE, Z_ADJUST))} M117 CONFIGURING M118 CONFIGURING SET_GCODE_OFFSET Z=0.0 # reset z offset M140 S{BED} # start bed heating to bed - # M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder G21 # set units to millimeters G90 # use absolute coordinates @@ -188,12 +173,6 @@ gcode: M109 S{EXTRUDER} # set and wait for extruder temperature SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1 - {% if ERCF %} - M117 ercf changing to tool {ERCF_EXTRUDER} - M118 ercf changing to tool {ERCF_EXTRUDER} - ERCF_HOME - _ERCF_CHANGE_TOOL_SLICER TOOL={ERCF_EXTRUDER} - {% endif %} BRUSHIE {% if PURGE %} PURGE_NOZZLE @@ -211,9 +190,6 @@ gcode: M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-10.0 F3600 ; retract filament - {% if UNLOAD_AT_END == 1 %} - ERCF_EJECT - {% endif %} TURN_OFF_HEATERS M107 ; turn off fan @@ -245,17 +221,9 @@ description: Resume the actual running print rename_existing: _RESUME_BASE gcode: {% if printer.pause_resume.is_paused|lower == 'true' %} - {% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int != 0 %} - M118 You can't resume the print without unlocking the ERCF first. - M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again - {% else %} - RESTORE_GCODE_STATE NAME=PAUSE_state - G90 - {% if printer["gcode_macro _ERCF_VAR"].clog_detection|int == 1 %} - SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 - {% endif %} - _RESUME_BASE - {% endif %} + RESTORE_GCODE_STATE NAME=PAUSE_state + G90 + _RESUME_BASE {% else %} M117 not paused M118 not paused diff --git a/moonraker.conf b/moonraker.conf index 5688cf8..c3d4ad6 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -69,12 +69,12 @@ is_system_service: false path: ~/moonraker-timelapse origin: https://github.com/mainsail-crew/moonraker-timelapse.git -[update_manager ercf] -type: git_repo -primary_branch: main -is_system_service: false -path: ~/EnragedRabbitProject -origin: https://github.com/EtteGit/EnragedRabbitProject.git +# [update_manager ercf] +# type: git_repo +# primary_branch: main +# is_system_service: false +# path: ~/EnragedRabbitProject +# origin: https://github.com/EtteGit/EnragedRabbitProject.git [power voron-v2.4] # type: tplink_smartplug diff --git a/printer.cfg b/printer.cfg index 5a411f7..4aed32a 100644 --- a/printer.cfg +++ b/printer.cfg @@ -65,7 +65,6 @@ path: /home/pi/printer_data/gcodes [include neopixel.cfg] [include fans.cfg] [include resonance_test.cfg] -[include ercf.cfg] ##################################################################### From c298263d941e11ea1808e082706eac06521afa63 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 7 Feb 2024 22:43:43 +0100 Subject: [PATCH 131/131] wip --- KlipperScreen.conf | 19 +++++++--- crowsnest.conf | 62 +++++++++++++++++++++++++++++---- macros/debug.cfg | 30 ++++++++++++++++ macros/print.cfg | 17 +++++++-- moonraker.conf | 18 +++++----- printer.cfg | 87 ++++++++++++++++++++++++++-------------------- 6 files changed, 175 insertions(+), 58 deletions(-) diff --git a/KlipperScreen.conf b/KlipperScreen.conf index b65b537..b43f942 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -1,14 +1,25 @@ +[printer v2.4] +# Define distances and speeds for the extrude panel. CSV list 2 to 4 integers the second +# value is default +extrude_distances: 5, 10, 15, 25 +extrude_speeds: 2, 5, 10, 25 + [preheat PLA] bed = 50 extruder = 200 -[preheat ABS] -bed = 105 -extruder = 250 - [preheat PETG] bed = 80 extruder = 240 + +[preheat ASA] +bed = 100 +extruder = 230 + +[preheat ABS] +bed = 110 +extruder = 255 + #~# --- Do not edit below this line. This section is auto generated --- #~# #~# #~# [main] diff --git a/crowsnest.conf b/crowsnest.conf index 985a5f7..62c41a5 100644 --- a/crowsnest.conf +++ b/crowsnest.conf @@ -1,10 +1,60 @@ +#### crowsnest.conf +#### This is a typical default config. +#### Also used as default in mainsail / MainsailOS +#### See: +#### https://github.com/mainsail-crew/crowsnest/blob/master/README.md +#### for details to configure to your needs. + + +##################################################################### +#### ##### +#### Information about ports and according URL's ##### +#### ##### +##################################################################### +#### ##### +#### Port 8080 equals /webcam/?action=[stream/snapshot] ##### +#### Port 8081 equals /webcam2/?action=[stream/snapshot] ##### +#### Port 8082 equals /webcam3/?action=[stream/snapshot] ##### +#### Port 8083 equals /webcam4/?action=[stream/snapshot] ##### +#### ##### +#### Note: These ports are default for most Mainsail ##### +#### installations. To use any other port would involve ##### +#### changing the proxy configuration or using directly ##### +#### http://:/?action=[stream/snapshot] ##### +#### ##### +##################################################################### +#### RTSP Stream URL: ( if enabled and supported ) ##### +#### rtsp://:/stream.h264 ##### +##################################################################### + + [crowsnest] log_path: ~/printer_data/logs/crowsnest.log -log_level: quiet +log_level: verbose # Valid Options are quiet/verbose/debug +delete_log: false # Deletes log on every restart, if set to true +no_proxy: false +## LEGACY [cam 1] -mode: mjpg -port: 8080 -device: /dev/video0 -resolution: 1280x960 -max_fps: 10 +mode: ustreamer # ustreamer - Provides mjpg and snapshots. (All devices) + # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only) +enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server +rtsp_port: 8554 # Set different ports for each device! +port: 8080 # HTTP/MJPG Stream/Snapshot Port +device: /dev/video0 # See Log for available ... +resolution: 640x480 # widthxheight format +max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. +#custom_flags: # You can run the Stream Services with custom flags. +#v4l2ctl: # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of. + +# ## LIBCAMERA +# [cam 1] +# mode: camera-streamer # ustreamer - Provides mjpg and snapshots. (All devices) +# # enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server +# # rtsp_port: 8554 # Set different ports for each device! +# # port: 8080 # HTTP/MJPG Stream/Snapshot Port +# device: /dev/v4l/by-path/platform-3f801000.csi-video-index0 # See Log for available ... +# # resolution: 1920x1080 # widthxheight format +# # max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. +# #custom_flags: # You can run the Stream Services with custom flags. +# #v4l2ctl: # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of. diff --git a/macros/debug.cfg b/macros/debug.cfg index ba21067..55488c3 100644 --- a/macros/debug.cfg +++ b/macros/debug.cfg @@ -7,6 +7,36 @@ ##################################################################### +[gcode_macro xk] +gcode: + M117 xk + M118 xk + # M117 {quad_gantry_level.applied} + # M118 {quad_gantry_level.applied} + {% if printer['quad_gantry_level'] is not none %} + M117 not none + M118 not none + {% if printer['quad_gantry_level'].applied %} + M117 not none yes + M118 not none yes + {% endif %} + {% else %} + M117 not not none + M118 not not none + {% endif %} + + {% if printer['quad_gantry_level'] is defined %} + M117 defined + M118 defined + {% if printer['quad_gantry_level'].applied %} + M117 defined yes + M118 defined yes + {% endif %} + {% else %} + M117 not defined + M118 not defined + {% endif %} + ## Use: ## - DUMP_PARAMETERS ## - DUMP_PARAMETERS S='gcode_macro _USER_VARIABLE' diff --git a/macros/print.cfg b/macros/print.cfg index 961d8b1..98729b0 100644 --- a/macros/print.cfg +++ b/macros/print.cfg @@ -39,7 +39,7 @@ gcode: {% endif %} -# # - CANCEL_PRINT +# CANCEL_PRINT [gcode_macro CANCEL_PRINT] description: Cancel the actual running print rename_existing: _CANCEL_PRINT_BASE @@ -50,6 +50,18 @@ gcode: PARK _CANCEL_PRINT_BASE +# LOAD_FILAMENT +[gcode_macro LOAD_FILAMENT] +description: extrude 100mm of filament +gcode: + G0 E100 F600 # speed 10*60 + +# UNLOAD_FILAMENT +[gcode_macro UNLOAD_FILAMENT] +description: retract 100mm of filament +gcode: + G0 E-100 F600 # speed 10*60 + [gcode_macro M600] description: Change filament @@ -124,6 +136,7 @@ gcode: {% set PURGE=params.PURGE|default(0)|int %} {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} {action_respond_info("starting print BED=%d, EXTRUDER=%d, SHEET=%s, BMC=%d, PURGE=%d, Z_AJUST=%f" % (BED, EXTRUDER, SHEET, BMC, PURGE, Z_ADJUST))} + {% set EXTRUDER_MIN=120 %} M117 CONFIGURING M118 CONFIGURING SET_GCODE_OFFSET Z=0.0 # reset z offset @@ -162,7 +175,7 @@ gcode: G92 E0 # reset extruder G90 # use absolute coordinates - M104 S{EXTRUDER} # start extruder heating + M104 S{EXTRUDER_MIN} # start extruder heating NOTIFY_BED BED={BED} M190 S{BED} # set and wait for actual bed temperature # final home z diff --git a/moonraker.conf b/moonraker.conf index c3d4ad6..5db2bd0 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -62,12 +62,12 @@ env: ~/.KlipperScreen-env/bin/python requirements: scripts/KlipperScreen-requirements.txt install_script: scripts/KlipperScreen-install.sh -[update_manager timelapse] -type: git_repo -primary_branch: main -is_system_service: false -path: ~/moonraker-timelapse -origin: https://github.com/mainsail-crew/moonraker-timelapse.git +# [update_manager timelapse] +# type: git_repo +# primary_branch: main +# is_system_service: false +# path: ~/moonraker-timelapse +# origin: https://github.com/mainsail-crew/moonraker-timelapse.git # [update_manager ercf] # type: git_repo @@ -83,16 +83,16 @@ type: tasmota address: pcu-eg-office-voronberry.nom # password: mypassword -[timelapse] +# [timelapse] ## Following basic configuration is default to most images and don't need ## to be changed in most scenarios. Only uncomment and change it if your ## Image differ from standard installations. In most common scenarios ## a User only need [timelapse] in there configuration. ## ## Directory where the generated video will be saved -output_path: ~/timelapse/ +# output_path: ~/timelapse/ ## Directory where the temporary frames are saved -frame_path: /tmp/timelapse/ +# frame_path: /tmp/timelapse/ ## Directory where ffmpeg is installed #ffmpeg_binary_path: /usr/bin/ffmpeg diff --git a/printer.cfg b/printer.cfg index 4aed32a..14dfd8b 100644 --- a/printer.cfg +++ b/printer.cfg @@ -56,6 +56,19 @@ path: /home/pi/printer_data/gcodes [exclude_object] +# enable M118 and RESPOND +[respond] +# default_type: echo +# default_type: echo +# Sets the default prefix of the "M118" and "RESPOND" output to one +# of the following: +# echo: "echo: " (This is the default) +# command: "// " +# error: "!! " +default_prefix: >> +# Directly sets the default prefix. If present, this value will +# override the "default_type". +# ##################################################################### # includes ##################################################################### @@ -283,33 +296,33 @@ sample_retract_dist: 3 samples_tolerance: 0.01 samples_tolerance_retries: 5 -# activate_gcode: -# # impatient -# # {% set PROBE_TEMP = 200 %} -# {% set PROBE_TEMP = 250 %} -# {% set MAX_TEMP = PROBE_TEMP + 5 %} -# {% set ACTUAL_TEMP = printer.extruder.temperature %} -# {% set TARGET_TEMP = printer.extruder.target %} -# -# {% if TARGET_TEMP > PROBE_TEMP %} -# { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) } -# M109 S{ PROBE_TEMP } -# {% else %} -# # Temperature target is already low enough, but nozzle may still be too hot. -# {% if ACTUAL_TEMP > MAX_TEMP %} -# { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) } -# TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP } -# {% endif %} -# {% endif %} +activate_gcode: + # impatient + {% set PROBE_TEMP = 120 %} + # {% set PROBE_TEMP = 250 %} + {% set MAX_TEMP = PROBE_TEMP + 5 %} + {% set ACTUAL_TEMP = printer.extruder.temperature %} + {% set TARGET_TEMP = printer.extruder.target %} + + {% if TARGET_TEMP > PROBE_TEMP %} + { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) } + M109 S{ PROBE_TEMP } + {% else %} + # Temperature target is already low enough, but nozzle may still be too hot. + {% if ACTUAL_TEMP > MAX_TEMP %} + { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) } + TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP } + {% endif %} + {% endif %} [bed_mesh] speed: 500 horizontal_move_z: 10 -# 40, 40 --> 40 + probe.x_offset, 40 + probe.y_offset -mesh_min: 40, 40 -# 260, 260 --> 260 + probe.x_offset, 260 + probe.y_offset -mesh_max: 260, 260 +# x, y --> x + probe.x_offset, y + probe.y_offset +mesh_min: 35, 35 +# x, y --> x + probe.x_offset, y + probe.y_offset +mesh_max: 265, 265 # fade_start: 1 # fade_end: 10 # fade_target: 0 @@ -324,7 +337,7 @@ algorithm: bicubic # relative_reference_index: 24 probe_count: 9,9 # relative_reference_index: 40 -zero_reference_position: 150.00, 150.00 +zero_reference_position: 145.00, 145.00 [quad_gantry_level] speed: 500 @@ -353,7 +366,7 @@ max_adjust: 10 #*# [extruder] #*# #*# [probe] -#*# z_offset = -0.850 +#*# z_offset = -0.880 #*# #*# [input_shaper] #*# shaper_type_x = 3hump_ei @@ -364,22 +377,22 @@ max_adjust: 10 #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.057500, -0.073750, -0.055000, -0.015000, -0.026250, -0.012500, -0.021250, -0.048750, -0.062500 -#*# -0.028750, -0.053750, -0.048750, -0.041250, -0.046250, -0.025000, -0.028750, -0.028750, -0.040000 -#*# -0.077500, -0.053750, -0.091250, -0.076250, -0.051250, -0.035000, -0.050000, -0.087500, -0.063750 -#*# -0.048750, -0.042500, -0.071250, -0.011250, -0.073750, -0.041250, -0.075000, -0.090000, -0.118750 -#*# -0.081250, -0.052500, -0.061250, -0.046250, 0.000000, -0.037500, -0.062500, -0.100000, -0.120000 -#*# -0.095000, -0.116250, -0.037500, -0.020000, -0.075000, -0.068750, -0.048750, -0.111250, -0.121250 -#*# -0.118750, -0.078750, -0.083750, -0.116250, -0.087500, -0.133750, -0.117500, -0.122500, -0.162500 -#*# -0.126250, -0.110000, -0.087500, -0.107500, -0.083750, -0.128750, -0.107500, -0.138750, -0.155000 -#*# -0.055000, -0.088750, -0.083750, -0.130000, -0.121250, -0.111250, -0.106250, -0.128750, -0.141250 +#*# -0.000973, 0.016527, 0.007777, 0.001527, 0.016527, -0.005973, 0.014027, 0.015277, 0.007777 +#*# -0.003473, 0.012777, 0.009027, -0.005973, 0.011527, 0.000277, 0.021527, 0.002777, 0.012777 +#*# 0.004027, 0.007777, 0.012777, 0.020277, 0.024027, 0.024027, 0.020277, 0.017777, 0.014027 +#*# -0.005973, -0.008473, -0.002223, -0.003473, 0.019027, -0.003473, -0.003473, -0.002223, -0.003473 +#*# -0.000973, -0.007223, -0.004723, 0.011527, -0.004723, -0.000973, 0.022777, 0.009027, -0.005973 +#*# 0.001527, 0.015277, 0.036527, 0.015277, 0.014027, 0.012777, 0.021527, 0.016527, 0.019027 +#*# -0.010973, 0.012777, -0.005973, -0.000973, 0.000277, -0.007223, 0.000277, -0.002223, -0.012223 +#*# -0.007223, 0.005277, 0.006527, 0.015277, 0.011527, 0.024027, 0.011527, -0.012223, 0.001527 +#*# -0.003473, -0.003473, 0.009027, -0.008473, 0.009027, 0.007777, 0.009027, -0.007223, -0.009723 #*# x_count = 9 #*# y_count = 9 #*# mesh_x_pps = 2 #*# mesh_y_pps = 2 #*# algo = bicubic #*# tension = 0.2 -#*# min_x = 40.0 -#*# max_x = 260.0 -#*# min_y = 40.0 -#*# max_y = 260.0 +#*# min_x = 35.0 +#*# max_x = 265.0 +#*# min_y = 35.0 +#*# max_y = 265.0