printer.cfg opgedeeld in diverse bestanden en grootte van het bed aangepast

This commit is contained in:
2024-05-15 22:32:16 +02:00
parent acc9abf111
commit 42d596c820
16 changed files with 2055 additions and 757 deletions

View File

@@ -1,8 +1,8 @@
[bed_mesh]
speed: 100
horizontal_move_z: 5
mesh_min: 10,10
mesh_max: 265,230
mesh_min: 5,5
mesh_max: 220,195
algorithm: bicubic
bicubic_tension: 0.1
probe_count: 7,7

View File

@@ -0,0 +1,69 @@
# Copyright (C) 2022 Justin Schuh <code@justinschuh.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
#
# Credit to original source:
# https://gist.github.com/ChipCE/95fdbd3c2f3a064397f9610f915f7d02
[gcode_macro bed_mesh_calibrate]
rename_existing: _KM_BED_MESH_CALIBRATE_BASE
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 %}
# don't have the math functions available to work on a delta bed.
{%if "mesh_radius" not in bed_mesh %}
{% 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 %}
{% 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 max_x_probes = (params.PROBE_COUNT |
default(bed_mesh.probe_count)).split(",")[0]|int %}
{% set max_y_probes = (params.PROBE_COUNT |
default(bed_mesh.probe_count)).split(",")[1]|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 %}
{% 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", x_probes~","~y_probes) %}
{% endif %}
_km_bed_mesh_calibrate_base{%for k in params%}{
' '~k~'="'~params[k]~'"'}{%endfor%}
[gcode_macro g29]
gcode:
BED_MESH_CALIBRATE

View File

@@ -0,0 +1,56 @@
# All customizations are documented in globals.cfg. Just copy a variable from
# there into the section below, and change the value to meet your needs.
[gcode_macro _km_options]
# These are examples of some likely customizations:
# Any sheets in the below list will be available with a configurable offset.
#variable_bed_surfaces: ['smooth_1','texture_1']
# Length (in mm) of filament to load (bowden tubes will be longer).
#variable_load_length: 90.0
# Hide the Octoprint LCD menu since I don't use it.
#variable_menu_show_octoprint: False
# Customize the filament menus (up to 10 entries).
#variable_menu_temperature: [
# {'name' : 'PLA', 'extruder' : 200.0, 'bed' : 60.0},
# {'name' : 'PETG', 'extruder' : 230.0, 'bed' : 85.0},
# {'name' : 'ABS', 'extruder' : 245.0, 'bed' : 110.0, 'chamber' : 60}]
# Length of filament (in millimeters) to purge at print start.
#variable_start_purge_length: 30 # This value works for most setups.
gcode: # This line is required by Klipper.
# Any code you put here will run at klipper startup, after the initialization
# for these macros. For example, you could uncomment the following line to
# automatically adjust your bed surface offsets to account for any changes made
# to your Z endstop or probe offset.
# ADJUST_SURFACE_OFFSETS
# This line includes all the standard macros.
[include klipper-macros/*.cfg]
# Uncomment to include features that require specific hardware support.
# LCD menu support for features like bed surface selection and pause next layer.
[include klipper-macros/optional/lcd_menus.cfg]
# Optimized bed leveling
[include klipper-macros/optional/bed_mesh.cfg]
# The sections below here are required for the macros to work. If your config
# already has some of these sections you should merge the duplicates into one
# (or if they are identical just remove one of them).
[idle_timeout]
gcode:
_KM_IDLE_TIMEOUT # This line must be in your idle_timeout section.
[pause_resume]
[respond]
[save_variables]
filename: ~/printer_data/variables.cfg # UPDATE THIS FOR YOUR PATH!!!
#[virtual_sdcard]
#path: ~/gcode_files # UPDATE THIS FOR YOUR PATH!!!
[display_status]
# Uncomment the sections below if Fluidd complains (because it's confused).
#[gcode_macro CANCEL_PRINT]
#rename_existing: CANCEL_PRINT_FAKE_BASE
#gcode: CANCEL_PRINT_FAKE_BASE {rawparams}

View File

@@ -0,0 +1,59 @@
################################################################################
# ~~~~~~~~~~~~~~~~~~~~~~~~ AUTOCREATED WITH KIAUH ~~~~~~~~~~~~~~~~~~~~~~~~~~ #
################################################################################
# Recommended macros and config entries if you use Mainsail or Fluidd! #
# You can edit or delete those macros if you already defined them elsewhere! #
################################################################################
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
##### set defaults #####
{% set x = params.X|default(230) %} #edit to your park position
{% set y = params.Y|default(230) %} #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 #####
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{e} F2100
G1 Z{z_safe}
G90
G1 X{x} Y{y} F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
##### set defaults #####
{% set e = params.E|default(1) %} #edit to your retract length
G91
G1 E{e} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
################################################################################
################################################################################

View File

@@ -0,0 +1,125 @@
[pause_resume]
[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}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
# The print bed can move so far to the front, that the nozzle can reach the
# plastic cover of the print bed heater cable (only when the bed is moved by
# hand). By homing the Y axis before the X axis, it is ensured the nozzle will
# not melt through the plastic part.
# BEWARE: You will lose the ability to home axes individually. The printer will
# always home all axes for every G28 command.
#[homing_override]
#gcode:
# G28 Y0
# G28 X0
# G28 Z0
# ================================================================================
# GCode Macro: START_PRINT
# Add START_PRINT in your slicers starting script.
# ================================================================================
[gcode_macro START_PRINT]
gcode:
G28; Home all axes
BED_MESH_CALIBRATE
G92 E0; Reset Extruder
G1 Z25.0 F3000; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30; Draw the second line
G92 E0; Reset Extruder
G1 Z25.0 F3000; Move Z Axis up little to prevent scratching of Heat Bed
M118 punt gcode_macro START_PRINT
# ================================================================================
# GCode Macro: END_PRINT
# Add END_PRINT in your slicers ending script
# ================================================================================
[gcode_macro END_PRINT]
gcode:
G91; Relative Positioning
G1 Z+10; Move Z up so it doesn't hit anything
G90; Absolute Positioning
G1 Y190 F1500; bring Y up front
# G10 ; set tool offset? or retract?
# G1 E-10 F300; Retrack-10
G1 X10 Y220 F2000; Move to X10, Y220
M104 S0; Turn off Extruder temperature (set it to 0)
M140 S0; Turn off Bed temperature (set it to 0)
M106 S0; turn off cooling fan
M84; Disable steppers
# ================================================================================
# GCode Macro G29
# Fires when G29 is sent to the printer
# ================================================================================
#[gcode_macro G29]
#gcode:
# G1 Z10 F600
# G4 P200
# G1 Z10 F600
# G4 P100
### Raspberry Pi als MCU om de GPIO te gebruiken voor in- en output