PV and night tariff + EV and immersion heater

A while back I had to code all that reversing power stuff from a meter perspective so might be able to shed some light on the internals, although as you’ve already observed it no doubt varies wildly from one meter design to the next, but at least on this one…

The energy IC used records energy in a signed register with a resolution of WattSecs (aka Joules). It grows in one direction or the other, depending on the power direction, freely passing through zero as required. It resets to zero upon reading.

In contrast, the meter offers its clients two unsigned 64-bit readings: Positive WattSecs and Negative WattSecs. Those two values only ever get bigger. It’s a 12-channel per phase meter, so each phase has a set of registers like this:

So the basic f/w approach is to read the IC’s energy register every second, if it’s positive add it into the meter’s Positive Energy register and if negative add it into the meter’s Negative Energy register. The value read also gives an average Power value over the last second in Watts which can be read in yet another meter register (all that times 36, in the case of the 3-phase meter).

Left like that it would give a diverter a full second to balance the books and no energy would get recorded in the meter registers as the IC energy register would read as 0 (assuming the diverter could sync up with the meter’s one second window). But the IC can additionally raise an interrupt when it detects a change of direction in power flow. When that interrupt fires the f/w immediately reads the IC’s energy register and does the same processing as above. In that case the opportunity for a diverter to get the value back to 0 before the f/w reads it is greatly reduced. It comes down to how long the IC takes to notice the reversal, and how long the f/w takes to respond to the /IRQ and read the value.

The IC can only monitor half the channels at a time for power reversal, which is why half the channels in the meter register table above are flagged as “preferred for bi-directional circuits”. All channels can correctly tally bi-directional circuits into positive and negative accumulators, but half of them respond much faster to reversals. In different variants of the energy IC, the device itself tallies the positive and negative energies, making life much easier for the firmware, while being less friendly to diverters.

To test all this, I needed a way to reverse the power flow, preferably under f/w control, so I could test things like “what happens if the power reverses during a WaveView capture?”. This little device lets me do that:

It’s designed for high currents but low voltages, so is a good fit with the Current loop of a calibrator. It takes a single GPIO input to control which way the power should flow.

1 Like