Home Energy Nuclear Fusion Electricity Climate Change Lighting Control Contacts Links


XYLENE POWER LTD.

ELECTRICITY METER PROGRAM

By C. Rhodes, P.Eng., Ph.D.

INTRODUCTION:
This web page describes the detailed operation of an interval electricity meter intended to be used with a new electicity rate. This new rate is based on peak sliding average kVA measured only at times when electricity is in short supply and on total kWh consumption. This electricity rate encourages load control to minimize demand when electricity is in short supply and encourages energy storage or displacement of fossil fuels when there is surplus electricity available.

This electricity meter features:
a) Remote reading;
b) Storage of date, time, cumulative kWh, cumulative kVAh and control flags at 15 minute intervals;
c) Local display of: date/time, cumulative kWh, cumulative kVAh, interval kW, interval kVA, metered sliding average kVA and peak metered sliding average kVA.
d) Automatic bypassing of the sliding average kVA metering during intervals when interruptible energy is available.
e) Automatic reset of the peak metered kVA register at the end of each billing period.

A basic smart electricity meter consists of a pulse initiating power transducer, a counter that indicates total cumulative energy registered by cumulating the transducer output pulses, a display that indicates the total registered cumulative energy in kWh, a microcontroller that has a real time clock/calendar which every 15 minutes acquires the cumulative kWh count and stores this count along with the corresponding date and time. At a convenient time the microcontroller sends the acquired data to a central computer. At that time it corrects any error in its clock/calendar. The microcontroller has a limited amount of non-volatile memory for storing acquired data, so eventually if the meter data is not read the meter will write over old data.

It is essential that the microcontroller be configured so that data is not corrupted or lost when the meter loses power.

In theory a basic smart meter could be used for electricity billing on the basis of peak demand calculated monthly from stored interval data. However, the practical problems with doing that are: there is no consideration of power factor and there is no local display of interval power, interval kVA, sliding average kVA, peak sliding average kVA and no provision for bypassing the sliding average kVA calculation to permit use of interruptible energy.

As a practical matter the basic smart meter firmware should be modified so that the meter acquires, calculates and sequentially displays total cumulative kWh and kVAh, the interval demand Pi in W, the interval volt-amperes Ui in VA, sliding average volt-amperes Ua in VA, and the Um = (peak value of Ua) in VA during the billing period.

The display should have 5 numeric characters plus extra character(s) which identify the quantity being displayed and its units (kWh, kVAh, W, VA, date and time). Since the numeric display sequentially shows a number of different values the display register can be reused for each value.
 

The meter has an opto-isolated input for an interruptible power availability signal.
 

CUMULATIVE kWh AND kVAh:
The power transducer is configured to linearly output 4096 counts / kWh and 4096 counts / kVAh.

Hence a fast pulse LED and the cumulative kWh register will indicate cumulative kWh in increments of (1 kWh / 4096 pulses).

Similarly a fast pulse LED and the cumulative kVAh register will indicate cumulative kVAh in increments of (1 kVAh / 4096 pulses).

In order to permit easy field diagnostics the transducer(s) should also have a LEDs that flash at:
4096 / 32 = 128 pulses / kWh
and at:
4096 / 32 = 128 pulses / kVA

These lower flash rate LEDs permit a field service technician to identify the source of an energy or power metering problem at a high electrical load.
 

A low flash rate LED will indicate kWh in increments of:
(1 kWh / 4096 pulses) X (32 pulses / flash) = (1 kWh / 128 flashes).

A low flash rate LED will indicate kVAh in increments of:
(1 kVAh / 4096 pulses) X (32 pulses / flash) = (1 kVAh / 128 flashes).

The peak VA ever seen by a typical residential electricity meter on a 240 V split phase 200 amp service is:
250 V X 200A = 50,000 VA
= 50 kVA.

Generally the design maximum load on a 240 V 200 A split phase service is:
0.8 X 240 V X 200 A = 38.4 kVA

At a load of 38.4 kVA the low LED flash rate is:
38.4 kVA X (1 h / 3600 s) X 4096 pulses / kVAh X (1 / 32) = 1.36533 pulses / s
which is a pulse rate easily checked by a field service technician.

At a load of 1 kVA the high speed service LED flash rate is:
1 kVA X (1 h / 3600 s) X 4096 pulses / kVAh = 1.13777 pulses / s
which is a flash rate easily checked by a field service technician.

The maximum number of transducer output pulses produced in a month is:
38.4 kVA X 744 h / month X 4096 pulses / kVAh = 117,021,082 pulses / month

A four byte register counts to 429,654,016. Hence if the electricity service is running at maximum capacity in less than 4 months a four byte register would roll over. Hence the total kVAh and kWh cumulation registers should each contain 5 bytes.

