Conversation
Range-3 codes below VERISENSE_PULSE_PLUS_GSR_UNCAL_LIMIT_RANGE3 are raised to it before calibration so that an open circuit reads as open. The limit was 1134. At the second-generation front end's 1.8 V full scale that is below the 0.5 V that calibrateGsrDataToKOhmsUsingAmplifierEq divides by, which is code 1137.5. So codes 1134 to 1137, and every code clamped up to 1134, decoded to a negative resistance. nudgeGsrResistance then floored it at 8 kOhm in auto-range, reading the open circuit as 125 uS, the highest conductance the device can report. On fixed range 3 it pinned it to 680 kOhm, the bottom of the range. It is not a corner case. With the electrodes open the amplifier output sits on its reference, and the ADC reads either side of it. DEV-793's B6 recording (SR68-9, auto-range, open-circuit gaps; ASM_PC Test_056) has 4,629 range-3 samples between codes 1080 and 1250, peaking at 1126-1136, and 3,205 of them are at or below 1137. The committed Test_056 reference decodes every one of those as 125.000 uS. The limit is now 1138, the first code above 0.5 V, as 683 is at the Shimmer3's 3.0 V. 1134 came in with ASM-1736 in 2021, replacing a "TODO update value" 683, with no derivation recorded. It is the last code below 0.4986 V, the reference the C# API and web SDK use for this front end, and it is wrong there too. API_00015 decodes codes 1134-1138 on range 3 through VerisenseDevice and processDataCustom, for an SR68-9 and an SR61-5, in auto-range and on fixed range 3. It also pins the limit to the first code above the reference. At 1134 all five tests fail (8.0 and 680.0 kOhm). At 1138 all five pass, as does the rest of ShimmerDriver (108 tests). It is numbered API_00015 because DEV-1047's branch already uses 00012-00014. Downstream: ASM_PC has to bump this submodule and regenerate Test_056's reference, whose open-circuit samples change from 125.000 uS to ~0 uS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DEV-1067
Problem
SensorGSRVerisense.VERISENSE_PULSE_PLUS_GSR_UNCAL_LIMIT_RANGE3raises every range-3 code below it to it before calibration, so that an open circuit reads as open. It was 1134. At the gen-2 front end's 1.8 V full scale that is below the 0.5 V thatcalibrateGsrDataToKOhmsUsingAmplifierEqdivides by (0.5 V is code 1137.5). So codes 1134–1137, and everything clamped up to 1134, decode to a negative resistance.nudgeGsrResistancethen pins it to the wrong end:This happens in real data. DEV-793's B6 recording (SR68-9, auto-range with open-circuit gaps; ASM_PC
Test_056) has 4,629 range-3 open-circuit samples peaking at codes 1126–1136. 69% of them are ≤ 1137, and the committedTest_056reference decodes every one as 125.000 µS.Fix
The limit is now 1138, the first code above 0.5 V — the same rule as the Shimmer3's 683 at 3.0 V. 1134 came in with ASM-1736 (2021), replacing a
TODO update value, with no derivation recorded. It is the last code below 0.4986 V, the reference the C# API and web SDK use for this front end.Tests
API_00015_VerisenseGsrOpenCircuitLimitbuilds the sensor throughVerisenseDeviceand decodes codes 1134–1138 on range 3 withprocessDataCustom. It covers an SR68-9 and an SR61-5, in auto-range and on fixed range 3, and pins the limit to the first code above the reference.CI builds only
ShimmerDriverPC, so it will not run this test; it was run locally. The test is numbered 00015 because DEV-1047's branch already uses 00012–00014.After merge
Test_056's reference. Its open-circuit samples change from 125.000 µS to ~0 µS, and any other gen-2 GSR reference with range-3 codes ≤ 1137 will move the same way.VerisenseFileParserPC.jarpicks this up only when it is re-vendored.Sibling PRs (same constant, same ticket)
🤖 Generated with Claude Code