directory gewijzigd

This commit is contained in:
2024-05-28 21:10:07 +02:00
parent 782ef1a040
commit e0182051f8
67 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
[bed_mesh]
speed: 100
horizontal_move_z: 5
mesh_min: 5,5
mesh_max: 220,195
algorithm: bicubic
bicubic_tension: 0.1
probe_count: 7,7
mesh_pps: 2,2
relative_reference_index: 24 # (5,3)=7 (3,3)=4 (5,5)=12 (7,7)=24 (7,5)=17 (9,9)=40
move_check_distance: 5.0
split_delta_z: .025
fade_start: 0.6
fade_end: 10
fade_target: 0
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_BASE
variable_mesh_delta : 25 ## distance between points
variable_x_mesh_max : 7 ## max points on x-axis
variable_y_mesh_max : 7 ## max points on y-axis
variable_mesh_area_offset : 5 ## the clearance between print area and probe area
gcode=
{% if params.AREA_START and params.AREA_END %}
## get [bed_mesh] config parameters
{% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %}
{% set safe_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %}
{% set safe_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %}
{% set safe_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %}
{% set safe_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %}
## get print area min/max from slicer gcode
{% set area_min_x = params.AREA_START.split(",")[0]|float %}
{% set area_min_y = params.AREA_START.split(",")[1]|float %}
{% set area_max_x = params.AREA_END.split(",")[0]|float %}
{% set area_max_y = params.AREA_END.split(",")[1]|float %}
## set probing area
{% if area_min_x - mesh_area_offset >= safe_min_x %}
{% set area_min_x = area_min_x - mesh_area_offset %}
{% else %}
{% set area_min_x = safe_min_x %}
{% endif %}
{% if area_min_y - mesh_area_offset >= safe_min_y %}
{% set area_min_y = area_min_y - mesh_area_offset %}
{% else %}
{% set area_min_y = safe_min_y %}
{% endif %}
{% if area_max_x + mesh_area_offset <= safe_max_x %}
{% set area_max_x = area_max_x + mesh_area_offset %}
{% else %}
{% set area_max_x = safe_max_x %}
{% endif %}
{% if area_max_y + mesh_area_offset <= safe_max_y %}
{% set area_max_y = area_max_y + mesh_area_offset %}
{% else %}
{% set area_max_y = safe_max_y %}
{% endif %}
## set probe counts
{% set meshPointX = ((area_max_x - area_min_x) / mesh_delta + 1)|round(0)|int %}
{% if meshPointX < 3 %}
{% set meshPointX = 3 %}
{% elif meshPointX > x_mesh_max %}
{% set meshPointX = x_mesh_max %}
{% endif %}
{% set meshPointY = ((area_max_y - area_min_y) / mesh_delta + 1)|round(0)|int %}
{% if meshPointY < 3 %}
{% set meshPointY = 3 %}
{% elif meshPointY > y_mesh_max %}
{% set meshPointY = y_mesh_max %}
{% endif %}
## check for invalid mesh
{% if meshPointX > 5 %}
{% if meshPointY == 3 %} # 7x3 mesh invlaid for bicubic
{% set meshPointY = 5 %} # set 7x5 mesh
{% endif %}
{% endif %}
{% if meshPointY > 5 %}
{% if meshPointX == 3 %} # 3x7 mesh invlaid for bicubic
{% set meshPointX = 5 %} # set 5x7 mesh
{% endif %}
{% endif %}
## set new reference index point
{% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %}
## send bed mesh parameters
M117 probe_count={meshPointX},{meshPointY}
BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} relative_reference_index={referenceIndex}
{% else %}
BED_MESH_CALIBRATE_BASE
{% endif %}

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,63 @@
# 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']
variable_print_min: (0, 0) # example: (0, 0)
variable_start_bed_heat_overshoot: 0.0
variable_park_x: 5.0
variable_park_y: 5.0
# Length (in mm) of filament to load (bowden tubes will be longer).
variable_load_length: 50.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' : 'TPU', 'extruder' : 220.0, 'bed' : 40.0},
# {'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
M118 Einde gcode_macro _km_options
# This line includes all the standard macros.
[include ../klipper-macros-main/*.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-main/optional/lcd_menus.cfg]
# Optimized bed leveling
[include ../klipper-macros-main/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.
M118 Einde idle_timeout
[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,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

View File

@@ -0,0 +1,20 @@
[gcode_macro START_PRINT]
gcode:
{% 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}