Embedded Gate Intelligent Monitoring System Based on Linux

Publisher:fnfeecjknqucLatest update time:2011-08-09 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

The gate system is an important part of water resource dispatching. At present, most of them are operated manually and partially electrically, and there are few reports on truly intelligent gate control. This paper adopts embedded technology based on the Linux operating system to realize local/remote automatic monitoring of water conservancy project gates, which integrates video monitoring and real-time monitoring of water level, gate position, reservoir capacity, flow and other parameters.

Linux and Embedded Systems

An embedded system is a special-purpose computer system that is application-centric, based on computer technology, and whose software and hardware can be tailored to meet the strict requirements of actual applications on functions, reliability, cost, volume, power consumption, etc. It is oriented to specific applications, has high reliability and a long market life cycle. As the functions of embedded systems become more and more complex and hardware conditions become better and better, choosing a suitable embedded operating system has become a key issue in system development.

Currently, there are two main methods for developing 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., which have mature technology, powerful functions, and provide a large number of available function call interfaces, which greatly shortens the product development cycle, but the price is not cheap; the other is to develop based on free software Linux, customize it according to the needs of your own system, and do not have to pay extra fees for obtaining a license, which can greatly reduce the development cost.

Linux is a multi-task and multi-process embedded operating system based on the 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 available, and Linux has C, C++, and Object C compilers GCC that can support up to 11 operating platforms. It is powerful and has an execution efficiency 20% to 30% higher than that of general compilers. Among 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 (Linux distribution for ARM, MIPS, PPC), ARM2Linux (Linux on ARM), etc. In view of the fact that the current gate intelligent monitoring system does not have high requirements for real-time operation, we chose Red Hat 9.0 based on the Linux2.4.22 kernel as the development environment in this application.

Linux Customization

Kernel Configuration

Since the storage space of embedded systems is limited, Linux must be customized if it is 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 cut.

(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 create a boot and start program on the electronic disk.

(1) Modify the lilo.conf file so that the system boots 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 the directory files necessary for running the system: bin dev etc lib mnt proc sbin tmp usr var, as well as the necessary files under 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 = kernel data block number. Among them, ram-image. gzJ is the compressed root system file, and the kernel data block number is the kernel size.

Quick start and startup screen

Since the system is developed based on Rad Hat 910, the startup process is relatively long. 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 needs 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, the time for Linux to detect the IDE interface can be reduced to shorten the system startup time. The real way to speed up the startup time is to rewrite the startup scripts such as rc. sysinit and rc so that the system only performs the necessary hardware module initialization work and services to achieve the purpose.

During quick startup, only the user-defined interface needs to be displayed. The original data in Linuxlogo.h can be replaced by 1pcx or 1tif format image data with 256 colors and 640X480 pixels, and a small amount of modification can be made to the driver/ video/ fbcon. c source code. The macro definition LOGO-H 80 is changed to 640, LOGO-W 80 is changed to 480, and the corresponding functions are modified.

Abnormal shutdown

In the process of using the system, in order to facilitate users, it should support abnormal shutdown, that is, to avoid possible problems when the power is directly cut off. The ext2 file system is usually used, which is a non-logging file system. When the system restarts, it will take a lot of time to check the file system, and sometimes even produce fatal errors, forcing users to manually use the fsck command to check the file system.

The use of the general log file ext3 system will ensure the reliability of data recovery through log records. The system will not require a file system check when restarting, and the running speed and stability are good. 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 use of the ext3 log file system does not require frequent file system checks (fsck), it is necessary to use the tune2fs - i 0 - c 0 / dev/hda6 command to turn off the file system check, which also achieves the purpose of reducing the system startup time.

Gate intelligent monitoring system composition

System structure and function

The gate intelligent monitoring system consists of the control cabinet in the central control room, the on-site gate opening and closing machine, the front-end video monitoring point, the on-site water level and gate position monitoring points and related auxiliary equipment. The system structure is shown in Figure 1. The monitoring system is based on the Linux-based embedded system and realizes the following functions:

(1) Intelligent control of gate raising, lowering and stopping operations, as well as alarm and emergency flood discharge;

(2) 8-channel digital MPEG24 compressed streaming video, remotely monitoring water conditions, gate status and operation through video images;

(3) Real-time water data monitoring, automatic measurement and reporting of water level, flow and water volume, providing a basis for flood control and water volume scheduling;

(4) Historical data statistics, generate corresponding process lines and reports.

Hardware Implementation

The control cabinet in the central control room is required to have video monitoring and data curve display functions, using CRT monitors, with passive backplanes, half-length CPU boards using PCI6870, CPUs using Intel's PIII Celeron 1.2GHzMHz, memory of 256MB, Ethernet interface of 10MHz RTL-8139A, and four-channel video acquisition cards for Phituo DVS4816AVC. The CPU board is connected to the sampling module and output module through the PC104 bus, and the electronic disk uses 64MFlashDisk.

Software Implementation

The system software consists of two parts, namely the embedded operating system and the application program (structure as shown in Figure 2). The basic embedded operating system includes:

(1) Bootloader (initializes the processor, initializes necessary devices, downloads the system image, and initializes 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 Outlook

The application of embedded Linux in gate intelligent monitoring system has positive significance in reducing costs and improving reliability and stability.

In this system, the ext3 file system is used. In order to further improve the reliability of the system, the log file system JFFS or JFFS2 designed specifically for Flash memory can also be used in the future. Since JFFS2 uses a new storage method, supports loss balancing, and has a power-off protection function, it can quickly recover after a file crash. Therefore, the JFFS2 file system is more suitable for embedded systems that use flash as a storage device.

Reference address:Embedded Gate Intelligent Monitoring System Based on Linux

Previous article:FPGA Implementation of VGA Graphics Controller
Next article:Design of IPv6 Composite Firewall Based on Linux

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号