Skip to content

Commit 0bcdee9

Browse files
authored
[Fix]: Weight fix for determine spoolers speed (#454)
Addresses a bug that caused spoolers to operate at super-fast speeds when the weight fell below the empty spool threshold and ensures that weight does not drop below zero during printing
1 parent e493c2d commit 0bcdee9

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ 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-16]
9+
### Fixed
10+
- Issue where espoolers would move way faster than normal when weight was below empty spool weight.
11+
812
## [2025-06-15]
913
### Added
1014
- Added support for the AFC-Pro board in the installer to install an 8-Lane Boxturtle.

extras/AFC_lane.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,11 @@ def calculate_rpm(self, feed_rate):
676676
:param feed_rate: Filament feed rate in mm/s
677677
:return: Calculated RPM for the assist motor
678678
"""
679-
if self.weight <= self.empty_spool_weight:
680-
return self.empty_spool_weight # No filament left to assist
679+
# Figure in weight of empty spool
680+
weight = self.weight + self.empty_spool_weight
681681

682682
# Calculate the effective diameter
683-
effective_diameter = self.calculate_effective_diameter(self.weight)
683+
effective_diameter = self.calculate_effective_diameter(weight)
684684

685685
# Calculate RPM
686686
rpm = (feed_rate * 60) / (math.pi * effective_diameter)
@@ -757,8 +757,9 @@ def update_remaining_weight(self, distance_moved):
757757
filament_weight_change = filament_volume_mm3 * self.filament_density / 1000 # Convert mm cubed to g
758758
self.weight -= filament_weight_change
759759

760-
if self.weight < self.empty_spool_weight:
761-
self.weight = self.empty_spool_weight # Ensure weight doesn't drop below empty spool weight
760+
# Weight cannot be negative, force back to zero if it's below zero
761+
if self.weight < 0:
762+
self.weight = 0
762763

763764
def set_loaded(self):
764765
"""

0 commit comments

Comments
 (0)