Skip to content

DEV-1067: decode an open circuit on gen-2 GSR range 3 as open - #157

Open
marknolan wants to merge 1 commit into
mainfrom
DEV-1067_gsr_range3_open_circuit_limit
Open

marknolan wants to merge 1 commit into
mainfrom
DEV-1067_gsr_range3_open_circuit_limit

Conversation

@marknolan

@marknolan marknolan commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

DEV-1067

Problem

SensorADC raises range-3 codes below GSR_UNCAL_LIMIT_RANGE3_SR68 to that limit before calibration, so that an open circuit reads as open. The limit was 1134, which is below the 0.4986 V this decode divides by for the gen-2 front end (code 1134.3 at 1.8 V). So 1134, and every code clamped up to it, decodes to a negative resistance. The nudge turns that into 8 kΩ in auto-range — 125 µS, the highest conductance there is — and 680 kΩ on fixed range 3. An SR68-9 with its electrodes open (DEV-793 dataset B6) reads range-3 codes peaking at 1126–1136.

Fix

The limit is now 1138, the first code above 0.5 V at 1.8 V. That clears this decode's 0.4986 V and the Java driver's 0.5 V alike, and it is the value the Java driver and C# API get in the PRs below. CHANGELOG.md has an entry under [Unreleased].

Tests

The existing clamp test asserted only that a clamped sample decoded like one at the limit. It passed at 1134 because both sides came out at the 8 kΩ floor. It now uses 1138, and two tests are added:

  • codes 1134–1138 on range 3 must read ≥ 4.7 MΩ on an SR61-5 and an SR68-9, in auto-range and on fixed range 3
  • the limit must be the first code above 0.5 V
Limit Result
1134 4 tests fail
1138 the suite passes (1892)

typecheck, lint and prettier are clean.

Release

No version bump here. The consoles pick this up at the next vendoring bump or release.

Not changed here

In auto-range the nudge also caps resistance at 4.7 MΩ, so an open circuit now reads 0.213 µS. That is still above the 0.03 µS threshold, so connectivity still says 'Connected'. Java and C# only floor at 8 kΩ in auto-range (ASM-2156). This needs its own change, and the CHANGELOG entry says so.

Sibling PRs (same constant, same ticket)

🤖 Generated with Claude Code

SensorADC raises range-3 codes below GSR_UNCAL_LIMIT_RANGE3_SR68 to it
before calibration so that an open circuit reads as open. The limit was
1134, below the 0.4986 V this decode divides by for the gen-2 front end
(code 1134.3 at 1.8 V). So 1134, and every code clamped up to it, decoded
to a negative resistance. The nudge turned that into 8 kOhm in auto-range
(125 uS, the highest conductance there is) and 680 kOhm on fixed range 3.
An SR68-9 with its electrodes open (DEV-793 dataset B6) reads range-3
codes peaking at 1126-1136.

The limit is now 1138, the first code above 0.5 V at 1.8 V. That clears
0.4986 V and the Java driver's 0.5 V alike, and it is the value the Java
driver and the C# API get under the same ticket.

The existing clamp test asserted only that a clamped sample decoded like
one at the limit. It passed at 1134 because both came out at the 8 kOhm
floor. It now uses 1138, and two tests are added: codes 1134-1138 on
range 3 must read at least 4.7 MOhm on an SR61-5 and an SR68-9, in
auto-range and on fixed range 3; and the limit must be the first code
above 0.5 V. At 1134 four tests fail, and at 1138 the suite passes
(1892). Typecheck, lint and prettier are clean.

Not changed here: in auto-range the nudge caps resistance at 4.7 MOhm, so
an open circuit now reads 0.213 uS. That is still above the 0.03 uS
connectivity threshold, so the connectivity flag cannot say
'Disconnected'. Recorded in the CHANGELOG entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

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.

1 participant