For local cumulative energy display in kWh the most significant 4 bytes of the current count are copied into a 4 byte binary register and then are right shifted 4 bits to achieve an effective divide by 4096. That result in kWh is converted into BCD and displayed.

For local cumulative kVAh display the most significant 4 bytes of the current count are copied into a 4 byte binary register and then are right shifted 4 bits to achieve an effective divide by 4096. That result in kVAh is converted into BCD and displayed.

There must be two 5 byte cumulative energy registers. One stores the current total cumulative energy count. The other stores the past total cumulative energy count.

Similarly there must be two 5 byte cumulative kVAh registers. One stores the current total cumulative kVAh count. The other stores the past total cumulative kVAh count.
 

INTERVAL POWER Pi
Every 15 minutes the processor calculates the difference between the current cumulative energy count and the past cumulative energy count. This difference is an integer INT. Thus:
INT = Current energy count - Past energy count
The processor then immediately sets:
Past energy count = current energy count.

The maximum value of INT is:
50 kW X (1 / 4) hour X 4096 pulses / kWh = 51,200
which is a 2 byte value.

The power during the last (1 / 4) hour was:
Pi = [INT (1 kWh / 4096)] / [(1 / 4) h]
= (INT / 1024) kW

Thus each bit increment of INT adds (1 / 1024) kW to the measured power. When INT = 1024 the measured power is 1 kW.

To avoid truncation error a better way of expressing this relationship is:
(1024 Pi) / kW = INT
where Pi is measured power in kW

For local display purposes we can express Pi in watts. Thus the displayed power is given by:
Displayed power = {[(1000 W / kW) (INT) kW] / 1024}
= {[1000 INT] / 1024} watts

Note that the displayed value of Pi is the 4 byte result of a 2 byte X 2 byte binary multiplication which result is right shifted to truncate the least significant 10 bits. This three byte result is then converted from binary to BCD and is displayed.
 

INTERVAL kVA Ui
Every 15 minutes the processor calculates the difference between the current cumulative kVAh count and the past cumulative kVAh count. This difference is an integer INTU. Thus:
INTU = Current kVAh count - Past kVAh count
The processor then immediately sets:
Past kVAh count = current kVAh count.

The maximum value of INTU is:
50 kVA X (1 / 4) hour X 4096 pulses / kVAh = 51,200
which is a 2 byte value.

The kVA during the last (1 / 4) hour was:
Ui = [INTU (1 kVAh / 4096)] / [(1 / 4) h]
= (INTU / 1024) kVA

Thus each bit increment of INTU adds (1 / 1024) kVA to the kVA register. When INTU = 1024 the measured kVA is 1 kVA.

To avoid truncation error a better way of expressing this relationship is:
(1024 Ui) / kW = INTU
where Ui is the measured kVA.

For local display purposes we can express Ui in VA. Thus for the displayed VA is given by:
Displayed VA = {[(1000 VA / kVA) (INTU) kVA] / 1024}
= {[1000 INTU] / 1024} VA

Note that the displayed value of Ui is the 4 byte result of a 2 byte X 2 byte binary multiplication which result is right shifted to truncate the least significant 10 bits. This three byte result is then converted from binary to BCD and is displayed.
 

SLIDING AVERAGE VA Ua:
At the end of each 15 minute interval if the IESO flag is not set then the sliding average VA is updated using the relationship:
Ua(present) = [(2^N - 1) Ua(past) + Ui] / 2^N

This relationship can be written as:
Ua(present) - Ua(past) = [Ui - Ua(past)] / 2^N
= the change in Ua during each metering interval dT.

Hence:
dUa / dT = [Ui - Ua(past)] / [2^N (metering interval length)]
or
dUa / [Ui - Ua] = dT / [2^N (metering interval length)]

In state o:
Ua = Uao at time T = To

In a later state Ua = Ua and T = M (metering interval length)

Integrating from state o to the generql state gives:
Ln[(Ui - Ua) / (Ui - Uao)] = - [M (metering interval length)] / [2^N (metering interval length)]
= - M / 2^N

Hence:
(Ui - Ua) = (Ui - Uao) Exp[- M / 2^N]
which shows that after a step change in power Ua exponentially converges to Ui
 

Recall that:
Ua(present) = [(2^N - 1) Ua(past) + Ui] / 2^N

Choose N = 3 to give the desired step response.
Then:
Ua(present) = [7 Ua(past) + Ui] / 8

