Skip to content

Commit 1cfb808

Browse files
authored
Merge pull request #282 from ArmoredTurtle/DEV
Merging DEV changes into main
2 parents cde2a73 + 93687d8 commit 1cfb808

41 files changed

Lines changed: 2952 additions & 1039 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,157 @@ 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-03-17]
9+
### Added
10+
- Added `SET_SPEED_MULTIPLIER` macro to allow user to change fwd/rwd speed multipliers during prints
11+
- Added `SAVE_SPEED_MULTIPLIER` macro to save updated multiplier to config file for specified lane
12+
13+
### Fixed
14+
- Added check to AFC pause/resume functions to make sure printer was not paused/paused before doing any actions
15+
- Fixed issue where macro variables were not passed from AFC_PAUSE/AFC_RESUME to PAUSE/RESUME macros if user passed in variables when calling these macros
16+
17+
## [2025-03-12]
18+
### Added
19+
- Virtual bypass sensor, AFC adds this sensor if hardware bypass is not detected
20+
21+
### Fixed
22+
- Issue where z would move back down when calling cut macro after z hop from AFC
23+
24+
## [2025-03-10]
25+
### Added
26+
- Reporting error messages in AFC status so they can be shown in AFC integration panel
27+
28+
### Fixed
29+
- Issue where resuming position could crash into object/purge tower
30+
- Issue where creating filament_switch_sensor in AFC would cause klipper to error out when AFC include is before `[pause_resume]` and user has `recover_velocity` defined
31+
- Issue where passing in `+-<number>` for length when calling `SET_BOWDEN_LENGTH` would crash klipper
32+
33+
## [2025-03-07]
34+
### Added
35+
- Added variable_z_purge_move to Poop macro. Setting this to False will allow pooping with no z movement
36+
- Added variable_z_move to brush macro. this value will set a positive Z move at the end of the brush to move the nozzle away from the brush
37+
38+
### Fixed
39+
- Fixed error that occurs when all lanes are calibrated
40+
41+
## [2025-03-07]
42+
### Added
43+
- Added error checking to spool runout, before if a error happened during unload it could keep running the print
44+
- Added lane ejection when runout detected but rollover not setup
45+
- Added AFC_PAUSE function to override users pause macro so that necessary measures could be added to move in Z to avoid
46+
hitting part if users pause macro moves toolhead
47+
- Added `afc_unload_bowden_length` parameter
48+
- Added moving Z to previous saved position +z hop when resuming to avoid hitting part when moving back
49+
50+
### Fixed
51+
- Fixed error when trying to turn of LEDs
52+
- Fixed saving position as it was not saving correctly
53+
- Reworked rollover logic to restore position after lane has been ejected fully so that nozzle does not sit
54+
on part while ejecting spool
55+
- Fixed error where user could put wrong lane for rollover and it would not error until runout logic is triggered
56+
- Fixed errors found in calibration routines
57+
58+
59+
## [2025-03-02]
60+
61+
### Fixed
62+
- Fixed calibration to error out at excessive distances
63+
- Calibration uses default config values plus fixed distances to be able to error out distances
64+
65+
## [2025-02-28]
66+
67+
### Added
68+
- Logging of delta time and total time for how long toolchanges take
69+
- Logging for AFC now logs to AFC.log file
70+
- Ability to turn off/on AFC leds with `TURN_OFF_AFC_LED`/`TURN_ON_AFC_LED`
71+
- `default_material_type` variable to assign to spool when loaded into lane
72+
- `pause_when_bypass_active` variable to pause print if bypass is active, defaults to false
73+
- `unload_on_runout variable` to unload lane when runout happens and another lane is not setup to change to, default to false
74+
- Updated calibration to use buffer as tool_pin_start if only tool_pin_end is defined and buffer is also defined
75+
- Ability to change tool_stn/tool_stn_unload/tool_sensor_after_extruder without restarting
76+
77+
### Fixed
78+
- Issue where filament was not unloading correctly when only tool_pin_end is defined
79+
- Issue where prep logic would try to unload forever if only tool_pin_end was defined
80+
81+
## [2025-02-25]
82+
83+
### Fixed
84+
85+
- Tip forming was multiplying all speeds with a factor of 60 by mistake. Existing configuration might need to be adapted
86+
to compensate for this fix.
87+
888
## [2025-02-23]
989

