forked from Klipper3d/klipper
-
Notifications
You must be signed in to change notification settings - Fork 0
[Go Migration] Fix bltouch.test 0.25s timing offset #4
Copy link
Copy link
Open
Description
Problem
All commands have a consistent 4,000,000 MCU clock ticks (0.25 second) offset:
Expected: queue_digital_out oid=12 clock=1400981798
Actual: queue_digital_out oid=12 clock=1396981798
Offset: 4,000,000 ticks = 0.25 seconds
This affects all BLTouch-related operations including homing and probing.
Root Cause
Go initialization (bltouch.go:50-55):
nextCmdTime: bltMinCmdTimeSec + 0.200 + bltPinMoveTimeSec, // = 0.98sPython initialization (bltouch.py:40):
self.next_cmd_time = self.action_end_time = 0. # Initialize to ZEROGo pre-calculates nextCmdTime during object creation, while Python initializes to 0.0 and adds values dynamically during handle_connect().
Proposed Fix
File: go/pkg/hosth4/bltouch.go
- Initialize
nextCmdTimeto0.0(not pre-calculated value) - Add connect-phase initialization that:
- Syncs to runtime print_time
- Adds 0.200 seconds
- Calls
raise_probe()
Match Python's handle_connect() behavior:
def handle_connect(self):
self.sync_mcu_print_time()
self.next_cmd_time += 0.200
self.set_output_mode(self.output_mode)
try:
self.raise_probe()
self.verify_raise_probe()Verification
./scripts/go_migration_golden.py compare --only bltouch --mode strictEstimate
~3-4 hours (requires understanding initialization flow)
Parent Issue
Part of #1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels