Skip to content

Evident IX85: Attempt to make AF Limits actually work.#947

Merged
nicost merged 3 commits into
micro-manager:mainfrom
nicost:EvidentIX85
May 22, 2026
Merged

Evident IX85: Attempt to make AF Limits actually work.#947
nicost merged 3 commits into
micro-manager:mainfrom
nicost:EvidentIX85

Conversation

@nicost
Copy link
Copy Markdown
Member

@nicost nicost commented May 22, 2026

Also enable to set nosepiece limit numerically.

nicost added 2 commits May 22, 2026 13:50
 Fix 1 (FindFocusWithOffset, line ~4383): Added clamping of targetZPos to
  hardware limits (FOCUS_MIN_POS/FOCUS_MAX_POS) and then to the user-set AF
  search limits (farLimit_/nearLimit_) before the final focus move. This
  prevents the post-search offset move from driving the objective outside the
  safe range — the most likely cause of the collision.

  Fix 2 (Initialize, line ~3586): Removed the block that overwrote
  nearLimit_/farLimit_ from the hardware's AFL query (which returns the cleared
  full-range defaults after remote mode exits). Replaced with zdcInitNeeded_ =
  true, ensuring InitializeZDC() always re-applies the adapter's stored limits
  (restored from a saved config file) before the first AF operation.

  Fix 3 (OnNearLimit/OnFarLimit, lines ~4479, ~4517): The direct AFL send is now
   only attempted when afStatus_ == 0 (idle), respecting the hardware
  documentation constraint. The member variable is updated unconditionally and
  zdcInitNeeded_ = true guarantees limits are applied before the next AF run
  regardless.
…, on the IX85-Nosepiece

  device)

  - BeforeGet: reads back the stored near limit for the currently active
  objective, so the property always shows the current value
  - AfterSet: converts the typed µm value to steps, clamps to [FOCUS_MIN_POS,
  FOCUS_MAX_POS], updates nearLimits_[obj], and sends the NL command to the
  hardware
  - Range is enforced via SetPropertyLimits (0 to 10,500 µm)

  The existing Set-Focus-Near-Limit (Set/Clear) and the read-only
  Focus-Near-Limit-um properties are unchanged. The new property is
  per-objective — whatever objective is currently in position receives the new
  limit when the value is set.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the Evident IX85 Windows device adapter to improve autofocus (AF) limit handling across remote-mode transitions and to allow setting per-objective focus near-limits numerically (in µm) from the UI/config.

Changes:

  • Added a writable numeric property to set the nosepiece’s per-objective focus near-limit directly in micrometers.
  • Changed ZDC autofocus initialization behavior to re-apply adapter-stored AF limits instead of reading limits from hardware at init time.
  • Added clamping in “Find Focus with Offset” to keep the offset move within configured AF search limits (and hardware limits).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
DeviceAdapters/EvidentIX85Win/EvidentIX85Win.h Declares the new nosepiece property action handler for numeric near-limit setting.
DeviceAdapters/EvidentIX85Win/EvidentIX85Win.cpp Implements numeric near-limit property, adjusts AF limit initialization/setting, and adds clamping for offset moves.

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

Comment thread DeviceAdapters/EvidentIX85Win/EvidentIX85Win.cpp
Comment thread DeviceAdapters/EvidentIX85Win/EvidentIX85Win.cpp
Comment thread DeviceAdapters/EvidentIX85Win/EvidentIX85Win.cpp Outdated
Comment thread DeviceAdapters/EvidentIX85Win/EvidentIX85Win.cpp
Comment thread DeviceAdapters/EvidentIX85Win/EvidentIX85Win.cpp
@nicost nicost merged commit 82eab60 into micro-manager:main May 22, 2026
2 checks passed
@nicost nicost deleted the EvidentIX85 branch May 22, 2026 21:41
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