90+
### Added
91+
- Checking to make sure lane was not None in cmd_CHANGE_TOOL
92+
- Pauses in TOOL_LOAD/TOOL_UNLOAD/CHANGE_TOOL for early returns if printer is currently in a print
93+
94+
### Changed
95+
- The `install-afc.sh` script will now check for a supported version of python and fail the installation if it is not present.
96+
97+
### Fixed
98+
- Error in cmd_CHANGE_TOOL where change logic was being triggered if change was in a comment on the same line
99+
- Turned runout pause message into error message which also pauses printer
100+
- Error where infinite spool would crash klipper when calling change tool
101+
102+
## [2025-02-20]
103+
104+
### Added
105+
106+
- Users are now able to specify a non default moonraker address when using the `install-afc.sh` script. This value defaults to `http://localhost` but
107+
can be adjusted for cases such as a remote moonraker installation, https, etc. This value can be set during the installation process by using the `-a <address>` flag.
108+
109+
## [2025-02-19]
110+
111+
### Added
112+
- Clearing error_state when print starts, before this could be set before printing and would cause AFC to not save/restore position
113+
- Added 1 second time debounce to prep callback
114+
- Added abs function when determining speed for LANE_MOVE macro
115+
10116
### Changed
11-
- The `install-afc.sh` script will now check for a supported version of python and fail the installation if it is not present.
117+
- Updated error print out messages when loading/unloading
118+
- The way error messages printed out so they are grouped together
119+
120+
### Fixed
121+
- Issue where getting spoolman data would error out when server variable in moonraker ended in a slash
122+
- Issue where prep would no longer activate extruder motors when user rapidely triggered prep sensor
12123

13124
## [2025-02-17]
14125

15126
### Changed
16127
- Updated the `install-afc.sh` script to prompt the user to install dependencies if they are not already installed instead of installing them automatically.
17128

129+
## [2025-02-16]
130+
131+
### Added
132+
- Ability to manually set and unset lanes that are loaded in toolhead
133+
- Braking to n20 when stopping them. This was advised to implement from Isik to hopefully help reduce backfeeding from motors into MCU board when in coast mode
134+
- Default temperature value to default_material_temps list instead of using min_temp_val + 5
135+
- Check for printing for LANE_MOVE, HUB_LOAD and LANE_UNLOAD macros
136+
- Variable for prep done so save_vars function is not called before running prep function which would override the variables file before PREP could run
137+
- More guidance to error messages when errors happen during TOOL_LOAD and TOOL_UNLOAD
138+
- Helper function to get loaded lane for current extruder, help move the code towards working with multiple extruders
139+
- Debounce logic when triggering prep sensor so that it does not run more than once
140+
- Variable speed to LANE_MOVE move, run faster for distance over 200
141+
- Printout when trying to load and load sensor is already triggered
142+
- More printout to let user know when calibration is done
143+
- Printout when trying to unload but no lane is loaded
144+
145+
### Changed
146+
- Updated documentation
147+
148+
### Fixed
149+
- Error in prep when there are multiple extruders
150+
- Error when hub was not defined
151+
18152
## [2025-02-13]
19153

154+
### Added
155+
- Assisted unload
156+
When enabled, the retracts out of the toolhead before the long, fast move back throught the bowden tube is assisted.
157+
This helps with full spools where even a retract of a few centimeters can cause a loop to fall off the spool.
158+
20159
### Changed
21160
- The `install-afc.sh` install script will now remove the `AFC.var.tool` file if detected as it is no longer needed.
22161

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Once the plugin is updated, please uncomment the lines in your `printer.cfg` fil
6363

