30
1 PS1000 Single Phase Electricity Meter SOC By Ann Chou Project Manager

PS1000 Single Phase Electricity Meter SOC

  • Upload
    danica

  • View
    74

  • Download
    17

Embed Size (px)

DESCRIPTION

PS1000 Single Phase Electricity Meter SOC. By Ann Chou Project Manager. PS1000 User Guide. LCD Display. I 2 C. NVM. Vref. Temp. Sensor. LCD Controller. UART. Modem. IA. AGC. ADC. UARTx2. GPRS. GPIO. Key Pad. DSP. MCU. IB. AGC. ADC. 32-bit H/W DSP. 8032T. RTC. VA. - PowerPoint PPT Presentation

Citation preview

Page 1: PS1000 Single Phase Electricity Meter SOC

1

PS1000 Single Phase Electricity Meter SOC

By Ann Chou Project Manager

Page 2: PS1000 Single Phase Electricity Meter SOC

2

PS1000 User Guide

Page 3: PS1000 Single Phase Electricity Meter SOC

3

System Architecture

DSPController

DSP

ADC

ADC

ADC

AGC

AGC

LCD Controller

UART

UARTx2

SSP

RTC

Timerx2

RAM16KB

ShadowFlash32KB

Watch Dog

Temp. Sensor

MCU

8032T32-bit H/W DSP

IB

IA

VA

LCD Display

Modem

GPRS

DSP/UP

I2C NVM

GPIO Key Pad

Vref

Zcc Detection

Power Detection

SPI

DSPROM

Page 4: PS1000 Single Phase Electricity Meter SOC

4

Features•  < 0.1% WH accuracy over 2000:1 range. •  Exceeds IEC61036/IEC62053/ANSI C12.20 standard •  3 high accuracy Sigma-delta ADC with SNR > 80 dB   2 ch 16-bit ADC with AGC for current input (1x/2x/4x/8x) 1 ch 16-bit ADC for voltage input•  DSP-MCU dual core with 8051 compatible programming   8032T high performance MCU   Built-in 32-bit hardware DSP core•  LCD driver(up to 160 pixels) •  64 kB Flash •  16 kB RAM •  3 Timers + Watchdog timer •  3 UARTs for AMR and calibration •  RTC for time of use functions •  I2C interface •  SPI interface •  Up to 16 general purpose I/O pins •  Built-in internal temperature sensor with 10-bit ADC •  Built-in energy management for the power outage meter reading •  128-lead LQFP package

Page 5: PS1000 Single Phase Electricity Meter SOC

5

SFR Mapping F8H IMR  IPR ICR IRR  ISR      

F0H B            

E8H                

E0H ACC PDCON            

D8H WDTCON              

D0H PSW              

C8H T2CON T2MOD RCAP2L RCAP2H TL2 TH2    

C0H SCON1 SBUF1  SCON2  SBUF2        

B8H IP     SSPCFG1 SSPCFG2 SPICON SPISTA SPIDAT

B0H P3   I2CCKH I2CCKL I2CCON I2CSTA I2CADR I2CDAT

A8H IE SSPDXH SSPDXL SSPRXH SSPRXL  SSPSTA

A0H P2       Reserved Reserved    

98H SCON SBUF P5 ALU_OP A0/R0 A1/R1 A2/R2 A3/R3

90H P1   P4CON P5CON B0/R4 B1/R5 B2/R6 B3/R7

88H TCON TMOD TL0 TL1 TH0 TH1 CKCON P4

80H P0 SP DPL DPH DPL1 DPH1 DPS PCON

*Red Mark: PS1000 proprietary, not the standard SFR

Page 6: PS1000 Single Phase Electricity Meter SOC

6

I/O Mapping

0xFC00

0xFE00

DSP Buffer (256 Bytes)

I/O Space (128 Bytes)

0xFD00

0xFE7F

0xF000DSP ROM (1K Bytes)

0xF400

0x0000

0x3FFF

16KB XDATA

Control by MCUCFG

Page 7: PS1000 Single Phase Electricity Meter SOC

7

DSP

VA offset value IA offset value IB offset value

VA RMS value IA RMS value IB RMS value

PA value PB value

Over voltage count Over voltage maximum value

Under voltage count Under voltage minimum value

• DSP calculation items

Page 8: PS1000 Single Phase Electricity Meter SOC

8

AGC

when the IA/IB integration is over the 50% of full scale, the AGC will decrease the gain value as one level (8X – 4X – 2X – 1X).

When the IA/IB integration value is under the 16% of full scale, AGC will increase the gain range as one level (1X – 2X – 4X – 8X).

The MCU can set the AGC threshold to control the AGC adjustment point. The threshold setting as

                   (MSB)                                                  (LSB)AGCTH_L = {FE65h, FE64h, FE63h, FE62h, FE61h, FE60h}AGCTH_H = {FE6Bh, FE6Ah, FE69h, FE68h, FE67h, FE66h}

Page 9: PS1000 Single Phase Electricity Meter SOC

9

SPI

SCKMISOMOSI

SS

Port0Port1Port2Port3

