AN3398
Application note
Fast digital calibration procedure for
STPMC1 based energy meters
Introduction
The STPMC1 device functions as an energy calculator and is an ASSP designed for
effective energy measurement in power line systems utilizing Rogowski coil, current
transformer, and Shunt or Hall current sensors. Used in combination with one or more
STPMSx ICs, it implements all the functions needed in a 1, 2, or 3-phase energy meter.
Due to its internal structure and features, STPMC1 allows a more effective and innovative
calibration procedure, which is explained in this document.
Advantages of this procedure are:
■
■
reduced calibration time
no need for re-calibration (calibration parameter can be written in a permanent way).
For further information about the device please refer to the STPMC1 datasheet.
This application note integrates the AN2299 application note for the STPMC1 metering chip.
Sections 1, 2, and 3.1 of the AN2299 application note can be considered valid also for the
STPMC1 device, sharing the same architecture as STPM01 and STPM10 devices, whilst
the calibration calculations shown in section 3.2 of AN2299 and in this document are slightly
different and are reported below.
November 2011
Doc ID 018812 Rev 1
1/11
www.st.com
Contents
AN3398
Contents
1
Calibration flow chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1
Calibration procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
Working point setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Algorithm choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Offline parameter calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Online procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Coherency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2/11
Doc ID 018812 Rev 1
AN3398
Calibration flow chart
1
Calibration flow chart
The calibration procedure can be summarized in the following steps, which are examined in
Section 1.1.
Figure 1.
Calibration flow chart
St
tar
Start
t
S
art
Start
Wor
rking
poi
in
Working point
t
Wo
king
po
nt
Working point
1. Working point
setting
R1 or SV
R1 or
r
SV
R1 o SV
R1 or SV
2. Algorithm choice
Of
f
line
Off
fline
Offline
Offline
O
fline
Decrease LED frequency
3.
Offline parameters calculations
Onl
line
Online
On
ine
Online
4. Online procedure (for each phase)
K?
K?
K?
K?
5. Coherency check (for each phase)
End
End
End
End
AM09391v1
1.1
1.1.1
Calibration procedure
Working point setting
According to the information contained in AN2299, the STPMC1 device can also be
calibrated in a single point for each phase.
Therefore, voltage and current nominal values of the selected phase must be defined before
running the calibration procedure, for example:
Doc ID 018812 Rev 1
3/11
Calibration flow chart
Table 1.
Working point setting
Value
230 V
5A
Description
Phase to neutral RMS voltage
Phase RMS current
AN3398
Parameter
Vn
In
The other parameters, which follow, and the constants of the STPMC1 metering device (and
relative tolerances) are also known:
Table 2.
STPMC1 internal parameters
Value
0.875
K
V
0.9375
0.875
K
I
len_i
len_u
Kint_comp
0.9375
2^16
2^12
1.004
3.14159
4 * 10^6
FM
2^22
4915200
D
UD
Vref
Au
2
8
Amplification of current ADC for STPMS1
32
Ai
2
Amplification of current ADC for STPMS2
16
0.815
Kint
0.679
0.6135
Kdif
0.7359
Gain of differentiator @ line frequency = 60 Hz
1. PM is CFG 21, which sets the meter precision (Class 1 or Class 0.1).
Parameter
Description
Voltage calibrator ideal value if PM = 0
(1)
Voltage calibrator ideal value if PM = 1
Current calibrator ideal value if PM = 0
Current calibrator ideal value if PM = 1
Current register length
Voltage register length
Gain of decimation filter
π
If oscillator frequency is 4.000 or 8.000 MHz
If oscillator frequency is 4.194 or 8.388 MHz
If oscillator frequency is 4.915 or 9.830 MHz
Internal parameter
Internal voltage reference
Amplification of voltage ADC for STPMS1
Amplification of voltage ADC for STPMS2
2^17
1.23
4
Gain of integrator @ line frequency = 50 Hz
Gain of integrator @ line frequency = 60 Hz
Gain of differentiator @ line frequency = 50 Hz
4/11
Doc ID 018812 Rev 1
AN3398
Calibration flow chart
Only analog parameters are objects of calibration because they introduce a certain error.
Voltage ADC amplification Av is constant, while Ai is chosen according to the used sensors.
The calibration procedure has, as a final result, correction parameters called K
VR
, K
VS
, K
VT
and K
IR
, K
IS
, K
IT
and K
IN
(if used) which, applied to STPMC1 voltage and current
measurements, compensate small tolerances of analog components that affect energy
calculations.
As K
VR
, K
VS
, K
VT
and K
IR
, K
IS
, K
IT
and K
IN
calibration parameters are the decimal
representation of the corresponding configuration bytes CVR, CVS, CVT and CIR, CIS, CIT,
CIN, the values of those bits are obtained at the end of calibration.
In the following procedure CVR, CVS, and CVT are indicated as Cv; CIR, CIS, CIT, and CIN
are indicated as Ci; K
VR
, K
VS
, and K
VT
are indicated as Kv, and K
IR
, K
IS
, K
IT
, and K
IN
are
indicated as Ki.
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).
If PM=1, two bits are appended to each Cv and Ci (see the STPMC1 datasheet for details),
and the corresponding tunings vary from 0.875 to 1 in 1024 steps.
To initially obtain the greatest correction dynamic, calibrators are set in the middle of the
range, therefore obtaining a calibration range of ± 12.5% (± 6.25% when PM is set) per
voltage or current channel:
Table 3.
PM
0
1
Kv = Ki = 0.875
Ci = Cv = 128
Kv = Ki = 0.9375
Ci = Cv = 512
Calibrator value according to PM
Calibrator value
In this way it is possible to tune Kv and Ki having a precise measurement: for example, with
PM=0, 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 the information above, the following formulas, which relate Kv,i and Cv,i to each
other are obtained:
Equation 1
Kv,i = (Cv,i/128) * 0.125 + 0.75
Equation 2
Cv,i = 1024 * Kv,i - 768
or when PM = 1
Equation 3
Kv,i = (Cv,i/512) * 0.0625 + 0.875
Equation 4
Doc ID 018812 Rev 1
5/11