Klipper popraweczki

This commit is contained in:
Rafal 2025-06-24 12:25:47 +02:00
parent 4e80084820
commit 411d9d567f
2 changed files with 253 additions and 101 deletions

110
moonraker.conf Normal file
View File

@ -0,0 +1,110 @@
[spoolman]
server: http://192.168.1.18:7912
# URL to the Spoolman instance. This parameter must be provided.
sync_rate: 5
# The interval, in seconds, between sync requests with the
# Spoolman server. The default is 5.
[server]
host: 0.0.0.0
port: 7125
# The maximum size allowed for a file upload (in MiB). Default 1024 MiB
max_upload_size: 1024
# Path to klippy Unix Domain Socket
klippy_uds_address: ~/printer_data/comms/klippy.sock
[file_manager]
# post processing for object cancel. Not recommended for low resource SBCs such as a Pi Zero. Default False
enable_object_processing: False
[authorization]
cors_domains:
https://my.mainsail.xyz
http://my.mainsail.xyz
http://*.local
http://*.lan
trusted_clients:
127.0.0.1
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 announcements for mainsail
[announcements]
subscriptions:
mainsail
[update_manager KlipperScreen]
type: git_repo
path: ~/KlipperScreen
origin: https://github.com/KlipperScreen/KlipperScreen.git
virtualenv: ~/.KlipperScreen-env
requirements: scripts/KlipperScreen-requirements.txt
system_dependencies: scripts/system-dependencies.json
managed_services: KlipperScreen
# this enables moonraker's update manager
[update_manager]
refresh_interval: 168
enable_auto_refresh: True
[update_manager mainsail]
type: web
channel: stable
repo: mainsail-crew/mainsail
path: ~/mainsail
[update_manager mainsail-config]
type: git_repo
primary_branch: master
path: ~/mainsail-config
origin: https://github.com/mainsail-crew/mainsail-config.git
managed_services: klipper
# 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/pkglist.sh
### moonraker-timelapse
### Don't forget to include timelapse.cfg to your printer.cfg
### Uncomment to enable moonraker-timelapse
#[update_manager timelapse]
#type: git_repo
#primary_branch: main
#path: ~/moonraker-timelapse
#origin: https://github.com/mainsail-crew/moonraker-timelapse.git
#managed_services: klipper moonraker
#[timelapse]
### Directory where the generated video will be saved
#output_path: ~/timelapse/
### Directory where ffmpeg is installed
#ffmpeg_binary_path: /usr/bin/ffmpeg
# Sonar update_manager entry
[update_manager sonar]
type: git_repo
path: ~/sonar
origin: https://github.com/mainsail-crew/sonar.git
primary_branch: main
managed_services: sonar
system_dependencies: resources/system-dependencies.json

View File

