Skip to content

log: add filter wheel position diagnostics - #545

Merged
Alpaca233 merged 1 commit into
Cephla-Lab:masterfrom
Alpaca233:youyan/filter-wheel-logging
May 19, 2026
Merged

log: add filter wheel position diagnostics#545
Alpaca233 merged 1 commit into
Cephla-Lab:masterfrom
Alpaca233:youyan/filter-wheel-logging

Conversation

@Alpaca233

Copy link
Copy Markdown
Collaborator

Summary

Add five INFO/WARNING log lines to SquidFilterWheel to make filter-wheel position drift easier to diagnose. Targets cases that aren't already covered by the existing recovery-path warnings introduced in #540.

  • __init__: firmware version + skip_init flag
  • __init__: per-wheel motor_slot, slot range, offset — config sanity check
  • __init__: WARNING when skip_init=True (tracked position assumed, never verified by homing — a known way for tracked/physical to diverge)
  • _move_to_position: wheel N: current -> target (usteps=X) on every move. The absolute usteps target is the most direct signal for diagnosing slot-misalignment — if usteps is wrong, the config math is suspect; if usteps is right but the slot is wrong, it's hardware/firmware.
  • _home_wheel: entry (prev tracked position) + exit (elapsed time)

No behavior changes. +15 lines, no deletions.

Test plan

  • Run microscope, switch filters, verify Filter wheel N: A -> B (usteps=X) appears in log
  • Run with --skip-init and verify the WARNING surfaces
  • Trigger a home (e.g. via timeout-recovery path or explicit home call) and verify the entry/exit pair appears
  • Confirm no log spam during normal acquisition (per-move INFO is one line per filter change, not per FOV)

🤖 Generated with Claude Code

Five INFO/WARNING lines to help diagnose when a wheel lands at the wrong
slot. Targets the cases that aren't already covered by upstream's
recovery-path warnings:

- __init__: firmware version + skip_init flag
- __init__: per-wheel motor_slot, slot range, offset (config sanity check)
- __init__: WARNING when skip_init=True (tracked position assumed, not
  verified by homing)
- _move_to_position: 'wheel N: current -> target (usteps=X)' on every
  move — the absolute usteps target is the most direct signal for
  diagnosing slot-misalignment
- _home_wheel: entry (prev tracked position) + exit (elapsed time)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds targeted INFO/WARNING diagnostics to SquidFilterWheel to help troubleshoot filter-wheel position drift without changing motion behavior. The new logs provide visibility into firmware/initialization context, config parameters used to compute absolute microstep targets, and basic timing/traceability around move and home operations.

Changes:

  • Log firmware version + skip_init during SquidFilterWheel.__init__, and warn when skip_init=True (tracked positions assumed without homing).
  • Log per-wheel configuration parameters (motor slot, slot index range, offset) at startup.
  • Log each absolute move with current -> target and computed absolute usteps, plus home entry/exit timing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Alpaca233
Alpaca233 merged commit 0771c85 into Cephla-Lab:master May 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants