Application of embedded Linux in the field of industrial control

xiaoxiao2021-03-06  54

1 preface

With the rapid development of the Internet, network applications are increasingly wide, and network functional requirements for various industrial control devices are getting higher and higher. Current requirements are that industrial control devices can support TCP / IP and other Internet protocols, enabling the user's familiar browser to view device status, set up device parameters, or transfer the data collected by the device to Windows or Unix / Linux. In the database on the server. This requires the industrial control system to have two functions: First, complex measurement and control tasks should be completed on site, because some tasks are usually a real-time requirement; second, the requirements of the measurement and control system can be connected to a type of control network. To achieve remote monitoring. In most measure control systems currently applied, the hardware of the embedded system is 8/16-bit microcontrollers; software is multi-assembly language programming, because these programs contain only some simple loop processing control flows. Therefore, communication between the single-chip microcontroller or the host machine is usually to network through RS232, RS485. These networks have problems such as slow communication speed, poor network function, difficult development. Industrial Ethernet has gradually improved, and more and more applications are obtained in the field of industrial control. Industrial Ethernet uses the TCP / IP protocol, thus facilitating the network, and has the advantages of high-speed control network.

Now, the decline in 32-bit embedded CPU prices and improved performance indicators provide a possibility of extensive applications for embedded systems. Then, the bottleneck that restricts the development of embedded systems is highlighted in software. Despite the beginning of the end of the 1980s, some embedded operating systems have already emerged (more famous VxWork, PSOS, NECULEUS, and Windows CE, but these private operating systems are commercial products, their high prices Many small companies that produce low-end products are still; and the sealing of source code has greatly limited the enthusiasm of developers. Embedded systems require a set of highly concise, interface friends, reliable quality, extensive application, easy development, multitasking, and low price. Today, the industry has reached a consensus: embedded Linux is a general trend. The embedded Linux operating system is widely adopted in terms of low price, powerful, easy to transplant, etc., and has become an emerging force. 2 Embedded Linux Technology

Embedded Linux is a small operating system designed in accordance with the requirements of the embedded operating system, which consists of a system module customized by a KERNEL (kernel) and some system modules customized as needed. KERNEL is generally only about hundreds of KB, even if there are other modules and applications, the required storage space is also small. It has multitasking, multi-process system features, and some have real-time. A small embedded Linux system only needs to boot the program, the Linux microennote, and the initialization process 3 basic elements. The CPU running embedded Linux can be X86, Alpha, SPARC, MIPS, PPC, etc. The motherboard with these chips is very small, usually only one PCI card size, some even smaller. The memory required by embedded Linux is not a soft disk, a hard disk, a ZIP disk, a CD-ROM, a DVD. These well-known conventional memories, which mainly uses the ROM, CompactFlash, M-Systems Diskonchip, Sony Memorystick, IBM MicroDrive and other volumes (Compared with the BIOS size on the motherboard, the storage capacity is not too large. Its memory can use ordinary memory, or a dedicated RAM can also be used.

Compared to other embedded operating systems, Linux source code is open and there is no black box technology. Linux is a cropped software platform system, which is likely to develop a great resource for future embedded equipment products. Linux is a broad-wide road that is a broad flat road. Therefore, while maintaining a smaller, more stable, more price competitiveness such as the Linux kernel system, the system kernel is optimized, and it is more possible to adapt to the high-time requirements for industrial control. This is also the development of the embedded Linux operating system in the embedded industrial control system. It also makes Linux a new expensive in an embedded operating system. Standard Linux kernels typically reside in memory, each application is shipped from disk to memory. After the program is over, the memory it occupies is released, and the program is downloaded. In an embedded system, there may be no disks. There are two ways to eliminate the dependence on the disk, one is in a simple system, when the system is started, the kernel and all applications exist in memory. This is the working mode of most traditional embedded systems, the same Linux. The second is the functionality unique to Linux, because Linux already has the ability to "load" and "uninstall" programs, so an embedded system can use it to save memory. A comparison typical system has approximately 8MB to 16MB flash memory and 8MB RAM  and flash memory can be used as a file system. The use of flash drivers as an interface from flash to file systems is a choice. Of course, you can also use a flash disk. Use flash to get rid of the demand for a disk (dependencies) with Diskonchip technology and the CMOPACTFLASH card.

The programs used to connect to the Flash Memory and the file system are stored in the Flash file in the file. When needed, it is necessary to load the memory, which is an important feature that supports other series of functions as needed. It allows the initialization code to be released after the system is booted. In fact, Linux also has a lot of public procedures that run outside, which typically run once in initialization, and will not run in the future. Moreover, these utilities can be operated in sequential in order to use them in a common way. In this way, the same memory space can be repeatedly used in "calling" each program, just like the system boot. This saves memory, especially those that are no longer changed after configuring. If the functionality of the Linux loadable module is included in the kernel, the driver and the application can be loaded. Since it can check the hardware environment and install the corresponding software for hardware, eliminate the complexity of using a program to occupy a number of Flash Memory to handle multiple hardware. In addition, the upgrade of the software is more modular, and the application and load driver can be upgraded at the system run, which can be stored in the Flash as a data file when the system is running. 3 Embedded Industrial Control Network Implementation Schedule Based on embedded Linux's industrial control system to run an embedded Linux operating system with an embedded microprocessor. The application can be updated over the network and can be dialogue via the keyboard. The data can be displayed on site via the LCD. The important data can be saved in flash memory in Flash, and the data and the alarm information can be transmitted to the upper machine by serial port. You can also release remote monitoring and remote maintenance over the network via Ethernet. More critical is to quickly build a reception data acquisition system to quickly build the existing software and protocols (such as FTP, HTTP, Apachephpmysql, etc.) on the Internet, to enable communication between the measurement and control system and the background management system. . Figure 1 shows a system block diagram of such an implementation scheme. The advantages of this way are:

(1) You can transfer the data to anywhere with the existing Inter-Net network without dedicated communication lines. (2) The audio and image signal can also be transmitted not only to transmit data signals.

(3) Since the current Internet protocol is ready-made and disclosed, the network data can be read by using the Microsoft IE browser that is large to tens of megabytes.

4 system design

4.1 Hardware Design

The hardware operation platform of the embedded system is the basis for developing applications, and the entire development board can be based on the IntelR SA-1110 microprocessor architecture.

Figure 2 is a hardware structure block diagram of an embedded system. The hardware selects the Strongarm MCU in the Intel Series for the application of the network service. The Strongarm SA-1110 is a high performance, low price, high integration microprocessor. The interior of the SA-1110 chip is integrated with 32-bit Intel stron-Garm * RISC processors that can run at 206 MHz, and a memory bus and flexible memory controller that speed up to 100 MHz can support SDRAM, SMROM, and Variable-Latency I. / O device and provide a high storage bandwidth for system design. Since SA-1110 can accommodate a network application of larger traffic, it can provide support for running Linux. In addition, SA-1110 is also integrated with 32MB SDRAM, 8 MB of Flash, 10 Baset Ethernet interface, RS232 / RS485 serial port, I / O interface, and expansion Flash card memory, and the like. More detailed information about SA-1110 can be referred to the relevant information. 4.2 software design

The embedded operating system is the core of the entire embedded system. As mentioned earlier, the embedded system must be reduced to the Linux in the case where the memory capacity and the storage capacity are insufficient. In the crop process, the main techniques involved have the following. (1) Rendition of the kernel

Standard Linux is a PC, which integrates many PCs that need to be embedded and unnecessary. Therefore, for some functional blocks that can be independently or unloaded, only the functional modules required for the embedded system can only be reserved when compiling the core, and the unwanted function block is removed. In this way, the reconstructed kernel will be significantly reduced.

(2) Shielding of virtual memory mechanism

After analysis, virtual memory is one of the reasons why Linux live is not in real time. In industrial control, some tasks must meet certain real-time requirements, and the virtual memory management mechanism of the shielding kernel can enhance the real-time in Linux. When you want to change a mechanism for the kernel, you don't have to write code on a large scale. At the same time, because the Linux system uses a fair time allocation scheduling algorithm for the application process, this algorithm does not guarantee the real-time requirements of the system, so it is required to make changes. There are two ways to change: First, through POSIX, the second is through the underlying programming. The author is the order of the real-time task through the special queue of LINUX's real-time, FiFo. In fact, real-time well-known pipes are as unmissive from the real-time task, so it can greatly reduce uncertain delays due to memory flipping.

Figure 3 shows the block diagram of Linux works.

(3) Writing of device drivers

After identifying the basic functions of the kernel, the driver is written for a specific device, and can be written according to the rules of the driver under Linux. The device driver written should have the following features:

● Initialize and release the device;

● Complete data from the kernel to the transfer of hardware devices and read data from hardware;

● Read the application to pass the data to the device file and the data that returns the application request;

● Detect and process errors that appear in devices.

(4) Develop flash-based file system JFFS

Applications and important data are usually stored in a flash file system in the form of a file. The JFFS2 file system is log structure, which means it is basically a long column node. Each node contains some information about the file. Jffs2 is created specifically to embedded devices like flash chips, so its entire design provides better flash management, thus having other file systems are unparalleled. details as follows:

● JFFS2 performs flash memory / write / read operation than the EXT2 file system in the sector level. ● JFFS2 provides better crash / power-down security than EXT2FS. When you need to change a small amount of data, the EXT2 file system copies the entire sector into memory (DRAM) and merges into new data to write back to the entire sector. JFFS2 can change the entire sector at any time, while also has crash / power-off safety protection.

After implementing the above steps, a small Linux operating system is completed. The constructed Linux includes three parts: process management, memory management, and file management. It supports multitasking parallel, has a complete TCP / IP protocol, while Linux has support for Ethernet controller, which can be connected to Ethernet through Ethernet ports to achieve remote configuration and monitoring.

When the cropped kernel is transplanted on the target board used, the kernel should first be compiled into the target code for the processor. Since different hardware systems have different launching codes, some kernel programs may be rewritten. The code involved in the preparation of Linux boot code and modification and architectural associated part is mainly starting boot, memory management, and interrupt processing section. When the M-System's DOC2000 is used as the system's startup device, the boot code can be placed on the DOC. In this way, the system is powered up, boot the code to make basic hardware initialization, then load the kernel image into memory and run, and finally, then the debugged kernel and application will be burn into the flash memory. Since the cropped Linux has been successfully ported to the target platform, the application can be developed based on the specific application when starting the running development system. Such as data acquisition modules, data processing modules, communication, and data release modules, etc.

5 Conclusion

转载请注明原文地址:https://www.9cbs.com/read-117960.html

New Post(0)