VDD

SCKMISOMOSI

SS

SCKMISOMOSI

SS

SCKMISOMOSI

SS

SCKMISOMOSI

SS

Page 10: PS1000 Single Phase Electricity Meter SOC

10

I2C

I2C DeviceOther Device

with I2C Interface

Other Device with I2C Interface

Rp Rp

I2C-busSCL

SDA

Page 11: PS1000 Single Phase Electricity Meter SOC

11

RTC

RTCCFG (0xFE28)

B7 B6 B5 B4 B3 B2 B1 B0

1 UPD RTCADJ[5:0]

UPD: RTC update 1: Update

0: no update (Default)RTCADJ[5:0]: RTC Frequency Adjust (Hz), 2’s complement

…000010: RTCCLK = 32768 + 2Hz000001: RTCCLK = 32768 + 1Hz 000000: RTCCLK = 32768Hz111111: RTCCLK = 32768 - 1Hz111110: RTCCLK = 32768 - 2Hz

RTCCFG2(0xFE3C)

B7 B6 B5 B4 B3 B2 B1 B0

RTCTM[2:0] x RTCFADJ[3:0]

Page 12: PS1000 Single Phase Electricity Meter SOC

12

RTCRTCTM[2:0] RTC Test Mode control

Must always set as 000

RTCFADJ[3:0] RTC clock tuning fraction part (RTCAdj)

0000 RTCAdj - 0/16Hz0001 RTCAdj - 1/16Hz0010 RTCAdj - 2/16Hz0011 RTCAdj - 3/16Hz0100 RTCAdj - 4/16Hz0101 RTCAdj - 5/16Hz0110 RTCAdj - 6/16Hz0111 RTCAdj - 7/16Hz1000 RTCAdj - 8/16Hz1001 RTCAdj - 9/16Hz1010 RTCAdj - 10/16Hz1011 RTCAdj - 11/16Hz1100 RTCAdj - 12/16Hz1101 RTCAdj - 13/16Hz1110 RTCAdj - 14/16Hz1111 RTCAdj - 15/16Hz

Page 13: PS1000 Single Phase Electricity Meter SOC

13

LCD

VLCD

V1

V2

V3

VSS

LCDDriver Control

LCDDriver

SEG0

COM0…

COM3

SEG39

LCDEN

VR

R

R

R

R: 5K ~ 25KVCC

Page 14: PS1000 Single Phase Electricity Meter SOC

14

Interrupt

PS1000 has 8 extended interrupt input source

IR

IRR

IMR

IPR/ICR

SPI_INT

I2C_INT

TXINT

RXINT

TIin_2

RIin_2

ExINT1

ExINT0

8051Interrupt

Controller

INT0/INT1

Serial Port 0/1

T/C 0/1/2

ISR Entry Point

Page 15: PS1000 Single Phase Electricity Meter SOC

15

Power Management

Functional Block Enable Setting Operation Current(3.3V) Operation Current (2.5V)

Fully Operation 26.17mA 32.95mA

DSP DSPCFG[7]=0 1.32mA

LCD LCDCFG[7]=0 0.2mA

RTC RTCCFG[7]=0 7uA

AGC AGCCFG[7]=0 0.1mA

ADC ADCCFG[7]=0 7.77mA

Temperature Sensor SARCFG[7]=0 0.6mA

MCU Power Down 2.33mA 3.73mA

• Most of the functional block of PS1000 can turn-on/off individually

Page 16: PS1000 Single Phase Electricity Meter SOC

16

Power Management

MCUDIV[3:0]DSPDIV[3:0]

Crystal(24MHz)

MCU Power Consumption(2.5V)

DSP Power Consumption(2.5V)

0000 SCLK / 1 24.00 26.24mA 4.92mA

0001 SCLK / 2 12.00 11.57mA 2.34mA

0010 SCLK / 3 8.00 7.66mA 1.57mA

0011 SCLK / 4 6.00 5.62mA 1.19mA

0100 SCLK / 5 4.80 4.5mA 0.95mA

0101 SCLK / 6 4.00 3.81mA 0.8mA

0110 SCLK / 7 3.43 N/A N/A

0111 SCLK / 8 3.00 2.8mA 0.6mA

1000 SCLK / 9 2.67 N/A N/A

1001 SCLK / 10 2.40 N/A N/A

1010 SCLK / 11 2.18 N/A N/A

1011 SCLK / 12 2.00 1.81mA 0.39mA

1100 SCLK / 13 1.85 N/A N/A

1101 SCLK / 14 1.71 N/A N/A

1110 SCLK / 15 1.60 N/A N/A

1111 SCLK / 16 1.50 1.42mA 0.29mA

• For the MCU and DSP, when you change the different operation frequency, it also can help to save the power consumption or increase the MCU/DSP performance

Page 17: PS1000 Single Phase Electricity Meter SOC

17

Development tool kit

Page 18: PS1000 Single Phase Electricity Meter SOC

18

Development tool kit

Development tool kit

EVB ckt

Keil C Compiler (自購 )

Tools

Download program UART

Sample code

