From 9ed8bf2ced1a6bb84021e99dd34f55ae9f32697c Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 16 Feb 2023 18:07:35 -0500 Subject: [PATCH 01/29] Adjusted pressure_advance. --- printer.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index 72fd64b..d863592 100644 --- a/printer.cfg +++ b/printer.cfg @@ -107,7 +107,7 @@ sensor_pin: PC5 min_temp: 0 max_temp: 300 max_extrude_only_distance: 150.0 -pressure_advance: 0.027 +pressure_advance: 0.044 [tmc2209 extruder] uart_pin: PC14 From 2b33f079b3072588105af29d29b2009f111cbf68 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 16 Feb 2023 18:55:08 -0500 Subject: [PATCH 02/29] RP2040 adxl345 working. Input shaper values adjusted. --- cfgs/adxl-rp2040.cfg | 19 +++++++++++-------- printer.cfg | 10 +++++----- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/cfgs/adxl-rp2040.cfg b/cfgs/adxl-rp2040.cfg index bf02a8e..a97f16b 100644 --- a/cfgs/adxl-rp2040.cfg +++ b/cfgs/adxl-rp2040.cfg @@ -3,20 +3,23 @@ # https://www.klipper3d.org/Measuring_Resonances.html#adxl345 ##################################################################### -[mcu rp2040] +[mcu RP2040] baud: 115200 # 250000 restart_method: command # Obtain definition by "ls -l /dev/serial/by-id/" serial: /dev/serial/by-id/usb-Klipper_rp2040_E66138935F154C28-if00 [adxl345] -spi_software_miso_pin: rp2040:gpio8 -cs_pin: rp2040:gpio9 -# spi_bus: spi0b -spi_software_sclk_pin: rp2040:gpio10 -spi_software_mosi_pin: rp2040:gpio11 -axes_map: x,y,z +axes_map: x,z,y # Installed with vertical ADXL # For Diamond in X, y, z + + # RP2040 +cs_pin: RP2040:gpio1 #RP2040:gpio1 +spi_bus: spi0a # spi0a [resonance_tester] accel_chip: adxl345 -probe_points: 111.5, 111.5, 20 \ No newline at end of file +probe_points: 111.5, 111.5, 20 + +[gcode_macro ADX] +gcode: + ACCELEROMETER_QUERY # check ADXL345 diff --git a/printer.cfg b/printer.cfg index d863592..2905860 100644 --- a/printer.cfg +++ b/printer.cfg @@ -14,7 +14,7 @@ [include ./cfgs/beeper.cfg] # NOTE Uncomment the ONE of the following lines if you're using an adxl345 -# [include ./cfgs/adxl-rp2040.cfg] +[include ./cfgs/adxl-rp2040.cfg] # [include ./cfgs/adxl-direct.cfg] [mcu] @@ -168,10 +168,10 @@ encoder_pins: ^PB14, ^PB10 click_pin: ^!PB2 [input_shaper] -shaper_freq_x = 56.0 -shaper_type_x: mzv -shaper_freq_y = 59.0 -shaper_type_y: 3hump_ei +shaper_freq_x = 102.2 +shaper_type_x: 3hump_ei # mzv +shaper_freq_y = 41.8 # 59.0 +shaper_type_y: mzv # 3hump_ei [bed_screws] screw1: 26.5, 31 From 74d4e13e1d1c5f53254f9346af2c742ff5884bb8 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 16 Feb 2023 20:17:20 -0500 Subject: [PATCH 03/29] Adjusted README.md for personal branch. --- README.md | 101 ++---------------------------------------------------- 1 file changed, 3 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 17b9b0b..d7e3656 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,3 @@ -# Sovol-SV06-firmware - -This repository contains firmware for the SV06 3D printer from Sovol. You should not use this firmware on any other printer. - -I am creating these files for my personal use and cannot be held responsible for what it might do to your printer. - -⚠️ The instructions found on this page apply only to the `master` branch. - -⚠️⚡☢️ USE AT YOUR OWN RISK! YOU HAVE BEEN WARNED! ☢️⚡⚠️ - -# Highlights - -- Minimum configuration settings for Mainsail/Fluiddpi to work. -- Mechanical gantry calibration/`G34` macro. -- SuperSlicer config bundle that contains the printer configuration, as well as what are considered by many to be the best print settings available for an FDM printer. Find the differences between the different print setting profiles [here](https://github.com/AndrewEllis93/Ellis-SuperSlicer-Profiles/tree/master/SuperSlicer). -- Bed model and texture to use in SuperSlicer/PrusaSlicer. -- Macros - - Misc macros: `PRINT_START`, `CANCEL_PRINT`, `PRINT_END`, `PAUSE`, `RESUME`. - - Parking macros (parks the printhead at various locations): `PARKFRONT`, `PARKFRONTLOW`, `PARKREAR`, `PARKCENTER`, `PARKBED`. - - Load/unload filament macros. - - Purge line macro. - -To do: -- Get the Ellis `TEST_SPEED.cfg` working. -# Installation Steps - -💡 **Requirement**: klipper must be installed on the host Raspberry Pi for everything to work after the flash. Easiest is to use a Fluiddpi or MailsailOS image. - -## Flash Firmware - -1. Copy `klipper.bin` to a MicroSD card and rename to `anyNewFilename.bin`. -2. Make sure the printer is off. -3. Insert MicroSD into printer. -4. Turn on the printer and wait a minute (usually takes 10 seconds). -5. Turn off printer and remove MicroSD. - -You may find this [video](https://youtu.be/p6l253OJa34) useful. - -⚠️ **Caveat**: flashing will only work if current firmware filename (`anyNewFilename.bin` in this example) is different from previous flashing procedure. The `.bin` is also important. - -## Clone the Repository - -There are many ways to get started, the simplest being to clone this repo to the appropriate folder. - -1. `cd ~/printer_data/config` -2. Empty entire `~/printer_data/config` folder. Unfortunately, for safety reasons I will not post this command here. However, in linux, you can delete files via `rm filename`. -3. `git clone -b master --single-branch git@github.com:bassamanator/Sovol-SV06-firmware.git .` - -## Initial Steps - -⚠️⚡☢️ **Your finger should be on the power switch for most of these steps** ☢️⚡⚠️ - -⚠️⚡☢️ **Power off if there is a collision/problem** ☢️⚡⚠️ - -💡 I would recommend searching for the word `NOTE` in this repository. There are about 6 short points amongst the various files that you should be aware of if you're using this `printer.cfg`. - -I recommend no filament be loaded for any of these steps. - -1. Do a `G28`; home all. - 1. Check to see if `X` and `Y` max positions (`G1 X223 F3000`, `G1 Y223 F3000`) can be reached, and adjust `position_max`, if necessary. You can probably go all the way up to `225` for `X` and `Y` both, however, I would not recommend it. -2. Do a `G34`; mechanical gantry calibration. After the controlled collision against the beam at the top, there will be a 10 second pause for you to verify that both sides of the gantry are pressed up agaisnt the `stoppers` at the top. You will hear a succession of beeps. - 1. Figure out your `Z` `position_max` by baby stepping your way up to the beam. The range is 250 to 261 from what I've seen, could be even higher for you. Adjust `position_max`, if necessary. I can go all the way to 258 over and over again, however, I would not print anything higher than 255 probably. -3. Pid tune the bed, but first move the printhead to the center. Ideally, all Pid tuning should occur at the temperatures that you print most at. - 1. `G28` - 2. `G1 X111 Y111 Z40 F6000` - 3. `PID_CALIBRATE HEATER=heater_bed TARGET=70` - 4. `SAVE_CONFIG` (once completed) -4. Pid tune the extruder while part cooling fan runs at 25%. - 1. `G28` - 2. `G1 X111 Y111 Z10 F6000` - 3. `M106 S64` - 4. `PID_CALIBRATE HEATER=extruder TARGET=245` - 5. `SAVE_CONFIG` (once completed) -5. Adjust `z_offset`. Make sure your nozzle if very clean. Paper test [reference](https://www.klipper3d.org/Bed_Level.html?h=probe_calibrate#the-paper-test). - 1. `SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=60` - 2. `SET_HEATER_TEMPERATURE HEATER=extruder TARGET=180` - 3. Proceed to next steps after both temperatures have been reached. - 4. `G28` - 5. `PROBE_CALIBRATE` - 6. `SAVE_CONFIG` (once completed) -6. Create a bed mesh. - 1. `SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=60` - 2. `SET_HEATER_TEMPERATURE HEATER=extruder TARGET=180` - 3. Proceed to next steps after both temperatures have been reached. - 4. `G28` - 5. `BED_MESH_CALIBRATE` - 6. `SAVE_CONFIG` (once completed) - -## Sources - -- https://www.klipper3d.org -- https://ellis3dp.com/Print-Tuning-Guide -- https://github.com/strayr/strayr-k-macros -- https://docs.vorondesign.com/build/software/miniE3_v20_klipper.html -- https://github.com/spinixguy/Sovol-SV06-firmware -- https://github.com/Pr20100/SOVOL-SV06-Klipper-profile -- https://www.printables.com/model/378915-sovol-sv06-buildplate-texture-and-model-for-prusas -- https://github.com/AndrewEllis93/Ellis-SuperSlicer-Profiles +#Sovol SV06 Klipper Firmware +## This branch contains my personal settings. +## Please refer to the [master branch](https://github.com/bassamanator/Sovol-SV06-firmware/tree/master) to download the firmware. \ No newline at end of file From ad1e85c4b3adfa9773e8fc3cc7a6b89090352536 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 16 Feb 2023 20:40:56 -0500 Subject: [PATCH 04/29] Input shapre x adjusted. --- printer.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/printer.cfg b/printer.cfg index 70e44fa..7e2b688 100644 --- a/printer.cfg +++ b/printer.cfg @@ -168,8 +168,8 @@ encoder_pins: ^PB14, ^PB10 click_pin: ^!PB2 [input_shaper] -shaper_freq_x = 102.2 -shaper_type_x: 3hump_ei # mzv +shaper_freq_x = 84.2 +shaper_type_x: 2hump_ei # mzv shaper_freq_y = 41.8 # 59.0 shaper_type_y: mzv # 3hump_ei From 20588bc181fb2105afaa5127373bb8f3fe5d20cc Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 16 Feb 2023 21:53:49 -0500 Subject: [PATCH 05/29] RP2040-zero working, adxl-rp2040.cfg adjusted. --- cfgs/adxl-rp2040.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cfgs/adxl-rp2040.cfg b/cfgs/adxl-rp2040.cfg index 54243f4..5362615 100644 --- a/cfgs/adxl-rp2040.cfg +++ b/cfgs/adxl-rp2040.cfg @@ -1,5 +1,6 @@ ##################################################################### -# Here's how to set up your RP2040-zero +# Find my instructions here: +# https://github.com/bassamanator/rp2040-zero-adxl345-klipper # ADXL345 related Settings # https://www.klipper3d.org/Measuring_Resonances.html#adxl345 ##################################################################### From 15276c01ab5f161fcdf99181dafa2d64e2050575 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 19 Feb 2023 01:31:17 -0500 Subject: [PATCH 06/29] New z_offset and mesh after disassemble. --- printer.cfg | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/printer.cfg b/printer.cfg index 7e2b688..7ddc040 100644 --- a/printer.cfg +++ b/printer.cfg @@ -225,7 +225,7 @@ enable_force_move: True #*# pid_kd = 945.503 #*# #*# [probe] -#*# z_offset = 1.500 +#*# z_offset = 1.515 #*# #*# [bed_mesh best] #*# version = 1 @@ -249,11 +249,11 @@ enable_force_move: True #*# [bed_mesh default-v1] #*# version = 1 #*# points = -#*# -0.192500, -0.107500, -0.040000, -0.010625, -0.013750 -#*# -0.198125, -0.115000, -0.028750, 0.000000, -0.027500 -#*# -0.226875, -0.118125, -0.051875, -0.023750, -0.050000 -#*# -0.238750, -0.152500, -0.085000, -0.079375, -0.109375 -#*# -0.210625, -0.126875, -0.075625, -0.085625, -0.113750 +#*# -0.224375, -0.111875, -0.013125, 0.017500, -0.013125 +#*# -0.231875, -0.125000, -0.015000, 0.016875, -0.020000 +#*# -0.261250, -0.136875, -0.037500, -0.000625, -0.030000 +#*# -0.274375, -0.155000, -0.066250, -0.048750, -0.081250 +#*# -0.241875, -0.129375, -0.056250, -0.049375, -0.081250 #*# min_x = 27.0 #*# max_x = 222.0 #*# min_y = 5.0 @@ -268,11 +268,11 @@ enable_force_move: True #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.224375, -0.111875, -0.013125, 0.017500, -0.013125 -#*# -0.231875, -0.125000, -0.015000, 0.016875, -0.020000 -#*# -0.261250, -0.136875, -0.037500, -0.000625, -0.030000 -#*# -0.274375, -0.155000, -0.066250, -0.048750, -0.081250 -#*# -0.241875, -0.129375, -0.056250, -0.049375, -0.081250 +#*# -0.158750, -0.064375, 0.022500, 0.069375, 0.076875 +#*# -0.214375, -0.114375, -0.010625, 0.030625, 0.016875 +#*# -0.254375, -0.135625, -0.041875, -0.006250, -0.025000 +#*# -0.255000, -0.143750, -0.062500, -0.041250, -0.059375 +#*# -0.193125, -0.098750, -0.033750, -0.019375, -0.035625 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 From 8ad625a00fe41cb7f4f556f675424f86be497b56 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 19 Feb 2023 02:37:59 -0500 Subject: [PATCH 07/29] Adjusted README.md. --- README.md | 6 ++++-- cfgs/macros.cfg | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d7e3656..19eb854 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ -#Sovol SV06 Klipper Firmware +# 🚨 *One-Stop-Shop* Sovol SV06 Klipper Configuration 🏎️ + ## This branch contains my personal settings. -## Please refer to the [master branch](https://github.com/bassamanator/Sovol-SV06-firmware/tree/master) to download the firmware. \ No newline at end of file + +## Please refer to the [master](https://github.com/bassamanator/Sovol-SV06-firmware/tree/master) branch to download the recommended Klipper configuration. \ No newline at end of file diff --git a/cfgs/macros.cfg b/cfgs/macros.cfg index a9211eb..7962d60 100644 --- a/cfgs/macros.cfg +++ b/cfgs/macros.cfg @@ -64,7 +64,7 @@ gcode: [gcode_macro PRINT_END] # Use PRINT_END for the slicer ending script - please customize for your slicer of choice gcode: - BEEP I=2 DUR=30 FREQ=8500 + BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} M400 ; wait for buffer to clear G92 E0 ; zero the extruder From 6af7d81daf1e7b554c8c5d441084b7396c0d083a Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Tue, 21 Feb 2023 20:59:59 -0500 Subject: [PATCH 08/29] New z_offset and mesh after new part cooler. Prev z_offset 1.515 was good. --- printer.cfg | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/printer.cfg b/printer.cfg index 7ddc040..c7e4b05 100644 --- a/printer.cfg +++ b/printer.cfg @@ -225,7 +225,7 @@ enable_force_move: True #*# pid_kd = 945.503 #*# #*# [probe] -#*# z_offset = 1.515 +#*# z_offset = 1.480 #*# #*# [bed_mesh best] #*# version = 1 @@ -249,11 +249,11 @@ enable_force_move: True #*# [bed_mesh default-v1] #*# version = 1 #*# points = -#*# -0.224375, -0.111875, -0.013125, 0.017500, -0.013125 -#*# -0.231875, -0.125000, -0.015000, 0.016875, -0.020000 -#*# -0.261250, -0.136875, -0.037500, -0.000625, -0.030000 -#*# -0.274375, -0.155000, -0.066250, -0.048750, -0.081250 -#*# -0.241875, -0.129375, -0.056250, -0.049375, -0.081250 +#*# -0.224375, -0.111875, -0.013125, 0.017500, -0.013125 +#*# -0.231875, -0.125000, -0.015000, 0.016875, -0.020000 +#*# -0.261250, -0.136875, -0.037500, -0.000625, -0.030000 +#*# -0.274375, -0.155000, -0.066250, -0.048750, -0.081250 +#*# -0.241875, -0.129375, -0.056250, -0.049375, -0.081250 #*# min_x = 27.0 #*# max_x = 222.0 #*# min_y = 5.0 @@ -268,11 +268,11 @@ enable_force_move: True #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.158750, -0.064375, 0.022500, 0.069375, 0.076875 -#*# -0.214375, -0.114375, -0.010625, 0.030625, 0.016875 -#*# -0.254375, -0.135625, -0.041875, -0.006250, -0.025000 -#*# -0.255000, -0.143750, -0.062500, -0.041250, -0.059375 -#*# -0.193125, -0.098750, -0.033750, -0.019375, -0.035625 +#*# -0.158750, -0.064375, 0.022500, 0.069375, 0.076875 +#*# -0.214375, -0.114375, -0.010625, 0.030625, 0.016875 +#*# -0.254375, -0.135625, -0.041875, -0.006250, -0.025000 +#*# -0.255000, -0.143750, -0.062500, -0.041250, -0.059375 +#*# -0.193125, -0.098750, -0.033750, -0.019375, -0.035625 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 From 44670bf489503a750a6e5f13d10f29b72d5ffece Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 2 Mar 2023 16:08:45 -0500 Subject: [PATCH 09/29] New bed installed; new pid values. --- printer.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/printer.cfg b/printer.cfg index c7e4b05..6e0d449 100644 --- a/printer.cfg +++ b/printer.cfg @@ -220,9 +220,9 @@ enable_force_move: True #*# #*# [heater_bed] #*# control = pid -#*# pid_kp = 71.224 -#*# pid_ki = 1.341 -#*# pid_kd = 945.503 +#*# pid_kp = 67.629 +#*# pid_ki = 1.288 +#*# pid_kd = 887.637 #*# #*# [probe] #*# z_offset = 1.480 From c2a8de51a9fe466f4a46c1831d167a424dd38c51 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Thu, 2 Mar 2023 17:27:01 -0500 Subject: [PATCH 10/29] New z_offset and mesh. --- printer.cfg | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/printer.cfg b/printer.cfg index 6e0d449..7f8987e 100644 --- a/printer.cfg +++ b/printer.cfg @@ -225,35 +225,35 @@ enable_force_move: True #*# pid_kd = 887.637 #*# #*# [probe] -#*# z_offset = 1.480 +#*# z_offset = 1.640 #*# -#*# [bed_mesh best] +#*# [bed_mesh newbed] #*# version = 1 #*# points = -#*# -0.017708, -0.023125, -0.023542, -0.037500, -0.088750 -#*# -0.034167, -0.051875, -0.035833, -0.037708, -0.091875 -#*# -0.072500, -0.066875, -0.056042, -0.050208, -0.093333 -#*# -0.075417, -0.074167, -0.051458, -0.054375, -0.095625 -#*# -0.030833, -0.014583, -0.000625, -0.013333, -0.051667 -#*# min_x = 27.0 -#*# max_x = 222.0 -#*# min_y = 5.0 -#*# max_y = 203.0 +#*# -0.240625, -0.114375, -0.018750, 0.004375, 0.092500 +#*# -0.280625, -0.120000, -0.005000, 0.025000, -0.011250 +#*# -0.330625, -0.151875, -0.035000, -0.006875, 0.011250 +#*# -0.350625, -0.145000, -0.030000, 0.001875, 0.073125 +#*# -0.353125, -0.110000, 0.031250, 0.056250, 0.006250 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 #*# mesh_y_pps = 2 #*# algo = bicubic #*# tension = 0.2 +#*# min_x = 27.0 +#*# max_x = 222.0 +#*# min_y = 5.0 +#*# max_y = 203.0 #*# -#*# [bed_mesh default-v1] +#*# [bed_mesh oldbed] #*# version = 1 #*# points = -#*# -0.224375, -0.111875, -0.013125, 0.017500, -0.013125 -#*# -0.231875, -0.125000, -0.015000, 0.016875, -0.020000 -#*# -0.261250, -0.136875, -0.037500, -0.000625, -0.030000 -#*# -0.274375, -0.155000, -0.066250, -0.048750, -0.081250 -#*# -0.241875, -0.129375, -0.056250, -0.049375, -0.081250 +#*# -0.158750, -0.064375, 0.022500, 0.069375, 0.076875 +#*# -0.214375, -0.114375, -0.010625, 0.030625, 0.016875 +#*# -0.254375, -0.135625, -0.041875, -0.006250, -0.025000 +#*# -0.255000, -0.143750, -0.062500, -0.041250, -0.059375 +#*# -0.193125, -0.098750, -0.033750, -0.019375, -0.035625 #*# min_x = 27.0 #*# max_x = 222.0 #*# min_y = 5.0 @@ -268,11 +268,11 @@ enable_force_move: True #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.158750, -0.064375, 0.022500, 0.069375, 0.076875 -#*# -0.214375, -0.114375, -0.010625, 0.030625, 0.016875 -#*# -0.254375, -0.135625, -0.041875, -0.006250, -0.025000 -#*# -0.255000, -0.143750, -0.062500, -0.041250, -0.059375 -#*# -0.193125, -0.098750, -0.033750, -0.019375, -0.035625 +#*# -0.233750, -0.100625, -0.006875, 0.023125, 0.116875 +#*# -0.260000, -0.106250, 0.005625, 0.040625, 0.005625 +#*# -0.308750, -0.133750, -0.023750, 0.004375, 0.025625 +#*# -0.323750, -0.128125, -0.015000, 0.015625, 0.090625 +#*# -0.321875, -0.086250, 0.053750, 0.081875, 0.034375 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 From 11f11de7db7cfeb65817c2360cb81b71aea1ea78 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Fri, 3 Mar 2023 22:06:29 -0500 Subject: [PATCH 11/29] Added temperature wait macro. --- cfgs/macros.cfg | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cfgs/macros.cfg b/cfgs/macros.cfg index 7962d60..f762c09 100644 --- a/cfgs/macros.cfg +++ b/cfgs/macros.cfg @@ -13,6 +13,28 @@ gcode: {action_raise_error('Pre purge prime length not found')} {% endif %} +[gcode_macro M109] +rename_existing: M99109 +gcode: + #Parameters + {% set s = params.S|float %} + + M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set hotend temp + {% if s != 0 %} + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1} ; Wait for hotend temp (within 1 degree) + {% endif %} + +[gcode_macro M190] +rename_existing: M99190 +gcode: + #Parameters + {% set s = params.S|float %} + + M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set bed temp + {% if s != 0 %} + TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1} ; Wait for bed temp (within 1 degree) + {% endif %} + [gcode_macro PURGE_LINE] # https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt # https://github.com/VoronDesign/Voron-Switchwire/blob/200cdae033c59ef81f67c4235469da7ca66d53a1/Firmware/skr_mini_e3_v2_config.cfg From bcea3555cfcd8cb4f23d83fdae3c8a51d7dfcfd5 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Fri, 3 Mar 2023 22:16:39 -0500 Subject: [PATCH 12/29] New z_offset and mesh. --- printer.cfg | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/printer.cfg b/printer.cfg index 7f8987e..99cef71 100644 --- a/printer.cfg +++ b/printer.cfg @@ -225,7 +225,7 @@ enable_force_move: True #*# pid_kd = 887.637 #*# #*# [probe] -#*# z_offset = 1.640 +#*# z_offset = 1.655 #*# #*# [bed_mesh newbed] #*# version = 1 @@ -268,11 +268,30 @@ enable_force_move: True #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.233750, -0.100625, -0.006875, 0.023125, 0.116875 -#*# -0.260000, -0.106250, 0.005625, 0.040625, 0.005625 -#*# -0.308750, -0.133750, -0.023750, 0.004375, 0.025625 -#*# -0.323750, -0.128125, -0.015000, 0.015625, 0.090625 -#*# -0.321875, -0.086250, 0.053750, 0.081875, 0.034375 +#*# -0.165625, -0.108125, -0.055000, -0.035625, -0.055000 +#*# -0.182500, -0.125625, -0.056250, -0.045625, -0.089375 +#*# -0.202500, -0.114375, -0.050625, -0.040625, -0.086250 +#*# -0.203125, -0.109375, -0.033750, -0.038750, -0.078750 +#*# -0.161250, -0.062500, 0.011875, 0.015000, -0.007500 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = bicubic +#*# tension = 0.2 +#*# min_x = 27.0 +#*# max_x = 222.0 +#*# min_y = 5.0 +#*# max_y = 203.0 +#*# +#*# [bed_mesh oldbed-again] +#*# version = 1 +#*# points = +#*# -0.231875, -0.156875, -0.092500, -0.093125, -0.143125 +#*# -0.221875, -0.158750, -0.082500, -0.071250, -0.131250 +#*# -0.237500, -0.144375, -0.074375, -0.062500, -0.113125 +#*# -0.240625, -0.141250, -0.059375, -0.060625, -0.110625 +#*# -0.208750, -0.101875, -0.026875, -0.033125, -0.067500 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 From 6f274b73924b3c4278fd3bb881756bedc9f2fb88 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Fri, 3 Mar 2023 22:31:54 -0500 Subject: [PATCH 13/29] Adjusted z position min. --- printer.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index 99cef71..e2402dd 100644 --- a/printer.cfg +++ b/printer.cfg @@ -80,7 +80,7 @@ enable_pin: !PC3 microsteps: 32 rotation_distance: 4 endstop_pin: probe:z_virtual_endstop -position_min: -4 +position_min: -3 position_max: 258 # NOTE You can adjust this if you have more room homing_speed: 5 From ae24ae66d4fd9c2f3dbe6248b7029a3e8ea67682 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Fri, 3 Mar 2023 22:57:22 -0500 Subject: [PATCH 14/29] New z_offset and mesh. --- printer.cfg | 59 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/printer.cfg b/printer.cfg index e2402dd..1d9ec0f 100644 --- a/printer.cfg +++ b/printer.cfg @@ -225,7 +225,7 @@ enable_force_move: True #*# pid_kd = 887.637 #*# #*# [probe] -#*# z_offset = 1.655 +#*# z_offset = 1.710 #*# #*# [bed_mesh newbed] #*# version = 1 @@ -265,25 +265,6 @@ enable_force_move: True #*# algo = bicubic #*# tension = 0.2 #*# -#*# [bed_mesh default] -#*# version = 1 -#*# points = -#*# -0.165625, -0.108125, -0.055000, -0.035625, -0.055000 -#*# -0.182500, -0.125625, -0.056250, -0.045625, -0.089375 -#*# -0.202500, -0.114375, -0.050625, -0.040625, -0.086250 -#*# -0.203125, -0.109375, -0.033750, -0.038750, -0.078750 -#*# -0.161250, -0.062500, 0.011875, 0.015000, -0.007500 -#*# x_count = 5 -#*# y_count = 5 -#*# mesh_x_pps = 2 -#*# mesh_y_pps = 2 -#*# algo = bicubic -#*# tension = 0.2 -#*# min_x = 27.0 -#*# max_x = 222.0 -#*# min_y = 5.0 -#*# max_y = 203.0 -#*# #*# [bed_mesh oldbed-again] #*# version = 1 #*# points = @@ -302,3 +283,41 @@ enable_force_move: True #*# max_x = 222.0 #*# min_y = 5.0 #*# max_y = 203.0 +#*# +#*# [bed_mesh default-v1] +#*# version = 1 +#*# points = +#*# -0.165625, -0.108125, -0.055000, -0.035625, -0.055000 +#*# -0.182500, -0.125625, -0.056250, -0.045625, -0.089375 +#*# -0.202500, -0.114375, -0.050625, -0.040625, -0.086250 +#*# -0.203125, -0.109375, -0.033750, -0.038750, -0.078750 +#*# -0.161250, -0.062500, 0.011875, 0.015000, -0.007500 +#*# min_x = 27.0 +#*# max_x = 222.0 +#*# min_y = 5.0 +#*# max_y = 203.0 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = bicubic +#*# tension = 0.2 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# -0.219375, -0.138125, -0.072500, -0.067500, -0.108750 +#*# -0.208125, -0.140625, -0.065625, -0.053125, -0.111250 +#*# -0.220000, -0.124375, -0.058750, -0.051250, -0.100625 +#*# -0.224375, -0.121250, -0.046250, -0.049375, -0.097500 +#*# -0.184375, -0.072500, -0.006875, -0.008125, -0.043125 +#*# x_count = 5 +#*# y_count = 5 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = bicubic +#*# tension = 0.2 +#*# min_x = 27.0 +#*# max_x = 222.0 +#*# min_y = 5.0 +#*# max_y = 203.0 From 648346616e9648e497a391a7e2189864b60e5e96 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Wed, 8 Mar 2023 03:41:15 -0500 Subject: [PATCH 15/29] New z_offset. --- printer.cfg | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/printer.cfg b/printer.cfg index 1d9ec0f..144fd24 100644 --- a/printer.cfg +++ b/printer.cfg @@ -225,7 +225,7 @@ enable_force_move: True #*# pid_kd = 887.637 #*# #*# [probe] -#*# z_offset = 1.710 +#*# z_offset = 1.690 #*# #*# [bed_mesh newbed] #*# version = 1 @@ -287,11 +287,11 @@ enable_force_move: True #*# [bed_mesh default-v1] #*# version = 1 #*# points = -#*# -0.165625, -0.108125, -0.055000, -0.035625, -0.055000 -#*# -0.182500, -0.125625, -0.056250, -0.045625, -0.089375 -#*# -0.202500, -0.114375, -0.050625, -0.040625, -0.086250 -#*# -0.203125, -0.109375, -0.033750, -0.038750, -0.078750 -#*# -0.161250, -0.062500, 0.011875, 0.015000, -0.007500 +#*# -0.165625, -0.108125, -0.055000, -0.035625, -0.055000 +#*# -0.182500, -0.125625, -0.056250, -0.045625, -0.089375 +#*# -0.202500, -0.114375, -0.050625, -0.040625, -0.086250 +#*# -0.203125, -0.109375, -0.033750, -0.038750, -0.078750 +#*# -0.161250, -0.062500, 0.011875, 0.015000, -0.007500 #*# min_x = 27.0 #*# max_x = 222.0 #*# min_y = 5.0 @@ -306,11 +306,11 @@ enable_force_move: True #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.219375, -0.138125, -0.072500, -0.067500, -0.108750 -#*# -0.208125, -0.140625, -0.065625, -0.053125, -0.111250 -#*# -0.220000, -0.124375, -0.058750, -0.051250, -0.100625 -#*# -0.224375, -0.121250, -0.046250, -0.049375, -0.097500 -#*# -0.184375, -0.072500, -0.006875, -0.008125, -0.043125 +#*# -0.219375, -0.138125, -0.072500, -0.067500, -0.108750 +#*# -0.208125, -0.140625, -0.065625, -0.053125, -0.111250 +#*# -0.220000, -0.124375, -0.058750, -0.051250, -0.100625 +#*# -0.224375, -0.121250, -0.046250, -0.049375, -0.097500 +#*# -0.184375, -0.072500, -0.006875, -0.008125, -0.043125 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 From c3e4b85ca2226c9e4ebd70fe3caa1394467ef98c Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Wed, 8 Mar 2023 11:57:52 -0500 Subject: [PATCH 16/29] New z_offset and mesh. --- printer.cfg | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/printer.cfg b/printer.cfg index 144fd24..a133a68 100644 --- a/printer.cfg +++ b/printer.cfg @@ -265,33 +265,14 @@ enable_force_move: True #*# algo = bicubic #*# tension = 0.2 #*# -#*# [bed_mesh oldbed-again] -#*# version = 1 -#*# points = -#*# -0.231875, -0.156875, -0.092500, -0.093125, -0.143125 -#*# -0.221875, -0.158750, -0.082500, -0.071250, -0.131250 -#*# -0.237500, -0.144375, -0.074375, -0.062500, -0.113125 -#*# -0.240625, -0.141250, -0.059375, -0.060625, -0.110625 -#*# -0.208750, -0.101875, -0.026875, -0.033125, -0.067500 -#*# x_count = 5 -#*# y_count = 5 -#*# mesh_x_pps = 2 -#*# mesh_y_pps = 2 -#*# algo = bicubic -#*# tension = 0.2 -#*# min_x = 27.0 -#*# max_x = 222.0 -#*# min_y = 5.0 -#*# max_y = 203.0 -#*# #*# [bed_mesh default-v1] #*# version = 1 #*# points = -#*# -0.165625, -0.108125, -0.055000, -0.035625, -0.055000 -#*# -0.182500, -0.125625, -0.056250, -0.045625, -0.089375 -#*# -0.202500, -0.114375, -0.050625, -0.040625, -0.086250 -#*# -0.203125, -0.109375, -0.033750, -0.038750, -0.078750 -#*# -0.161250, -0.062500, 0.011875, 0.015000, -0.007500 +#*# -0.219375, -0.138125, -0.072500, -0.067500, -0.108750 +#*# -0.208125, -0.140625, -0.065625, -0.053125, -0.111250 +#*# -0.220000, -0.124375, -0.058750, -0.051250, -0.100625 +#*# -0.224375, -0.121250, -0.046250, -0.049375, -0.097500 +#*# -0.184375, -0.072500, -0.006875, -0.008125, -0.043125 #*# min_x = 27.0 #*# max_x = 222.0 #*# min_y = 5.0 @@ -306,11 +287,11 @@ enable_force_move: True #*# [bed_mesh default] #*# version = 1 #*# points = -#*# -0.219375, -0.138125, -0.072500, -0.067500, -0.108750 -#*# -0.208125, -0.140625, -0.065625, -0.053125, -0.111250 -#*# -0.220000, -0.124375, -0.058750, -0.051250, -0.100625 -#*# -0.224375, -0.121250, -0.046250, -0.049375, -0.097500 -#*# -0.184375, -0.072500, -0.006875, -0.008125, -0.043125 +#*# -0.181250, -0.127500, -0.082500, -0.086875, -0.124375 +#*# -0.182500, -0.123750, -0.063750, -0.069375, -0.132500 +#*# -0.190000, -0.106250, -0.056250, -0.067500, -0.128125 +#*# -0.185625, -0.100000, -0.042500, -0.063750, -0.128125 +#*# -0.133125, -0.045625, 0.000000, -0.019375, -0.079375 #*# x_count = 5 #*# y_count = 5 #*# mesh_x_pps = 2 From e453f7459774120de3574159cf202b57076991b2 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Wed, 8 Mar 2023 12:47:24 -0500 Subject: [PATCH 17/29] New input shaper. --- printer.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/printer.cfg b/printer.cfg index a133a68..70a2b25 100644 --- a/printer.cfg +++ b/printer.cfg @@ -168,10 +168,10 @@ encoder_pins: ^PB14, ^PB10 click_pin: ^!PB2 [input_shaper] -shaper_freq_x = 84.2 -shaper_type_x: 2hump_ei # mzv -shaper_freq_y = 41.8 # 59.0 -shaper_type_y: mzv # 3hump_ei +shaper_freq_x = 82.2 # 84.2 +shaper_type_x: 2hump_ei +shaper_freq_y = 40.6 # 41.8 +shaper_type_y: mzv [bed_screws] screw1: 26.5, 31 From 557545a17f2b46c346a2dbf68b740e1906cfe504 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Wed, 8 Mar 2023 14:10:49 -0500 Subject: [PATCH 18/29] Input shaper section comments. --- printer.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/printer.cfg b/printer.cfg index 70a2b25..7da0352 100644 --- a/printer.cfg +++ b/printer.cfg @@ -107,7 +107,7 @@ sensor_pin: PC5 min_temp: 0 max_temp: 300 max_extrude_only_distance: 150.0 -pressure_advance: 0.044 +pressure_advance: 0.0465 # 0.044 [tmc2209 extruder] uart_pin: PC14 @@ -168,9 +168,9 @@ encoder_pins: ^PB14, ^PB10 click_pin: ^!PB2 [input_shaper] -shaper_freq_x = 82.2 # 84.2 +shaper_freq_x = 82.2 # 84.2; 4020 shaper_type_x: 2hump_ei -shaper_freq_y = 40.6 # 41.8 +shaper_freq_y = 40.6 # 41.8; 4020 shaper_type_y: mzv [bed_screws] From 110c84f4514cef9536c74ee23b4c3023b5344b04 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Fri, 10 Mar 2023 05:39:51 -0500 Subject: [PATCH 19/29] Added headings for sections in printer.cfg. --- printer.cfg | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/printer.cfg b/printer.cfg index 89726cb..5485d17 100644 --- a/printer.cfg +++ b/printer.cfg @@ -26,6 +26,10 @@ max_accel: 3000 max_z_velocity: 15 max_z_accel: 45 +##################################################################### +# X/Y/Z Stepper Settings +##################################################################### + [stepper_x] step_pin: PC2 dir_pin: !PB9 @@ -90,6 +94,10 @@ sense_resistor: 0.150 uart_address: 3 diag_pin: PA7 +##################################################################### +# Extruder +##################################################################### + [extruder] step_pin: PB4 dir_pin: !PB3 @@ -114,6 +122,10 @@ interpolate: False sense_resistor: 0.150 uart_address: 3 +##################################################################### +# Bed Heater +##################################################################### + [heater_bed] heater_pin: PA2 sensor_type: EPCOS 100K B57560G104F @@ -121,6 +133,10 @@ sensor_pin: PC4 min_temp: 0 max_temp: 110 +##################################################################### +# Probe Related +##################################################################### + [probe] pin: PB1 x_offset: 27 @@ -147,6 +163,10 @@ fade_start: 1 fade_end: 10 fade_target: 0 +##################################################################### +# Misc +##################################################################### + [display] lcd_type: st7920 cs_pin: PB12 From 3c84c049c88a5fd6e57a5eb4cf334d9fb70180ec Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sat, 11 Mar 2023 23:19:47 -0500 Subject: [PATCH 20/29] Rearranged beeper section. --- cfgs/beeper.cfg | 7 ------- printer.cfg | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cfgs/beeper.cfg b/cfgs/beeper.cfg index 7904e88..2454d26 100644 --- a/cfgs/beeper.cfg +++ b/cfgs/beeper.cfg @@ -1,10 +1,3 @@ -[output_pin beeper] -pin: PC6 -value: 0 -shutdown_value: 0 -pwm: True -cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz) - [gcode_macro BEEP] description: BEEP I=3 DUR=200 FREQ=2000: Beep 3 times, for 200ms each, at 2kHz frequency. gcode: diff --git a/printer.cfg b/printer.cfg index 0845d1f..fc3ecfe 100644 --- a/printer.cfg +++ b/printer.cfg @@ -213,6 +213,13 @@ speed: 50 horizontal_move_z: 10 screw_thread: CCW-M4 +[output_pin beeper] +pin: PC6 +value: 0 +shutdown_value: 0 +pwm: True +cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz) + #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# From 69a5cbc45c4e5fc98242570829fa5a24fe60c0f1 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 01:32:40 -0500 Subject: [PATCH 21/29] Merging filament sensor related code. --- cfgs/misc-macros.cfg | 36 ++++++++++++++++++++++++++---------- printer.cfg | 9 +++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index 643707d..9fa3d76 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -14,10 +14,28 @@ path: /home/pi/printer_data/gcodes [pause_resume] [display_status] +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + [gcode_macro _globals] variable_pre_purge_prime_length: 1.4 +variable_filament_sensor_enabled: 0 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected gcode: SET_GCODE_VARIABLE MACRO=_globals VARIABLE=pre_purge_prime_length VALUE={ variable_pre_purge_prime_length } + SET_GCODE_VARIABLE MACRO=_globals VARIABLE=filament_sensor_enabled VALUE={ variable_filament_sensor_enabled } + +[gcode_macro ADJUST_FILAMENT_SENSOR_STATUS] +gcode: + # Parameters + {% set NEWSTATUS = params.ENABLE|default(-1)|int %} + + {% set FILAMENT_SENSOR_ENABLED=printer["gcode_macro _globals"].filament_sensor_enabled|default(-1)|int %} + + {% if FILAMENT_SENSOR_ENABLED == 1 and NEWSTATUS != -1 %} + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=NEWSTATUS + {% endif %} [gcode_macro CHECK_PRE_PURGE_PRIME_LENGTH] gcode: @@ -72,16 +90,14 @@ gcode: BASE_CANCEL_PRINT [gcode_macro PRINT_START] -# Use PRINT_START for the slicer starting script - please customize for your slicer of choice -#gcode: -# G28 ; home all axes -# G1 Z20 F3000 ; move nozzle away from bed -gcode: +gcode: # Parameters {% set bedtemp = params.BED|int %} {% set hotendtemp = params.HOTEND|int %} {% set chambertemp = params.CHAMBER|default(0)|int %} + ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 + G28 X Y # M140 S{bedtemp} ; set & don't wait for bed temp @@ -97,9 +113,9 @@ gcode: G1 Z20 F3000 ; move nozzle away from bed [gcode_macro PRINT_END] -# Use PRINT_END for the slicer ending script - please customize for your slicer of choice gcode: - BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print + ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 + BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} M400 ; wait for buffer to clear G92 E0 ; zero the extruder @@ -166,7 +182,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro - # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 ; disable filament sensor + ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume BASE_PAUSE ; pause print {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max @@ -192,8 +208,8 @@ gcode: {% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm) {% if printer['pause_resume'].is_paused|int == 1 %} - # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 ; enable filament sensor - #INITIAL_RGB ; reset LCD color + ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value {% if etemp > 0 %} M109 S{etemp|int} ; wait for hotend to heat back up diff --git a/printer.cfg b/printer.cfg index fc3ecfe..976e116 100644 --- a/printer.cfg +++ b/printer.cfg @@ -220,6 +220,15 @@ shutdown_value: 0 pwm: True cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz) +[filament_switch_sensor filament_sensor] +switch_pin: !PA4 # "Pulled-high" +pause_on_runout: True +insert_gcode: + M117 Insert Detected +runout_gcode: + M117 Runout Detected + BEEP i=3 dur=300 freq=400 + #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# From 5ccabd1a3d425ec0575b98dac3515432a4917c20 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 01:53:44 -0500 Subject: [PATCH 22/29] Added conditional beeping. --- cfgs/beeper.cfg | 47 -------------------------------------------- cfgs/misc-macros.cfg | 36 ++++++++++++++++++++++++++++++--- printer.cfg | 3 +-- 3 files changed, 34 insertions(+), 52 deletions(-) delete mode 100644 cfgs/beeper.cfg diff --git a/cfgs/beeper.cfg b/cfgs/beeper.cfg deleted file mode 100644 index 2454d26..0000000 --- a/cfgs/beeper.cfg +++ /dev/null @@ -1,47 +0,0 @@ -[gcode_macro BEEP] -description: BEEP I=3 DUR=200 FREQ=2000: Beep 3 times, for 200ms each, at 2kHz frequency. -gcode: - # Parameters - {% set i = params.I|default(1)|int %} ; Iterations (number of times to beep). - {% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms. - {% set freq = params.FREQ|default(2000)|int %} ; Frequency in Hz. Default 2kHz. - - {% for iteration in range(i|int) %} - SET_PIN PIN=beeper VALUE=0.8 CYCLE_TIME={ 1.0/freq if freq > 0 else 1 } - G4 P{dur} - SET_PIN PIN=beeper VALUE=0 - G4 P{dur} - {% endfor %} - -# [gcode_macro M300] -# gcode: -# {% set S = params.S|default(1000)|int %} -# {% set P = params.P|default(100)|int %} - -# SET_PIN PIN=beeper VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 } -# G4 P{P} -# SET_PIN PIN=beeper VALUE=0 - -# [gcode_macro SONG_SINGLE_BEEP] -# gcode: -# M300 S830.61 P137 - -# [gcode_macro TOGGLE_BEEPER] -# description: Toggle the printer beeper on and off. -# gcode: -# {% set beeper_state = printer.save_variables.variables.beeper_state|lower %} - -# {% if printer['gcode_macro _USER_VARIABLE'].debug == 1 %} -# {action_respond_info('==== TOGGLE_BEEPER ====')} -# {action_respond_info("beeper_state: %s" % (beeper_state))} -# {action_respond_info('===============')} -# {% endif %} - -# {% if beeper_state == "off" %} -# {action_respond_info('beeper is off, turning it on')} -# SAVE_VARIABLE VARIABLE=beeper_state VALUE='"on"' -# {% else %} -# {action_respond_info('beeper is on= turning it off')} -# SAVE_VARIABLE VARIABLE=beeper_state VALUE='"off"' -# {% endif %} -# SONG_SINGLE_BEEP \ No newline at end of file diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index 9fa3d76..7b45e4a 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -20,11 +20,26 @@ gcode: SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 [gcode_macro _globals] -variable_pre_purge_prime_length: 1.4 variable_filament_sensor_enabled: 0 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected +variable_beeping_enabled: 1 # NOTE Enable(1) or disable(0) beeping everywhere except during gantry calibration +variable_pre_purge_prime_length: 1.4 gcode: SET_GCODE_VARIABLE MACRO=_globals VARIABLE=pre_purge_prime_length VALUE={ variable_pre_purge_prime_length } SET_GCODE_VARIABLE MACRO=_globals VARIABLE=filament_sensor_enabled VALUE={ variable_filament_sensor_enabled } + SET_GCODE_VARIABLE MACRO=_globals VARIABLE=beeping_enabled VALUE={ variable_beeping_enabled } + +[gcode_macro CONDITIONAL_BEEP] +gcode: + # Parameters + {% set i = params.I|default(1)|int %} ; Iterations (number of times to beep). + {% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms. + {% set freq = params.FREQ|default(2000)|int %} ; Frequency in Hz. Default 2kHz. + + {% set BEEPING_ENABLED=printer["gcode_macro _globals"].beeping_enabled|default(-1)|int %} + + {% if BEEPING_ENABLED == 1 %} + BEEP I=i DUR=dur FREQ=freq + {% endif %} [gcode_macro ADJUST_FILAMENT_SENSOR_STATUS] gcode: @@ -115,7 +130,7 @@ gcode: [gcode_macro PRINT_END] gcode: ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 - BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print + CONDITIONAL_BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} M400 ; wait for buffer to clear G92 E0 ; zero the extruder @@ -231,4 +246,19 @@ gcode: gcode: {% if "xyz" not in printer.toolhead.homed_axes %} G28 - {% endif %} \ No newline at end of file + {% endif %} + +[gcode_macro BEEP] +description: BEEP I=3 DUR=200 FREQ=2000: Beep 3 times, for 200ms each, at 2kHz frequency. +gcode: + # Parameters + {% set i = params.I|default(1)|int %} ; Iterations (number of times to beep). + {% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms. + {% set freq = params.FREQ|default(2000)|int %} ; Frequency in Hz. Default 2kHz. + + {% for iteration in range(i|int) %} + SET_PIN PIN=beeper VALUE=0.8 CYCLE_TIME={ 1.0/freq if freq > 0 else 1 } + G4 P{dur} + SET_PIN PIN=beeper VALUE=0 + G4 P{dur} + {% endfor %} \ No newline at end of file diff --git a/printer.cfg b/printer.cfg index 976e116..ca71ee7 100644 --- a/printer.cfg +++ b/printer.cfg @@ -8,7 +8,6 @@ [include ./cfgs/TEST_SPEED.cfg] [include ./cfgs/PARKING.cfg] [include ./cfgs/MECHANICAL_GANTRY_CALIBRATION.cfg] -[include ./cfgs/beeper.cfg] # NOTE Uncomment the ONE of the following lines if you're using an adxl345 # [include ./cfgs/adxl-rp2040.cfg] @@ -227,7 +226,7 @@ insert_gcode: M117 Insert Detected runout_gcode: M117 Runout Detected - BEEP i=3 dur=300 freq=400 + CONDITIONAL_BEEP i=3 dur=300 freq=400 #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. From f70f23e2909c72b5cd9e978c549f8099f86eee6d Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 10:44:23 -0400 Subject: [PATCH 23/29] ADJUST_FILAMENT_SENSOR_STATUS and conditional_beep fixed. --- cfgs/misc-macros.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index 7b45e4a..7e790f8 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -38,7 +38,7 @@ gcode: {% set BEEPING_ENABLED=printer["gcode_macro _globals"].beeping_enabled|default(-1)|int %} {% if BEEPING_ENABLED == 1 %} - BEEP I=i DUR=dur FREQ=freq + BEEP I={i} DUR={dur} FREQ={freq} {% endif %} [gcode_macro ADJUST_FILAMENT_SENSOR_STATUS] @@ -49,7 +49,7 @@ gcode: {% set FILAMENT_SENSOR_ENABLED=printer["gcode_macro _globals"].filament_sensor_enabled|default(-1)|int %} {% if FILAMENT_SENSOR_ENABLED == 1 and NEWSTATUS != -1 %} - SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=NEWSTATUS + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE={NEWSTATUS} {% endif %} [gcode_macro CHECK_PRE_PURGE_PRIME_LENGTH] From 36ba332e818846f599e59815afc92c79c785376f Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 11:15:01 -0400 Subject: [PATCH 24/29] Added SET_FILAMENT_SENSOR to print_start. --- cfgs/misc-macros.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index 7e790f8..c410d09 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -112,6 +112,7 @@ gcode: {% set chambertemp = params.CHAMBER|default(0)|int %} ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 + SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 G28 X Y # From 9e05774aa1a38be4b12c57569623d5eb403b53ff Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 11:23:04 -0400 Subject: [PATCH 25/29] Reversed filament sensor pin. --- printer.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index ca71ee7..999ab48 100644 --- a/printer.cfg +++ b/printer.cfg @@ -220,7 +220,7 @@ pwm: True cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz) [filament_switch_sensor filament_sensor] -switch_pin: !PA4 # "Pulled-high" +switch_pin: PA4 # "Pulled-high" pause_on_runout: True insert_gcode: M117 Insert Detected From 0b5909ab53b848c343b5550db74d1b9017bdcbb3 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 12:19:59 -0400 Subject: [PATCH 26/29] Added ADJUST_FILAMENT_SENSOR_STATUS use back. --- cfgs/misc-macros.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index 6a6e13b..c7a8d3e 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -20,7 +20,7 @@ gcode: SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 [gcode_macro _globals] -variable_filament_sensor_enabled: 0 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected +variable_filament_sensor_enabled: 1 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected variable_beeping_enabled: 1 # NOTE Enable(1) or disable(0) beeping everywhere except during gantry calibration variable_pre_purge_prime_length: 1.4 gcode: @@ -112,7 +112,7 @@ gcode: {% set chambertemp = params.CHAMBER|default(0)|int %} ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 - SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 G28 X Y # @@ -131,7 +131,7 @@ gcode: [gcode_macro PRINT_END] gcode: ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 - SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 CONDITIONAL_BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} M400 ; wait for buffer to clear @@ -200,7 +200,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 - SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume BASE_PAUSE ; pause print {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max @@ -227,7 +227,7 @@ gcode: {% if printer['pause_resume'].is_paused|int == 1 %} ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 - SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 + # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value {% if etemp > 0 %} From 150e1b74251c865803a76ea91df90c63e5bd2194 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 14:35:13 -0400 Subject: [PATCH 27/29] Removed CHECK_PRE_PURGE_PRIME_LENGTH macro. --- cfgs/misc-macros.cfg | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index c7a8d3e..680ec20 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -52,13 +52,6 @@ gcode: SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE={NEWSTATUS} {% endif %} -[gcode_macro CHECK_PRE_PURGE_PRIME_LENGTH] -gcode: - {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %} - {% if not PRE_PURGE_PRIME_LENGTH %} - {action_raise_error('Pre purge prime length not found')} - {% endif %} - [gcode_macro M109] rename_existing: M99109 gcode: @@ -85,8 +78,8 @@ gcode: # https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt # https://github.com/VoronDesign/Voron-Switchwire/blob/200cdae033c59ef81f67c4235469da7ca66d53a1/Firmware/skr_mini_e3_v2_config.cfg gcode: - {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %} - CHECK_PRE_PURGE_PRIME_LENGTH + {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} + ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 G0 Y0 X0 F4000 ; go to tongue of print bed G1 Z0.4 F500.0 ; move bed to nozzle G92 E0.0 ; reset extruder @@ -112,7 +105,6 @@ gcode: {% set chambertemp = params.CHAMBER|default(0)|int %} ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 - # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 G28 X Y # @@ -131,7 +123,6 @@ gcode: [gcode_macro PRINT_END] gcode: ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 - # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 CONDITIONAL_BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} M400 ; wait for buffer to clear @@ -200,7 +191,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0 - # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 + SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume BASE_PAUSE ; pause print {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max @@ -227,7 +218,6 @@ gcode: {% if printer['pause_resume'].is_paused|int == 1 %} ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1 - # SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value {% if etemp > 0 %} From 9770e25b4ac38a8b88ca0bcc8dc8c1da6a9413d5 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 12 Mar 2023 20:35:04 -0400 Subject: [PATCH 28/29] Adjusted .gitignore and workspace settings. --- .gitignore | 1 + .vscode/settings.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a46f989..c90eda7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ printer-*_*.cfg .moonraker.conf.bkp +.directory diff --git a/.vscode/settings.json b/.vscode/settings.json index 06c7957..384e9d9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,6 @@ "editor.insertSpaces": true, "editor.detectIndentation": false, "git.mergeEditor": false, - "spellright.language": ["en-US-10-1."], - "spellright.documentTypes": ["markdown", "latex", "plaintext"] + "spellright.language": ["en-GB-10-1."], + "spellright.documentTypes": ["markdown", "plaintext"] } From c20f18280ca8b6881dc31d3a099deb06ca5336e7 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Tue, 14 Mar 2023 01:26:12 -0400 Subject: [PATCH 29/29] Changed extruder microsteps to 64. --- printer.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer.cfg b/printer.cfg index ca71ee7..01aeb32 100644 --- a/printer.cfg +++ b/printer.cfg @@ -101,7 +101,7 @@ diag_pin: PA7 step_pin: PB4 dir_pin: !PB3 enable_pin: !PC3 -microsteps: 32 +microsteps: 64 rotation_distance: 4.65 # NOTE Calibrate e-steps and adjust https://www.klipper3d.org/Rotation_Distance.html nozzle_diameter: 0.400 filament_diameter: 1.750