一种基于单片机的新型三相多费率电能表的设计外文文献及翻译
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
always adopts mechanical tinplate to measure. There are some shortcomings that the measurement precision falls with machine abrasion, single time period setting and strong manpower [2]. In this paper, we propose a novel multi-rate three-phase watt-hour meter based on AT89LV52. This multi-rate three-phase
watt-hour meter adopts AD7752 for measurement. It has the characteristics which are time-sharing measurement, accurate measurement, LCD display, automatic meter reading, flexible time period setting, timely emendation, low cost and novel design.
II. STRUCTURE AND WORKING PRINCIPLE
The novel multi-rate three-phase watt-hour meter proposed in this paper is based upon AT89LV52 singlechip [3]. AT89LV52 has the flash memorizer with 8k bytes, cryptographical program memorizer with third class, RAM with 256 bytes, 32 programmable I/O lines, three time/ counter with 16 bits and a two class
halt with six vectors. The interface circuit adopts I2C bus unit which is a 8 bits singlechip with good performance and suitable price. The system structure diagram is shown in figure 1.
Figure 1. System structure diagram
The principle of this multi-rate watt-hour meter is reading in the
multi-rate time segments using RS485 bus and noting in X25045 then take over correctional clock with RS485 bus and write in clock CMOS chip S3530A. The three-phase AC voltage and electric current pass through potentiometer and mutual inductance instrument respectively so as to produce small signal which is sent to AD7752 to complete measurement. The clock CMOS chip S3530A gives clock information per second in the course of automatic move and analyze this clock belongs to which period of time according to advance periods of time set in X25045 then save the electrical energy in RAM memorizer
according to corresponding period of time. We write it to corresponding address of X25045 when the electrical energy achieves one degree in order to make the multi-rate measurement come true. This watt-hour meter hasfunctions of clear LCD display, missing phase detection, burthen control, halt electricity check and storage, automatic meter reading and so on.
III. THE DESIGH OF HARDWARE CIRCUIT
A. Electrical energy measurement
The three-phase electrical energy measurement is realized by the low consume CMOS chip AD7752 of ADI company. The inside of AD7752 adopts digital circuit besides ADC, filter and multiplication circuit which can eliminate noises effectively. The sampling course of voltage and electric current in three-phase AC power supply loop is shown in figure 2 in which IA stands for voltage sampling of A phase. The sampling circuits of B phase and C phase are similar to A phase. The power after integral is transformed to electrical pulse for output. The pulse of fan-out CF enters into
interregnum INT0 of AT89LV52 through photoelectricity insulation 4N25. CPU measures the electrical energy [4]. We adjust the pulse number of CF by combining the state of S1 and S2. The connection of electrical energy and pulse is W = M C . In which, W is the electrical energy with the unit of kilowatt-
hour, M is the total pulse number, C is the pulse number of ammeter. We choose C equals to 3000 that is to say every kilowatt-hour is 3000
pulses.
Figure 2. Circuit schematic diagramof watt-hour meter
B. LCD display
The LCD display [6] adopts HT1621 CMOS chip of HOLTEK Company to
achieve twelve bits digital display. HT1621 is the LCD drivers with 128 segments (32× 4) inner memorizer. The interior of HT1621 consists ofcontrol and time circuits, RAM, LCD drive and watch timer. It has
the merits of small volume and low cost so that it is suit to watt-hour meter. We use serial interface which only has four lines between HT1621 and AT89LV52. The detailed connection is shown in figure 3. P20, P21, P22 and P23 of AT89LV52 connect to CS, RD, WR and DATA respectively with the use to refurbish the display of RAM. HT1621 drive CMOS chip has 48 nodes in which COM0, COM1, COM2,
COM3 connect to the communal end and drive output of LCD and SG0, SG1, SG2, SG3 connect to drive output of every segment respectively. In addition, an adjustable resistance of 20kΩ is put between VDD and VLCD to adjust the display contrast of LCD. Experiment shows that the contrast is better with
VDD=5V and VLCD=4V.
C. Serial memorizer
Serial memorizer adopts low power consumption chip X25045 of XICOR
company .It has three functions which are watchdog timer WTD, voltage supervision and serial memorizer E2PROM with 512 bytes. WTD can be set 200ms, 600ms and 1400ms time intervals. The software program is read into X25045. During the normal running of program, WTD receives the trigger signal in time intervals in order to ensure the normal running of program. X25045 will output a high potential through RESET line if WTD does not receive trigger signal in time intervals. The trigger watt-hour meter reset in order to prevent program flying away. As the serial memorizer chip, 512 bytes of X25045 are used to storage the watt-hour meter code, multi-rate periods of time, the apex electricity, smooth electricity, vale electricity and total electricity of last month and this month. Storage can be divided into two same areas. One is used as data storage. The other is used for backup. The number of storage can be revised 100,000 times. Data can be stored for 100 years. It is connected with AT89LV52 by SPI agreement bus. The connection is shown in figure 3.
D. Clock circuit
The clock circuit is completed by S3530A chip. It is a low power
consumption clock chip that supports I2C Bus. It sets the clock and calendar according to the data received by CUP communicating with RS485. At the same time, it continues to walk time by its own oscillation. The crystal
oscillator of 32.768 kHz is put between Xin and Xout of S3530A which is connected with CPU through latching. SDA foot and SCL foot connect to P1.6 and P1.7 of AT89LV52 respectively. There are two interrupt alarming foots can be set as second output or minute output synchronizing pulse which supply interrupt signal to AT89LV52 with one second period. Single-chip system will readout the current time through I2C communication interface according to this signal and calculate the period of time that this moment belongs to so as to realize the electrical energy measurement in different periods of time [5]. This clock circuit has spare lithium battery. The powersupply VCC supply power in normal wiring and electrified for lithium battery of 3.6V. When there is power off, the system will automatically convert lithium battery to clock circuit for power supply. The clock will still running accurately even the power is off.
Figure 3. Partial circuit figure of watt-hour meter
E. RS485 Communication
MAX485 chip can implement RS485 communication control of
multi-rate watt-hour meter. MAX485 chip has RS485 communication protocol. It can take 128 hypogenous computers. Its transmission distance is greater than
1km and its transfer rate is up to 250kb per second. The watt-hour meter connects with the unit controller through the RS485 bus. Each unit has a cell controller can manage 128 multi-rate watt-hour meter. The cell controller connects to power management computer. Each watt-hour meter has one and only meter number with eight bits of hex. The electrician should write the user’s information and meter number and then import to the power management computer for initial installation so ad to complete the connection of user and management computer. Management computer sends setting of period of time and clock information with the manner of broadcast communication without address information. PC uploads information by the way of calling address.
F. Lack Phase detection and relay control
It can achieve relay control [7] with P27 of AT89LV52. P27 can
control relays using 4N25 photoelectricity isolator so as to complete powersupply and power control. Lack Phase detection gets the signal from fan-out of the relay and connects to 1 foot of photoelectricity isolator after passing a 75K resistance, the diode half-wave rectifier and capacitive
filtering respectively. We detect the 4 foot of isolator to determine whether there is the lack of phase. If there is lack of phase, we detect again after 2 seconds overtime. We break off the power immediately if there is lack of power after the twice confirmation. In power protection circuit, it uses the INT1 interrupt foot of AT89LV52 to detect signal.
When there is a sudden power off, INT1 jumps into a low voltage and the INT1 interrupt enters to the power protection program relying on the energy storage capacitor to save data. In the system, pulse output of AD7752, relay control port and the inputs of lack phase detection all use photoelectric isolator
4N25. It sends electrical signal by light coupling which can enhance the
ability of anti-jamming.
IV. THE DESIGN OF SOFTWARE
A.The distribution of resource
The software program includes main program, X25045 read and write program,
RS485 serial communication program, interrupt serve program, timer handling program, HT1621 display control program, electrical energy measurement in different period of time and power down protection program, and system self-checking and anti-interference handling program. Interrupt resource
distribution of system is: INT0 interrupt is used as AD7752 pulse measurement, INT1 as synchronization detecting, timer T0 as 100 ms timing, T1 as 1ms timing, and T2 as baud rate generator for serial communication program. RS485 asynchronous communication is set to receive
interrupt and check information for sending.
B. Module desigh
The flow chart of main program is shown in figure 4. The watt-hour
meter should be able to initialize at each power up time. The initializing program includes setting working mode of timers, serial stomata and interrupts for AT89LV52, writing control word into X25045, S3530A and HT1621. This system sets three periods of time. The singlechip reads clock value from S3530A per second then analyze this clock belongs to which period of time according to advance periods of time set in X25045 then save the electrical energy in RAM memorizer according to corresponding period of time. We write it to corresponding address of X25045 when the electrical energy achieves one degree. The LCD display with 16 bits shows period of time and electrical energy information in turn. Figure 4. Flow chart of main program
V. TESTING RESULT
Error measurement and running test have been made in Zibo Billion Electron Co., Ltd. The epigenous computer completes the setting of time management. There are
three-rate period of time. The first period of time is vale electricity from 00 point 00 minute to 06 point 30 minutes. The second period of time is apex electricity from 06 point 30 minutes to 22 point 30 minutes. The third period of time is smooth electricity from 22 point 30 minutes to 24 point 00 minute. The setting of rate period of time is sent to computer management system by electric power company according to national policy and saved in X25045. The apex electricity, smooth electricity, vale electricity and total electricity per month read saved in electrical energy meter and sent to epigenous computer through cell controller. The communication baud rate is 9600 bits per second. The checkout platform of 0.1 grade standard electronic power meter is used as standard meter and the multi-rate watt-hour meter is the tested meter. Billion Electron Company has carried out testing according to different load running. The measured data is shown in table 1 with the burthen of 30kW.
TABLE I. COMPARE OF NORMAL METER AND TESTING METER
The testing result indicates that the error of this multi-rate
watt-hour meter is less than 1%, belongs to 1.0 grade. The return reading of electrical energy is precision and the emendation of time is timely and right. By testing, the method of decreasing errors for electricity metering can be obtained. Firstly, adjust the sampling resistance of AD7752 to accurate value. Secondly, the value of this resistance is needed less varying with temperature. Thirdly, during electricity metering progress, when mantissa portion of electricity is less than 0.01, the remaining pulse should be accessed together, thus cumulative error caused by lack of 0.01degree energy loss could be avoided.
VI. CONCLUSION AND EXPECTATION
The multi-rate watt-hour meter achieves electrical energy
computation in different time according to different time setting. It adopts RS485 for serial communication and realizes automatic meter reading and real-time emendation. The results of production in Billion Electron Company show
that the multi-rate three-phase watt-hour meter proposed in this paper has the characteristics of novel design technique, accurate measurement, and flexible time period setting. Various technical indexes achieve the technique standard for national intelligent card watt-hour meter. Therefore, it has wide application.
REFERENCES
[1] Bu Zhengliang, Yin Xianggen, Tu Guangyu. “Development of HV Watt-hour meter.” Automation of Electric Power Systems, 2006, 30(19): 89-93.
[2] Kosukegawa M., Sakumoto Y. “Traceability system of electric energy standard and tendency in static watthour meter development in Japan.” Sixth International Conference on Metering Apparatus and Tariffs for Electricity Supply, 1990,4: 259-263.
[3] Xuehai Li. Applied tutorial of singlechip. Electronic industry publishing company, 2003.
[4] Al-Khateeb Tarik, Blundel Martin. “An electronic meter for measuring the saving in electrical power.” The Ninth Arab International Conference on Solar Energy (AICSE-9), Kingdom of Bahrain, 2007,4 (209):328-333.
[5] Liu Ying, Liu Qingyu. “Development of a self-calibration precision electrical measuring meter.” Proceedings of the 1998 Conference Precision Electromagnetic Measurements, 1998,7:276.
[6] Gao Yun-Peng, Teng Zhao-Sheng, Liu Peng. “Design of three-phase multi-functional harmonic energy meter.” Journal of Hunan University Natural Sciences, 2008, 35(9): 53-57.
[7] Qu Qingchang. “Key technology to three-phase electric meter and high voltage electric power measurement.” Acta Metrologica Sinica, 2007, vol28: 25-30.
一种基于单片机的新型三相多费率电能表的设计
Jishun Jiang Lanlan Yu
School of Electric and Electronic Engineering School of Electric and Electronic Engineering Shandong University of Technology Shandong University of Technology Zibo, 255091, China Zibo, 255091, China
摘要:
随着社会的发展,对电力的需求变得越来越大。
在不同时间的电力不平衡现象日益严重。
为了合理调整电力负荷,节约能源,我们提出了一个新的多速率设计三相电度表。
这种新型多速率三相电度表的设计原理是在AT89LV5基础上提出的。
硬件和软件流程设计,以及实验数据的分析,详细介绍。
通过审判淄博亿电子有限公司制造,它表明这种多速率三相电度表具有特色,是步行的精度,准确测量,自动抄表,灵活的时间设置,成本低。
因此,这种新型三相多费率电度表具有广阔的应用前景。
关键词:多速率,三相电度表,AT89LV52
一.引言
计算机技术的发展和应用推动了电表的智能化转型。
由于电力的需求增大,在不同时间的电力需求不平衡的现象越来越严重,电力公司鼓励人们使用复费率电度表[1],以合理调整电力负荷,节省能源。
传统的复费率电度表总是采用机械马口铁来衡量。
也有一些不足之处,测量精度低与机械磨损快,单一的时间内设置需要强大的人力资源[2]。
在本文中,我们在AT89LV52的基础上提出一个新的多速率三相电度表。
这种多速率三相电度表采用测量AD7752。
它的特点是分时计量,计量准确,液晶显示直观器,自动抄表,灵活的时间设置,及时校正,成本低,设计新颖。
二.结构和工作原理
本文提出的新颖的多速率三相电度表是基于AT89LV52单片机[3]。
AT89LV52具有8K字节,三级加密程序存储器,256字节的RAM,32个可编程I / O线,3次/ 16位和一个6
向量2级停止计数器的RAM。
该接口电路采用I2C总线的单位,是一个8位具有良好的性
能和价格合适的单片机。
该系统结构图见图1。
图1。
系统结构图
这种多费率电度表读数的原则是多速率一次使用RS485总线段并记录在X25045然后接管RS485总线时钟并将该时钟写入CMOS芯片S3530A。
三相交流电压和电流通过电位仪和互感分别以生产小信号,传送到AD7752完成测量。
时钟芯片S3530A提供了时钟的自动移动过程中每秒的信息和分析这种时钟属于哪个时期根据预先设定的时间在X25045的时间然后保存在RAM存储器电能按照相应的时间期限。
我们把它写的X25045的通讯地址,当电能达到1度,以使多速率测量成真。
这种电度表具有明确的液晶显示功能,缺相检测,负荷控制,停止用电检查和存储,自动抄表等
三.系统硬件电路的设计
A 电能计量
三相电能计量由ADI公司的低耗能CMOS芯片AD7752来实现了。
在AD7752内部,除了采用的ADC,滤波器和乘法电路,还有可以有效地消除噪声的数字电路。
采样过程中的电压和电流的三相交流电源回路如图2所示,其中IA代表A相电压采样。
对B相和C相的取样电路类似A相。
电源积分后转化为电脉冲输出。
脉冲从CF口通过光电绝缘4N25进入到空位的AT89LV52的INT0。
CPU测量电能[4]。
我们通过S1和S2的联系调节CF的脉冲数。
电力能源和脉冲的转换关系是W = MC的。
其中,W是同千瓦时电能的单位,M是总脉冲数,C 是电表脉冲数。
我们选择C=3000即每千瓦小时,,每千瓦时 3000脉冲。
图2。
电度表的电路原理图
B 液晶显示器
该液晶显示器[6]通过盛群公司的CMOS芯片对HT1621的实现12位数字显示。
HT1621是128段(32 × 4)内部存储器,LCD驱动器。
在HT1621内部由控制电路和时间,内存,液晶驱动器和计时器。
它有体积小,成本低的优点,使其使用于电度表。
我们使用串行接口,在HT1621和AT89LV52之间只有4条线。
详细的连接如图3所示。
AT89LV52的
P20,P21,P22,P23分别连接到CS,RD,WR并分别与数据使用翻新的RAM显示。
对HT1621驱动器芯片已在48个节点的COM0,串口COM1,COM2端口,COM3连接到公共端和驱动器的LCD和SG0,的SG1,SG2的,SG3连接到驱动器输出的每个部分分别输出。
此外,一个20k Ω的电阻可调之间放置VDD和VLCD来调整液晶显示对比度。
实验表明,VDD= 5V比VLCD= 4V的更好。
C 串行存储器
串行存储器采用了XICOR公司的低功耗芯片X25045。
它有三个功能看门狗定时器,电压监控和串行存储器E2PROM的有512个字节。
看门狗定时器可以设置的200ms,600ms和1400ms的时间间隔。
该软件程序被读入X25045。
在正常运行的程序,看门狗定时器收到的时间间隔,以确保程序的正常运行触发信号。
如果看门狗定时器在时间间隔没有收到触发信号,X25045将输出高级复位线。
触发电度表复位,以防止程序飞走。
由于串行存储器芯
片,512 X25045的字节用于存储的电能表的代码,时间多速率时期,电力顶点,平滑用电,低谷电,上月和本月总电力。
存储可以分为两个相同的地方。
一个是作为数据存储。
另一种是用于备份。
对存储的数目可以修改10万次。
数据可存储100年。
它是采用SPI总线连接AT89LV52。
连接如图3所示。
图3。
电度表的数字电路部分
D 时钟电路
时钟电路是由S3530A芯片完成。
这是一个低功耗时钟芯片,支持I2C总线。
它通过CUP发送给RS485的数据来设置时钟和日历。
同时,它继续走自己的振荡时间。
32.768 kHz的晶体振荡器是把XIN和S3530A 的XOUT连接锁定的CPU。
SDA的脚和SCL脚分别连接到
AT89LV52的P1.6和P1.7。
有两个中断的脚可作为第二分钟输出或输出同步脉冲在一秒的时间内供应中断信号给AT89LV52。
单片机系统将读出通过I2C通信接口当前时间根据这一信号,并计算出这一段时间的电能,从而实现在不同时期的电能测量[5]。
该时钟电路用锂电池。
该电源VCC在正常供电线路是3.6V的锂电池电气化供电。
当有电源关闭时,系统会自动转换成锂电池供电的时钟电路。
时钟仍在运行准确,即使关闭了电源。
E RS485通讯
MAX485芯片可实现RS485多费率电能表通信控制。
MAX485芯片有RS485通讯协议。
它可以在128 hypogenous电脑传输。
它的传输距离大于1公里,其传输速率可达每秒250kb。
该电度表连接通过RS485总线单元控制器。
每个单元有一个单元控制器可以管理128多费率电能表。
该单元控制器连接到电脑的电源管理。
每个电度表只有一个8位16进制数米。
电工应写入用户的信息和米数,然后导入到初次安装电源管理的计算机,以便完成广告的用户和管理计算机的连接。
管理计算机发送广播通信地址信息并设定一段时间,没有地址信息就没有时钟信息。
电脑通过调用地址的方式更新资料。
F 缺相检测和继电器控制
它可以实现继电器控制[7] AT89LV52的P27。
P27可以控制继电器使用4N25光电隔离器,以完成电源和功率控制。
缺相检测得到的信号是75K的电阻连接到1引脚的光电隔离器输出的,分别通过二极管半波整流和滤波电容。
我们发现了通过4引脚的隔离,以确定是否存在着缺相。
如果有缺相,我们再次发现2秒后超时。
我们打破立即关闭电源,如果有缺乏权力后,两次确认。
在电源保护电路,它使用AT89LV52 INT1中断脚检测信号。
当有一个突然断电,INT1的跳跃进入低电压和INT1中断进入到电源保护方案,对储能电容器依靠保存数据。
在该系统中,AD7752的输出脉冲,继电器控制端口和缺相检测的投入都用光电隔离器4N25。
它发出的光耦合,可提高抗干扰能力电信号。
四.软件设计
A 资源的分配
该软件设计包括主程序,X25045的读写程序,RS485串行通信程序,中断服务程序,定时器处理程序,对HT1621显示控制方案,在不同时间和不同功率的电能测量了保护方案,系统自检与反干扰的处理方案。
中断系统资源的分布如下:INT0中断的是AD7752脉冲测量,为检测同步,计时器T0的INT1的使用时间为100毫秒,T1的为1ms的时间,并作为串行通信程序T2的波特率发生器。
RS485的异步通信设置为接收和发送中断检查信息。
B 模块设计
主要程序流程图如图4所示。
该电度表应能在每个功率初始化时间。
该计划包括设置初始化工作模式定时器,串行气孔和AT89LV52中断,写入X25045的,S3530A和和对HT1621控制字。
该系统设置三个时间段。
该单片机每秒从S3530A读取时钟值,然后分析这些时钟
属于哪个时期,根据预先设定的时间在X25045的时间然后保存在RAM存储器,电能按照相应的时间期限。
我们把它写入X25045的通讯地址,当电能达到1度时。
16位液晶显示屏显示的时间,并反过来显示电能信息。
图4。
主程序流程图
五.测试结果
测量误差和运行测试已在淄博亿电子有限公司取得。
epigenous计算机完成时间的管理和设置。
这里有三种费率的时间段。
第一阶段的时间是低峰期从00点00分钟到06点30分钟。
时间的第二个时期是用电高峰期从06点30分钟到22点30分钟。
第三阶段的时间是正常用电时期从22点30分钟到24点00分钟。
设置各个时间的用电效率并发送到计算机管理系统,电力公司根据国家政策调整并保存到X25045。
用电高峰期,正常用电,用电低峰期,每月电力总读数保存在电能表,并通过单元控制器发送到epigenous计算机。
通讯波特率是9600比特每秒。
0.1级标准的电子式电能表是标准的校验表并且是多费率电能表的测试仪表。
淄博亿电子公司根据不同的负荷运行已进行了测试。
在30kW的负荷下测量的数据见表1。
表一比较普通电能表和多费率电能表
测试结果表明,该复费率电度表误差小于1%,属于1.0级。
反复读数电能精度和校正的时间是及时和正确的。
通过测试,对降低用电计量误差的方法可以得到。
第一,调整
AD7752采样电阻的准确值。
其次,需要这个电阻值随温度变化的较少。
第三,在电力计量的过程中,当电力尾数部分不足0.01,其余的脉冲应该在一起访问,从而累积误差不足
0.01度,能量损失是可以避免的。
六.结论和展望
多费率电能表在不同的时间根据不同的设置完成电能计算。
它采用485串行通信,实现自动抄表和实时校正。
淄博亿电子公司生产的结果表明,在本文的多速率三相电度表有新颖的设计技术,精确测量的特点,灵活的时间设置。
各项技术指标达到国家智能卡电能表的技术标准。
因此,它具有广泛的应用前景。