sparkfun / sparkfun/SparkFun_ADE7953_Arduino_Library

Example 08 zero calibration does not affect displayed Amps value

オープン 初心者向け
#5 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C++
スター
1
フォーク
0
平均マージ
1分
マージ済み PR(30日)
1

説明

uint32_t corrected =
    (rawIrms > zeroOffset) ? (rawIrms - zeroOffset) : 0;

In Example 08 (`Example08_DiagnosticTool`), the `z` command calculates a local
`zeroOffset` from raw IRMS readings. That offset is applied to the displayed
`Corrected` and `Averaged` raw values as above.

However, the displayed current in amps is obtained independently using:

mySensor.getCurrentA(amps);

Consequently, zero calibration does not affect the Amps field. For example,
after zeroing, Corrected may be near zero while Amps continues to show the
original no-load value.

Also, linear subtraction of two RMS magnitudes is not generally the correct
noise-floor correction. The library already provides autoCalibrateA(), which
performs the correction in the squared/RMS domain.

Would you consider changing the z command to use the library calibration?

For example:
void doZeroCalibration()
{
    const uint16_t NUM_SAMPLES = 50;

    Serial.println(
        F("\nZero calibration - keep the CT connected with no current flowing."));

    if (mySensor.autoCalibrateA(NUM_SAMPLES) != ksfTkErrOk)
    {
        Serial.println(F("Zero calibration failed!"));
        return;
    }

    resetBuffer();
    Serial.println(F("Channel A zero calibration complete.\n"));
}

The r command could correspondingly call:

mySensor.clearCalibration();

This would make the zero operation affect getCurrentA(amps) directly and
would avoid having two independent calibration paths in the example.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Example08_DiagnosticTool の doZeroCalibration と z/r コマンドハンドラーから始め、ローカルの zeroOffset パスと mySensor.getCurrentA(amps) を比較します。ライブラリのキャリブレーション API が一貫して使用されていること、またゼロ調整またはリセット後に表示される Amps と raw フィールドがキャリブレーションを反映していることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
arduino, cpp
領域
embedded-iot
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
78/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。