6464
The `install-afc.sh` script will automatically install the majority of the plugin for you.
6565

66-
Prior to starting Klipper, please review the configuration located at `~/printer_data/config/AFC/AFC_Hardware.cfg` and ensure all pins are correct for your specific hardware.
66+
Prior to starting Klipper, please review the configuration located at `~/printer_data/config/AFC/AFC_Turtle_(n).cfg` and ensure all pins are correct for your specific hardware.
6767

6868
Additionally, review the following files for any changes that may be required:
6969

@@ -121,7 +121,7 @@ Prior to operation, the following checks / updates **MUST** be made to your syst
121121
1. Update the following values in the `~/printer_data/config/AFC/AFC_Hardware-{board}.cfg` file:
122122
*default name with AFC-lite will be AFC_Hardware-AFC.cfg*
123123

124-
- tool_stn: This value is the length from your toolhead sensor to nozzle
124+
- tool_stn: This value is the length from your toolhead sensor to nozzle, if `tool_end` is defined then distance is from this sensor
125125
- tool_stn_unload: This value is the amount to unload from extruder when doing a filament change.
126126

127127
2. Update the following in the `~/printer_data/config/AFC/AFC_Turtle_{n}.cfg` file:
@@ -294,7 +294,7 @@ Debug information about the respooler system can be found by visiting the follow
294294

295295
## LEDs not displaying correct color
296296

297-
If your leds are not displaying the correct color update the following value under your `AFC_led` section in `~/printer_data/config/AFC/AFC_hardware.cfg` file.
297+
If your leds are not displaying the correct color update the following value under your `AFC_led` section in `~/printer_data/config/AFC/AFC_Turtle_(n).cfg` file.
298298

299299
- color_order: change to match the color order for you leds. Different color orders are: RGB, RGBW, GRB, GRBW
300300

config/AFC.cfg

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,29 @@ short_moves_speed: 50 # mm/s. Default value is 50mm/s.
1212
short_moves_accel: 300 # mm/s². Default value is 300mm/s².
1313
short_move_dis: 10 # Move distance for failsafe moves. Default is 10mm.
1414

15-
# global_print_current: 0.6 # Uncomment to set stepper motors to a lower current while printing
15+
#global_print_current: 0.6 # Uncomment to set stepper motors to a lower current while printing
1616
# This value can also be set per stepper with print_current: 0.6
17-
# enable_sensors_in_gui: True # Uncomment to show all sensor switches as filament sensors in mainsail/fluidd gui
18-
# this can also be set at individual levels in your config file
19-
default_material_temps: PLA:210, ABS:235, ASA:235 # Default temperature to set extruder when loading/unloading lanes.
17+
enable_sensors_in_gui: True # Uncomment to show all sensor switches as filament sensors in mainsail/fluidd gui
18+
# this can also be set at individual levels in your config file
19+
default_material_temps: default: 235, PLA:210, ABS:235, ASA:235 # Default temperature to set extruder when loading/unloading lanes.
2020
# Material needs to be either manually set or uses material from spoolman if extruder temp is not
2121
# set in spoolman. Follow current format to add more
22+
#default_material_type: PLA # Default material type to assign to a spool once loaded into a lane
23+
2224
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
23-
# moonraker_port: 7125 # Port to connect to when interacting with moonraker. Used when there are multiple moonraker/klipper instances on a single host
25+
#moonraker_port: 7125 # Port to connect to when interacting with moonraker. Used when there are multiple moonraker/klipper instances on a single host
26+
27+
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.
28+
#pause_when_bypass_active: True # When True AFC pauses print when change tool is called and bypass is loaded
29+
#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)
30+
#debug: True # Setting to True turns on more debugging to show on console
2431