@ -48,8 +48,31 @@ heater_pin: P2.7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.24
min_temp: 0
max_temp: 260
max_extrude_only_distance: 500
max_temp: 300
max_extrude_only_distance: 750
# pressure_advance: 0.0 # Overture PLA
# printer.cfg
[gcode_macro SET_ACTIVE_SPOOL]
gcode:
{% if params.ID %}
{% set id = params.ID|int %}
{action_call_remote_method(
"spoolman_set_active_spool",
spool_id=id
)}
{% else %}
{action_respond_info("Parameter 'ID' is required")}
{% endif %}
[gcode_macro CLEAR_ACTIVE_SPOOL]
gcode:
{action_call_remote_method(
"spoolman_set_active_spool",
spool_id=None
)}
#-------------------------------------
# Printer General
@ -105,8 +128,8 @@ switch_pin: P1.26
[printer]
kinematics: cartesian
max_velocity: 60
max_accel: 300
max_velocity: 170
max_accel: 2500
max_z_velocity: 5
max_z_accel: 100
@ -125,7 +148,7 @@ points: 38,180
speed: 50
horizontal_move_z: 5
retries: 5
retry_tolerance:0.08
retry_tolerance:0.2
[screws_tilt_adjust]
screw1: 71,60
@ -260,23 +283,6 @@ position_max: 360
homing_speed: 50
homing_retract_dist: 5
# [stepper_z]
# step_pin: P1.15
# dir_pin: !P1.14
# enable_pin: !P1.27
# microsteps: 16
# rotation_distance: 4
# endstop_pin: probe:z_virtual_endstop
# position_max: 400
# position_min: -5
# [stepper_z1]
# step_pin: P0.22
# dir_pin: !P2.11
# enable_pin: !P0.21
# microsteps: 16
# rotation_distance: 4
# endstop_pin: probe:z_virtual_endstop
[stepper_z]
step_pin: P0.22
@ -305,32 +311,13 @@ endstop_pin: probe:z_virtual_endstop # Tak, również dla tego silnika BLTouch j
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(210)|float %}
G28 ; Homing wszystkich osi
# Rozpocznij grzanie stołu i ekstrudera do zadanych temperatur
M140 S{BED_TEMP} ; Ustaw temperaturę stołu (bez czekania)
M104 S{EXTRUDER_TEMP} ; Ustaw temperaturę ekstrudera (bez czekania)
# Poczekaj, aż stół osiągnie zadaną temperaturę
M190 S{BED_TEMP}
# Poczekaj, aż ekstruder osiągnie zadaną temperaturę
M109 S{EXTRUDER_TEMP}
G28
Z_TILT_ADJUST ; Wykonaj regulację Z-Tilt
BED_MESH_PROFILE LOAD=default ; Załaduj domyślny profil siatki stołu
G92 E0 ; Zresetuj ekstruder
G1 Z2.0 F3000 ; Podnieś głowicę na wysokość 2 mm
G1 X5.1 Y20 Z0.3 F5000.0 ; Przesuń głowicę do pozycji początkowej linii gruntującej
G1 X5.1 Y200.0 Z0.3 F1500.0 E15 ; Wytłocz pierwszą część linii gruntującej
G1 X5.4 Y200.0 Z0.3 F5000.0 ; Szybki ruch, aby odciągnąć dyszę od wytłoczonej linii
G1 X5.4 Y20 Z0.3 F1500.0 E30 ; Wytłocz drugą część linii gruntującej
G92 E0 ; Zresetuj ekstruder ponownie
G1 Z2.0 F3000 ; Podnieś głowicę ponownie
@ -378,6 +365,117 @@ gcode:
# G1 X0 Y0 Z5 F4000
M140 S0
#####################################################################
# Filament Load/Unload Macros (Ender 5 Plus) - English Version
#####################################################################
[gcode_macro UNLOAD_FILAMENT]
gcode:
# Set default temperature for PLA if not provided
{% set TEMP = params.TEMP|default(210)|float %}
# Save G-Code state
SAVE_GCODE_STATE NAME=UNLOAD_state
M117 Heating nozzle...
# Heat nozzle to target temp and wait
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={TEMP}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={TEMP}
M117 Unloading filament...
# Set extruder to relative mode
M83
# Small retraction to form a tip
G1 E-5 F1800
# Fast, long retraction from the Bowden tube
# Adjust E-680 if your tube length is different
G1 E-680 F3000
M117 Remove filament!
# Restore previous G-Code state
RESTORE_GCODE_STATE NAME=UNLOAD_state
[gcode_macro LOAD_FILAMENT]
gcode:
# Set default temperature for PLA if not provided
{% set TEMP = params.TEMP|default(210)|float %}
# Save G-Code state
SAVE_GCODE_STATE NAME=LOAD_state
M117 Heating nozzle...
# Heat nozzle to target temp and wait
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={TEMP}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={TEMP}
M117 Insert filament into extruder.
# Set extruder to relative mode
M83
# Slow load through the Bowden tube
# Adjust E650 if your tube length is different
M117 Loading filament...
G1 E650 F400
# Final purge to clean the nozzle
M117 Purging nozzle...
G1 E40 F150
M117 Filament loaded.
# Restore previous G-Code state
RESTORE_GCODE_STATE NAME=LOAD_state
[gcode_macro CANCEL_PRINT]
description: Safely cancels the current print, parks the print head, and turns off heaters/motors.
gcode:
M117 Cancelling print...
TURN_OFF_HEATERS
M106 S0 ; Wyłącz wentylator hotendu
M107 ; Wyłącz wentylator druku
{% if printer.gcode_move.absolute_coordinates %} ; Sprawdź, czy tryb bezwzględny jest aktywny
G91 ; Ustaw tryb względny
{% endif %}
G0 Z10 F3000 ; Podnieś głowicę o 10mm (lub więcej, jeśli potrzebujesz)
G90 ; Ustaw tryb bezwzględny
G0 X5 Y5 F6000 ; Zaparkuj głowicę w bezpiecznym miejscu (np. lewy dolny róg)
M84 ; Wyłącz wszystkie silniki krokowe
M117 Print cancelled!
CLEAR_PAUSE ; Wyczyść stan pauzy, jeśli druk był wstrzymany
[gcode_macro END_PRINT]
description: Wykonywane po pomyślnym ukończeniu druku.
gcode:
# Zapisz ostatnią pozycję
G90
# Podnieś głowicę, aby nie zahaczyła o wydruk
G91
G1 Z10 F3000
G90
# Zaparkuj głowicę w tylnym prawym rogu, aby odsłonić wydruk
M117 Parkowanie...
G0 X300 Y300 F6000
# Wyłącz grzałki i wentylator
M104 S0
M140 S0
M107
# Wyłącz silniki krokowe
M84
M117 Druk ukonczony!
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
@ -426,12 +524,7 @@ gcode:
{% 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 load_mesh]
gcode:
@ -448,58 +541,7 @@ gcode:
SET_PIN PIN=BEEPER_pin VALUE=0
[gcode_macro TESTZ]
description: Wykonuje 5-liniowy test do kalibracji offsetu Z
gcode:
{% set H_TEMP = 200 %} ; Temperatura hotendu w stopniach C
{% set B_TEMP = 60 %} ; Temperatura stołu w stopniach C
M140 S{B_TEMP} ; Ustaw temperaturę stołu (bez czekania)
M104 S{H_TEMP} ; Ustaw temperaturę hotendu (bez czekania)
G28 ; Homing wszystkich osi (X, Y, Z)
M190 S{B_TEMP} ; Czekaj, aż stół osiągnie temperaturę
M109 S{H_TEMP} ; Czekaj, aż hotend osiągnie temperaturę
G92 E0 ; Zeruj ekstruder
G1 Z0.2 F300 ; Podnieś dyszę na wysokość pierwszej warstwy (0.2mm)
G1 X10 Y10 F6000 ; Przesuń głowicę do pozycji startowej (X10, Y10)
; Linia 1
G1 E2 F1800 ; Wytłocz trochę filamentu, żeby wypełnić dyszę
G1 X100 Y10 E10 F1200 ; Drukowanie linii (10-100 na X)
G92 E0 ; Zeruj ekstruder
G1 Z0.4 F300 ; Podnieś dyszę lekko w górę
; Linia 2
G1 X10 Y20 F6000 ; Przesuń głowicę do startu drugiej linii
G1 X100 Y20 E10 F1200 ; Drukowanie linii (10-100 na X)
G92 E0 ; Zeruj ekstruder
G1 Z0.6 F300 ; Podnieś dyszę lekko w górę
; Linia 3
G1 X10 Y30 F6000 ; Przesuń głowicę do startu trzeciej linii
G1 X100 Y30 E10 F1200 ; Drukowanie linii (10-100 na X)
G92 E0 ; Zeruj ekstruder
G1 Z0.8 F300 ; Podnieś dyszę lekko w górę
; Linia 4
G1 X10 Y40 F6000 ; Przesuń głowicę do startu czwartej linii
G1 X100 Y40 E10 F1200 ; Drukowanie linii (10-100 na X)
G92 E0 ; Zeruj ekstruder
G1 Z1.0 F300 ; Podnieś dyszę lekko w górę
; Linia 5
G1 X10 Y50 F6000 ; Przesuń głowicę do startu piątej linii
G1 X100 Y50 E10 F1200 ; Drukowanie linii (10-100 na X)
G92 E0 ; Zeruj ekstruder
G1 Z10 F300 ; Podnieś dyszę znacznie
G1 X0 Y0 F6000 ; Przesuń głowicę do pozycji startowej
M104 S0 ; Wyłącz grzałkę hotendu
M140 S0 ; Wyłącz grzałkę stołu
M84 ; Wyłącz silniki
#-------------------------------------
@ -522,7 +564,7 @@ gcode:
#*# pid_kd = 1246.178
#*#
#*# [bltouch]
#*# z_offset = 1.640
#*# z_offset = 1.532
#*#
#*# [bed_mesh default]
#*# version = 1