For an initial value of Ua = 0 and for Ui = 1:
After 1 interval (0.25 hour): Ua = 1 / 8 = 0.125
After 2 intervals (0.50 hour): Ua = [7 (0.125) + 1] / 8 = 0.234375
After 3 intervals (0.75 hour): Ua = [7 (0.234375) + 1] / 8 = 0.3300781225
After 4 intervals (1.00 hour): Ua = [7 (0.3300781225) + 1] / 8 = 0.4138183594
After 5 intervals (1.25 hours): Ua = [7 (0.4138183594) + 1] / 8 = 0.4870910645
After 6 intervals (1.50 hours): Ua = [7 (0.4870910645) + 1] / 8 = 0.5512046814
After 7 intervals (1.75 hours): Ua = [7 (0.5512046814) + 1] / 8 = 0.6073040962
After 8 intervals (2.00 hours): Ua = [7 (0.6073040962) + 1] / 8 = 0.6563910842
After 9 intervals (2.25 hours): Ua = [7 (0.6563910842) + 1] / 8 = 0.6993421987
After 10 intervals (2.50 hours): Ua = [7 (0.6993421987) + 1] / 8 = 0.7369244238
After 11 intervals (2.75 hours): Ua = [7 (0.7369244238) + 1] / 8 = 0.7698088708
After 12 intervals (3.00 hours): Ua = [7 (0.7698088708) + 1] / 8 = 0.7985827620
After 13 intervals (3.25 hours): Ua = [7 (0.7985827620) + 1] / 8 = 0.8237599167
After 14 intervals (3.50 hours): Ua = [7 (0.8237599167) + 1] / 8 = 0.8457899271
After 15 intervals (3.75 hours): Ua = [7 (0.8457899271) + 1] / 8 = 0.8650661863
After 16 intervals (4.00 hours): Ua = [7 (0.8650661863) + 1] / 8 = 0.8819329130
After 17 intervals (4.25 hours): Ua = [7 (0.8819329130) + 1] / 8 = 0.8966912989
After 18 intervals (4.50 hours): Ua = [7 (0.8966912989) + 1] / 8 = 0.9096048865

Hence the step response of this algorithm for N = 3 is 89.67% after 17 intervals (4.25 hours) or 90.96% after 18 intervals (4.5 hours). Hence the 90% step response time is given by:
4.25 hours + [(90.00% - 89.67%)/(90.96% - 89.67%)][0.25 hour]
= 4.25 hour + 0.064 hour
= 4.314 hour
~ 4.3 hour

Note that the above table indicates a step response approximately of the form:
(Ui - Ua) = (Ui - Uao) Exp[- M / 2^N]
where in the above table:
Uao = 0
N = 3
0 < M < 19

Hence:
8 Ua(present) = [7 Ua(past) + Ui]
or
8 (1024) Ua(present) = [7 (1024) Ua(past) + (1024) Ui]
or
8 [1024 Ua(present)] = [7 [1024 Ua(past)] + INTU]
or
[1024 Ua(present)] = [7 [1024 Ua(past)] + INTU] / 8

Else if the IESO flag is set:
[1024 Ua(present)] = [1024 Ua(past)]

Recall that:
Ua < 50 kVA
and
INTU < 51,200
so the largest possible value of:
[7 [1024 Ua(past)] + INTU] = [7 [1024 (50)] + 51,200]
= 409,600
which is less than (256)^3.

Hence computing the quantity [1024 Ua(present)] requires 3 byte addition but after the divide by 8 gives a 2 byte result.

For display purposes the average VA is given by:
Sliding average VA = {[1024 Ua(present)] X (1000 VA / kVA)} / 1024

Note that the displayed value of Ua is the result of a 2 byte X 2 byte binary multiplication with the least significant 10 bits of the product truncated. This three byte result is then converted from binary to BCD and displayed.
 

VA RESOLUTION:
Note that if Ua(past) is initialized to zero INTU must be at least 8 for the quantity [1024 Ua(present)] to increase. Recall that:
(1024 Ui) / kW = INTU

At INTU = 8:
Ui = (8 / 1024) kVA
= (2 / 256) kVA
= 2000 VA / 256
= 7.8125 VA

Thus if the load is below 7.8125 VA for a prolonged period this calculation methodology will give a zero result. For a 730 hour month the theoretically undetected VAh could be as large as:
7.8125 VA X 730 h = 5703.125 VAh
= 5.703 kVAh
This undetected amount is about 0.8% of a small residential customer's bill. However, the corresponding energy will still show up on the cumulative energy and cumulative kVA registers. Reducing this small error requires increasing the number of transducer output counts per kWh which proportionately increases the on-board data memory requirements of each electricity meter.
 

MAXIMUM SLIDING AVERAGE VA Um:
Let [1024 Um] be the maximum value of [1024 Ua] in the current billing period. Every time that [1024 Ua] is calculated the new value of [1024 Ua] is compared to [1024 Um]. If:
[1024 Ua] > [1024 Um]
Then:
[1024 Um] = [1024 Ua]
Else:
[1024 Um] is unchanged.

