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]
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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- csi_pwm_init function
- EEWORLD University Hall----Circuit (Jiangsu University)
- Fire host transmission equipment
- MSP432P401R manually realizes the breathing light
- 【NXP Rapid IoT Review】 + WEB IDE usage experience and improvement suggestions
- Can you please help me analyze the principle of this circuit? Thank you.
- TI Solar Cell Charging Maximum Power Point Tracking Algorithm Reference Design
- [GD32L233C-START Review] 4. Serial port variable length data reception
- 【AD21】How to modify the shell display of PCB 3D packaging
- The weekly review information is here~~