Design of RTU Radio Telemetry System Based on AVR Microcontroller

Publisher:chuyifeiLatest update time:2020-02-04 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I. Introduction

MTU (Master Terminal Unit) and RTU radio telemetry systems based on AVR microcontrollers and dedicated MODEM chips.


Remote RTUs (the system can carry 256 RTUs) distributed at pipeline monitoring points throughout the city collect data, process the data and send the data to the central dispatch end through a radio station. After receiving the data, the central dispatch end processes the data, stores the data, and sends it to the simulation screen for display.


2. Design Concept

The existing system had the following main problems: 1. The wireless communication baud rate was low (300bps), the bit error rate was high, the inspection speed was slow, and it could only carry 32 RTU terminals at most; 2. When the radio station at a remote RTU end was in a long-term mis-transmission state (referred to as "long-transmission"), it would occupy the system frequency. Since the system shared a set of radio frequencies, all other radio stations in the system would be unable to communicate, paralyzing the entire system. The radio station at fault could not send valid data, so the fault point could not be determined. The pressure measurement points were widely distributed and scattered, making fault finding very difficult, often taking several days; 3. The RTU board had low integration, a high failure rate, and difficult to purchase components.


Taking into account the versatility of the system and the actual situation of the company, the RTU system is required to make maximum use of the original radio station, antenna, power supply, analog screen, detection instruments, etc., and to realize the following functions: 8-way 10-bit analog input, 8-way switch input and 2-way pulse input, of which 8-way switch input can be expanded to 64-way switch input, and 24-hour historical data (15 minutes/time) can be stored in the RTU station, with power-off protection function.


Through the organic coordination of software and hardware, we have solved the problems and system function requirements of the original system economically and effectively, making the MTU board and RTU board completely consistent in hardware, and integrating the wireless modem MODEM that is usually independent of the RTU board on the RTU board, simplifying the hardware structure of the system. The RTU board of this system has a wireless communication baud rate of 1200bps, a low bit error rate, and can carry up to 256 RTU terminals, effectively solving the problem of system paralysis caused by "long hair" of the radio station, and has the advantages of high data acquisition accuracy, high integration of the RTU board, strong versatility, and easy software upgrade.


3. RTU Design

1. Selection of components

The CPU uses ATMEL's AVR series microcontroller AT90S8535, which is a relatively new type of microcontroller. Its internal resources are as follows: 8K bytes of FLASH program memory, 512 bytes of EEPROM data memory, 8 channels of 10-bit precision A/D converter, a standard serial port, 1 16-bit timer/counter, 1 8-bit timer/counter, 1 real-time clock, 2 external interrupts, built-in watchdog circuit, etc. The functions required by RTU and data acquisition functions can basically be realized on this microcontroller; the connection with the radio station uses OKI's MSM7512B MODEM chip for modulation and demodulation, the communication with the computer uses MAX232 chip, and the historical data storage uses 8K bytes of serial EEPROM storage chip AT24C64. The power supply of the radio station is controlled by the CPU and provided through relays.


2. Data communication

(1) Communication between RS-232 serial port and PC

Since the only serial port of the microcontroller is used for radio station communication, the accuracy of wireless communication must be ensured first. The communication with the PC uses the MAX232 chip to convert the TTL level of the microcontroller into the standard RS-232 level, and uses the external interrupt INT0, INT1 and I/O ports of the microcontroller to simulate the application software to achieve two half-duplex three-wire serial port communications with a baud rate of 9600Bps, and the receiving data adopts the interrupt mode.

(2) Wireless communication between radio stations

We integrate the wireless modem, which is usually independent of the RTU board, on the RTU board, which simplifies the hardware structure of the system, reduces costs, improves the reliability of communication, and realizes the close integration of RTU and MODEM. The MODEM chip uses the MSM7512B modem chip of OKI. MSM7512B is a relatively mature chip with a communication baud rate of 1200Bps and a working mode of half-duplex mode. In practice, we found that when the radio station changes from the receiving state to the transmitting state or from the transmitting state to the receiving state, there is an unstable state, and the data at this time is prone to bit errors. According to the experiment, a more appropriate delay time is obtained. We delay the appropriate time after controlling the radio station to transmit and receive conversion, which greatly improves the reliability and accuracy of data transmission. In the process of data transmission, the system code, RTU station code, and the low byte of the sum value are added to ensure the reliability and correctness of the system communication.


