Skip to content

Current and ADC voltage limits, and the PGA #64

@raineth

Description

@raineth

Howdy,

I recently picked up some of the SCT-024 200A CTs from your shop. I spent this evening debugging some weird measurement behavior where low currents (below 20-30A) were accurate, but higher currents started to look distorted and the readings would top out around 40-45A despite measuring 65A+ with a separate clamp meter. After some research and testing, I think I've root-caused the problem to a mis-read of the datasheet which has implications for both the single-phase and 6ch meters.

In the documentation and store pages for the 2ch, 6ch, and 6ch expansion boards, a maximum CT output of 720mA is specified (the docs for the 6ch board also mention a 1V maximum). The M90E32AS datasheet (sec 6.1) specifies a maximum ADC differential input of 720mV RMS, which means the maximum CT output (with the stock burden resistor) is only 720mV / 12Ω = 60mA RMS (or, tautologically, 0.72V RMS). The current revision of the boards will reach that at around 120A using the 200A CTs you currently sell and the lowest PGA gain of 1X.

Speaking of the PGA gain, that was the other half of my problem: the 2ch version of EmonESP has poor guidance in energy_meter.h, which led me to start out with a 4X PGA gain. Since the PGA sits before the ADC, the voltage after the PGA scaling must be ≤720mV RMS (reiterated in the M90E32AS application note, 4.2.4), so the 4X gain was effectively limiting me to 15mA of range. That would have hypothetically limited me to 30A, so I guess the IC can still make some sense of those out-of-spec voltages on the current-sensing inputs, but the response outside of the spec looks pretty non-linear to me.

Finally, after correcting my PGA gain to 1X, I discovered that the M90E32AS reports all currents as a 16-bit number of mA and therefore tops out at 65.535 amps. If higher range is needed, the measurement accuracy section (6.2.2) of the datasheet recommends e.g. halving the calibration value and doubling the current/energy register values. I am currently using esphome, so this was easy enough to implement with filters; however, afaict the EmonESP software does not support setting a multiplier to apply to the current/energy values for users needing >65.5A on a single channel.

So, here's what I'm proposing:

  1. The M90E32AS specs give us a pretty clear picture of what the PGA gain should be: 4X for CTs up to 15mA (assuming the current 12Ω burden resistor)/180mV, 2X for CTs up to 30mA/360mV, and 1X for CTs up to 60mA/720mV. The documentation surrounding PGA gain and maximum CT current/voltage limits should be updated to match.
  2. If you ever spin another revision of either board, perhaps it'd be worth using a lower value burden resistor and/or a voltage divider to facilitate CTs with higher current and voltage outputs.
  3. Support should be added to EmonESP for an arbitrary multiplier that's applied to all current and energy readings on given channel, which will enable support for currents >65.5A when the CT gain value is divided to match. After doing this in ESPHome, I'm seeing pretty reasonable data.

What do you think? Am I way off base here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentionUpdate is needed to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions