Design and implementation of a general industrial control platform based on ARM and Linux

Publisher:QianfengLatest update time:2011-07-29 Keywords:UDP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the advancement of industrial control technology and the intensification of market competition, developers usually need to design a measurement and control system that meets user requirements in the shortest possible time. In view of the characteristics of embedded systems, this paper uses the cost-effective 32-bit ARM embedded processor AT91RM9200 as the hardware core to build a general industrial control hardware platform, and transplants the embedded Linux operating system and the graphical interface development environment MiniGUI on this platform. Based on this general industrial control platform, most of the automatic measurement and control systems required for engineering applications can be easily built. Its application is extremely competitive in terms of performance and cost, which indicates that this platform has a good application prospect.

In terms of hardware, this industrial control platform selects ATMEL's AT91RM9200 microprocessor, and designs its minimum system and peripheral components to adapt to the more abundant technical requirements of the current industrial control site, and combines the industrial measurement and control Modbus protocol to expand a variety of communication interfaces to meet the communication needs of users. At the same time, the selection of the embedded Linux operating system provides a high-performance software platform for the development of measurement and control software.

Design of general industrial control hardware platform
1 AT91RM9200 microprocessor minimum system composition
The minimum system is the basic circuit necessary to ensure the reliable operation of the microprocessor. The minimum embedded system based on AT91RM9200 microprocessor consists of AT91RM9200 microprocessor, power supply circuit, crystal oscillator circuit, reset circuit, JTAG interface, memory module, serial debugging interface and other circuits. So far, the hardware foundation for designing and developing a general industrial control platform based on ARM microprocessor has been established.


2 Hardware platform peripheral interface circuit
Using the rich built-in peripherals of AT91RM9200, the peripheral interface can be easily expanded, as shown in Table 2.

3 Hardware platform user interface
The system provides a 2*32-pin standard 3U slot, a total of 64 pins. The 3U slot is specially designed for portable applications and is particularly suitable as an integrated mobile controller for industrial measurement and control, product lines, transportation systems and traffic control systems.

4 Hardware platform structure
Based on the above design of the AT91RM9200 minimum system and various peripheral components, a general industrial control hardware platform with the AT91RM9200 microprocessor as the hardware core is finally formed, as shown in Figure 1.

Figure 1 General industrial control platform hardware structure

Design of general industrial control software platform
1 Build Linux operating system based on ARM hardware platform
ARM-Linux development environment
Establish the development environment of industrial control platform with embedded Linux as operating system and the software development environment of virtual machine Linux environment installed under Windows. Embedded Linux kernel compilation and application compilation are completed in this virtual machine. In order to improve development efficiency, Linux installed in the virtual machine is used as the server. Use Telnet or SSH to log in to the server through the Windows client. The server can freely download the necessary development tools and software in the client. When debugging the application, you can first simulate it in the Linux environment of the PC, and then download it to the target platform through the DEBUG debugging serial port. The advantage of this development environment is that only one computer is needed to truly simulate Linux. The specific process is shown in Figure 2.

Figure 2 Development environment

Cross-compilation
Cross-compilation is to generate executable code on one platform for another platform. The so-called platform actually includes two concepts: architecture and operating system. According to the development environment established above, the target platform is an embedded Linux operating system based on the ARM architecture, and the development and compilation environment is based on the Linux operating system on the virtual machine in the PC. If the program is run on the target platform, the code must be cross-compiled in the PC development environment to adapt to the target platform.

According to the environment variable PREFIX, the compiled tool chain can be installed to the specified folder and used.

For example, modify the environment variable of arm-Linux-gcc-2.95.3 to:
PATH=$PATH:$HOME/bin:$PREFIX/bin:/usr/local/arm/2.95.3/bin:/sbin:/usr/sbin:

/usr/local/sbin, and write the hello.c program for verification
$arm-Linux-gcc hello.c -o hello-arm
$file hello-arm
hello-arm: ELF 32-bit LSB executable, ARM, version1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped
This shows that the generated hello-arm can run on the ARM platform, and it also proves that the cross-compilation tool chain is valid and usable. [page]

Linux kernel compilation and download
The specific steps are as follows:

(1) Unzip Linux-2.6.21-2009-04-10.bz2: tar xjvf Linux-2.6.21-2009-04-10.bz2;

(2) Enter the Linux-2.6.21 directory and compile the kernel: make uImage;

(3) After the compilation is completed, copy the uImage file to the Windows environment through SSH;

(4) Configure the U-Boot environment variables;

(5) Configure the tftp server: Run the tftp server under the Linux system, copy the uImage file of the Linux kernel to the tftp download working directory, start the tftp service, and ensure that the PC and AT91RM9200 are connected to the same network segment;

(6) Download the kernel image file and erase the Flash in the U-Boot prompt;

(7) Download the kernel image file to the Flash;

Linux file system
The software platform uses the cramfs file system, which has the following features: when the system accesses data at a certain location, it immediately calculates the location of the data in cramfs, decompresses it into RAM, and then obtains the data through memory access. The storage location of the data in the memory after decompression in cramfs is managed by the cramfs file system itself, and the user does not need to implement the process, thus increasing transparency and saving time for developers.

2 Device driver development under the Linux operating system
The device drivers on Linux are very rich, supporting various mainstream hardware devices and the latest hardware technologies. In the Linux kernel, device drivers are independent "black boxes" that make a specific hardware respond to a well-defined internal programming interface while completely hiding the working details of the device. It is the task of the device driver to map these calls to device-specific operations through a set of standardized calls. In the Linux system, each device is regarded as a file. The opened device is marked by a File structure in the kernel, and the kernel uses the File_operations structure to access the driver's functions. Each device is associated with a set of standard function sets.

3 Application Development under Linux Operating System
Compile the application on the PC, run the test, and then download it to the /usr directory of the target platform through the network or serial port. For smaller programs, it is more convenient to use the serial port to download. The specific steps are:

(1) Develop the program in the PC simulation environment and cross-compile;

(2) After Linux runs normally on the ARM platform, enter the usr directory and select the downloaded program;

(3) After the download is complete, chmod +x filenam changes the file attribute to an executable command;

(4) The command to execute the newly downloaded file is ./filename.

Implementation of human-computer interaction communication mechanism for general industrial control platform
Embedded GUI provides a human-computer interaction interface for embedded systems for special occasions. The main features of the new generation of embedded GUI are: user-centric, multi-channel, intelligent, and high bandwidth. In embedded Linux systems, almost all GUIs are built on FrameBuffer devices.

MiniGUI is a complete graphics support system tailored to the application characteristics of embedded systems. Bringing modern window and graphics technology to embedded devices is an efficient, reliable, customizable, compact and flexible graphical user interface support system that is very suitable for embedded devices. The main advantages can be summarized as supporting multiple embedded operating systems and having excellent portability; scalable system architecture, easy to expand; rich functions, flexible tailoring; getting the best balance between small size and high performance and having a wide range of applications.



1 Preparation before porting MiniGUI
MiniGUI 1.3.3 is an open source version of MiniGUI, with rich resources and stable performance, so MiniGUI 1.3.3 is selected as the GUI development environment. To port MiniGUI, you need to prepare the files listed in Table 3, which can be obtained on the Internet.

2 PC simulator development environment construction
Create your own development directory, decompress the files libminigui-1.3.3.tar.gz and minigui-res-1.3.3.tar.gz; compile and install the library file libminigui required for MiniGUI operation; install the resource file minigui-res-1.3.3; modify the /etc/ld.so.conf file, add a line /usr/local/lib, and then execute [root]# ldconfig Modify the minigui configuration file according to the hardware platform configuration and development environment settings, including modifying the path, screen resolution, etc.

After the PC simulator development environment is built, you can develop applications on the PC and execute them in qvfb. After verifying the correctness of the program, you can cross-compile and download it for operation.

3 Cross-compile Minigui1.3.3
Unzip the arm-Linux-2.95.3.bz2 file and install the cross-compilation tool?cross-2.95.3. After installation, modify the .bashrc script and set the environment variable: PATH="$PATH:/sbin:/usr/local/arm/2.95.3/bin:/usr/local/bin:/usr/local".