3. Solutions to the system paralysis when the radio station is in a state of long-term mis-transmission ("long-transmission") (1) Set the radio power control port on the RTU board (the power of the radio station is controlled by the single-chip microcomputer through a relay). The RTU board can control the on and off of the radio power; set a software trap. If the RTU does not receive any signal from the radio within 15 minutes, it may be that the radio station is "long-transmitting", the radio reception failure, other radio stations are "long-transmitting", the RTU data port failure, or the repeater failure. At this time, cut off the radio power, but turn on the radio power again after 15 minutes and continue the above detection process. At this time, if the signal cannot be received due to external failures such as the repeater, other radio stations "long-transmitting", etc., the RTU board can resume normal operation; set a watchdog reset system so that working failures caused by the program can be reset.

(2) Judgment by the Central Dispatching Office

If only signals from certain points cannot be received while signals from other points are always normal, then there are faults at these points themselves; if signals from all points cannot be received, then there is a fault with the relay station or dispatching machine or the frequency is continuously interfered with; if only signals from certain points cannot be received for 15 minutes while signals from other points are normal, and signals from all points cannot be received for 15 minutes, then there is a "long hair" phenomenon at certain points, and the fault point can be determined from the 15 minutes in which data can be received; if the received data is intermittent and not regular at 15-minute intervals, then the system frequency is interfered with or there is an irregular fault with the relay station or dispatching machine.

By taking the above measures, the fault point can be found more quickly, and the system paralysis caused by the radio's "long hair" can be eliminated, which greatly reduces the maintenance workload and maintenance costs.


4. Data Collection

Remote telemetry RTUs are distributed in pipe network monitoring points throughout the city. The environment is relatively messy and there are various interferences in the surrounding environment. Filtering is performed on the input channel and larger interferences are filtered out through hardware circuits. In order to improve the reliability and accuracy of collected data, the software design adopts a discrete collection method and selects corresponding data filtering technology according to the specific situation.

(1) Discrete acquisition method

When designing the data acquisition program for multiple parameters such as pressure on site using analog input, we design it according to the principle of "discrete acquisition of the same parameter, continuous acquisition of different parameters". Because short-term continuous acquisition of the same parameter is likely to cause the collected data values ​​to be affected by interference, digital filtering technology is powerless to this; the method of "discrete acquisition of the same parameter, continuous acquisition of different parameters" makes parameter acquisition discrete in time and space, reduces the probability of interference, and distributes interference on different parameters, so that multiple acquisitions and digital filtering can remove the influence of interference.

(2) Digital filtering technology

Digital filtering is to smooth the collected signal through a certain algorithm program. Here we collect each data four times. The algorithm removes the highest and lowest values ​​and takes the arithmetic average of the remaining data to eliminate or reduce interference and ensure the authenticity of the system data. By using the above anti-interference measures, the system's anti-interference ability is greatly improved and the reliable operation of the system is guaranteed.


IV. Application and Promotion

Since the system was officially put into operation in May 2000, it has been operating stably and basically without any trouble for more than two years. It has made contributions to the company's reasonable scheduling, energy saving, timely detection of pipe breakage, etc., and has significant economic benefits.


Reference address:Design of RTU Radio Telemetry System Based on AVR Microcontroller

Previous article:The difference between the sending identifier UDRE and TXC used in AVR microcontroller communication
Next article:How to configure AVR fuse bits correctly

Recommended ReadingLatest update time:2024-11-16 13:25

51 MCU RS485 communication program simulation and MODBUS RTU static time detailed explanation
The simulation schematic is as follows MODBUS-RTU requires that the data interval in each frame of information must not exceed the static time of 1.5 characters.  Therefore:  (1) When the serial port generates a receive interrupt, the initial value of the "timeout timer" is immediately reloaded. (Note: The initial
[Microcontroller]
51 MCU RS485 communication program simulation and MODBUS RTU static time detailed explanation
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号