From c298263d941e11ea1808e082706eac06521afa63 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 7 Feb 2024 22:43:43 +0100 Subject: [PATCH] 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