Next, install the zlib library, png library, and libttf library in turn. Their functions are: the compilation basis of other libraries, displaying PNG graphics, and displaying text. After completing the cross-compilation of the above additional libraries, you can compile libminigui. Copy the corresponding library in /usr/local/arm/2.95.3/arm-Linux/lib to the /usr/lib directory of the target board. When copying, execute the arm-Linux-strip command on the library file first to remove the debugging information in the file. At the same time, copy the resource file to the /usr/local/lib directory of the target platform. This completes the cross-compilation process, and you can download the debugged application on the PC to the target hardware platform for use. [page]

Development of Human-Machine Interface for General Industrial Control Platform
1 Human-Machine Interaction Interface Requirements Analysis and Overall Design
The communication human-machine interaction interface of the general industrial control platform is a human-machine interaction platform that integrates functions such as function demonstration, information collection, equipment status, and communication interaction. It can efficiently and intuitively display the basic information of the general industrial control platform, and effectively guide the user's operation and improve the efficiency of use. It is the main way for users to interact with the general industrial control platform.

The display of the human-machine interaction interface uses a 14-inch color display screen from PHILIPS. The software operating environment uses the embedded operating system Linux 2.6.21 and the GUI development environment MiniGUI 1.3.3. The entire software design process needs to complete the following functions:

(1) Real-time display of the specific information of the platform and the information of other online industrial control devices in this network;

(2) Using the platform as a controller to realize multi-threaded information collection and control of other common online devices in this network;

(3) Real-time control of the internal industrial control network using UDP and RS485 communication methods;

(4) Automatically disconnect the industrial control device when it is offline to prevent user misoperation;

The general industrial control platform communication human-machine interaction interface is mainly based on the Modbus protocol to complete the functions of function demonstration, information collection, device status, and communication interaction in the industrial control system for UDP and RS485 networking methods. The design requires simplicity, practicality, and easy operation. Complex interfaces will bring unnecessary overhead and affect performance. The overall design scheme and effect diagram of the human-machine interaction interface are set according to the demand analysis as shown in Figures 3 and 4.

Figure 3 Overall design of human-computer interaction interface

Figure 4 Overall effect diagram


2 Interface design process
The interface design process using MiniGUI is shown in Figure 5.

Figure 5 Interface design process

Communication implementation scheme based on industrial measurement and control Modbuss protocol
A good industrial control platform must have the function of efficient communication to keep up with the requirements of industrial development. The general industrial control platform designed in this paper can be used as a control center to collect and control data from other devices in the communication network, including typical digital-to-analog conversion equipment, analog-to-digital conversion equipment, digital quantity equipment, etc. in the industrial control field, so as to grasp the situation of each work site at any time. Since the Modbus protocol is a standard communication protocol in the field of industrial measurement and control, the protocol is simple and widely used, so the design of the communication software of this platform adopts the Modbus protocol.

The common networking methods in the field of industrial measurement and control are mainly UDP and RS485, which occupy a certain position in industrial networking with their own unique advantages. In order to achieve the design goal of the universality of the industrial control platform, this platform integrates the two networking methods into the communication human-computer interaction interface. Figure 6 is the topological structure diagram of the communication of this platform.

Figure 6 Communication topology

Conclusion
In the development process of the general industrial control platform based on ARM and Linux, the hardware platform selects the appropriate ARM microprocessor AT91RM9200 and expands its peripheral components to adapt to the more abundant technical requirements of the current industrial control site, and combines fieldbus technology to expand a variety of communication interfaces to meet the communication needs of users; the software platform uses Linux, the most widely used operating system in the embedded field, and builds a cross-compilation environment at the same time, and makes full use of open source software. Based on the MiniGUI developed by the graphical interface, an industrial control human-computer interaction interface based on UDP and RS485 two communication structures is designed for the bus protocol Modbus in the industrial control field, realizing a general industrial control platform based on ARM and Linux with strong network communication capabilities and rich interfaces as technical indicators.

The main features of this general industrial control platform are:

