Design of Remote Measurement and Control Terminal Based on 80C196KB

Publisher:数字火花Latest update time:2011-10-25 Source: 电子产品世界Keywords:80C196KB Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

RTU (Remote Terminal Unit) is a remote measurement and control terminal, which is a terminal measurement and control unit of the monitoring, supervisory control and data acquisition (SCADA) system. The SCADA system is based on computers and can realize functions such as remote data acquisition, equipment control, measurement, parameter adjustment and signal alarm. It can be widely used in industries such as electricity, water conservancy, petroleum, chemical industry, municipal administration, etc., and is used for remote monitoring in unmanned environments with harsh geographical environments. The entire SCADA system consists of three parts: a monitoring center, a number of remote measurement and control terminals (RTUs) distributed at various monitoring points, and a communication medium. As an independent work station of the system, RTU completes the collection and processing of on-site data, the control of on-site actuators, and remote communication with the monitoring center. It has the characteristics of easy scalability and easy maintenance, and is self-contained. When remote communication is interrupted, it can run independently without affecting the monitoring function of the site.

2 Main configuration of RTU

RTU has two main working modes, automatic mode and manual mode. In automatic mode, all working parameters of RTU are set by the monitoring center at a fixed time or at any time, and can only be queried on site but not modified; in manual mode, all working parameters of RTU can be queried and modified on site. Generally speaking, manual mode is only used in on-site debugging, maintenance and long-term interruption of system communication. No matter it works in automatic mode or manual mode, once the working parameters are set, RTU will automatically perform data acquisition and processing, on-site control and communication response according to the prescribed process and mode.

The main configuration of RTU includes CPU board 4 keyboard display board, I/O board, serial communication interface unit 3, communication equipment, power supply, chassis, etc. The CPU board generally uses single-chip microcomputer, DSP, etc. as the control core. The program solidified by the CPU board determines the entire workflow of the RTU, including the data acquisition and processing methods, control modes and functions, fault handling methods, remote communication protocols and their implementation, etc. Updating the program can make the RTU meet the requirements of various on-site processes. The keyboard display board is used to realize the human-computer dialogue function of the RTU and support the on-site operation control of the RTU to ensure that the RTU can continue to monitor when the system communication is interrupted. To prevent misoperation, the keyboard must be locked or password-managed to limit the operator level. To adapt to different on-site environmental conditions, the display device can be realized by using LED digital tubes or LCD liquid crystal display modules. The I/O channel on the I/O board is the interface between the RTU and the on-site signal. On the
basis of meeting industrial standards, it should also have a variety of structural forms to adapt to different on-site signal types, such as switch quantity I/O channel, pulse quantity I/O channel, analog quantity I/O channel, digital quantity I/O channel, etc. RTU serial communication interface unit generally has at least two communication ports to support communication between RTU and monitoring center, RTU and lower-level equipment or RTU. The communication medium of RTU can be wired or wireless according to the requirements of the site environment and the object. Wired methods include power line carrier, RS-485 bus, public telephone line network, etc., and wireless methods include VHF/UHF radio station, mobile phone network, etc. The communication methods supported by RTU include communication triggered by the monitoring center and communication triggered by RTU. The communication triggered by the monitoring center includes: (1) Site query. The monitoring center periodically, at a certain time interval, within a certain time limit, issues query commands to all RTUs in turn to collect field data and information of each site. (2) Site control. The monitoring center periodically or randomly transmits working parameters or control commands to all RTUs (group control) or a certain RTU (single control), such as RTU working parameter settings, on/off control of field equipment, etc. (3) Proofreading time. The monitoring center regularly calibrates the system time% of all RTUs to ensure the consistency of system operation. Communications triggered by the monitoring center have a higher priority response. Communications triggered by RTUs include: (1) Responding to commands from the monitoring center. Uploading field parameters and information according to the command format of the monitoring center, or receiving working parameters and commands m transmitted by the monitoring center and performing corresponding control operations. (2) Fault alarm. When an abnormality or fault occurs in the field work, the RTU actively calls the monitoring center to upload field status information and fault information. For the monitoring center, RTU fault alarms should be responded to first. (3) Responding to calls from lower-level devices or RTUs, receiving their uploaded information, and processing it. (4) Transmitting parameters or commands to lower-level devices or RTUs. In the SCADA system, RTU sites are relatively scattered, there are many sites, and the distance from the monitoring center is far. The reliability of communication is crucial to the normal operation of the entire system. In addition, RTU should also have certain on-site fault location and safety protection functions.