Note that [1024 Um] is a 2 byte register.

At the end of each billing period, as indicated by the electricity meter's on board date/time clock the register [1024 Um] is cleared to zero and a warning flag is set indicating that this register was cleared. This warning flag is automatically cleared at the end of each 15 minute interval. If the recorded data shows that this warning flag was set at any time other than the end of a billing period it indicates that a hacker is tampering with the metering system.
 

CHOICE OF N:
An important issue is that with N = 3 can the meter track the grid load profile? ie Will Ua slew at least as fast as the grid load profile? Recall that we can express the meter response as:
(Ui - Ua) = (Ui - Uao) Exp[- M / 2^N]
= (Ui - Uao) Exp[- M / 8]

d(Ui - Ua) / dT = (Ui - Uao) Exp[- M / 8] (dM / dT)

(dM / dT) = (1 interval) / 0.25 h = 4 / h

COMPARE WITH GRID SLEW RATE FIND EXPONENTIAL ACCURACY

POWER DISPLAY ISSUE:
The meter firmware is designed to handle up to 50 kVA. The resolution is 7.8 VA. If the available display has only four usable digits instead of five usable digits it will be necessary to express the values in 10 VA units. In this case:
Load in ten VA units = {[1024 Ua(present)] X (100 X 10 VA / kVA)} / 1024
= ({[1024 Ua(present)] X 100 / kVA} / 1024) X 10 VA
 

INTERRUPTIBLE ELECTRICITY SERVICE:
If a customer adopts the new rate that customer automatically qualifies for IES electricity. The IESO transmits an IES enable signal that directly turns the customers interruptible load on/off. If at any time during a 15 minute period the IES enable signal is on the IES flag in the electricity meter is set for that time interval. At the end of each 15 minute interval the data and flag status are recorded and then the flags are cleared.

If the IES enable flag is recorded as set at any time when there was no IES enable signal for interruptible power it indicates tampering with the metering system.

For every interval in which the IES enable flag is set the customer's sliding peak VA metering is disabled by setting:
Ua(present) = Ua(past) and the customer is only billed for energy at the IES rate of about $0.02 / kWh for energy usage.

It is important that for each sustomer there be multiple greater than 8.6 hour intervals per billing period, at high load times on random days when there is no IES enable signal for that customer, so that the customer is properly charged for his/her/its monthly peak kW or peak kVA uncontrolled electricity usage.
 

POWER TRANSDUCER REQUIREMENT:
This metering software requires a transducer that linearly outputs 4096 pulses / kWh and 4096 pulses / kVAh. The accuracy and stability of these transducers must meet requirements established by legal metrology. The design of such a transducer is discussed on the web page titled: ELECTRICITY POWER TRANSDUCER
 

SUMMARY OF RAM REQUIREMENTS EXCLUSIVE OF TRANSDUCER REQUIREMENTS:
Scratchpad sufficient for arithmetic ~ 10 bytes
Cumulative Total kWh Current Count Register = 5 bytes
Cumulative Total kVAh Current Count Register = 5 bytes
Six character BCD display register = 6 bytes
Cumulative Total kWh last count register = 5 bytes
Cumulative Total kVAh last count register = 5 bytes
INT = 1024 Pi = 2 bytes
INTU = 1024 Ui = 2 bytes
Flags = 1 byte
[1024 Ua] = 2 bytes
[1024 Um] = 2 bytes
[Last Month's kVA] = 2 bytes
Thus in addition to about 10 scratchpad bytes for arithmetic the processor should have 37 additional bytes of available unused battery backed RAM above and beyond that required for transducer and communication purposes.
 

SUMMARY OF STORED DATA:
For each metering interval the stored data for retransmission to a central computer is:
Cumulative Total kWh Current Count Register = 5 bytes
Cumulative Total kVAh Current Count Register = 5 bytes
Interval Count (Date / Time) = 3 bytes Flags = 1 byte
Checksum = 1 byte
Thus each meter potentially outputs (15 bytes / interval) X (4 intervals / hour) X (744 h / month) = 44640 bytes / month. At the central computer the power, kVA values and the date/time can be derived from the acquired data.
 

CENTRAL DATA PROCESSING:
From time to time the data stored in the meter is acquired by a central computer. This computer checks the data validity via the checksum and then recalculates the peak sliding average kVA using the same algorithm as does the meter. This computer then generates electricity bills based on the acquired data values.
 

This web page last updated June 19, 2018.

Home Energy Nuclear Fusion Electricity Climate Change Lighting Control Contacts Links