Improve hub:direct unload behavior#720
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR fixes a bug preventing ejection of direct-hub lanes that are loaded but not connected to a toolhead. The fix removes conditional blocking in the eject control flow and updates the unload movement sequence to use a bounded forward-advance retry approach instead of retract-based logic. ChangesDirect-hub lane ejection support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Assessment against linked issues
Suggested reviewers
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@extras/AFC.py`:
- Around line 2028-2033: The retry loop for parking can perform 6 moves because
park_tries is incremented then checked with > 5; change the cap so it stops
after 5 attempts: either move the check into the loop condition (e.g., while
park_tries < 5 and not cur_lane.raw_load_state and cur_lane.prep_state) or
change the post-increment check to >= 5; update the block around park_tries,
cur_lane.move_advanced(cur_lane.short_move_dis, SpeedMode.SHORT) and the break
so the loop performs at most five move_advanced calls.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 128bd2c8-df17-41e8-bbe2-3bc60654d03a
📒 Files selected for processing (2)
CHANGELOG.mdextras/AFC.py
In hub:direct mode (toolchanger, single lane driving toolhead) unsetting load_to_hub will keep newly loaded spools from winding all the way out to the toolhead, leaving more of the filament inside the enclosure. What doesn't work in this case is the unload. Since there is no hub to home back to, filament homes back to the load switch, which means that the lane loaded state is lost since that switch is no longer triggered. This change updates the unload behavior so that hub:direct lanes can be unloaded. It does this by doing the same homing move, but then scootching the filament forward until the load switch is triggered again. This change also addresses an inconsistency where hub:direct lanes can't be ejected. The sequencing of this now works normally with the working unload routine. Fixes AFCProject#719
1b1b83c to
05ff37f
Compare
Major Changes in this PR
In hub:direct mode (toolchanger, single lane driving toolhead) unsetting load_to_hub will keep newly loaded spools from winding all the way out to the toolhead, leaving more of the filament inside the enclosure. What doesn't work in this case is the unload. Since there is no hub to home back to, filament homes back to the load switch, which means that the lane loaded state is lost since that switch is no longer triggered.
This change updates the unload behavior so that hub:direct lanes can be unloaded. It does this by doing the same homing move, but then scootching the filament forward until the load switch is triggered again.
This change also addresses an inconsistency where hub:direct lanes can't be ejected. The sequencing of this now works normally with the working unload routine.
Fixes #719
Notes to Code Reviewers
One inconsistency is that when load_to_hub:False is omitted from the config, the unload routine does not bring the filament back to its load position near the toolhead, it is still unloaded to the position near the load switch. Subsequent loads still work fine though.
How the changes in this PR are tested
Toolchanger setup with hub:direct lanes in both load_to_hub:False and default configurations.
PR Checklist: (Checked-off items are either done or do not apply to this PR)
NOTE: GitHub Copilot may be used for automated code reviews, however as it is an automated system, it's suggestions
may not be correct. Please do not rely on it to catch all issues. Please review any suggestions it makes and use your
own judgement to determine if they are correct.
Summary by CodeRabbit