2532
#--=================================================================================-
2633
#------- TRSYNC Values --------------------------------------------------------------
2734
#--=================================================================================-
28-
# trsync_update: True # Uncomment this value to update Klipper's trsync value automatically
29-
# trsync_timeout: 0.05 # Uncomment this value if timeout needs to be greater than the default of 0.05
30-
# trsync_single_timeout: 0.250 # Uncomment this value if single_timeout needs to be greater than the default of 0.250
35+
#trsync_update: True # Uncomment this value to update Klipper's trsync value automatically
36+
#trsync_timeout: 0.05 # Uncomment this value if timeout needs to be greater than the default of 0.05
37+
#trsync_single_timeout: 0.250 # Uncomment this value if single_timeout needs to be greater than the default of 0.250
3138

3239
#--=================================================================================-
3340
#------- Pause/Resume ---------------------------------------------------------------

config/AFC_Macro_Vars.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ gcode: # Leave empty
119119

120120
variable_purge_loc_xy : -1, -1 # (x,y) Location of where to purge
121121
variable_purge_spd : 6.5 # Speed, in mm/s, of the purge.
122+
variable_z_purge_move : True # Set to False to not move in Z during poop
122123

123124
# Speed, in mm/s to lift z after the purge is completed. Its a faster lift to keep it from
124125
# sticking to the toolhead
@@ -193,6 +194,9 @@ variable_brush_depth : 10 # Total depth in mm of the brush i
193194
variable_y_brush : True # True - Brush along Y axis first then X. False - Only brush along x
194195
variable_brush_count : 4 # Number of passes to make on the brush.
195196

197+
# Move in Z after brush to avoid bed if brush is at Z0 (Set z to -1 if you dont want a z move)
198+
variable_z_move : -1
199+
196200

197201
#--=================================================================================-
198202
#------- Park ----------------------------------------------------------------------

config/macros/Brush.cfg

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
[gcode_macro AFC_BRUSH]
22
description: Wipe the nozzle on the brush
33
gcode:
4-
{% 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 %}
9-
{% set vars = printer['gcode_macro _AFC_BRUSH_VARS'] %}
10-
{% set Bx, By, Bz = vars.brush_loc|map('float') %}
4+
{% 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 %}
9+
{% set vars = printer['gcode_macro _AFC_BRUSH_VARS'] %}
10+
{% set Bx, By, Bz = vars.brush_loc|map('float') %}
1111
{% set brush_clean_accel = vars['brush_clean_accel']|float %}
12-
{% set y_brush = vars['y_brush']|default(false)|lower == 'true' %}
12+
{% set y_brush = vars['y_brush']|default(false)|lower == 'true' %}
1313
{% 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 %}
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 %}
1718

1819
# Get printer bounds to make sure none of our cleaning moves fall outside of them
1920
{% set x_max = printer.toolhead.axis_maximum.x %}
@@ -47,6 +48,8 @@ gcode:
4748
{% if verbose > 1 %}
4849
RESPOND TYPE=command MSG='AFC_Brush: Move to Brush.'
4950
{% endif %}
51+
52+
G90
5053

5154
G1 X{Bx} Y{By} F{travel_speed}
5255

@@ -91,5 +94,16 @@ gcode:
9194

9295
{% endfor %}
9396

97+
{% if z_move >= 0 %}
98+
{% if verbose > 1 %}
99+
RESPOND TYPE=command MSG='AFC_Brush: Finish z_move.'
100+
{% endif %}
101+
G91
102+
G1 Z{z_move} F{z_travel_speed}
103+
G90
104+
{% endif %}
105+
106+
G90
107+
94108
# Reset acceleration values to what it was before
95109
SET_VELOCITY_LIMIT ACCEL={saved_accel}

config/macros/Park.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ gcode:
2424
RESPOND TYPE=command MSG='AFC_Park: Park Toolhead'
2525
{% endif %}
2626

27+
G90
28+
2729
G1 Z{z_safe} F{z_travel_speed}
2830
G1 X{Px} Y{Py} F{travel_speed}

0 commit comments

Comments
 (0)