Skip to content

Commit

Permalink
Fix DC offset calculation in processing.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
FredM67 committed Mar 18, 2024
1 parent 3e4e999 commit 49e30d0
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 138 deletions.
4 changes: 2 additions & 2 deletions Mk2_3phase_RFdatalog_temp/processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#include "processing.h"
#include "utils_pins.h"

int32_t l_DCoffset_V[NO_OF_PHASES]; /**< <--- for LPF */

// Define operating limits for the LP filters which identify DC offset in the voltage
// sample streams. By limiting the output range, these filters always should start up
// correctly.
constexpr int32_t l_DCoffset_V_min{ (512L - 100L) * 256L }; /**< mid-point of ADC minus a working margin */
constexpr int32_t l_DCoffset_V_max{ (512L + 100L) * 256L }; /**< mid-point of ADC plus a working margin */
constexpr int16_t i_DCoffset_I_nom{ 512L }; /**< nominal mid-point value of ADC @ x1 scale */

int32_t l_DCoffset_V[NO_OF_PHASES]; /**< <--- for LPF */

constexpr uint32_t WORKING_ZONE_IN_JOULES{ 3600UL }; /**< number of joule for 1Wh */

/**< main energy bucket for 3-phase use, with units of Joules * SUPPLY_FREQUENCY */
Expand Down
Loading

0 comments on commit 49e30d0

Please sign in to comment.