Open Wmelonhead opened 1 year ago
Here is my config file if you don't want to open the zip:
[include mainsail.cfg]
[stepper_x] step_pin: PA14 dir_pin: !PA10 enable_pin: !PA13 microsteps: 16 rotation_distance: 39.800 endstop_pin: ^PC4 position_endstop: 0 position_max: 235 homing_speed: 50
[stepper_y] step_pin: PC8 dir_pin: !PA15 enable_pin: !PC14 microsteps: 16 rotation_distance: 39.756 endstop_pin: ^PB0 position_endstop: 0 position_max: 235 homing_speed: 50
[stepper_z] step_pin: PD2 dir_pin: !PD4 enable_pin: !PD3 microsteps: 16 rotation_distance: 7.967 endstop_pin: ^PC6 endstop_pin: probe:z_virtual_endstop
position_min: 0 position_max: 270
[stepper_z1] step_pin: PD5 dir_pin: !PD6 enable_pin: !PB3 microsteps: 16 rotation_distance: 7.967 endstop_pin: ^PC6 endstop_pin: probe:z_virtual_endstop
[extruder] step_pin: PB7 dir_pin: PB6 enable_pin: !PB4 microsteps: 16 rotation_distance: 7.583 nozzle_diameter: 0.400 filament_diameter: 1.750 pressure_advance: 0.0 pressure_advance_smooth_time: 0.040 heater_pin: PB10 #HE0 sensor_type: EPCOS 100K B57560G104F sensor_pin: PA5 #TH0
min_temp: 0 max_temp: 250
#M117 Runout Detected!
[filament_motion_sensor BTT] detection_length: 10.00 ; This can be adjusted to your desired level of sensitivity. 10 is a recomended value to prevent flow dropoff false triggers. extruder: extruder switch_pin: ^PC5 pause_on_runout: True ; This can be set to false to debug false positives putting the sensor in "monitor mode". The printer will not pause but it will run the runout_gcode below. event_delay: 3.0 pause_delay: 0.5 runout_gcode: M117 Runout Detected!
[delayed_gcode DISABLEFILAMENTSENSOR] ; This will disable the SFS 1 second after klipper starts initial_duration: 1 gcode: SET_FILAMENT_SENSOR SENSOR=BTT ENABLE=0 ; Put your filament sensor's name after SENSOR=
[heater_bed] heater_pin: PB2 #HB sensor_type: EPCOS 100K B57560G104F #Generic 3950 sensor_pin: PA3 #TB
min_temp: 0 max_temp: 250
[fan] pin: PA8
[heater_fan fan1] pin: PB15
[heater_fan fan2] pin: PB14
[mcu] serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_590028000C504B5735313920-if00
[virtual_sdcard] path: /home/biqu/printer_data/gcodes
[printer] kinematics: cartesian max_velocity: 300 max_accel: 3000 max_z_velocity: 5 max_z_accel: 100 square_corner_velocity: 5.0
########################################
########################################
[tmc2209 stepper_x] uart_pin: PB8 diag_pin: PC4 run_current: 0.596 hold_current: 0.516 stealthchop_threshold: 999999
[tmc2209 stepper_y] uart_pin: PC9 diag_pin: PB0 run_current: 0.596 hold_current: 0.516 stealthchop_threshold: 999999
[tmc2209 stepper_z] uart_pin: PD0 diag_pin: PC6 run_current: 0.596
stealthchop_threshold: 999999
[tmc2209 stepper_z1] uart_pin: PB5 diag_pin: PB1 run_current: 0.596
stealthchop_threshold: 999999
[board_pins] aliases:
EXP1_1=PC1, EXP1_3=PC3, EXP1_5=PC0, EXP1_7=PA2, EXP1_9=<GND>,
EXP1_2=PC2, EXP1_4=<RST>, EXP1_6=PA0, EXP1_8=PA1, EXP1_10=<5V>
[bltouch] sensor_pin: PA6 control_pin: PA7 x_offset: -29 y_offset: -41
speed: 5.0 samples: 2 samples_result: median sample_retract_dist: 6.0 samples_tolerance: 0.01 samples_tolerance_retries: 3
[resonance_tester] accel_chip: adxl345 probe_points: 100, 100, 20 # an example
[adxl345] cs_pin: PC15 spi_software_miso_pin: PC11 spi_software_mosi_pin: PC12 spi_software_sclk_pin: PC10
[input_shaper]
shaper_freq_x: 52.6 # frequency for the X mark of the test model
shaper_freq_y: 49.2 # frequency for the Y mark of the test model
shaper_type_x: mzv shaper_type_y: 2hump_ei
damping_ratio_x: 0.1 damping_ratio_y: 0.1
[bed_screws] screw1: 30.5, 37 screw2: 30.5, 207 screw3: 204.5, 207 screw4: 204.5, 37
[display] lcd_type: st7920 cs_pin: EXP1_7 sclk_pin: EXP1_6 sid_pin: EXP1_8 encoder_pins: ^EXP1_5, ^EXP1_3 click_pin: ^!EXP1_2
[output_pin beeper] pin: EXP1_1
[safe_z_home] home_xy_position: 117.5,117.5 # Change coordinates to the center of your print bed speed: 100 z_hop: 10 # Move up 10mm z_hop_speed: 5
[bed_mesh] speed: 120 horizontal_move_z: 5 mesh_min: 10, 37 mesh_max: 206, 183 # Make sure X,Y here meets these conditions (X+(bltouch+x_offset) < bed X) and (Y+(bltouch+y_offset) < Bed Y) probe_count: 10,10 move_check_distance: 5 split_delta_z: 0.025 fade_start: 1 fade_end: 10 mesh_pps: 2, 2 algorithm: bicubic
bicubic_tension: .2
[z_tilt] z_positions: 250, 117.5 15, 117.5
points: 225,110 40, 110
speed: 150
horizontal_move_z: 5
retries: 30
retry_tolerance: 0.0025
[gcode_macro MECHANICAL_GANTRY_CALIBRATION] gcode:
{% set my_current = params.CURRENT|default(0.12)|float %} ; adjust crash current on the fly :D
###
{% set oldcurrent = printer.configfile.settings["tmc2209 stepper_z"].run_current %} ; TODO: Find runtime current settings
{% set oldhold = printer.configfile.settings["tmc2209 stepper_z"].hold_current %}
{% set x_max = printer.toolhead.axis_maximum.x %}
{% set y_max = printer.toolhead.axis_maximum.y %}
{% set z_max = printer.toolhead.axis_maximum.z %}
{% set fast_move_z = printer.configfile.settings["printer"].max_z_velocity %}
{% set fast_move = printer.configfile.settings["printer"].max_velocity %}
M117 {printer.homed_axes}
{% if printer.homed_axes != 'xyz' %}
G28 #Home All Axes
{% endif %}
G90 ; absolute
G0 X{x_max / 2} Y{y_max / 2} F{fast_move * 30 } ;put toolhead in the center of the gantry
G0 Z{z_max -1} F{fast_move_z * 60 } ; go to the Z-max at speed max z speed
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={my_current} ; drop current on Z stepper
{% if printer.configfile.settings["stepper_z1"] %} ; test for dual Z
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={my_current} ; drop current
{% endif %}
G4 P200 ; Probably not necessary, it is here just for sure
SET_KINEMATIC_POSITION Z={z_max - 12} ; Trick printer into beleiving the gantry is 12mm lower than it is
G1 Z{z_max -2} F{6 * 60} ; try to move 10mm up
G4 P200 ; wait
G1 Z{z_max -6} F{6 * 60} ; move 4mm down
G4 P200 ; same as the first one
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={oldcurrent} HOLDCURRENT={oldhold}
{% if printer.configfile.settings["stepper_z1"] %} ; test for dual Z
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={oldcurrent} HOLDCURRENT={oldhold} ; reset current
{% endif %}
G1 Z{z_max -30} F{6 * 60} ; move to 30mm below z-max to allow homing movement
G4 P200 ; same as the first one
G28 Z ; we MUST home again as the ganty is really in the wrong place.
[gcode_macro G34] gcode: MECHANICAL_GANTRY_CALIBRATION
#G34
[force_move] enable_force_move: true ; enable FORCE_MOVE and SET_KINEMATIC_POSITION
[gcode_macro G29] gcode: BED_MESH_CALIBRATE
[gcode_macro FILAMENT_LOAD] gcode: M83 # Put the extruder into relative mode G92 E0.0 # Reset the extruder so that it thinks it is at position zero G1 E50 F350 # Move the extruder forward 120mm at a speed of 350mm/minute G92 E0.0 # Reset the extruder again M82 # Put the extruder back into absolute mode.
[gcode_macro FILAMENT_UNLOAD] gcode: M83 # Put the extruder into relative mode G92 E0.0 # Reset the extruder so that it thinks it is at position zero G1 E-50 F350 # Move the extruder forward 120mm at a speed of 350mm/minute G92 E0.0 # Reset the extruder again M82 # Put the extruder back into absolute mode.
####################################
####################################
[gcode_macro _km_options]
variable_load_length: 50.0
gcode: # This line is required by Klipper.
[include klipper-macros/*.cfg]
[idle_timeout] gcode: _KM_IDLE_TIMEOUT [pause_resume]
[respond]
[save_variables] filename: /home/biqu/printer_data/config/variables.cfg # UPDATE THIS FOR YOUR PATH!!!
[virtual_sdcard] path: /home/biqu/printer_data/gcodes
[display_status]
#
[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 G91 G1 z50 F600 G90
M117 DISABLING the Smart Filament Sensor
G92 E0
SET_FILAMENT_SENSOR SENSOR=BTT ENABLE=0 ; Put your filament sensor's name after SENSOR=
[gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE
variable_extrude: 1.0 gcode:
{% 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:
{% 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 bed_mesh_calibrate_fast] description: Wraps BED_MESH_CALIBRATE, scaling probe count to specified area. Usage: See Klipper documentation. gcode: {% set km = printer["gcode_macro _km_globals"] %} {% set probe_mesh_padding = km.probe_mesh_padding %} {% set probe_min_count = km.probe_min_count %} {% set probe_count_scale = km.probe_count_scale %} {% set bed_mesh = printer.configfile.config.bed_mesh %}
{%if "mesh_radius" not in bed_mesh and "MESH_RADIUS" not in params and "relative_reference_index" not in bed_mesh and "RELATIVE_REFERENCE_INDEX" not in params %} {% set safe_min_x = bed_mesh.mesh_min.split(",")[0]|float %} {% set safe_min_y = bed_mesh.mesh_min.split(",")[1]|float %} {% set safe_max_x = bed_mesh.mesh_max.split(",")[0]|float %} {% set safe_max_y = bed_mesh.mesh_max.split(",")[1]|float %}
# Always bound MESH_MIN and MESH_MAX.
{% if "MESH_MIN" in params %}
{% set mesh_min_x = (params.MESH_MIN.split(",")[0]|float -
probe_mesh_padding, safe_min_x)|max %}
{% set mesh_min_y = (params.MESH_MIN.split(",")[1]|float -
probe_mesh_padding, safe_min_y)|max %}
{% else %}
{% set mesh_min_x = safe_min_x %}
{% set mesh_min_y = safe_min_y %}
{% endif %}
{% if "MESH_MAX" in params %}
{% set mesh_max_x = (params.MESH_MAX.split(",")[0]|float +
probe_mesh_padding, safe_max_x)|min %}
{% set mesh_max_y = (params.MESH_MAX.split(",")[1]|float +
probe_mesh_padding, safe_max_y)|min %}
{% else %}
{% set mesh_max_x = safe_max_x %}
{% set mesh_max_y = safe_max_y %}
{% endif %}
{% set probe_count = (params.PROBE_COUNT |
default(bed_mesh.probe_count)).split(",") %}
# Don't scale the probe count if one was explicitly provided.
{% if "PROBE_COUNT" not in params %}
{% set max_x_probes = probe_count[0]|int %}
{% set max_y_probes = probe_count[1]|default(max_x_probes)|int %}
{% set x_probes = (max_x_probes * (mesh_max_x - mesh_min_x) /
(safe_max_x - safe_min_x) * probe_count_scale)
| round(0) | int %}
{% set x_probes = ((x_probes, probe_min_count)|max, max_x_probes)|min %}
{% set y_probes = (max_y_probes * (mesh_max_y - mesh_min_y ) /
(safe_max_y - safe_min_y) * probe_count_scale )
| round(0) | int %}
{% set y_probes = ((y_probes, probe_min_count)|max, max_y_probes)|min %}
# Add probes for bicubic if one axis has too many probes for lagrange.
{% if x_probes > 6 and y_probes < 4 %}
{% set y_probes = 4 %}
{% elif y_probes > 6 and x_probes < 4 %}
{% set x_probes = 4 %}
{% endif %}
{% set probe_count = [x_probes,y_probes] %}
{% endif %}
{% set dummy = params.__setitem__("MESH_MIN", mesh_min_x~","~mesh_min_y) %}
{% set dummy = params.__setitem__("MESH_MAX", mesh_max_x~","~mesh_max_y) %}
{% set dummy = params.__setitem__("PROBE_COUNT", probe_count|join(',')) %}
# Force bicubic if we've exceeded the max for lagrange.
{% if probe_count[0]|int > 6 or probe_count[1]|default(0)|int > 6 %}
{% set dummy = params.__setitem__("ALGORITHM", "bicubic") %}
{% endif %}
{% endif %} {% if printer["gcode_macro bed_mesh_calibrate"].km_override|default(False) %} {% set calibrate_cmd = "_km_bed_mesh_calibrate_base" %} {% else %} {% set calibrate_cmd = "BED_MESH_CALIBRATE" %} {% endif %} BED_MESH_CHECK {calibrate_cmd}{%for k in params%}{' '~k~'="'~params[k]~'"'}{%endfor%}
[gcode_macro bed_mesh_check] description: Warns if bed_mesh config may generate an invalid mesh. Usage: See Klipper documentation. gcode: {% if printer.bed_mesh is defined %} {% set x_min = printer.configfile.settings.stepper_x.position_min %} {% set y_min = printer.configfile.settings.stepper_y.position_min %} {% set x_max = printer.configfile.settings.stepper_x.position_max %} {% set y_max = printer.configfile.settings.stepper_y.position_max %}
{% set mesh_min_x = printer.configfile.settings.bed_mesh.mesh_min[0] %}
{% set mesh_min_y = printer.configfile.settings.bed_mesh.mesh_min[1] %}
{% set mesh_max_x = printer.configfile.settings.bed_mesh.mesh_max[0] %}
{% set mesh_max_y = printer.configfile.settings.bed_mesh.mesh_max[1] %}
{% if "bltouch" in printer.configfile.settings %}
{% set x_offset = printer.configfile.settings.bltouch.x_offset %}
{% set y_offset = printer.configfile.settings.bltouch.y_offset %}
{% set probe = "bltouch" %}
{% elif "probe" in printer.configfile.settings %}
{% set x_offset = printer.configfile.settings.probe.x_offset %}
{% set y_offset = printer.configfile.settings.probe.y_offset %}
{% set probe = "probe" %}
{% else %}
{% set x_offset = 0.0 %}
{% set y_offset = 0.0 %}
{% endif %}
{% set output = [] %}
{% set warn =
"* bed_mesh.mesh_%s (%f, %f) does not account for " ~ probe ~
".%s_offset (%f) and can move out of range for "
"stepper_%s.position_%s (%f)." %}
{% if x_offset > 0 and (mesh_min_x - x_offset) < x_min %}
{% set dummy = output.append(warn % ('min', mesh_min_x, mesh_min_y,
'x', x_offset, 'x', 'min', x_min)) %}
{% elif x_offset < 0 and (mesh_max_x - x_offset) > x_max %}
{% set dummy = output.append(warn % ('max', mesh_max_x, mesh_max_y,
'x', x_offset, 'x', 'max', x_max)) %}
{% endif %}
{% if y_offset > 0 and (mesh_min_y - y_offset) < y_min %}
{% set dummy = output.append(warn % ('min', mesh_min_x, mesh_min_y,
'y', y_offset, 'y', 'min', y_min)) %}
{% elif y_offset < 0 and (mesh_max_y - y_offset) > y_max %}
{% set dummy = output.append(warn % ('max', mesh_max_x, mesh_max_y,
'y', y_offset, 'y', 'max', y_max)) %}
{% endif %}
{% if output %}
{ action_respond_info(
"Warning: The following issue(s) were detected in your [bed_mesh] "
" config:\n" ~ output|join("\n")) }
{% endif %}
{% endif %}
######################################################################
######################################################################
[gcode_macro START_PRINT] gcode: ; Ender 3 Custom Start G-code M117 ENABLING the Smart Filament Sensor G92 E0 ; Reset Extruder SET_FILAMENT_SENSOR SENSOR=BTT ENABLE=1 ; Put your filament sensor's name after SENSOR= {% set BED_TEMP = params.BED_TEMP|default(60)|float %} {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(210)|float %}
M140 S{BED_TEMP}
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0.0
# Home the printer
G28
# Move the nozzle near the bed
G1 Z5 F3000
# Move the nozzle very close to the bed
G1 Z0.15 F300
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
M117 Priming
; Start of print
G21; metric values
G90 ; absolute positioning
M82; set extruder to absolute mode
#M420 S1 V1
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.4 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.4 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.7 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.7 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
;Tuning params
;Put printing message on LCD screen
M117 Printing...
#{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
#{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
# Start bed heating
#M140 S{BED_TEMP}
# Use absolute coordinates
#G90
# Reset the G-Code Z offset (adjust Z offset if needed)
#SET_GCODE_OFFSET Z=0.0
# Home the printer
#G28
# Move the nozzle near the bed
#G1 Z5 F3000
# Move the nozzle very close to the bed
#G1 Z0.15 F300
# Wait for bed to reach temperature
#M190 S{BED_TEMP}
# Set and wait for nozzle to reach temperature
#M109 S{EXTRUDER_TEMP}
#LED_PRINTING
[gcode_macro END_PRINT] gcode: G91 ;Relative positioning G1 E-2 F2700 ;Retract a bit G1 E-2 Z0.2 F2400 ;Retract and raise Z G1 X5 Y5 F3000 ;Wipe out G1 Z10 ;Raise Z more G90 ;Absolute positioning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 X Y E ;Disable all steppers but Z
M117 DISABLING the Smart Filament Sensor
G92 E0
SET_FILAMENT_SENSOR SENSOR=BTT ENABLE=0 ; Put your filament sensor's name after SENSOR=
#LED_COOLING
# Turn off bed, extruder, and fan
#M140 S0
#M104 S0
#M106 S0
# Move nozzle away from print while retracting
#G91
#G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
#G1 Z10 F3000
#G90
# Disable steppers
#M84
######################################################################
######################################################################
#{% 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
#
#
# ################################################################################ [gcode_macro _km_globals]
variable_bed_surface_max_name_length: 10
variable_bed_surfaces: ['default']
variable_beep_frequency: 1000
variable_beep_duration: 100
variable_load_length: 90.0
variable_load_speed: 300
variable_load_priming_length: 25.0
variable_load_priming_speed: 150
variable_menu_show_octoprint: True
variable_menu_show_sdcard: True
variable_menu_temperature: [ {'name' : 'PLA', 'extruder' : 200, 'bed' : 60}, {'name' : 'PETG', 'extruder' : 230, 'bed' : 85}, {'name' : 'ABS', 'extruder' : 245, 'bed' : 110}]
variable_park_x: 0.0
variable_park_y: 0.0
variable_park_z: 20.0
variable_print_min: () # example: (0, 0)
variable_print_max: () # example: (220, 220)
variable_pressure_advance_scale: -1.0
variable_probe_mesh_padding : 5.0
variable_probe_min_count: 3
variable_probe_count_scale: 1.0
variable_start_bed_heat_delay: 2000
variable_start_bed_heat_overshoot: 2.0
variable_start_clear_adjustments_at_end: True
variable_start_end_park_y: 0.0
variable_start_extruder_preheat_scale: 0.5
variable_start_extruder_set_target_before_level: True
variable_start_gcode_before_print: ''
variable_start_home_z_at_temp: True
variable_start_level_bed_at_temp: True
variable_start_purge_clearance: 2.0
variable_start_purge_length: 0.0 # 30 is a good starting point.
variable_start_purge_prime_length: 12.0
variable_start_quad_gantry_level_at_temp: True
variable_start_z_tilt_adjust_at_temp: True
variable_travel_speed_xy: 3000
variable_travel_speed_z: 600
variable_velocity_decel_scale: 0.5 ################################################################################ description: Initializes our globals, including any _km_options overrides. gcode:
{% set required_sections = {"heater_bed" : None, "extruder" : None, "gcode_macro _km_options" : None, "idle_timeout" : ("gcode", "_KM_IDLE_TIMEOUT"), "pause_resume" : None, "respond" : None, "save_variables" : None, "virtual_sdcard" : None } %} {% set output = [] %} {% for s in required_sections %} {% set f = required_sections[s][0] if required_sections[s] else None %} {% set v = required_sections[s][1] if required_sections[s] else None %} {% if s not in printer.configfile.config %} {% set dummy = output.append("Missing [%s] section.\n" | format(s)) %} {% elif f and (v not in printer.configfile.config[s][f]|default("")|upper) %} {% set dummy = output.append("Missing %s in %s for [%s] section.\n" | format(v, f, s)) %} {% endif %} {% endfor %} {% if output %} { action_emergency_stop(( "required printer.cfg section(s) missing:\n" ~ output | join("\n")) ~ "See readme: https://github.com/jschuh/klipper-macros\x23klipper-setup") } {% endif %}
SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=start_level_bed_at_temp VALUE="{ 1 if printer.bed_mesh is defined else 0}" BED_MESH_CHECK SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=start_quad_gantry_level_at_temp VALUE="{ 1 if printer.quad_gantry_level is defined else 0}" SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=start_z_tilt_adjust_at_temp VALUE="{ 1 if printer.z_tilt is defined else 0}" {% set toolhead = printer.toolhead %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=print_min VALUE="{ (toolhead.axis_minimum.x, toolhead.axis_minimum.y)}" SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=print_max VALUE="{ (toolhead.axis_maximum.x, toolhead.axis_maximum.y)}" SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=start_end_park_y VALUE="{ toolhead.axis_maximum.y}" {% set settings = printer.configfile.settings %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=start_home_z_at_temp VALUE="{ 1 if ("stepper_z" in settings and settings.stepper_z.endstop_pin.split()|join("")|lower == "probe:z_virtual_endstop") else 0}"
{% set options = printer["gcode_macro _km_options"] %} {% set km = printer["gcode_macro _km_globals"] %}
{% for k in options %} {% if k not in km %} {action_raise_error("%s is not valid for _KM_OPTIONS." | format(k))} {% endif %} {% if km[k] is string %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE={k } VALUE="'{options[k]|replace('\','\\')|replace('\'','\\'') |replace('\"','\\"')}'" {% elif km[k] is float %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE={k } VALUE="{options[k]|float}" {% elif km[k] is integer or km[k] is boolean %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE={k} VALUE="{options[k]|int}" {% elif km[k] is mapping %} {% if options[k] is not mapping %} {action_raise_error("%s requires a mapping type." | format(k))} {% endif %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE={k } VALUE="{options[k]|replace('\"','\\"')}" {% elif km[k] is sequence %} {% if options[k] is not sequence %} {action_raise_error("%s requires a sequence type." | format(k))} {% endif %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE={k } VALUE="{options[k]|replace('\"','\\"')}" {% else %} {action_raise_error("%s is not a valid type for _KM_OPTIONS."|format(k))} {% endif %} {% endfor %}
{% if "print_max" in options and "start_end_park_y" not in options %} SET_GCODE_VARIABLE MACRO=_km_globals VARIABLE=start_end_park_y VALUE="{ options.print_max[1] }" {% endif %}
{% if "homing_override" in printer.configfile.config %} {% for l in printer.configfile.config.homing_override.gcode.split("\n") %} {% if " g28 " in (" " ~ l.split("\x23")[0].split(";")[0]|lower ~ " ") %} { action_raise_error( "G28 in [homing_override] gcode. Replace with G28.6245197 to " "fix recursive macro call.\n" "See readme: https://github.com/jschuh/klipper-macros\x23g28") } {% endif %} {% endfor %} {% endif %}
M400
[delayed_gcode INIT_GLOBALS]
initial_duration: 1 gcode: _KM_GLOBALS
CHECK_KM_CONFIG _INIT_SURFACES
SET_DRAW_PARAMS WIDTH="{printer.configfile.settings.extruder.nozzle_diameter}"
_KM_OPTIONS
[gcode_macro check_km_config] description: Checks global variables and throws an error on any invalid values. Does nothing if the config has no errors. gcode: {% set km = printer["gcode_macro _km_globals"] %} {% set toolhead = printer.toolhead %} {% set output = [] %} {% if km.park_x > toolhead.axis_maximum.x or km.park_x < toolhead.axis_minimum.x %} {% set dummy = output.append("park_x is invalid.") %} {% endif %} {% if km.park_y > toolhead.axis_maximum.y or km.park_y < toolhead.axis_minimum.y %} {% set dummy = output.append("park_y is invalid.") %} {% endif %} {% if km.park_z > toolhead.axis_maximum.z or km.park_z < toolhead.axis_minimum.z %} {% set dummy = output.append("park_z is invalid.") %} {% endif %} {% if km.print_max[0] > toolhead.axis_maximum.x or km.print_max[1] > toolhead.axis_maximum.y %} {% set dummy = output.append("print_max is invalid.") %} {% endif %} {% if km.print_min[0] < toolhead.axis_minimum.x or km.print_min[1] < toolhead.axis_minimum.y %} {% set dummy = output.append("print_min is invalid.") %} {% endif %} {% if km.start_extruder_preheat_scale > 1.0 or km.start_extruder_preheat_scale < 0.0 %} {% set dummy = output.append("extruder_preheat_scale is invalid.") %} {% endif %} {% if km.load_length > printer.configfile.settings["extruder"].max_extrude_only_distance %} {% set dummy = output.append( "load_length exceeds max_extrude_only_distance.") %} {% endif %} {% if km.load_length < km.load_priming_length %} {% set dummy = output.append( "load_length is shorter than load_priming_length.") %} {% endif %} {% if km.load_length < 0.0 %} {% set dummy = output.append("load_length is negative.") %} {% endif %} {% if km.load_priming_length < 0.0 %} {% set dummy = output.append("load_priming_length is negative.") %} {% endif %}
{% if output %} { action_raise_error(output|sort|join('\n')) } {% endif %} M400
[gcode_macro kmvars]
description: Lists global variables used by klipper-macros.
Usage: KMVARS [SEARCH=
[gcode_macro check_macro_docs] description: Lists macros lacking proper documentation. Usage: CHECK_MACRO_DOCS [USAGE=<0|1>] [HIDDEN=<1|0>] [RENAMED=<1|0>] gcode: {% set USAGE = params.USAGE|default(0)|int %} {% set HIDDEN = params.HIDDEN|default(0)|int %} {% set RENAMED = params.RENAMED|default(0)|int %} {% set output = [] %} {%set config = printer.configfile.config %} {% for k in config|sort %} {% if k.startswith("gcode_macro") %} {% set name = k.split()[1] %} {% set desc = config[k].description|default("") %} {% set is_renamed = config[k].renameexisting|default("") %} {% if (not desc or (USAGE and not "Usage: "~name.upper() in desc)) and (HIDDEN or not name.startswith('')) and (RENAMED or is_renamed) %} {% set dummy = output.append("%s %s: missing %s." | format("*" if is_renamed else " ", name, "description" if not desc else "usage")) %} {% endif %} {% endif %} {% endfor %} {action_respond_info(output|join("\n"))}
[gcode_macro listvars]
description: Lists per-macro variables with a name containing SEARCH. This is
useful for debugging macros by allowing you to probe printer state. Be very
careful, however, as an overly broad SEARCH parameter can take a long time
to process and potentially hang or crash klipper.
Usage: LISTVARS SEARCH=
{% if 'SEARCH' not in params and 'S' not in params %} { action_raise_error("Must provide a SEARCH parameter.") } {% endif %} {% set SEARCH = params.SEARCH|default(params.S)|lower %} {% set ns = namespace() %} {% set output = [] %} {% for item in printer %} {% if item is not string %} {% set ns.path = ['printer', "[%s]" % (item|string), ''] %} {% elif ' ' in item %} {% set ns.path = ['printer', "['%s']" % (item), ''] %} {% else %} {% set ns.path = ['printer.', item, ''] %} {% endif %}
{% if SEARCH in ns.path|lower %}
{% set dummy = output.append(ns.path|join) %}
{% endif %}
{% if printer[item].items() %}
{% for childkey, child in printer[item].items() recursive %}
{% set ns.path = ns.path[:loop.depth|int + 1] %}
{% if childkey is not string %}
{% set null = ns.path.append("[%s]" % (childkey|string)) %}
{% elif ' ' in childkey %}
{% set null = ns.path.append("['%s']" % (childkey)) %}
{% else %}
{% set null = ns.path.append(".%s" % (childkey)) %}
{% endif %}
{% if child is mapping %}
{loop(child.items())}
{% else %}
{% if SEARCH in ns.path|lower %}
{% set dummy = output.append("%s : %s" % (ns.path|join, child)) %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %} { action_respond_info(output|join("\n")) }
I'm having trouble with the heating of my bed and nozzle. I just installed the Manta E3EZ on my Ender 3 V2. I previously had Klipper running on my raspberry pi and SKR Mini E3V3 on the same printer without any issues. I have the Manta E3EZ installed with a CB1 and Klipper and Mainsail installed.
Everything appears normal. However, when I print something, the bed and nozzle will both show in Mainsail that they are heating at the same time, when it is actually only heating the bed. Then, after the bed hits 60 degrees, the nozzle will start heating, but the temperature for the bed will keep increasing in Mainsail, when it's not actually heating. Once the bed temperature on Mainsail gets up to 130 or 150 degrees, the printer will shutoff.
If I change the nozzle thermister from TH0 to TH1 on the Manta, then the temperatures will act properly in Mainsail. However, when I measure my bed temperature with my temperature gun, the bed will be about 15 degrees over 60 degrees. When I measure the nozzle temperature, it will only be about 90 degrees, not 210. As a result, my first layer tests are horrible.
I have also tried switching the extruder and power for the nozzle heater to the E1 connections, as well, with no results.
Can someone please help me with this issue. I can't seem to find anyone else having this issue, so maybe I have just done something stupid? I am attaching my printer.cfg file. Thanks for any help. And yes I know I have a lot of things in my config file. I will create separate directories for them later and cut the fat.
config-202344-202853.zip