Skip to content

P0 SV metering: raw INT32 counts must not appear as calibrated A/V or MW without scale authority #26

Closed

Description

@masarray

Physical lab failure reproduced (sanitized summary; do not commit operator PCAP)

From a 4I+4V / 4000 fps IEC 61850 Sampled Values lab publisher, the raw 64-byte ASDU contains eight [INT32 instMag.i + quality] pairs. Example setpoints: 1.000 A corresponds to 1000 raw counts; 57.740 V corresponds to 5774 raw counts. The current SCL-free raw 4I4V candidate maps the channels, waveform and angles correctly, but the Metering panel treats ~999 raw counts as 999 A and ~5774 raw counts as 5.77 kV, and computes false MW/Mvar/MVA. The actual lab profile expresses currents at 1/1000 A/count, voltages at 1/100 V/count. No subscriber or switch is needed for reproduction; synthetic owned golden frames suffice.

Root-cause starting point

RawProcessBusAnalyzer.SvStreamState.ObserveSamples() stores big-endian INT32 decoded counts without an explicit engineering scale authority, yet CreateChannelValue() labels numbers A and V; MainWindowViewModel.ComputeThreePhasePower() multiplies these unqualified values to calculate W/var/VA. SCL mapping currently provides channel order but not necessarily calibration. Do not fix by silently dividing all streams by hard-coded factors or keying vendor/svID names.

Required robust fix

  • Establish a single per-stream, versioned scale/source authority: raw counts (unknown physical unit), explicitly selected 9-2LE/61869-9 compatible nominal profile where justified, or validated engineering context. Keep the selected stream's waveform/RMS/phasor/metering coherent.
  • Without confirmed scaling, label magnitudes as raw counts and show P/Q/S/PF as unavailable (not fabricated MW/Mvar). Make missing scale and how to resolve it obvious to novice users.
  • Provide an easy no-SCL path to select/verify a known 4I+4V 9-2LE nominal profile (1 mA/count current, 10 mV/count voltage) with clearly marked evidence/provenance; never silently apply it to arbitrary publisher layouts.
  • Changing scale must atomically invalidate dependent derived views for the selected stream, without resetting capture ownership or mixing other stream identities.
  • Deterministic regression: 1 A and 57.74 V show near those figures and no bogus MW, preserving +30° dynamic phase changes; negative tests unknown scaling, malformed layout, second independent diagnostic stream, zero/neutral channels, switching selected stream, and no regressions in raw waveform shape/timing.
  • Follow repository AGENTS.md & src/AGENTS.md: bounded hot path, no synthetic waveform, no uncertain physical unit claims.

Dependencies

Source ARStack Studio flash-build mismatch is independently addressed in arstack61850 PR #189. This issue is for DigSubAnalyzer's receive-only interpretation, not ARStack firmware and not a request to embed a publisher in the analyzer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions