Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small correction to calibration and change tool #252

Merged
merged 5 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2025-02-04]

### Changed
- Changed default `hub_clear_move_dis` to 25 to avoid too much retraction during filament changes

### Fixed
- Fixed error out during calibration when not calibrating bowden length
- Fixed issue where AFC could crash klipper in some scenarios when tool unloads fail to clear hub


## [2025-02-03]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion config/AFC_Macro_Vars.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ variable_restore_position : False # True = return to initial positio
# Distance to retract prior to making the cut, this reduces wasted filament but might cause clog
# if set too large and/or if there are gaps in the hotend assembly
# *This must be less than the distance from the nozzle to the cutter
variable_retract_length : 20
variable_retract_length : 30

# This can help prevent clogging of some toolheads by doing a quick tip from to reduce stringing
variable_quick_tip_forming : False
Expand Down
9 changes: 5 additions & 4 deletions extras/AFC.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,13 +990,14 @@ def CHANGE_TOOL(self, CUR_LANE):

# If a current lane is loaded, unload it first.
if self.current is not None:
if self.current not in self.lanes:
self.gcode.respond_info('{} Unknown'.format(self.current))
c_lane = self.current
if c_lane not in self.lanes:
self.gcode.respond_info('{} Unknown'.format(c_lane))
return
if not self.TOOL_UNLOAD(self.lanes[self.current]):
if not self.TOOL_UNLOAD(self.lanes[c_lane]):
# Abort if the unloading process fails.
msg = (' UNLOAD ERROR NOT CLEARED')
self.ERROR.fix(msg, self.lanes[self.current]) #send to error handling
self.ERROR.fix(msg, self.lanes[c_lane]) #send to error handling
return
# Load the new lane and restore the toolhead position if successful.
if self.TOOL_LOAD(CUR_LANE) and not self.error_state:
Expand Down
8 changes: 4 additions & 4 deletions extras/AFC_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ def cmd_CALIBRATE_AFC(self, gcmd):
cal_msg = ''
# Check to make sure lane and unit is valid
if lanes is not None and lanes != 'all' and lanes not in self.AFC.lanes:
self.AFC.ERROR.AFC_error("{} not a valid lane".format(lanes), pause=False)
self.AFC.ERROR.AFC_error("'{}' is not a valid lane".format(lanes), pause=False)
return

if unit is not None and unit not in self.AFC.units:
self.AFC.ERROR.AFC_error("{} not a valid unit".format(unit), pause=False)
self.AFC.ERROR.AFC_error("'{}' is not a valid unit".format(unit), pause=False)
return

if afc_bl not in self.AFC.lanes:
self.AFC.ERROR.AFC_error("{} not a valid lane".format(afc_bl), pause=False)
if afc_bl is not None and afc_bl not in self.AFC.lanes:
self.AFC.ERROR.AFC_error("'{}' is not a valid lane to calibrate bowden length".format(afc_bl), pause=False)
return

# Determine if a specific lane is provided
Expand Down
2 changes: 1 addition & 1 deletion extras/AFC_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, config):

self.move_dis = config.getfloat("move_dis", 50)

self.hub_clear_move_dis = config.getfloat("hub_clear_move_dis", 50)
self.hub_clear_move_dis = config.getfloat("hub_clear_move_dis", 25)
self.assisted_retract = config.getboolean("assisted_retract", False) # if True, retracts are assisted to prevent loose windings on the spool
self.afc_bowden_length = config.getfloat("afc_bowden_length", 900)
self.config_bowden_length = self.afc_bowden_length # Used by SET_BOWDEN_LENGTH macro
Expand Down