STPM01: Programmable Single Phase Energy Metering IC With Tamper Detection
STPM01: Programmable Single Phase Energy Metering IC With Tamper Detection
STPM01: Programmable Single Phase Energy Metering IC With Tamper Detection
Features
■ Active, reactive, apparent energies and RMS
values
■ Ripple free active energy pulsed output
■ Live and neutral monitoring for tamper
detection
■ Easy and fast digital calibration in only one
point over the whole current range TSSOP20
■ OTP for calibration and configuration
■ Integrated linear VREGs for digital and analog
supply
dedicated command set. The configured bits are
■ Selectable RC or crystal oscillator used for testing, configuration and calibration
■ Support 50 ÷ 60 Hz – IEC62052-11, IEC62053- purpose. From a pair of Δ ∑ output signals coming
2x specification from analog section, a DSP unit computes the
amount of consummated active, reactive and
■ Less than 0.1 % error
apparent energy, RMS and instantaneous values
■ Precision voltage reference: 1.23 V and 30 of voltage and current. The results of computation
ppm/°C max are available as pulse frequency and states on
the digital outputs of the device or as data bits in a
Description data stream, which can be read from the device
by means of SPI interface. This system bus
The STPM01 is designed for effective interface is used also during production testing of
measurement of active, reactive and apparent the device and/or for temporary or permanent
energy in a power line system using Rogowski programming of bits of internal OTP. In the
coil, current transformer and shunt sensors. This STPM01 an output signal with pulse frequency
device can be implemented as a single chip proportional to energy is generated, this signal is
monophase energy meter or as a peripheral used in the calibration phase of the energy meter
measurement in a microcontroller based application allowing a very easy approach. When
monophase or 3-phase energy meter. The the device is fully configured and calibrated, a
STPM01 consists, essentially, of two parts: the dedicated bit of OTP block can be written
analog part and the digital part. The former, is permanently in order to prevent accidental
composed by preamplifier and 1st order Δ ∑ A/D entering into some test mode or changing any
converter blocks, band gap voltage reference, low configuration bit.
drop voltage regulator, the latter, is composed by
system control, oscillator, hard wired DSP and
SPI interface. There is also an OTP block, which
is controlled through the SPI by means of a
Table 1. Device summary
Order code Temperature range Package Packaging
Contents
2 Pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.1 Measurement error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 ADC offset error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.3 Gain error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.4 Power supply DC and AC rejection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.5 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8 Theory of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8.1 General operation description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8.2 Analog inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8.3 ∑Δ A/D converters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.4 Zero crossing detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.5 Period and line voltage measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.6 Single wire meter mode (only Rogowsky coil sensor) . . . . . . . . . . . . . . . 21
8.7 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
8.8 Load monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.9 Error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.10 Tamper detection module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.10.1 Detailed operational description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.11 Phase compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.12 Clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9 STPM01 calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10 Application design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
12 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
List of tables
List of figures
1 Schematic diagram
2 Pin configuration
3 Maximum ratings
Note: Absolute maximum ratings are those values beyond which damage to the device may occur.
Functional operation under these condition is not implied.
4 Functions
ZCR Zero crossing signal Provides positive pulse every time the line voltage crosses zero
AW Active energy Pulse frequency signal proportional to active energy
RW Reactive energy Pulse frequency signal proportional to reactive energy
SW Apparent energy Pulse frequency signal proportional to apparent energy
This signal is high when the voltage channel value is rising and it is low when
LIN Line frequency signal
the voltage channel is falling. Basically this signal is the sign of dv/dt.
This signal is high when either the voltage line frequency is outside the
nominal band or the voltage register is below 64.
BFR Base frequency range
It is cleared when the voltage line frequency is inside the nominal band and
the voltage register goes above 128.
MA
Stepper motor signals Signal available in MOP and MON to drive a stepper motor
MB
This signal provides the information on the tamper status. If low no tamper is
detected, when high a tamper condition has been detected. This signal is part
BIT Tamper flag
of the status register but is also available on the SDATD pin when in
standalone mode.
Provides information on the load condition. This signal is part of the status
BIL No load condition register but is also available on the SCLNLC pin when in standalone mode.
BIL=1 no load condition, BIL=0 normal operation.
5 Electrical characteristics
VCC = 5 V, TA = 25 °C, 100 nF to 1 uF between VDDA and VSS, 100 nF to 1 uF between VDDD
and VSS, 100 nF to 1 uF between VCC and VSS unless otherwise specified.
General section
6 Terminology
6.5 Conventions
The lowest analog and digital power supply voltage is named VSS which represent the
system ground (GND). All voltage specifications for digital input/output pins are referred to
GND.
Positive currents flow into a pin. Sinking current means that the current is flowing into the pin
and then it is positive. Sourcing current means that the current is flowing out of the pin and
then it is negative.
Timing specifications of signal treated by a digital control part are relative to CLKOUT. This
signal is provided from the crystal oscillator of 4.194 MHz nominal frequency or from the
internal RC oscillator, eventually an external source of 4.194 MHz or 8.192 MHz can be
used.
Timing specifications of signals of the SPI interface are relative to the SCLNLC, there is no
direct relationship between the clock (SCLNLC) of the SPI interface and the clock of the
DSP block. A positive logic convention is used in all equations.
Figure 3. Supply current vs. supply voltage, Figure 4. RC oscillator frequency vs. VCC,
TA = 25 °C R = 12 kΩ, TA = 25 °C
Figure 5. RC oscillator: frequency jitter vs. Figure 6. Analog voltage regulator: line - load
temperature regulation
Figure 7. Digital voltage regulator: line - load Figure 8. Voltage channel linearity at
regulation different VCC voltages
Figure 9. Power supply AC rejection vs. VCC Figure 10. Power supply DC rejection vs. VCC
Figure 11. Error over dynamic range gain Figure 12. Primary current channel linearity at
dependence different VCC
8 Theory of operation
The maximum differential input voltage is dependent on the selected gain according to the
following table.
Gain Max Input voltage (V) Gain Max input voltage (V)
8X ±0.15
16X ±0.075
4 ±0.30
24X ±0.05
32X ±0.035
The gain register is included in the device configuration register with the address names
PST and ADDG. The table below shows the gain configuration according to the register
values:
8 0 0
16 0 1
Rogowsky Coil
24 1 0
Disabled (No Tamper)
32 1 1
8 CT 2 X
32 Shunt 3 X
8 8 4 0
16 16 4 1
Rogowsky Coil Rogowsky Coil
24 24 5 0
32 32 5 1
8 8 CT 6 X
CT
8 32 Shunt 7 X
Note: If the device is used in configuration PST = 7 (primary channel with CT, secondary channel
with Shunt), the shunt Ks must always be equal to one fourth of the current transformer Ks.
Both the voltage and current channels implement an active offset correction architecture
which gives the benefit to avoid any offset compensation.
The analog voltage and current signals are processed by the ∑ Δ Analog to digital
converters that feed the hardwired DSP. The DSP implements an automatic digital offset
cancellation that make possible avoiding any manual offset calibration on the analog inputs.
f CLK/4
Integrator
Output digital signal
+
Σ ∫
Input analog signal
-
DAC
The BFR flag is also set if the register value of the RMS voltage drops below 64. BFR is
cleared when the register value goes above 128. The BFR, then, also gives information
about the presence of the line voltage within the meter.
When the BFR error is set, the computation of power is zero unless the FRS bit is set or the
single wire mode operation is selected (see Section 8.6).
In fact, the effect of the BFR bit can be overridden by setting FRS configuration bit.
It means that if FRS is set and BFR is also set, all the energy computation is carried on as
BFR was cleared. In this case then p=u*i, where u could be zero or not (if BFR was set
because voltage RMS register value is below 64).
In standalone mode, the MOP, MON and LED provide the energy information, their
operation is not affected by FRS bit, it means that when BFR is set they stop switching
regardless the FRS value.
for tampering purposes or in case the line voltage is very stable, it is possible to use a
predefined value for computing the energy without sensing it.
In order to enable the SWM mode, the STPM01 must be configured with PST values of 4 or
5, (tamper enabled-Rogowsky coils). In this way, if the BFR error is detected, STPM01
enters in SWM. If BFR is cleared the energy calculation is performed normally, when BFR is
set (no voltage information is available) the energy computation is carried out using a
nominal voltage value according to the NOM configuration bits.
Since there is no more information on the phase shift between voltage and current, the
apparent rather than active power is used for tamper and energy computation. The
calculated apparent energy is the product between IRMS (effectively measured) and an
equivalent VRMS that can be calculated as follows:
VRMS = VPK*KNOM,
where VPK represents the maximum line voltage reading of the STPM01 and KNOM is a
coefficient that changes according to the following table:
0 0.3594
1 0.3906
2 0.4219
3 0.4531
For example, if a R1 = 783 kΩ and R2 = 475 Ω are used as resistor divider when the line
voltage is present, the positive voltage present at the input of the voltage channel of
STPM01 is:
R2
VI = ⋅ VRMS 2
R1 + R2
since the maximum voltage value applicable to the voltage channel input of STPM01 is +0.3
V, the equivalent maximum line voltage applicable is:
VPK = R1+R2/R2 • 0.3 = 494.82
considering the case of NOM=2, the correspondent RMS values used for energy
computation are:
VRMS = VPK • 0.4219 = 208.76 [V]
Usually the supply voltage for the electronic meter is taken from the line voltage, in SWM,
since the line voltage is not present any more, some other power source must be used in
order to provide the necessary supply to STPM01 and the other electronic components of
the meter.
capacitor should be connected between VCC and VSS, VDDA and VSS, VDDD and VSS. All
these capacitors must be located very close to the device.
The STPM01 contains a power on reset (POR) detection circuit. If the VCC supply is less
than 2.5 V then the STPM01 goes into an inactive state, all the functions are blocked
asserting a reset condition. This is useful to ensure correct device operation at power-up
and during power-down. The power supply monitor has built-in hysteresis and filtering,
which give a high degree of immunity to false triggering due to noisy supplies.
A bandgap voltage reference (VBG) of 1.23 V ±1 % is used as reference voltage level
source for the two linear regulators and for the A/D converters. Also, this module produces
several bias currents and voltages for all other analog modules and for the OTP module. The
bandgap voltage can be compensated regardless to the temperature variations with the
BGTC bits.
0 800
1 1600
2 3200
3 6400
When a no load condition occurs (BIL=1) the integration of power is suspended and the
tamper module is disabled.
In standalone mode, if a no load condition is detected, the BIL signal blocks generation of
pulses for stepper and forces SCLNLC pin to be low. If APL = 2 (see Section 8.14) the LED
pin continues providing the high frequency pulses, while if APL = 3, the pulses are stopped
as happens for MOP and MON.
In peripheral mode, the BIL signal can be accessed only through the SPI interface.
Equation 1
EnergyCH1 - EnergyCH2 > KCRIT (EnergyCH1 + EnergyCH2)/2;
where KCRIT can be 12.5 % or 6.25 %.
The detection threshold is much higher than the accuracy difference of the current channels,
which should be less than 0.2 %, but, some headroom should be left for possible transition
effect, due to accidental synchronism of actual load current change with the rhythm of taking
the energy samples.
24/60 Doc ID 10853 Rev 8
STPM01 Theory of operation
The tamper circuit works if the energies associated with the two current channels are both
positive or negative, if the two energies have different sign, the tamper is on all the time
however, the channel with the associated higher power is selected for the final computation
of energy.
In single wire mode, the apparent energy rather than the active is used for tamper detection.
When internal signals are not good enough to perform the calculations, i.e. line period is out
or range or ΔΣ signals from analog section are stacked at high or low logic level, or no load
condition is activated, the tamper module is disabled and its state is preset to normal.
INH
Tamper power integrators B A
Cycles 24 4 4 4 4 24
When the secondary channel is selected to be integrated by the final energy integrator, the
MUX and INH signals change according to Figure 19 below.
This means that energy of four periods from secondary channel followed by energy of four
periods from primary channel is sampled within the tamper module. From these two
samples, called B and A respectively, the criteria of tamper is calculated and the channel
with higher current is selected, resulting in a new tamper state. If four consecutive new
results of criteria happen, i.e. after elapsed 5.12 s at 50 Hz, the meter will enter into tamper
state. Thus, the channel with the higher current will be selected for the energy calculation. If
samples of power A and B would have different signs, the Tamper would be on all the time
but, the channel with bigger power would be still selected for the final integration of energy.
If a tamper status has been detected, the multiplex ratio will be 56:8 if the primary channel
energy is greater than the secondary one, otherwise it will be 8:56.
The detected tamper condition is stored in the BIT status bit. If BIT = 0 tamper is not
detected, if BIT = 1 a tamper condition has been detected. In standalone mode the BIT flag
is also available in the SDATD pin.
the nominal frequency value of CLKOUT. Two nominal frequency ranges are expected, from
4.000 MHz to 4.194 MHz (MDIV = 0) or from 8.000 MHz to 8.192 MHz (MDIV = 1).
Figure 20. Different oscillator circuits (a): with quartz; (b): internal oscillator; (c): with external
source
0 P/64
1 P/128
P
2 P/32
3 P/256
Due to the innovative and proprietary power calculation algorithm the frequency signal is not
affected by any ripple at twice the line frequency, this feature strongly reduces the
calibration time of the meter.
In a practical example where APL = 2, and the desired P is 64000 pulses/kWh (= 17.7
Hz*kW), we have:
KAW = 7.63*10-6 Wh
This means that the reading of 0x00001 in the active energy register represents 7.63 µWh,
while 0xFFFFF represents 8 Wh.
0 0 31.25 ms P/64
0 1 31.25 ms P/128
0 2 31.25 ms P/32
0 3 31.25 ms P/256
1 0 156.25 ms P/640
1 1 156.25 ms P/1280
1 2 156.25 ms P/320
1 3 156.25 ms P/2560
The mono-flop limits the length of the pulses according to the LVS bit value.
The decoder distributes the pulses to MA and MB alternatively, which means that each of
them has only a half of selected frequency.
Negative power is computed with its own sign, and the MOP and MON signals invert their
logic state in order to make the backward rotation direction of the motor. See the diagram
below.
Hi
MON
Lo
Hi
MOP
Lo
Hi
MON
Lo
Hi
MOP
Lo
When a no-load condition is detected MOP and MON are held low.
It is expected that an application microcontroller should access the data in the metering
device on regular basis at least 1/s (recommended is 32/s). Every latching of results in the
metering device requested from the microcontroller also resets the watchdog. If latching
requests does not follow each other within 1.6 second, an active high pulse on MON is
produced, because device assumes that microcontroller does not operate properly. An
application can use this signal either to control the RESET pin of its microcontroller or it can
be tied to some interrupt pin. The last possibility is recommended for a battery backup
application which can enter some sleep mode due to power down condition and should not
be reset by metering device because it would exit from the sleep mode.
The LED pin can be driven from AW wide band (active energy as in standalone mode), AW
limited at fundamental, RW (reactive energy) or SW (apparent energy) according to the
value of KMOT bit.
In this case, since the LED pin is driven by signals different from AW, some other
relationship between the LSB of the register and must be defined:
KAWFund = 4*KAW [Wh]
KRW = 2*KAW [VARh]
KSW = KAW [VAh]
APL = 1:
MOP provides the ∑ Δ signal generated from the analog voltage input;
MON provides the ∑ Δ signal generated from the analog current input, according to the
selection of the tamper module
LED provides the information about the selection of the current channel made by the tamper
module. If LED is low it means the primary channel is selected, if LED is high the secondary
channel is actually selected.
When STPM01 is used in peripheral mode all these signal can be read through the SPI
interface. See paragraph 16 for details on the Status bit location in the STPM01 data
records.
In standalone mode the BIL signal is available in SCLNLC pin and the BIT signal in the
SDATD pin. All the other signals can be read only through SPI interface.
The first 6 registers are read-only except for the 8 bit mode signals in the DFP register (the
mode signals will be described later in this paragraph). The last two registers CFL and CFH
can be also written because they contain the configuration bits. Among these last 64 bits (32
of CFL and 32 of CFH), 8 bits are used for parity nibbles, then only 56 bits are used for
configuring and programming the STPM01.
20 bit 8 bit
1bit 1bit
4 bit 1bit 6 bit
The very first CFG bit, called TSTD, is used to disable any change of system signals after it
was permanently set. During the configuration phase, each bit set to logic level 1 will
increase the supply current of STPM01 of about 120 µA, until the TSTD bit is set to 1. The
residual increase of supply current is 2 µA per each bit set to 1. It is then recommended to
set the TSTD bit to 1 after the configuration procedure in order to keep the supply current as
low as possible.
The STPM01 can work either using the data stored in the OTP cells either the data available
in the shadow latches. This can be chosen according to the value RD Mode signal (see
mode signal paragraph for description). If the RD is set, the CFG bits originates from
corresponding OTP shadow latches otherwise, if the RD is cleared, the CFG bits originates
from corresponding OTP antifuses. This way one can temporary sets up certain
configuration or calibration of device then verify it and then change it, if it is necessary. For
example, this is extensively exercised during production tests.
Each configuration bit can be written sending a byte command to STPM01 through its SPI
interface. The procedure to write the configuration bits is described in the SPI section.
After the TSTD bit has been set, the only write commands accepted will be the precharge
and the remote reset, this implies that the shadow latches cannot be used as source of
configuration data anymore.
010000 16
2 RESERVED
010001 17 (1)
010010 18
BGTC 2 Bandgap Temperature compensation bits. See Figure 17 for details.
010011 19 (1)
010100 20
010101 21 4-bit unsigned data for compensation of phase error, 0°+0.576°.
CPH 4 16 values are possible with a compensation step of 0.0384°. When CPH=0 the
010110 22 compensation is 0°, when CPH=15 the compensation is 0.576°.
010111 23 (1)
011000 24
011001 25
011010 26
8-bit unsigned data for voltage channel calibration.
011011 27 256 values are possible. When CHV is 0 the calibrator is at -12.5 % of the
CHV 8
011100 28 nominal value. When CHV is 255 the calibrator is at +12.5 %. The calibration
step is then 0.098%.
011101 29
011110 30
011111 31 (1)
100000 32
100001 33
100010 34
8-bit unsigned data for primary current channel calibration.
100011 35 256 values are possible. When CHP is 0 the calibrator is at -12.5 % of the
CHP 8
100100 36 nominal value. When CHP is 255 the calibrator is at +12.5 %. The calibration
step is then 0.098%.
100101 37
100110 38
100111 39 (1)
101000 40
101001 41
101010 42
8-bit unsigned data for secondary current channel calibration.
101011 43 256 values are possible. When CHS is 0 the calibrator is at -12.5 % of the
CHS 8
101100 44 nominal value. When CHS is 255 the calibrator is at +12.5 %. The calibration
step is then 0.098 %.
101101 45
101110 46
101111 47 (1)
As it is indicated above, the STPM01 includes 56 CFG bits. Normally, some of these bits
should be permanently set during production of application of STPM01 in order to protect
the application from power fails. Of course, if an application would include an on-board
microcontroller, it could reload the configuration and calibration values after power on restart
and so, the permanent set of STPM01 would not be necessary. But this is not very safe way
to do it, because due to some EMI even imposed to tamper the meter, the microcontroller
may become lost and during such state, it can change some system signals in the STPM01
or somebody can change the calibration and configuration by changing the software of on-
board microcontroller.
0 0111000x 70 or 71
0 BANK Used for RC startup procedure
1 1111000x F0 or F1
0 MOP and MON operates normally 0111001x 72 or 73
1 PUMP MOP and MON provides the driving signals to implement a
1 1111001x F2 or F3
charge-pump DC-DC converter
2 Reserved
3 Reserved
0 Current Channel 1 selected when tamper is disabled 0111100x 78 or 79
4 CSEL
1 Channel 2 selected when tamper is disabled 1111100x F8 or F9
0 The 56 Configuration bits originated by OTP antifuses 0111101x 7A or 7B
5 RD
1 The 56 Configuration bits originated by shadow latches 1111101x FA or FB
Any writing in the configuration bits is recorded in the
0 0111110x 7C or 7D
shadow latches
6 WE
Any writing in the configuration bits is recorded both in the
1 1111110x FC or FD
shadow latches and in the OTP antifuse elements
Swap the 32 bits data records reading. From
7 Precharge 1 1111111x FF
1,2,3,4,5,6,7,8, to 5,6,7,8,1,2,3,4 and viceversa
– RD mode signal has been already described in the SPI section but there is another
implied function of the signal RD. When it is set, each sense amplifier is disconnected
from corresponding antifuse element and this way, its 3 V NMOS gate is protected
from the high voltage of VOTP during permanent write operation. This means that as
long as the VOTP voltage reads more than 3 V, the signal RD should be set.
– PUMP: when set, the PUMP mode signal transform the MOP and MON pins to act as
driving signals to implement a charge-pump DC-DC converter (see schematic page
36). This feature is useful in order to boost the VCC supply voltage of the STPM01 to
generate the VOTP voltage (14 V to 20 V) needed to program the OTP antifuse
elements.
– CSEL In normal operation, if the anti-tamper module is not activated (see PST
configuration bits) the STPM01 will select the channel 1 as source of current
information. For debug or calibration purposes it is possible to select channel 2 as
source of current channel signal when the tamper module is disabled. This is done
setting CSEL mode bit.
– WE (write enable): This mode signal is used to permanently write to the OTP antifuse
element. When this bit is not set, any write to the configuration bit is recorded in the
shadow latches. When this bit is set the writing is recorded both in the shadow latch
and in the OTP antifuse element.
– Precharge: this command swaps the sequence of data record read, allowing the
reading of the last four data records as first and the first four as second. The reading
sequence will be 5, 6, 7, 8, 1, 2, 3, 4. Differently from the other mode signals, the
precharge command is not retained inside the STPM01, in fact it should be sent each
time before the reading of the data records. This is the only command that can be
sent to STPM01 when the TSTD bit has been set.
SCS
SYN
SCLNLC
SDATD
t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
1. All the time intervals must be longer than 30 ns. t7 → t8 is the reset time, this interval must be longer than 30 ns as well.
division makes sense with the MSB of data value because the MSN of it holds the parity
code rather than useful data.
The sequence of data record during the reading operation is fixed. Normally, an application
will read 1st,.., 6th data record, the 7th and 8th data record would read only when it need to
fetch the configuration data. However, an application may apply a precharge command (see
Table 17) prior reading phase. This command forces the device to respond with the
sequence 5th,.., 8th, 1st,.., 4th. Such change of sequence can be used to skip the first four
data records.
The timing diagram of the reading operation is shown on the Figure 26. One can see the
latching and beginning of shifting phase of the first byte (0x5F) of the first data record and
end of reading. Also, both alternatives to reset the internal transmission serial clock counter
is shown in signal SYN.
SCS
f(read)
SYN
SCLNLC
SDATD
1st byte
last bit of 32nd byte
t1 t2 t3t4 t5 t6 t7 t8
Equation 2
v(t) = V•sin ωt; where V is the peak voltage and ω is related to the line frequency
and the instantaneous current:
Equation 3
i(t) = I • sin (ωt + ϕ);
where I is the peak current, ω is related to the line frequency and ϕ is the phase difference
between voltage and current.
In the STPM01, after the pre-conditioning and the A/D conversion, the digital voltage signal
(which is dynamically more stable with respect to the current signal) is processed by a
differentiated stage which transforms:
Equation 4
v(t) → v’(t) = dv/dt = V ⋅ ω ⋅ cos ωt − [see Figure 28 - 5]
The resulted signal, together with the pre-processed and digitalized current signal:
Equation 5
i(t) = I ⋅ sin(ωt + ϕ); [see Figure 28 - 6]
are then available for the calculation process. These digital signals are also provided into
two additional stages which perform the integration of themselves, obtaining:
Equation 6
dv/dt → v(t) = V ⋅sin ωt; [see Figure 28 - 7]
i(t) →
I
∫
I( t ) = i( t ) ⋅ dt = −
ω
⋅ cos( ω t + ϕ )
[see Figure 28 - 8]
Now four signals are available. Combining (pairing) them by means of two multiplying stages
two results are obtained:
Equation 7
Equation 8
Equation 9
(p ( t ) − p/ 1( t )) V ⋅ I ⋅ cos ϕ
p( t ) = / 2 =
2 2
[see Figure 28 - 11]
In this way, the AC part V•I•cos(2ωt + ϕ)/2 has been then removed from the instantaneous
power.
In the case of current sensors like “Rogowski coils”, which provide the rate of the
instantaneous current signal (di/dt), the initial voltage signal differentiated stage will be
switched off. In this case the signals coming from the A/D conversion and their consequent
integrations will be:
Equation 10
v(t) = V•sin ωt
di( t )
i′( t ) = = −I ⋅ ω ⋅ cos( ω t + ϕ )
dt
Equation 11
V
∫
V(t) = v(t) ⋅ dt = −
ω
⋅ cos ωt
Equation 12
[
(t) = ∫ i′( t ) ⋅ dt = i( t ) = − I ⋅ sin( ω t + ϕ )
The signals process flow will be the same as shown in the previous case, and even with the
formulas above, the result will be the same.
The absence of any AC component allows a very fast calibration procedure: it requires just
to set (using the internal device programming registers) the voltage and current sensor
conversion constants, using the effective voltage and current (VRMS, IRMS) readings
provided by the device built-in communication port, avoiding the time-averaged readings of
the active power or need for line synchronization.
Equation 13
⎛ ⎞
∫ v ′( t )dt ⋅ I( t ) =v ( t ) ⋅ I( t ) = ( V sin ω t ) ⋅ ⎜⎝ − ω cos( ω t + ϕ ⎟⎠ = 2 ω ⋅ (sin ϕ − sin( 2 ω t + ϕ ) )
I VI
Q 1( t ) =
The second is to multiply filtered DS value of voltage channel with the value of filtered
current channel,
Equation 14
Equation 15
1 1 VI
Q= ⋅ Q1(t) ⋅ ω + Q2 (t) ⋅ = sin ϕ
2 ω 2
Since the above computation would need significant additional circuitry, the Reactive Power
in the STPM01 is calculated using only the Q1(t) multiplied by ω, it means:
Doc ID 10853 Rev 8 47/60
Theory of operation STPM01
Equation 16
Equation 17
⎛ ⎞
∫ v( t)dt ⋅ ∫ i′(t)dt =V(t) ⋅ i(t) = ⎜⎝ − ω cos( ωt) ⎟⎠ ⋅ (− I sin( ωt + ϕ)) = 2ω (sin ϕ + sin( 2ωt + ϕ))
V VI
Q 1( t ) =
Equation 18
Q1( t) = v( t) ⋅ i′(t) = V sin ωt( t) ⋅ (− Iω cos( ωt + ϕ)) = − ⋅ ω ⋅ (sin ϕ − sin( 2ωt + ϕ))
VI
2
The reactive power is then calculated:
Equation 19
Equation 20
T
1 I
∫I ( t ) dt =
2
T
0
ω⋅ 2
Equation 21
I
IRMS =
2
Equation 22
T
1 V
VRMS = ∫v ( t )dt =
2
T 2
0
Equation 23
T
1 V ⋅ω
∫ v′ ( t )dt =
2
T 2
0
Multiplying Equation 20: and Equation 23: , the apparent power is produced:
Equation 24
I V⋅ω VI
S= ⋅ =
ω⋅ 2 2 2
Rogowsky coil
In this case we have:
Equation 25
T
1 I
IRMS = ∫ i′′ ( t )dt =
2
T 2
0
9 STPM01 calibration
Energy meters based on STPM01 device are calibrated in a fast and easy way. The
calibration is essentially based on the single calibration of the voltage and current channel
considering their RMS values rather than on the frequency of output pulse signal. When the
two channel are calibrated all the other measurement are calibrated too. This allows the
calibration to be performed in only one point shortening the production time of the meter.
This procedure is possible due to the below key points:
– Device is compound of two independent meter channels for line voltage and current
respectively. Each channel includes its own digital calibrator, to adjust the RMS in the
range of ±12.5 % in 256 steps, and digital filter, to remove any signal DC component.
All final results are not subject to calibration procedure because they are achieved
from such corrected signals by mathematical modules implemented by hardwired
DSP.
– Device computes different kind of energies: active, reactive and apparent. The active
energy is produced without 2nd harmonic of line frequency. It also computes RMS
values of measured voltage and current.
– Device produces an energy output pulse signal but information can also be read
through serial port interface, SPI, and communication channel.
– Device has an embedded memory, 56 bits, used for configuration and calibration
purposes. The value of these bits can be read or they can be changed temporarily or
permanently through SPI communication channel.
Let’s consider the basic information needed to start the calibration procedure:
The following typical STPM01 parameters and constants are also known:
As shown in Table 18, only analog parameter are object of calibration because introduce a
certain error. Voltage ADC amplification Av is constant, while Ai is chosen according to used
sensors.
The calibration algorithm will firstly calculate the voltage divider ratio and, as final result, the
correction parameters, called Kv and Ki, which applied to STPM01 voltage and current
measures compensate small tolerances of analog components that affect energy
calculation.
Since Kv and Ki calibration parameters are the decimal representation of the corresponding
configuration bytes CHV and CHP or CHS (respectively voltage channel, primary current
channel and secondary current channel calibration bytes), at the end of calibration CHV and
CHP or CHS (according to the current channel under calibration, primary or secondary
respectively) bits' values are obtained.
In the following procedure CHV, CHP and CHS will be indicated as Cv and Ci.
Through hardwired formulas Kv and Ki tune measured values varying from 0,75 to 1 in 256
steps, according to the value of Cv and Ci (from 0 to 255).
To obtain the greatest correction dynamic initially calibrators are set in the middle of the
range, thus obtaining a calibration range of 12.5 % per voltage or current channel:
Calibrator’s value
Kv = Ki = 0.875
Ci = Cv = 128
In this way it is possible to tune Kv and Ki having a precise measured: for example Cv = 0
generates a correction factor of -12.5 % (Kv = 0.75) and Cv = 255 determines a correction
factor of +12.5 % (Kv = 1), and so on.
According to what pointed out above, the following formulas, which relate Kv, i and Cv, i are
obtained:
Kv,i = (Cv,i/128) * 0.125 + 0.75
Cv,i = 1024 * Kv,i - 768.
The calibration procedure will output Cv and Ci values that will allow the above power
sensitivity of the meter.
This sensitivity is used to calculate target frequency at LED pin for nominal voltage and
current values:
XF = f * 64;
with:
f = PM * In * Vn / 3600000;
From values above and for both chosen amplification factor AI=32 and initial calibration data,
the following target values can be calculated:
Target RMS reading for given In:
XI = In * KS * AI * Ki * GINT * GDF * GDIF * BI / (VBG * 1000) = 1573
Target RMS reading for given Vn:
XV = f * BV * BI * DUD / (fM * XI) = 852
The output of the voltage divider is then:
10 Application design
The choice of the external components in the transduction section of the application is a
crucial point in the application design, affecting the precision and the resolution of the whole
system.
Among the several considerations, a compromise has to be found between the following
needs:
1. Maximize the signal to noise ratio in the voltage channel,
2. Choose the current to voltage conversion ratio Ks and the voltage divider ratio in a way
that calibration can be achieved (please refer to AN2299)
3. Choose Ks to take advantage of the whole current dynamic range according to desired
maximum current and resolution.
To maximize the signal to noise ratio of the current channel the voltage divider resistors ratio
should be as close as possible to those shown in Table 20.
The Figure 29 below shows a reference schematic for an application with the following
properties:
● P = 64000 imp/KWh
● INOM = 5 A
● IMAX = 60 A.
Typical values for the current sensors sensitivity, also used in the reference schematic
below, are shown in Table 21.
Note: If the device is used in configuration PST = 7 (primary channel with CT, secondary channel
with Shunt), the shunt Ks must always be equal to one fourth of the current transformer Ks.
Additional considerations on the application design, suggestions for noise and crosstalk
reduction can be found in the AN2317.
Figure 29. STPM01 reference schematic with one current transformer and one shunt
mm. inch.
Dim.
Min. Typ. Max. Min. Typ. Max.
A 1.2 0.047
K 0° 8° 0° 8°
A A2
K L
A1 b e
c E
E1
PIN 1 IDENTIFICATION
1
0087225C
mm. inch.
Dim.
Min. Typ. Max. Min. Typ. Max.
A 330 12.992
D 20.2 0.795
N 60 2.362
T 22.4 0.882
12 Revision history
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.