1 Controller hardware platform design
The controller node is the center of the embedded networked measurement and control system. In the measurement and control system, the main controller undertakes the two major tasks of control algorithm implementation and data acquisition, which requires the hardware platform of the controller node to have stronger computing power and better network performance. The hardware platform of the controller in this article adopts Samsung's S3C2440, and the peripheral devices mainly include RAM, Flash, etc. The hardware platform structure of the controller is shown in Figure 1.
(1) Introduction to S3C2440 processor
This system uses Samsung's 16/32-bit RISC microprocessor S3C2440AL as the controller core. A major feature of S3C2440AL is that its core processor (CPU) uses a 16/32-bit ARM920T RISC microprocessor. ARM920T implements MMU, AMBA BUS and Harvard cache architecture. The system has rich resources and peripheral interfaces, including power manager, external memory controller, 4-channel DMA, 3-channel UART, 8-way 10-bit ADC and GPIO.
(2) Introduction to peripheral circuits
The controller peripheral circuit is mainly composed of memory circuit module, communication module and JTAG debugging circuit. The memory circuit module uses 2 HY57V561620FTP chips as external SDRAM; 1 SST39VF1601 (2 MB) chip as NOR Flash to store bootloader program; 1 K9F1208 chip (64 MB) as NAND Flash to store operating system and file system. The DM9000 network card chip and the network transformer HR911103A are used in the communication module to realize the design of the Ethernet interface. At the same time, the USB host interface circuit is designed to provide an interface for the next step of WLAN communication. The A/D and D/A interface circuits realize data collection and control signal sending.
2 Design of controller software platform
2.1 Overall structure of software platform
The software architecture of controller node is shown in Figure 2. The bottom layer is the device driver layer, which is mainly used to initialize the processor and drive various peripheral circuit modules; the second layer is the embedded Linux operating system, which mainly manages the hardware and software resources of the system, the upper layer applications, and operates the bottom layer driver interface; the third layer is the Web server to realize the controller: Browser/Server access control; the fourth layer is the application program, which mainly includes the real-time database, GPC control algorithm and clock synchronization application program.
2.2 Configuration and compilation of bootloader
First, establish the arm-linux-gcc-2.95.3 cross-compilation environment under the Linux of the host machine, decompress vivi.tgz to the corresponding directory of Linux, enter the vivi directory, execute the make menuconfig command to enter the vivi configuration interface, and configure the parameters of vivi. After completing the configuration, compile, and vivi has been generated in the current directory. Vivi can be burned to NAND Flash for operation using H-JTAG.
2.3 Linux transplantation
(1) Compile the Linux kernel
First, establish the arm-linux-gcc-3.4.1 cross-compilation environment under the Linux of the host machine, then decompress Liunx-2.6.13.tgz to a directory in Linux, execute the make menuconfig command to enter the kernel configuration interface, and customize the Linux kernel, including configuring CPU options, network card and sound card drivers, serial ports, and support for the yaffs file system. After completing the customization, save the settings and exit. Then compile the kernel to generate the kernel image file zImage.
(2) Make a yaffs file system
To make a yaffs file system image, you need to use the mkyaffsimage tool program. First, decompress it to the /usr/sbin directory, and then decompress the file system to a directory in Linux. At this time, users can add their own applications or other files to the file system. After adding, use the mkyaffsimage command to get the root.img image file. Finally, you can use H-JTAG to burn the generated image file to NAND Flash for operation.
2.4 Transplantation and construction of Boa server
In the networked measurement and control system, each measurement and control node needs to use a Web browser for monitoring and data interaction. As a data carrier, the Web server can transmit local information and data to the remote client making the request through the network, which is of great significance to the realization of remote networked monitoring. Therefore, the transplantation of Web Server becomes an indispensable task. The advantages of Boa are its open source code, good performance and high reliability. The construction of Web Server in this article is also based on Boa.
First, download the Boa source code boa-0.94.13. tar. gz from the official website, decompress it to a directory of the Linux host, then enter the src directory, execute the ./config command, and generate the Makefile. in file. Since the generated Makefile file is for the X86 platform, in order to generate Boa that can run on ARM, the Makefile file needs to be modified. Find the two lines CC=gcc, CPP=gcc-E and modify them to CC=arm-linux-gcc, CPP=arm-linux-gcc-E; then use the make command to compile. After successful compilation, a Boa executable file that can run on the ARM platform will be generated in the src directory, and then the compiled Boa program will be placed in the /sbin directory.
Before running Boa on the target board, you also need to configure the boa.conf file. The boa.conf file mainly contains the basic boa parameters: Port, the port that the boa server listens on; User, the identity of the client connected to the server; DocumentRoot, the root directory of the HTML file. Users can set it according to their needs. After setting, enter the sbin directory and run Boa directly to start the Web server.
3 Design and implementation of GPC algorithm
The generalized predictive control algorithm was proposed by Clarke et al. in 1987. This algorithm retains the multi-step prediction optimization strategy in DMC, MAC and other algorithms, and draws on the ideas of model prediction, minimum variance control and online identification in minimum variance self-correcting control. Therefore, it has low requirements on model accuracy and strong robustness to objects with variable time delay. It has been widely used and valued in recent years. This paper adopts the GPC algorithm to solve the delay problem.
[page]
3.1 GPC algorithmIn GPC, the controlled autoregressive integrated moving average model (CARIMA) used in minimum variance control is used to describe the controlled object, that is where z-1 is the backshift operator, which represents the corresponding quantity of one sampling period backward; A(z-1), B(z-1), C(z-1) are polynomials of the backshift operator z-1. y(k) is the system output, and u(k) is the control output. ξ(t) is a white noise sequence with a mean of 0 and a variance of 0, which represents the influence of a type of random noise. △ is a difference operator, and △=1-z-1. Generally, let C(z-1)=1. For the convenience of research, without affecting the research of the system algorithm, let the system be a SISO system. The control increment weighting parameter is introduced into the objective function of the GPC algorithm to enhance the robustness of the system. Its objective function is Wherein, E is the mathematical expectation; ω(k+i) is the input reference trajectory, N1 and N2 are the initial and final values of the optimization time domain, NU is the control time domain, and λ(j) is the weighted coefficient of the control increment greater than zero. The generalized predictive control algorithm problem is ultimately reduced to: by recursively solving the Diophanfine equation, the optimal control increment △U is obtained to minimize the objective function. 3.2 MatIab simulation and target code generation RTW is a code automatic generation tool provided by Matlab, which can automatically generate code for different targets from Simulink models. Currently, Matlab/RTW can generate code that runs on devices such as PC and ARM, as well as executable files that run on systems such as Windows and Linux. Using RTW to automatically generate code allows engineers to focus on system design and implementation, reduce programming workload, and speed up product development. The simulation and debugging of the GPC algorithm is implemented in the Matlab7.0 environment, using the MPC toolbox, and compiling corresponding programs. Since the M language in Matlab cannot be directly transplanted to the embedded controller, the system model must be built with Simulink first, and then the C code for the ARM platform is automatically generated using Real-Time Workshop. The experimental steps for automatically generating code using RTW are as follows: ① Use Matlab's M language to write the GPC algorithm program. After the simulation passes, encapsulate it into a Simulink simulation block diagram and establish the GPC control system model Model.mdl. ② In the Simulink window, select the Simulink|Configuration Parameters option to set the solvet option, Data Import/Export, etc. ③ Select the Generate code only checkbox and click build to automatically generate the code. ④ Integrate the underlying driver function, user-defined function and automatically generated GPC program, and compile to generate the target file. As can be seen from Figure 3, in a binary system with random disturbances, the overshoot and adjustment time of the controller based on the GPC algorithm are relatively small, and the rise time is fast, showing good dynamic performance and robustness. This is inseparable from the characteristics of multi-step prediction and rolling optimization of the GPC algorithm.
Conclusion
This paper successfully built a software and hardware platform for networked controller nodes, and through the Matlab/RTW semi-physical simulation method, realized the rapid transplantation of the GPC algorithm and compensated for network delay. The measurement and control platform has a wide range of applications and is suitable for Ethernet-based embedded Web controllers to meet remote real-time control requirements, and has certain application prospects.
Previous article:Research on driving RGB TFT LCD screen with S3C2440A
Next article:Design of Embedded Navigation System Based on S3C2440A and Win CE
Recommended ReadingLatest update time:2024-11-16 21:50
- 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
- From the selection of resistors, we can see the research and development work of engineers
- Principles of Circuits (Second Edition)
- CircuitPython 6.3.0 released
- Methods to increase the transmission distance of wireless modules
- [Evaluation of Anxinke Bluetooth Development Board PB-02-Kit] KEY and LED Control
- Award-winning live broadcast | Azure Sphere helps to provide stable, secure and flexible IoT solutions
- Help: When downloading the BG22 development board, it prompts to upgrade jlink to connect, and the download fails
- Siemens Industrial Automation Data Collection (October 18, 2019)
- In gratitude to teachers, FLUKE offers annual discounts! Participate in the event and win a prize of 30,000 yuan!
- EEWORLD University Hall----Keithley 4200A-SCS parameter analyzer accelerates semiconductor equipment, materials and process development