The connection between the CPU board of RTU and other functional boards can be achieved by bus board slots or flat wire connectors, which is easy to maintain, replace and expand each template. The following introduces its hardware and software implementation in combination with the application of RTU in the automatic monitoring system of urban street lights.

3 RTU Hardware Circuit Design

3.1 Application of RTU in Urban Street Light Automatic Monitoring System

The city street lamp automatic monitoring system is a master-slave microcomputer network composed of microcomputers and single-chip microcomputers. In the system, the measurement and control terminals (RTUs) with single-chip microcomputers as the core are distributed in the sub-control stations of each block, directly controlling the on and off of street lamps. The control methods are flexible and diverse, including all-night lights, midnight lights, return lights and self-set lights, etc. It can automatically control the on/off of street lamps according to the sunrise and sunset time curve, set and modify the on/off time of any branch at any time according to the illumination and the special needs of the city, and realize forced on/off control, that is, regardless of the on/off time setting of each branch, the monitoring center directly issues commands to force the opening or closing of all stations or all or a certain branch of a station. At the same time, RTU also automatically detects the working voltage and current of each street light branch at regular intervals, and reports to the monitoring center through the wireless data transmission module, calculates the lighting rate, and keeps track of the working status of the street lights at any time. If the street light branch has an abnormality or fault, such as voltage exceeding the limit, current exceeding the limit, abnormal lighting, branch switch tripping, etc., RTU can not only detect and alarm the monitoring center in time, but also automatically take corresponding protection measures according to the type of fault to ensure the safe and reliable operation of the street light branch. The monitoring center uses an industrial control computer as the system host, and can automatically generate a daily on/off light time curve according to the longitude and latitude of the city. It can set the working parameters such as the street light control mode and light control time of each road point at regular intervals (automatic) or random (manual), extract the voltage/current value, fault, light state and other information of each branch, and store, summarize, calculate, alarm and print. The overall structural block diagram of the urban street light automatic monitoring system is shown in Figure 1.

Figure 1 Overall structure diagram of the urban street light automatic monitoring system

3.2 RTU Hardware Circuit Design

As shown in Figure 2, the RTU is mainly composed of an 80C196KB single-chip microcomputer, a program memory (EPROM), a non-volatile data memory (NVRAM), a calendar clock, a keyboard display circuit, a watchdog and reset circuit, an RS-232C standard serial interface, a relay control circuit, a voltage/current signal acquisition circuit, a wireless data transmission module, an antenna, etc. It can control 8 street light branches at the same time. In addition, the RTU also has 4 switch quantity and 2 pulse quantity input channels for system expansion.

Figure 2 RTU composition principle block diagram

RTU uses a single-chip microcomputer as the control core, equipped with a 32K program memory. 80C196KB is a 16-bit single-chip microcomputer with an 8-channel 10-bit A/D converter (with a sample/hold circuit). The analog input end of the A/D converter shares the pin with the 8-bit parallel digital input port P0. In the hardware circuit of RTU, the AD0 channel is selected as the analog input, and the remaining 7 lines are used as digital input lines to expand the switch input channel.

The calendar clock uses DS12C887 to provide accurate clock signals, including year, month, and day, and can generate second or minute timing interrupts to determine whether it is time to turn on or off the lights, thereby ensuring accurate on/off control of street lights according to the on/off time curve. In order to synchronize the entire street light system, the monitoring center regularly performs GPS time calibration on the RTUs of all sites.

The non-volatile data storage is used to store all the working parameters, real-time measurement data, real-time status and fault information of the RTU to ensure that the information is not lost in the event of power failure or communication interruption, and the system can continue to work normally after the power is restored to normal.

The keyboard display circuit includes a 4×4 keyboard and a 4-line 16-character graphic LCD display. The online modification and query of RTU working parameters, measurement data, status information, etc. are realized in a two-level menu and fully Chinese way.

The voltage/current signal acquisition circuit is composed of 3 voltage transformers, 8 current transformers and signal conditioning circuits, etc., to achieve real-time acquisition of 3-phase AC voltage and 8 branch currents. After signal conditioning, the output signal of the transformer is converted into a 0-5V voltage signal, and after switching through a multi-way switch, it is sent to the AD0 channel of the microcontroller in turn to be converted into a digital quantity.