Built in

User define

DSP Code

System Frame

Power Calculation

kWh pulse output

Calibration

Page 19: PS1000 Single Phase Electricity Meter SOC

19

PS1000 Evaluation Board User Guide

Page 20: PS1000 Single Phase Electricity Meter SOC

20

PS1000 EVB Hardware

V1

I1I2

Voltage Sensor

Current Sensor

PS1000

LCD

Key Pad

Battery

FRAM

Comm *3

I2C

Battery control Circuit

Flash Memory

kWh Pulse Output

RTC Power

I/O

I/O

Power

2.5V3.3V

5V

I/OI/O

Main Power

I/O

Push bottom

UART

SPI

Page 21: PS1000 Single Phase Electricity Meter SOC

21

EVB board LCD

Va Input

Ia/Ib Input

SSP IF

Debug Port

5V Power Connector

USB Power Source

Debug Pins Button Reset Button MCU Mode Switch

Download Port

PS1000 I 2C FRAM SPI

Flash

Ext. ROM

3.3V/2.5V LED

GND 3.3V

Page 22: PS1000 Single Phase Electricity Meter SOC

22

EVB Firmware Start

Initial DSPInitial Timer0Initial UART0

Initial 8051

EA=1

CALLModbus_Sub

DSPStatus.7=1

CALLCalc_Sub

CALLSelf_Sub2

CALLSelf_Sub1

Y

N

File name Description

Memory_map.h Define PS1000 register and I/O

Basic.h Define Sub-name and Parameter in Basic.obj

Basic.obj

Sub name Description

Init_DSP Download DSP ROM code , initial DSP register

Init_Timer0 initial Timer0 register

Init_UART0 initial UART register (Baud Rate , Stop bit …etc)

Init_8051 initial 8051 register , parameter

Modbus_Sub

Communication Process

Calc_Sub Calcuation V , I , Watt , VA ,Var , PF …….

kWh Pulse Output Process

Calibrate Process

Page 23: PS1000 Single Phase Electricity Meter SOC

23

Measurement

)()(

)(

)(

0

0

2

0

2

kikv

ki

kv

N

k

N

k

N

k

rmsrms

N

kirms

N

kvrms

IVS

kiGainI

kvGainV

0

2

0

2

)(

)(

22

0

2

0

2

01

)cos(

)

)()(

)()((cos

PSQ

pfSP

pf

kikv

kikv

r

N

k

N

k

N

kr

Page 24: PS1000 Single Phase Electricity Meter SOC

24

kWh Pulse Output

Calculation for kWh pulse output time Let meter constant as Kh (wh/pulse) , Current usage as a wattthen time interval of two pulse outputs will be

a

Kht

6060 sec

6363.1638.05110

606020

t sec

Ex : meter constant is 20 wh/pulse , Current conditions are 110V , 5A , PF=0.8 the time interval between two pulse can be found as

Page 25: PS1000 Single Phase Electricity Meter SOC

25

Communication

Protocol : Modbus

Transmission Modes : RTU modeThe format for each byte in RTU mode is:

Coding System: » 8–bit binary, hexadecimal 0–9, A–F

» Two hexadecimal characters contained in each

» 8–bit field of the message

Bits per Byte:» 1 start bit

» 8 data bits, least significant bit sent first

» 2 stop bits

Error Check Field:» Cyclical Redundancy Check (CRC)

Page 26: PS1000 Single Phase Electricity Meter SOC

26

Communication

Function Codes

Holding Register 0000h-01ffh map to FRAM address 0800h-0bffhInput Register 0000h-01ffh map to FRAM address 0c00h-0fffh

Code MODBUS_ name Description

03 Read Holding Registers Read the contents of read/write location

04 Read Input Registers Read the contents of read only location

16 Pre-set Multiple Registers Set the contents of read/write location

Page 27: PS1000 Single Phase Electricity Meter SOC

27

Calibration

PC transmit measuring time required for calibrationdetermining external voltage and current sourcesafter reaching steady , PC transmit calibration step to Modbus Holding Register 0000hwhen Modbus Holding Register 0000h = 0 being detected by PC, PC transmit the external voltage and current reference values to respective Modbus Holding Registers repeating 2-4 for 8 timesPC transmit Modbus Holding Register 0000h = 9 , Calibration parameters will be calculated by PS1000

Page 28: PS1000 Single Phase Electricity Meter SOC

28

Calibration

Calibration Step

1 Calibration Pointer #1 for Current Gain x8

2 Calibration Pointer #2 for Current Gain x8

3 Calibration Pointer #3 for Current Gain x4

4 Calibration Pointer #4 for Current Gain x4

5 Calibration Pointer #5 for Current Gain x2

6 Calibration Pointer #6 for Current Gain x2

7 Calibration Pointer #7 for Current Gain x1

8 Calibration Pointer #8 for Current Gain x1

9 Calculate Calibration Parameter

Page 29: PS1000 Single Phase Electricity Meter SOC

29

PS1000 Download Program

Page 30: PS1000 Single Phase Electricity Meter SOC

30

Thanks for your attention