Skip to content

Commit 34f3be0

Browse files
authored
Merge pull request #445 from ArmoredTurtle/DEV Release v1.0.20 DEV to main
Release v1.0.20 DEV to main
2 parents 6ba66e6 + dc77d9c commit 34f3be0

59 files changed

Lines changed: 5032 additions & 2688 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@
1010
- [ ] CHANGELOG.md is updated (if end-user facing)
1111
- [ ] Documentation updated in AT-Documentation repository
1212
- [ ] Sent notification to software-design channel requesting review
13+
- [ ] If this PR address a GitHub issue, the issue number is referenced in the PR description
14+
15+
**NOTE**: GitHub Copilot may be used for automated code reviews, however as it is an automated system, it's suggestions
16+
may not be correct. Please do not rely on it to catch all issues. Please review any suggestions it makes and use your
17+
own judgement to determine if they are correct.

CHANGELOG.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,143 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2025-06-10]
9+
### Added
10+
- Ability to turn on print assist if spool falls below a certain weight
11+
- Weight defaults to 1kg when first inserting spool
12+
- `AFC_CLEAR_MESSAGE` macro to clear current message that would be displayed in gui's
13+
- When saving variables and key is not found in current AFC files, a new file `AFC_auto_vars.cfg` will be created and variables will be added to that file
14+
15+
## [2025-06-08]
16+
### Added
17+
- Support for [QuattroBox](https://github.com/Batalhoti/QuattroBox) filament changer. QuattroBox can be chosen in install script for new or additional units to add to your printer
18+
19+
## [2025-06-07]
20+
### Fixed
21+
- `unknown command: Prompt_end` error will no longer show when users try to exit out of Happy Printing popup after AFC_CALIBRATION is done
22+
- Lanes are now marked a loaded_to_hub when bowden calibration happens
23+
- Fixed issue where HTLF might error out when first homing during PREP
24+
25+
## [2025-06-06]
26+
### Added
27+
- There is now a configurable option `error_timeout` in the `[AFC]` section of the `AFC.cfg` file. This option allows
28+
users to set a timeout for how long the printer will stay in a paused state when an error occurs. The default value is
29+
`36000` seconds (10 hours). When a `PAUSE` action is triggered, AFC will now compare the value of the `error_timeout` and
30+
the `idle_timeout` value (if defined) and choose the larger of the two values.
31+
32+
### Changed
33+
- The `afc-debug.sh` script will now create a zip file of the logs if the `nc` utility is not available.
34+
35+
36+
## [2025-05-30]
37+
### Added
38+
- Updated park to allow moving to an absolute z height after the x,y move. This is intended to reduce oozing during unload and load prior to using the poop command.
39+
40+
## [2025-05-29]
41+
### Fixed
42+
- HTLF infinite runout now works correctly
43+
44+
## [2025-05-27]
45+
### Added
46+
- Some AFC macros are now exposed in Mainsail/Fluidd.
47+
48+
## [2025-05-25]
49+
### Fixed
50+
- Exclude object bug where klipper would error out with max extrude error after excluding an object and
51+
trying to do a lane swap or doing TOOL_UNLOAD in PRINT_END function. Fixes issue [#364](https://github.com/ArmoredTurtle/AFC-Klipper-Add-On/issues/364)
52+
- Fixing issue [#348](https://github.com/ArmoredTurtle/AFC-Klipper-Add-On/issues/348)
53+
54+
## [2025-05-24]
55+
### Fixed
56+
- The calibration routines will now not allow a negative bowden length value to be set. If a negative value is detected,
57+
an error message will be displayed and the value will not be set.
58+
59+
## [2025-05-23]
60+
### Updated
61+
- The `PREP` sequence will now check to ensure the trailing and advance buffer switches are not both triggered. If
62+
both switches are triggered, a warning message will be displayed.
63+
64+
## [2025-05-22]
65+
### Added
66+
- Added `auto_home` support,
67+
68+
## [2025-05-22]
69+
### Added
70+
- Added statistics tracking for tool load/unload/total change, n20 runtime, number of cuts,
71+
average load/unload/full toolchange times, and number of load per lane.
72+
- Added ability to track when last blade was changed and how many cuts since last changed
73+
- `AFC_STATS` macro added to print statistics out. Set `SHORT=1` to print out a skinny version
74+
- `AFC_CHANGE_BLADE` macro added for when users change blade as this reset count and updates date changed
75+
- `AFC_RESET_MOTOR_TIME` macro added to allow users to reset N20 active time if motor was replaced in a lane
76+
- Added common class for easily interacting with moonraker api
77+
- Updated to use moonrakers proxy when fetching spoolmans data
78+
- Added getting toolchange count from moonrakers file metadata, `SET_AFC_TOOLCHANGES` will be deprecated
79+
Moonrakers version needs to be at least v0.9.3-64
80+
- Updated import error message to pull from a common error string in AFC_utils.py file
81+
- Clearing pause in klipper when starting a print
82+
- Warning message is outputted when number of cuts is within 1K of tool_cut_threshold value
83+
- Error message is outputted when number of cuts is over tool_cut_threshold
84+
85+
### Fixed
86+
- Issue where virtual bypass was being set for newly installed instances of AFC
87+
88+
## [2025-05-21]
89+
### Added
90+
- new macro `AFC_TOGGLE_MACRO` to enable disable other macros.
91+
92+
## [2025-05-15]
93+
### Added
94+
- added quiet mode support. `quiet_moves_speed` on `AFC.cfg` dictates the max speed when quiet mode is enabled.
95+
- new macro `AFC_QUIET_MODE ENABLE=1/0 SPEED=<max_speed>` to allow modifying `quiet_moves_speed` and enable/disable quiet mode.
96+
97+
## [2025-05-12]
98+
### Added
99+
- new variable `tool_homing_distance` in `[AFC]` to make the distance over which toolhead homing is attempted.
100+
- new variable `rev_long_moves_speed_factor` added to `AFC_lane` to allow per lane reverse speed for long moves. i.e. long move speeds will now be `rev_long_moves_speed_factor * long_move_speed`.
101+
- new macro `SET_LONG_MOVE_SPEED LANE=<lane_name> FWD_SPEED=<fwd_speed> RWD_FACTOR=<rwd_multiplier> SAVE=1/0` to allow modifying `rev_long_moves_speed_factor` and `long_move_speed`
102+
103+
104+
## [2025-05-11]
105+
### Changed
106+
- The `install-afc.sh` script will remove any `velocity` settings present in the `[AFC_buffer <buffer_name>]`
107+
section of the configuration files as they are no longer needed.
108+
109+
## [2025-05-01]
110+
### Added
111+
- Print assist is now filament usage based and will activate spool after a specified amount of filament is used. This is enabled by default.
112+
113+
### Removed
114+
- Removed velocity from AFC_buffer code and install code, please remove `velocity` variable from AFC_buffer configuration
115+
116+
## [2025-04-27]
117+
118+
### Removed
119+
- Removed deprecated belay code.
120+
121+
## [2025-04-25]
122+
### Added
123+
- The AFC_CUT macro now supports a servo-activated pin. Set values for ``[servo tool_cut]`` in ``AFC_Hardware.cfg`` and enable ``tool_servo_enable`` in ``AFC_Macro_Vars.cfg``
124+
125+
## [2025-04-23]
126+
127+
### Added
128+
- The `install-afc.sh` script will now prompt you if you want to update the AFC provided macros when updating the
129+
software. **WARNING** This will overwrite any existing macros present.
130+
131+
## [2025-04-20]
132+
133+
### Changed
134+
- Updated poop to do z lift based off last position so that toolhead does not smash into large poops.
135+
- Updated kick to move xy first and then move z so toolhead does not smash into poop.
136+
137+
## [2025-04-19]
138+
139+
### Changed
140+
- The `Type` parameter in the `AFC_<unit_type>.cfg` file is no longer required.
141+
142+
- The `install-afc.sh` script will now check for updates, and if new updates are present, it will sync and git changes
143+
and re-run the script automatically.
144+
8145
## [2025-04-12]
9146

10147
### Added

CONTRIBUTING.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
1-
# Contributing
21

2+
# Contributing to This Project
3+
4+
Thanks for your interest in contributing! Whether it's a bug report, new feature, or documentation fix, your help is welcome and appreciated.
5+
6+
## Getting Started
7+
8+
1. **Fork the repository** and create your branch from `main` or the default branch.
9+
2. Make your changes, following the guidelines below.
10+
3. Submit a [pull request](https://github.com/ArmoredTurtle/AFC-Klipper-Add-On/pulls).
11+
12+
**NOTE** All pull requests should be up to date with the latest changes from the `DEV` branch and PRs should be opened against the `DEV` branch.
13+
14+
## Guidelines
15+
16+
### Code Style
17+
18+
- Python code should follow [PEP 8](https://peps.python.org/pep-0008/) as closely as possible.
19+
- Use meaningful commit messages.
20+
- Keep changes focused—avoid mixing unrelated fixes or features.
21+
22+
### Scripts
23+
24+
- Bash scripts should be POSIX-compliant where practical.
25+
- Include a `#!/bin/bash` or `#!/usr/bin/env bash` shebang as appropriate.
26+
- Add inline comments to explain non-obvious logic.
27+
28+
### Testing
29+
30+
- If applicable, test your changes with your Klipper environment.
31+
- Make sure your code doesn't introduce errors or break existing functionality.
32+
- While formal unit tests may not be in place yet, please validate your changes manually.
33+
34+
### Pull Requests
35+
36+
- Clearly describe what your PR does and why it’s useful.
37+
- Link to any relevant issues.
38+
- Smaller PRs are easier to review and merge—break large changes into smaller steps if you can.
39+
40+
## Bug Reports & Feature Requests
41+
42+
- Use GitHub [Issues](https://github.com/ArmoredTurtle/AFC-Klipper-Add-On/issues) to report bugs or request features.
43+
- When reporting a bug, please include:
44+
- A description of the issue
45+
- Steps to reproduce
46+
- Any relevant logs or configuration
47+
348
## Virtual environment
449

550
It is recommended to set up a python virtual environment to keep installed dependencies isolated from your system dependencies.
@@ -42,7 +87,7 @@ should configure that for VSCode, but you may need to refer to your own IDE for
4287
## Linting
4388

4489
```shell
45-
ruff check
90+
ruff check .
4691
```
4792

4893
> [!TIP]

config/AFC.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ short_move_dis: 10 # Move distance for failsafe moves. Default is 1
1414
# This value can also be set per stepper with print_current: 0.6
1515
enable_sensors_in_gui: True # Uncomment to show all sensor switches as filament sensors in mainsail/fluidd gui
1616
# this can also be set at individual levels in your config file
17-
default_material_temps: default: 235, PLA:210, ABS:235, ASA:235 # Default temperature to set extruder when loading/unloading lanes.
17+
default_material_temps: default: 235, PLA:210, PETG:235, ABS:235, ASA:235 # Default temperature to set extruder when loading/unloading lanes.
1818
# Material needs to be either manually set or uses material from spoolman if extruder temp is not
1919
# set in spoolman. Follow current format to add more
20+
common_density_values: PLA:1.24, PETG:1.23, ABS:1.04, ASA:1.07 # Generic default density values. Follow current format to add more
2021
#default_material_type: PLA # Default material type to assign to a spool once loaded into a lane
2122

2223
load_to_hub: True # Fast loads filament to hub when inserted, set to False to disable. This is a global setting and can be overridden at AFC_stepper
@@ -25,6 +26,7 @@ load_to_hub: True # Fast loads filament to hub when inserted, set
2526
assisted_unload: True # If True, the unload retract is assisted to prevent loose windings, especially on full spools. This can prevent loops from slipping off the spool. This is a global setting and can be overridden at the unit and stepper level.
2627
#pause_when_bypass_active: True # When True AFC pauses print when change tool is called and bypass is loaded
2728
#unload_on_runout: True # When True AFC will unload lane and then pause when runout is triggered and spool to swap to is not set(infinite spool)
29+
#print_short_stats: True # Set to true to print AFC_STATS in short form instead of wide form, printing short form is better for consoles that are small in width
2830
#debug: True # Setting to True turns on more debugging to show on console
2931

3032
#--=================================================================================-
@@ -40,6 +42,7 @@ assisted_unload: True # If True, the unload retract is assisted to pre
4042
z_hop: 5 # Height to move up before and after a tool change completes
4143
resume_speed: 120 # Speed mm/s of resume move. Set to 0 to use gcode speed
4244
resume_z_speed: 30 # Speed mm/s of resume move in Z. Set to 0 to use gcode speed
45+
error_timeout: 36000 # Time in seconds to pause when an error is detected.
4346

4447

4548
#--=================================================================================-
@@ -54,6 +57,7 @@ led_tool_loaded: 0,0,1,0 # Loaded color (R,G,B,W) 0 = off, 1 =
5457
led_buffer_advancing: 0,0,1,0 # Buffer advancing color (R,G,B,W) 0 = off, 1 = full brightness.
5558
led_buffer_trailing: 0,1,0,0 # Buffer trailing color (R,G,B,W) 0 = off, 1 = full brightness.
5659
led_buffer_disable: 0,0,0,0.25 # Buffer disable color (R,G,B,W) 0 = off, 1 = full brightness.
60+
led_spool_illuminate: 1,1,1,0 # Loading color (R,G,B,W) 0 = off, 1 = full brightness.
5761

5862
#--=================================================================================-
5963
#------- Macro Config ---------------------------------------------------------------
@@ -69,6 +73,7 @@ led_buffer_disable: 0,0,0,0.25 # Buffer disable color (R,G,B,W) 0 = off, 1 =
6973

7074
# TOOL Cutting Settings
7175
tool_cut: True # Enable Cut macro.
76+
tool_cut_threshold: 10000 # Threshold value for message to change blade, warning starts at 1000k cuts before hitting this number
7277
tool_cut_cmd: AFC_CUT # Cut macro name.
7378

7479
# Park Settings

config/AFC_Macro_Vars.cfg

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ variable_safe_margin_xy : 30, 30 # Approx toolhead width +5mm, heig
111111
# variable_conf_name_stepper_z: "tmc2209 stepper_z"
112112
# variable_awd: True
113113

114+
# Addon variables for cutter pin servo control
115+
#variable_tool_servo_enable : False
116+
#variable_tool_servo_name : "tool_cut"
117+
#variable_tool_servo_angle_out : 115
118+
#variable_tool_servo_angle_in : 0
114119

115120
#--=================================================================================-
116121
#------- Poop ----------------------------------------------------------------------
@@ -127,13 +132,15 @@ variable_z_purge_move : True # Set to False to not move in Z du
127132
# Speed, in mm/s to lift z after the purge is completed. Its a faster lift to keep it from
128133
# sticking to the toolhead
129134
variable_fast_z : 200
130-
variable_z_lift : 20 # Z height to raise to after the purge is completed as part of the fast z move
135+
variable_z_lift : 10 # Z height to raise above the final purge position after the purge is completed as part of the fast z move
136+
# example: If final poop height ends at 20mm this variable will raise Z to 30mm
131137

132138
# If the toolhead returns to initial position after the poop is complete.
133139
variable_restore_position : False # True = return to initial position, False = don't return
134140

135-
# The height to raise the nozzle above the tray before purging. This allows any built up
141+
# The z height of the nozzle at the purge position before purging. This allows any built up
136142
# pressure to escape before the purge.
143+
137144
variable_purge_start : 0.6
138145

139146
# Set the part cooling fan speed. Disabling can help prevent the nozzle from cooling down
@@ -171,7 +178,7 @@ variable_purge_length_minimum : 60.999
171178
description: Kick macro configuration variables
172179
gcode: # Leave empty
173180

174-
variable_kick_start_loc : -1,-1,10 # Location to move before kick
181+
variable_kick_start_loc : -1,-1,5 # Location to move before kick
175182
variable_kick_z : 1.5 # Height to drop to for kick move
176183
variable_kick_speed : 150 # Speed of kick movement
177184
variable_kick_accel : 0 # Accel of kick moves. This will overwrite the global accel for this macro. Set to 0 to use global accel
@@ -210,4 +217,7 @@ gcode: # Leave empty
210217

211218
variable_park_loc_xy : -1, -1 # Position to park the toolhead
212219
# If you want z_hop during toolchanges please set the value in the AFC.cfg
213-
variable_z_hop : 0 # Height to raise Z when moving to park. Leave 0 to disable
220+
variable_z_hop : 0 # Height to raise Z when moving to park. Leave 0 to disable
221+
variable_park_z : 0 # Absolute height to lower to after park move. Leave 0 to disable
222+
# This is intended to be used to reduce oozing during loading / unload right before a poop.
223+
# Typically this would be set at the variable_purge_start value when needed.

config/macros/Brush.cfg

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
description: Wipe the nozzle on the brush
33
gcode:
44
{% set gVars = printer['gcode_macro _AFC_GLOBAL_VARS'] %}
5-
{% set accel = gVars['accel']|float %}
6-
{% set travel_speed = gVars['travel_speed'] * 60|float %}
7-
{% set z_travel_speed = gVars['z_travel_speed'] * 60|float %}
8-
{% set verbose = gVars['verbose']|int %}
5+
{% set accel = gVars['accel'] | default(2000) | float %}
6+
{% set travel_speed = gVars['travel_speed'] | default(120)*60| float %}
7+
{% set z_travel_speed = gVars['z_travel_speed'] | default(30)*60 | float %}
8+
{% set verbose = gVars['verbose'] | default(1) | int %}
99
{% set vars = printer['gcode_macro _AFC_BRUSH_VARS'] %}
10-
{% set Bx, By, Bz = vars.brush_loc|map('float') %}
11-
{% set brush_clean_accel = vars['brush_clean_accel']|float %}
12-
{% set y_brush = vars['y_brush']|default(false)|lower == 'true' %}
13-
{% set brush_clean_speed = vars['brush_clean_speed'] * 60|float %}
14-
{% set brush_width = vars['brush_width']|float %}
15-
{% set brush_depth = vars['brush_depth']|float %}
16-
{% set brush_count = vars['brush_count']|int %}
17-
{% set z_move = vars['z_move'] |float %}
10+
{% set Bx, By, Bz = vars.brush_loc | default([-1,-1,-1])| map('float') %}
11+
{% set brush_clean_accel = vars['brush_clean_accel']| default(0) | float %}
12+
{% set y_brush = vars['y_brush'] | default(false) | lower == 'true' %}
13+
{% set brush_clean_speed = vars['brush_clean_speed']| default(150)*60 | float %}
14+
{% set brush_width = vars['brush_width'] | default(30) | float %}
15+
{% set brush_depth = vars['brush_depth'] | default(10) | float %}
16+
{% set brush_count = vars['brush_count'] | default(4) | int %}
17+
{% set z_move = vars['z_move'] | default(-1) | float %}
1818

1919
# Get printer bounds to make sure none of our cleaning moves fall outside of them
2020
# Check for IDEX

0 commit comments

Comments
 (0)