The gate system is an important part of water resources dispatching. At present, manual and partly electric operation methods are mostly adopted in China. There are few reports on the real realization of intelligent control of the gate. The article adopts the embedded technology based on Linux operating system to realize the integrated local/remote automatic monitoring of water conservancy project gate integrating video monitoring and real-time monitoring of water level, gate position, storage capacity, flow and other parameters.
Linux and Embedded SystemEmbedded system is a special computer system that is application-centric and computer-based, software and hardware can be tailored to adapt to practical applications with strict requirements on function, reliability, cost, volume, and power consumption. It faces specific applications, has higher reliability and a longer market life cycle. As the functions of embedded systems are becoming more and more complex and hardware conditions are getting better and better, choosing a suitable embedded operating system has become a key issue for system development.
At present, there are two main development methods for embedded systems: one is to rely on the development platform and components provided by existing commercial software, such as VxWorks, uC/OS, Windows CE, QNX, etc., with mature technology, powerful functions, and a large number of available The function call interface greatly shortens the development cycle of the product, but the price is expensive; the second is to develop based on free software Linux, customize according to the needs of your own system, and does not have to pay additional fees for obtaining licenses, which can greatly reduce development cost.
Linux is a multitasking and multiprocess embedded operating system based on Unix core, supporting a wide range of computer hardware. Developers can modify and customize the operating system according to their own needs. It has a large number of open application codes to use, and Linux has C, C++, Object C compiler GCC that can support up to 11 operating platforms , Powerful, and the execution efficiency is 20%~30% higher than the general compiler. Among the Linux-based embedded operating systems, there are many improved varieties that cater to the embedded/real-time market, including RTLinux (real-time Linux), μcLinux (Linux for non-MMU memory management unit processors), Montavista Linux (for ARM , MIPS, PPC Linux distribution), ARM2Linux (Linux on ARM), etc. In view of the fact that the current gate intelligent monitoring system does not require high real-time operation, we chose Red Hat 9. 0 based on the Linux 2.4.22 kernel as the development environment in this application.
Linux customizationKernel configuration
Due to the limited storage space of embedded systems, Linux must be customized to be used in embedded systems, that is, unnecessary modules in the kernel, such as peripheral support modules such as SCSI and Floppy, must be reduced.
(1) Clear the setting environment make mrproper
(2) Set configuration make config
(3) Compile the kernel and modules make dep; make clean; make bzImage; make modules
The compiled kernel files are /usr/ src/ linux/ arch/ i386/ boot/ bzImage and /usr/ src/ linux/ System.map
Production system electronic disk
In a standard Linux environment, mount the electronic disk to / RamDisk, and make boot and boot on the electronic disk.
(1) Modify the lilo.conf file, and the system will boot directly from the electronic disk.
(2) Create a kernel file system ext2: mke2f s-i 8192-m 0/dev/ ram 50, and under the / RamDisk directory, create a directory file necessary for running the system: bin dev etc lib mnt proc sbin tmp usr var , And the necessary files in each directory, especially the library files required by the application.
(3) Put the kernel file into RamDisk: # dd if = bzImage of = /dev/ ram bs = 1k. And load the root system file: # dd if = /tmp/ ram-image. gz of = /dev/ fd0 bs = 1k seek = the number of kernel data blocks. Among them, ram-image. gzJ is the compressed root system file, and the number of kernel data blocks is the size of the kernel.
Quick start and boot screen
Since the system is developed on the basis of Rad Hat 910, the startup process is longer. It takes more than 30 seconds from the time the system is powered on until the system console displays "login:". Through testing, a lot of time is spent on hardware initialization when the kernel starts. For example, Linux has to detect a total of 20 IDE interfaces (including master and slave disks). By modifying the definition value of MAX-HWIFS in the Linux source code, from 10 to 1 to reduce the time for Linux to detect IDE interfaces and shorten the system startup time . Really speed up the startup time by rewriting startup scripts such as rc. sysinit and rc so that the system can only do the initialization work and services of the necessary hardware modules to achieve the goal.
The user-defined interface only needs to be displayed during quick start. You can replace the original data in Linuxlogo.h with 256-color 640X480 pixel image data in 1pcx or 1tif format, and make a few modifications to the driver/video/fbcon.c source code. Change the macro definition LOGO-H 80 to 640 and LOGO-W 80 to 480, and modify the corresponding functions.
Abnormal shutdown
During the use of the system, in order to facilitate the user's use, it should support abnormal shutdown, that is, avoid possible problems when the power supply is directly cut off. Usually the ext2 file system is a non-journaled file system. When the system is restarted, it will spend a lot of time to check the file system, sometimes even fatal error (fatal error) is generated, forcing the user to manually check the file system with the command fsck.
The general-purpose log file ext3 system will ensure the reliability of data recovery through log records. The system will not ask to check the file system when restarting, and it performs well in terms of operating speed and stability. Upgrade the original ext2 file system to ext3: tune2fs-j /dev/hda6, and change the file system type of the partition from ext2 to ext3 in the /etc/fstab file. Since the ext3 journal file system is used, there is no need to frequently check the file system (fsck), so it is necessary to use the tune2fs-i 0-c 0 / dev/ hda6 command to turn off the file system check, which also reduces system startup The purpose of time.
The composition of the gate intelligent monitoring systemSystem structure and function
The gate intelligent monitoring system is composed of the central control room control cabinet, on-site gate hoist, front-end video monitoring point, on-site water level, gate position monitoring point and related auxiliary equipment. The system structure is shown in Figure 1. The monitoring system takes the Linux-based embedded system as its core, and its functions are:
(1) Intelligent control of the raising, lowering and stopping of the gate, as well as intelligent control of alarm and emergency flood discharge;
(2) 8 channels of digital MPEG24 compressed streaming video, remotely monitor the water regime, the state and operation of the gate through the video image;
(3) Real-time water regime data monitoring, automatic measurement and reporting of water level, flow and water volume, providing a basis for flood control and water scheduling;
(4) Historical data statistics, and generate corresponding process lines and reports.
Hardware implementation
The control cabinet of the central control room requires video monitoring and data curve display functions. It adopts CRT monitor and passive backplane, half-length CPU board adopts PCI6870, CPU uses Intel’s PIII Celeron 1.2GHzMHz, memory is 256MB, and Ethernet interface It is a 10MHz RTL-8139A, and the four-channel video capture card is Photool DVS4816AVC. The CPU board is connected to the sampling module and the output module through the PC104 bus, and the electronic disk uses 64MFlashDisk.
Software Implementation
The software of the system has two parts, namely the embedded operating system and the application program (the structure is shown in Figure 2). The basic embedded operating system includes:
(1) Bootloader (initialize the processor, initialize the necessary equipment, download the system image, initialize the operating system);
(2) Embedded Linux kernel (including memory management, process management, inter-process communication, etc., as well as other configurable hardware drivers, TCP/IP network stack);
(3) Root file system.
Summary and outlookEmbedded Linux is applied to the gate intelligent monitoring system, which has positive significance for reducing costs, improving reliability and stability.
In this system, the ext3 file system is used. In order to further improve the reliability of the system, the journal file system JFFS or JFFS2 specially designed for Flash memory can also be used in the future. Because JFFS2 adopts a new storage method, it supports loss balance and has a power-off protection function, so that files can be quickly restored after a crash. Therefore, the JFFS2 file system is more suitable for embedded systems that use flash as a storage device.
High Power H Series Lead Acid Battery
High Rate Discharge Battery,High Energy Battery,High Output Battery,H Series Lead Acid Battery
Wolong Electric Group Zhejiang Dengta Power Source Co.,Ltd , https://www.wldtbattery.com