The relay control circuit is mainly composed of 8 relays and their driving circuits. It is connected to the microcontroller via an 8-bit parallel port, receives control signals, and controls the on and off actions of the street lamps through the AC contactor.

The remote communication between RTU and the monitoring center adopts the VHF/UHF wireless data transmission radio communication method. The wireless data transmission module is connected to the microcontroller through the RS-232C standard serial interface and equipped with a directional antenna. The transmission power and antenna height are based on the actual system coverage range.

Requirements and environmental conditions.

4 RTU software design

When the A/D converter inside the 80C196KB microcontroller uses an 8MHz crystal, the conversion cycle is about 22μs. The start control of the A/D converter and the reading of the conversion results are completed through register operations, and the query method is selected to judge the end of the conversion. The time period for RTU to collect voltage/current for all branches can be set by software, and the default is 3 minutes.

The RTU collects AC signals on site, and only effective value measurement of the working voltage and current of the street light branch is of practical significance. Therefore, the AC sampling method is adopted, that is, N instantaneous values ​​are sampled at equal intervals within one cycle of the AC signal, and the effective value of the voltage/current is calculated by software. The formula for calculating the effective value of voltage/current is as follows:

In the system, RTUs are distributed in various control points throughout the city. The environmental conditions are relatively complex and there are various interferences. In order to improve the reliability and accuracy of data acquisition, the digital filtering method is used in the software design. The data of 5 cycles are continuously collected, and 5 effective values ​​are calculated. Then, smoothing filtering is performed, that is, the maximum and minimum values ​​are removed, and the arithmetic mean of the remaining data is taken as the real-time effective value.

The transmission rate of the wireless data transmission module of RTU is 1200bps, and it works in half-duplex mode. Except for the sending state when responding to the command of the monitoring center to upload data or fault alarm, it is in the receiving state at other times, ready to receive the command of the monitoring center. Experiments have found that it takes a certain amount of time for the data transmission module to reliably switch from the sending state to the receiving state. Therefore, when programming, a delay program should be executed after the last byte of data is sent, and then switch to the receiving state, otherwise the last byte of data cannot be transmitted normally. The delay time can be determined through experiments.

In order to improve the reliability and accuracy of data transmission, on the one hand, before data transmission, the monitoring center and the communication site RTU will first call each other, and if the communication is successful, the subsequent commands or parameters will be transmitted. Otherwise, if there is no correct response within 5 seconds, call again. If the communication fails for three consecutive times, it is considered that the communication has temporarily failed and the information is recorded. On the other hand, due to the large number of data transmission command types and uncertain data length, the information adopts the following frame format during the transmission process.

Identification code indicating the start of an information frame.

RTU address and its inverse code are used for RTU address verification and target site identification.

The data length and its inverse are used for data length verification. Subsequent commands and parameters are received according to the length byte.

The check code is the check corresponding to the command code and parameter bytes. The system adopts the cumulative sum check method. In order to avoid the conflict between the cumulative sum byte and the identification code byte, it is stipulated during sending and receiving that when the cumulative sum byte is equal to the identification code, the cumulative sum takes its inverse code, otherwise the cumulative sum byte is transmitted normally.

The 10-byte data "00H" added at the end of the data has no actual meaning. Its function is to prevent the RTU from being in a "long receiving" state due to data loss during communication.

When the RTU is receiving data, after the three parts are verified to be correct, it will send back a correct contact code to the monitoring center. Otherwise, it will consider the data invalid and send back an incorrect contact code, asking the monitoring center to resend. After three transmissions fail, it will consider that the site has failed in communication, and the monitoring center will suspend communication with the site.

9 Conclusion

The remote measurement and control terminal (RTU) designed in this paper uses the 80C196 series single-chip microcomputer as the control core, making full use of the resources of the single-chip microcomputer, with fast operation speed and high integration, integrating field data acquisition and processing, field control and working status monitoring, and remote communication, with strong reliability and suitable for field operation. The RTU can also be used for data acquisition and control in the fields of electricity, petroleum, water conservancy, etc., and has broad application prospects.

Keywords:80C196KB Reference address:Design of Remote Measurement and Control Terminal Based on 80C196KB

Previous article:Application of STC MCU Expanding P4 Port
Next article:Using single chip microcomputer to simulate 2262 software coding

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号