(1) Rich hardware interfaces to meet various needs in the field of industrial measurement and control;

(2) Use of 3U slots to enhance versatility and scalability;

(3) Based on the Linux operating system and MiniGUI graphical interface development environment, the human-computer interaction interface is friendly and convenient;

(4) Adopting the industrial measurement and control Modbus communication protocol, the communication topology is constructed based on serial RS485 and network UDP, with a wide range of applications, reliable performance, and high real-time performance.

Keywords:UDP Reference address:Design and implementation of a general industrial control platform based on ARM and Linux

Previous article:Solar-LED Street Light Solution Based on STM32 MCU
Next article:STM32F103 series USB issues

Recommended ReadingLatest update time:2024-11-17 00:01

[linux kernel] The pitfalls of ksz9031 driver debugging under the kernel
System version: Ubuntu18.04-64 Compiler version: gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) uboot version: 2018.07-linux4sam_6.0 Board model: at91sama5d3x-xplained MCU model: sama5d36 Debugging the driver in the kernel is somewhat different from debugging in uboot, because the kernel startup pr
[Microcontroller]
OK6410A Development Board (VIII) 15 linux-5.11 OK6410A start_kernel Print Angle Phase II Overview
Print information of do_initcalls VFS: Mounted root (nfs filesystem) on device 0:10. Freeing unused kernel memory: 1024K Function classification arch_call_rest_init rest_init pid = kernel_thread(kernel_init, NULL, CLONE_FS); kernel_init_freeable smp_init do_basic_setup driver_init do_initcalls for
[Microcontroller]
Linux-2.6.32.2 kernel porting on mini2440 (VI) --- Add LCD backlight driver
Migration environment  1. Host environment: CentOS 5.5 under VMare, 1G memory. 2. Integrated development environment: Eclipse IDE 3. Compilation environment: arm-linux-gcc v4.4.3, arm-none-linux-gnueabi-gcc v4.5.1. 4. Development board: mini2440, 2M nor flash, 128M nand flash. 5.u-boot version: u-boot-2009.08 6. Linux
[Microcontroller]
Linux-2.6.32.2 kernel porting on mini2440 (VI) --- Add LCD backlight driver
Design and implementation of home intelligent control terminal based on ARM-Linux and GPRS
1 Introduction With the continuous advancement of technology, smart home has gradually become possible, and smart home network terminal is the key to smart home. This article introduces the design and implementation of a home smart controller based on embedded system using RS485 industrial bus. Users can remotely mo
[Microcontroller]
Design and implementation of home intelligent control terminal based on ARM-Linux and GPRS
avr+development environment+linux, building of avr microcontroller development environment under win7
Operating system: win7 professional x86 Development software: avr studio 4.19 First, download AVR Studio 4.19, because it seems that this is the last development environment that Atmel officially supports JTAG ICE. And only this version 4 supports Windows 7. I happened to have a JTAG, so I decisively chose this versio
[Microcontroller]
avr+development environment+linux, building of avr microcontroller development environment under win7
What is the difference between ARM64 and ARM32 Linux programs?
When ARM introduced 64-bit support for its architecture, it was designed to be compatible with previous 32-bit software. But for Linux programmers, there are still some significant differences that can affect the behavior of your code. Here are some of the ones we discovered and the workarounds we developed for them.
[Microcontroller]
What is the difference between ARM64 and ARM32 Linux programs?
Parameter transfer between BootLoader and Linux kernel
In embedded systems, BootLoader is used to initialize hardware, load the kernel, and pass parameters. Because the hardware environment of embedded systems is different, the BootLoader of embedded systems is also different. Among them, the more common one is U-Boot, which supports different architectures, such as ARM, P
[Microcontroller]
25.Linux-Automatic mounting of USB disk
1. Every time we insert a USB drive, a device node /dev/sda%d will be automatically created for the USB drive   This is because device_create() is called inside, and the busybox mdev mechanism will create a device node under /dev based on the primary and secondary device numbers and other information, as shown in the
[Microcontroller]
25.Linux-Automatic mounting of USB disk
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号