Datasheet PM9603APA, PM9603APE, PM9604APA, PM9604APE, PM9605APA Datasheet (SAMES)

...
Page 1
SA9603B APPLICATION NOTE
sames
PM9603AP
SINGLE PHASE POWER/ENERGY METERING MODULE
SPI INTERFACE
FEATURES
n Performs both power and energy
measurement
n Meets the accuracy requirements for
Class 1 AC Watt hour meters
500mW (excluding current sensing)
DESCRIPTION
The SAMES single phase power/energy metering module, the PM9603AP, provides energy data via a isolated SPI interface.
Energy consumption is determined by the power measurement being integrated over time.
The method of calculation takes the power factor into account. The output of this innovative universal power/energy meter is ideally suited for energy
calculations in applications using a micro-controller. The application utilises the SAMES SA9603B power metering integrated circuit for power
measurement. As a safety measure, this application shows the current sensor connected to the neutral
line. In practice, the live line may be used for current sensing, provided that the supply connections (MAINS) are reversed on the module.
n Uses a shunt resistor for current sensing n Operates over a wide temperature
range
n Isolated SPI interface.
7131 PDS038-SA9603B-001 REV.A 5-09-97
1/16
Page 2
PM9603AP
BLOCK DIAGRAM
NEUTRAL
NEUTRAL
NEUTRAL
LIVE
IN
OUT
IN
SHUNT
POWER SUPPLY
VOLTAGE SENSE
SA9603B POWER
METER WITH SPI BUS
DR-01349
OPTO­COUPLER
OPTO­COUPLER
D-sub CONNECTOR
ABSOLUTE MAXIMUM RATINGS*
Parameter Symbol Min Max Unit
Supply Voltage (Note 1) V Current Sense Input (Note 1) V Storage Temperature T
Operating Temperature T Max Current I through Sensor I
STG
MAX
MAX
AC
IV
-2.5 +2.5 V
-25 +125 °C
O
-10 +70 (Note 2) °C
300 V
800 (Note 3) A
2000 (Note 4) A
Note 1: Voltages are specified with reference to Live. Note 2: The SA9603B integrated circuit is specified to operate over the temperature
range -10°C to +70°C. The module functionality will however depend upon the
external components used. Note 3: t = 500ms Note 4: t = 1ms
*Stresses above those listed under “Absolute Maximum Ratings” may cause permanent
damage to the device. This is a stress rating only. Functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification, is not implied. Exposure to Absolute Maximum Ratings for extended periods may affect device reliability.
2/18
sames
Page 3
PM9603AP
ELECTRICAL CHARACTERISTICS
(Over the temperature range -10°C to +70°C, unless otherwise specified. Power consumption figures are applicable to the PM9603APE only.)
Parameter Symbol Min Typ Max Unit Condit ion
Supply Voltage V
AC
180 230 265 V PM9603APE
(Continuous) 90 115 135 V PM9603APA Power Measurement P
RNG
-18400 18400 W Specified
range accuracy Power Consumption
1
800 mW VAC = 230V
Supply direct from mains
Isolation Voltage
2
V
IS
2500 V Continuous
Opto-coupler Output Current I
O
10 mA VOL = 1V
Opto-coupler Input Current I
I
10 mA
Note 1: Power consumption specifications exclude power consumed by the current
sensor.
Note 2: Isolation voltage may be specified, depending on customer requirements.
CONNECTION DESCRIPTION
Designation Description
MAINS
Voltage supply connection to Neutral line Voltage supply connection to Live line
NEUTRAL IN Connection to positive side of current sensor NEUTRAL OUT Connection to negative side of current sensor SK1 P1 Supply (+ve) to opto-couplers
25-Way female P2 Input SA9603B - SCK
(D-type) P8 Input SA9603B - DI
P9 Input SA9603B - CS P12 Output SA9603B - DO P18, 20-25 Common emitters and cathodes opto-couplers
sames
3/18
Page 4
PM9603AP
FUNCTIONAL DESCRIPTION
1. Power Calculation
In the Application Circuit (see Figure 2), the output current from the current sensor will be between 0 and 16µA
(0 to 80A through a shunt resistor of 625µ). The
RMS
current input stage of the module, saturates at input currents greater than 18µA The mains voltage (Voltage + 15% - 20%) is used to supply the circuitry with power. A SA9603B utilize current information from the current sensor (shunt resistor), together with the mains voltage to perform the power calculation.
The SA9603B integrated circuits may be adjusted to accommodate any voltage or current values. The method for calculating external component values is described in paragraph 6 (Circuit Description).
SAMES offers two evaluation module options, namely 230V/80A and 115V/80A. The on chip registers are accessed via the isolated SPI bus.
2. Electrostatic Discharge (ESD) Protection
The device's inputs/outputs are protected against ESD according to the Mil-Std 883C, method 3015. The modules resistance to transients will be dependant upon the protection components used.
3. Power Consumption
The overall power consumption rating for this power metering application (Figure 2), is under 500mW, excluding the current sensor, when the supply is taken directly from the mains.
RMS
.
4. Isolation
The reference of the module is connected to neutral.
5. Isolated Input/Output Interface
The isolated interface is provided to allow the user to access the registers of the SA9603B.
A 25-Way D type connector (female) is provided on the PM9603AP module. The connector SK1 connects via a one to one connected cable to a Personal Computer parallel port.
6. Circuit Description
In the Application Circuits, (Figures 1), the components required for power metering applications are shown.
In Figure 1, a shunt resistor is used for current sensing. In this application, the circuitry requires a +2.5V, 0V, -2.5V DC supply.
4/18
sames
Page 5
PM9603AP
The current sense input requires a differential approach to cater for precision across the dynamic range. It is therefore important that the PC board layout of the branches to the sensing element, are as symmetrical as possible and the loop area is kept to a minimum.
The most important external components for the SA9603B integrated circuit are: R2, R1 and RSH are the resistors defining the current level into the current sense input. The values should be selected for an input current of 16µA
into the SA9603B at
RMS
rated line current. Values for RSH of less than 200µ should be avoided.
R1 = R2 = (IL/16µA Where I
L
) * RSH/2
RMS
= Line current
RSH = Shunt resistor/termination resistor R3, R6 and R4 set the current for the voltage sense input. The values should be selected so that the input current into the voltage sense input (virtual ground) is set to 14µA
RMS
.
R7 defines all on-chip bias and reference currents. With R7 = 24k, optimum conditions are set.
XTAL is a colour burst TV crystal (f = 3.5795MHz) for the oscillator. The oscillator frequency is divided down to 1.7897MHz on-chip and supplies the A/D converters and the digital circuitry.
7. Demonstration Software
Software which runs under Windows 3.1 and Windows 95 is provided with each evaluation module. See README.TXT on the diskette supplied for the installation instructions.
8. Sample C source code
The following software demonstrates how to synchronize the reading of the registers to the SA9603B's internal offset cancellation scheme. The software is also available on the SAMES Internet web pages.
sames
5/18
Page 6
PM9603AP
Figure 1: Connection Diagram
L
N
OU T
OU T
14 1
PARALLE L P OR T
R16
R14
R4
25 132513
R17
R18
R15
P M 960 3A P
S AME S
LK1
R13 R11
LK2
R12
C12
6/18
OP TIONA L
R1A
R3B
SHUNT
R3A
L
N
IN
IN
R7
R2
R1
R6
R10
C14
D2
R5
C15
C10
ZD1
ZD2
D1
C11A
XTAL
C9
R9
C13
C11B
DR -01350
sames
Page 7
PM9603AP
APPLICATION CIRCUIT Figure 2: Application using a Shunt Resistor for Current Sensing, having a
PC (Personal Computer) Interface.
SK1
3
15
1142
R20
680R
10
IC2D
R148680R
24k
R6
1M
R4
18
20
19
IVP
IIP
IIN GND
VREF CS
IC 4
3
1
2
1.6k
R1
R2
1.6k
16417518
9
IL Q74
7
R11
16
17
DI
TP 4
4
5
24k
R7
7
6
82192210
20
19
R16
680R
3
14
TEST VSS 7
5
IL Q74
IC2C
111213
R12
2.4k
131211
DO
DI
VDD
TP 9
8
9
680R
6
OSCI
OSCO
10
R18
4
IC2B
14
2.4k
15
TP 16
TP 2 FMO
TP 3
6
DB25
122513
23
11
24
680R
R17
2
1
IL Q74
IL Q74
IC2A
15
16
2.4k
R13
XTAL
3.5795 45MHz
S A 9 603B
1000uF
C12 +
C15
820n
Ground P l ane
dr-01351
100n
C10
100n
C9
2.4V
2.4V
ZD 1
ZD 2
180k
R3B
200k
R3A
470n/250V
C11
RSH
80A / 50mV
Load
sames
R9
680R
C13
+
470R/ 2WD1R5
1N414 8
680R
R10
100u
C14+100u
1N414 8
D2
S upply
7/18
Page 8
PM9603AP
Parts List For Application Circuit: Figure 2
Item Symbol Description Detail
1 IC-1 SA9603B DIP-20 2 IC-2 Opto Coupler, ILQ74 DIP-16 3 D1 Diode, Silicon, 1N4148 4 D2 Diode, Silicon, 1N4148 5 ZD1 Diode, Zener, 2.4V, 200mW 6 ZD2 Diode, Zener, 2.4V, 200mW 7 XTAL Crystal, 3.5795MHz Colour burst TV 8 R1 Resistor, 1.6k, 1%, metal Note 1
9 R2 Resistor, 1.6k, 1%, metal Note 1 10 R3A Resistor, 1%, metal Note 2 11 R3B Resistor, 1%, metal Note 2 12 R4 Resistor, 1M, ¼W 13 R5 Resistor, 470, 2W, 5%, carbon 14 R6 Resistor, 24k, ¼W, metal 15 R7 Resistor, 24k, ¼W, metal 16 R9 Resistor, 680, ¼W, 5% 17 R10 Resistor, 680, ¼W, 5% 18 R11 Resistor, 2.4k, ¼W, 5% 19 R12 Resistor, 2.4k, ¼W, 5% 20 R13 Resistor, 2.4k, ¼W, 5% 21 R14 Resistor, 680R, ¼W, 5% 22 R15 Resistor, 680R, ¼W, 5% 23 R16 Resistor, 2.4k, ¼W, 5% 24 R17 Resistor, 680R, ¼W, 5% 25 R18 Resistor, 680R, ¼W, 5% 26 C9 Capacitor, 100nF 27 C10 Capacitor, 100nF 28 C11 Capacitor, polyester Note 2 29 C12 Capacitor, 1000µF, 16V 30 C13 Capacitor, 100µF, 16V 31 C14 Capacitor, 100µF, 16V 32 C15 Capacitor, 820nF, 16V 33 RSH Shunt Resistor, 80A, 50mV (625µ) Note 1
Note 1: Resistor (R1 and R2) values are dependant upon the selected value of RSH. See
paragraph 6 (Circuit Description) when selecting the value for RSH.
Note 2: See the table below, detailing the component values for the selected voltage standard.
8/18
sames
Page 9
Description
Item Symbol
PM9603APA PM9603APE
115V 230V
12 R3A 120k 200k 13 R3B 82k 180k 31 C11 1µF 0.47µF
ORDERING INFORMATION
Part Number Description
PM9603APA 115V, 80A Module PM9603APE 230V, 80A Module
PM9603AP
Detail
sames
9/18
Page 10
PM9603AP
// This program will read the registers from a SA9603B device and // display the content on the screen. // The program work on a PM9603AP demonstration module.
#include <stdio.h> #include <math.h>
#define PI 3.141593 #define win_size 20
// Definitions for the parallel port #define CLK_b 0x20 //D5 on port pin 7 #define DO_b 0x40 //D6 on port pin 8 #define DI_b 0x20 //Paper out pin 12 #define CS_b 0x80 //D7 on port pin 9 #define PCTrig 0x02 //D1 on port pin 3 //#define freq_bits 0x00FFFF //#define inv_bits 0x0C0000
#define freq_bits 0x01FFFF // D16..D0 #define inv_bits 0x0E0000 #define bits_50hz 0x080000
// Mask definitions for the parallele port #define CLK_m ~CLK_b //D5 on port pin 7 #define DO_m ~DO_b //D6 on port pin 8 #define DI_m ~DI_b //Paper out pin 12 #define CS_m ~CS_b //D7 on port pin 9 #define byte_mask 0x80 //1000 0000
#define CLOCKFREQ 3579545 #define LPT1 0x378 #define LPT2 0x278
// Glogal variables unsigned char portval;
double arr_energy[win_size],arr_volt[win_size],arr_reactive[win_size]; long delay_time;
10/18
sames
Page 11
PM9603AP
int prt, buffindex = 0;
double convert_24bits(double value) // This function will sort out the 24 bits of the register values { if (fabs(value) > 0x7FFFFF) { if (value > 0) value = (16777216-value) * (-1); else value = (16777216+value)* (1); } return(value); }
void spi_wait(void) // This function will wait for the specified period, very short time { int ti; for (ti = 1; ti < 1 ; ti++); }
void spi_out(unsigned char value) // Put value on the parallel port { int n; portval = value; outport(prt,(~portval)); // Remove the ~ if you dont use opto couplers for(n=0 ; n< delay_time ; n++); // Specify the pulse width }
void spi_clock(void) // This function will pulse CLK pin of spi port { spi_wait(); spi_out(portval | CLK_b); // or spi_wait();
sames
11/18
Page 12
PM9603AP
spi_out(portval ^ CLK_b); // xor }
void spi_PCTrig(void) // This function will set the PC trigger pin { spi_out(portval & (~PCTrig)); // and spi_wait(); }
void spi_ClearPCTrig(void) // This function will clear the PC trigger pin { spi_out(portval | PCTrig); // or }
void spi_cs(void) // This function will set CSs pin of spi port { spi_out(portval | CS_b); // or }
void spi_reset(void) // all bits of the port are made 0 { spi_out(portval & CLK_m); spi_out(portval & DO_m); spi_out(portval & CS_m); }
void spi_start_read(unsigned char value) // All bits of the port are made 0 { int counter; unsigned char and_mask,mask;
mask = 0x80; value = (value | 0xC0 ); // Put the header for the adress 110—
12/18
sames
Page 13
PM9603AP
for ( counter = 0; counter <8; counter++) { and_mask = (mask & value); if (and_mask == mask) { spi_out(portval | DO_b); // 1 spi_clock(); } else { spi_out(portval & DO_m); // 0 spi_clock(); }
value = value << 1; } spi_clock(); // sort out the extra clock cycle between command & response }
unsigned long spi_read_register(void) // This function will read 24 bits of a register // the register to be red would be indicated by the // preceding spi_start_read function { int counter; unsigned char and_mask,mask; unsigned long fromport;
fromport = 0 ; for ( counter = 0; counter < 24; counter++) { spi_clock(); if (((inportb(prt+1)) & DI_b) == DI_b) fromport = fromport+ pow(2,(23-counter)); } return(fromport); }
sames
13/18
Page 14
PM9603AP
/ ***************************************************************************/ /* */ /* Main Function. */ /* */ / ***************************************************************************/
void main (int argc,char *argv[])
{ FILE *out;
char key;
int port,del_time ; long act , react , volt , freq, old_freq, act1, react1,volt1,prev_inv_bits; double k, active, reactive, voltage,fm,vm;
int first = 1;
fm = 0; act= 0; react= 0; volt= 0; freq = 0; del_time = 0;
if (argc == 3 ) { delay_time = atol(argv[2]); prt = atol(argv[1]); if(prt == 1) prt = LPT1; else prt = LPT2;
} else { printf(“\nusage : CHIP9603 <portnum> <SPI clock delay lime>\n”); printf(“ <portnum> = 1 or 2 (lpt port
14/18
sames
Page 15
PM9603AP
number)\n”); printf(“ <SPI clock delay lime> = For loop delay\n”); printf(“ use 1000 for a 486dx266 \n”); exit(0); }
clrscr();
while(key !=’q’) { if(bioskey(1)) { key = bioskey(0); } old_freq = freq;
spi_reset(); spi_cs(); spi_start_read(3); freq = spi_read_register();
// Get the rising edge if the inversion bits if (((freq & bits_50hz) == bits_50hz ) //D19 is now set && ((old_freq & bits_50hz) != bits_50hz)) //D19 was not set previously { // The following is used to indicate that //registers is read every 8th mains cycle spi_PCTrig(); delay(1); spi_ClearPCTrig();
//del_time is the amount of inversion cycles to wait before //reading the rest of the register values. del_time ++; }
if(del_time == 10) // 5 x 8 mains cycles time to integrate registers { // spi_PCTrig();
sames
15/18
Page 16
PM9603AP
spi_reset(); spi_cs(); spi_start_read(0); act = spi_read_register(); react = spi_read_register(); volt = spi_read_register();
// Now calculate the incremental difference and take care of register // overflow as well as the sign of register values active = convert_24bits(act - act1); reactive = convert_24bits(react - react1); voltage = convert_24bits(volt1 - volt);
k = (1/((double)(freq&freq_bits)*del_time)) * 80 * 230/(1.44*2);
fm = (double)((CLOCKFREQ/2)/((double)(freq & freq_bits)));
vm = (double)voltage * ((14/17.5)*0.63)/ ((double)(freq&freq_bits)*del_time) *230;
if (first == 0){ printf(“%08.2f \t”,active*k); printf(“%08.2f \t”,(reactive*k*PI/2)); printf(“%08.2f \t”,vm); printf(“%08.4f \t”,fm); printf(“%5.2f \n”,(del_time*(8/fm))); }
first = 0; act1 = act; react1= react; volt1 = volt; del_time = 0; } }//while }
16/18
sames
Page 17
Notes:
PM9603AP
sames
17/18
Page 18
PM9603AP
Disclaimer: The information contained in this document is confidential and proprietary to South African Micro-
Electronic Systems (Pty) Ltd ("SAMES") and may not be copied or disclosed to a third party, in whole or in part, without the express written consent of SAMES. The information contained herein is current as of the date of publication; however, delivery of this document shall not under any circumstances create any implication that the information contained herein is correct as of any time subsequent to such date. SAMES does not undertake to inform any recipient of this document of any changes in the information contained herein, and SAMES expressly reserves the right to make changes in such information, without notification,even if such changes would render information contained herein inaccurate or incomplete. SAMES makes no representation or warranty that any circuit designed by reference to the information contained herein, will function without errors and as intended by the designer.
Any Sales or technical questions may be posted to our e-mail address below: energy@sames.co.za
For the latest updates on datasheets, please visit out web site: http://www.sames.co.za
South African Micro-Electronic Systems (Pty) Ltd
P O Box 15888, 33 Eland Street, Lynn East, Koedoespoort Industrial Area, 0039 Pretoria, Republic of South Africa, Republic of South Africa
Tel: 012 333-6021 Tel: Int +27 12 333-6021 Fax: 012 333-8071 Fax: Int +27 12 333-8071
18/18
sames
Loading...