This paper proposes a design scheme of an embedded solar drying real-time monitoring system based on the ARM Cortex-M3 processor STM32F103VBT6. The scheme uses the AM2301 temperature and humidity sensor module to realize real-time monitoring of temperature and humidity parameters in the solar drying room, uses digital PID control technology to control the speed of the blower to keep the temperature in the drying room stable, and controls the start and stop of the exhaust fan through a relay to keep the humidity in the drying room below the set upper limit.
The drying room communicates with the host computer through the RS 485 bus. The host computer sets the target temperature and humidity upper limit in the drying room, and displays the temperature, humidity, blower speed, exhaust fan switch status and other parameters in real time. The embedded system software uses the FreeRTOS real-time operating system to ensure the real-time and reliability of the system, and realizes real-time monitoring and control of the temperature and humidity in the solar drying room. The field application verifies that the system runs stably, has high control accuracy and fast response speed, thus proving that this solution has strong practicality.
0Introduction
Solar energy is a clean and renewable energy source with a very broad application prospect. In recent years, the use of solar energy for processing agricultural products and medicines has also developed rapidly due to its energy saving, short drying time, and high drying quality. In order to ensure the quality and drying efficiency of the dried materials, the solar drying equipment needs to monitor the temperature and humidity in the drying room in real time during the drying operation. The intelligent solar drying control system based on AT89C51 developed by Wang Shengli, Fu Lisi and others from Shenyang Agricultural University did not transplant the real-time operating system, and the real-time requirements of monitoring and control could not be properly met, and the drying effect of the equipment was also affected. Although the PLC-based alfalfa solar drying control system developed by Xu Mingna from Inner Mongolia Agricultural University is relatively stable, the overall cost is relatively expensive and is not suitable for large-scale promotion and application.
In view of the design requirements of real-time, stability and scalability of solar drying monitoring system, this paper proposes a design scheme of real-time embedded solar drying monitoring and control system based on STM32 and FreeRTOS. The scheme uses temperature and humidity sensor AM2301 to measure temperature and humidity, and transmits it to PC host computer through RS 485 communication line, realizing real-time monitoring of temperature and humidity in solar drying room; digital PID is used to control the blower speed and relay to control the exhaust fan start and stop to complete the real-time control of temperature and humidity in solar drying room. The host computer is written in configuration software, which has the advantages of strong adaptability, good openness, easy expansion, economy, short development cycle, etc. The monitoring and control interface is simple and easy to operate. The test shows that the whole system has the characteristics of stable operation, rapid response and easy operation, and can realize real-time monitoring and control of temperature and humidity in drying room during drying operation.
1 Design of embedded solar drying monitoring and control system
The embedded solar drying real-time monitoring and control system consists of a PC host computer, an embedded ARM processor, an AM2301 temperature and humidity sensor, an RS 485 communication circuit, a relay control circuit, etc.
AM2301 collects the real-time temperature and humidity parameters in the drying room, which are transmitted to the PC host computer via the RS 485 communication line by the embedded ARM processor for display and storage. The drying temperature set manually by the host computer is transmitted to the embedded processor via the RS 485 communication line as the system control target, and the PID control algorithm is called with the actual temperature in the drying room as the input. The output of the PID control algorithm is used as the operating frequency of the inverter to adjust the speed of the blower in real time, thereby increasing or decreasing the amount of hot air supplied in real time to achieve constant temperature control of the drying room. When the humidity in the solar drying room is detected to be higher than the upper limit set by the host computer, the relay contacts are closed to control the exhaust fan to open and exhaust the over-humidified exhaust gas in the drying room to achieve the purpose of humidity control. The system structure block diagram is shown in Figure 1.
Figure 1 Structure diagram of embedded solar drying real-time monitoring and control system
2 Hardware design of embedded solar drying monitoring and control system
2.1 Embedded Processor Selection and Application
The main control processor of the embedded solar drying real-time monitoring and control system uses the low-power, high-speed industrial-grade chip STM32F103VBT6 (STMicroelectronics). The STM32 series has an ARM Cortex-M3 core designed for high-performance, low-cost, and low-power embedded applications. It integrates excellent security clock mode, low-power mode with wake-up function, internal RC oscillator, embedded reset circuit, etc., which greatly simplifies the peripheral circuit design and greatly improves the performance. The STM32 series of microcontrollers can also easily realize the transplantation of real-time operating systems, which can meet the design requirements of this embedded solar drying real-time monitoring and control system.
2.2 AM2301 temperature and humidity acquisition circuit design
The embedded solar drying real-time monitoring and control system uses the AM2301 humidity-sensitive capacitor digital temperature and humidity module to obtain the real-time temperature and humidity parameters in the drying room. AM2301 contains a capacitive humidity sensing element and a high-precision temperature measuring element, connected to a high-performance 8-bit microcontroller, with the advantages of excellent quality, ultra-fast response, strong anti-interference ability, high cost performance, and each sensor has been calibrated in an extremely accurate humidity calibration room. AM2301 uses a standard bus interface to make system integration simple and fast. With ultra-small size and extremely low power consumption, the signal transmission distance can reach more than 20 m. The temperature and humidity acquisition circuit is shown in Figure 2.
Figure 2 AM2301 temperature and humidity acquisition circuit
The temperature measurement range of the AM2301 sensor is -40~80℃, with an accuracy of 0.1℃; the humidity measurement range is 0.1~99.9% RH, with an accuracy of 0.1% RH, which can fully meet the design needs of this system. The measurement resolution of the AM2301 temperature and humidity sensor is 8 bits, and the single bus transmission data is divided into an integer part and a decimal part. The complete data transmission is 40 bits. The specific data format is as follows:
32 data bits, including 8-bit humidity integer data, 8-bit humidity decimal data, 8-bit temperature integer data, and 8-bit temperature decimal data; 8-bit check bit, which is the last 8 bits of the result of 8-bit humidity integer data + 8-bit humidity decimal data + 8-bit temperature integer data + 8-bit temperature decimal data.
The AM2301 temperature and humidity reading procedure is as follows:
2.3 Relay control circuit design
When the humidity in the drying room is detected to exceed the upper limit set by the host computer, the STM32 microcontroller pulls the relay control pin level high, and the relay contacts are closed to control the exhaust fan to turn on; when the humidity in the drying room is detected to drop below the upper limit, the STM32 microcontroller pulls the relay control pin level low, and the relay contacts are separated to control the exhaust fan to turn off, completing the exhaust of the over-humidified exhaust gas. The relay control circuit is shown in Figure 3.
Figure 3 Relay control circuit
2.4 RS 485 communication circuit design
Solar drying equipment needs to work in an open-air environment for a long time, which places high demands on the distance and anti-interference of the communication circuit. In response to this requirement, the real-time embedded solar drying monitoring and control system uses SP485R chip to build RS 485 communication control circuit to realize communication with the PC host computer.
The SP485R application circuit is shown in Figure 4.
Figure 4 SP485R application circuit diagram
3 Embedded solar drying monitoring and control system software design
3.1 FreeRTOS porting on STM32
Solar drying equipment has high requirements for temperature and humidity in the drying room during drying operations: too high temperature will affect the quality of the dried materials, and too low temperature or too high humidity will reduce the drying efficiency. This requires the monitoring and control system to have high real-time performance and reliable stability, and be able to respond quickly and act accurately, so that the temperature in the drying room can be maintained constant and the humidity is within a limited range. Based on this, the FreeRTOS real-time operating system is ported to the STM32 embedded processor to meet the design requirements.
The implementation of FreeRTOS mainly consists of four files: list.c, queue.c, croutine.c and tasks.c. list.c is an implementation of a linked list, mainly used by the kernel scheduler; queue.c is an implementation of a queue, supporting interrupt environment and semaphore control; croutine.c and task.c are the organization implementations of two tasks. For croutine, each task shares the same stack, which further reduces the demand for RAM. For this reason, its use is relatively strictly restricted. Task is a traditional implementation, each task uses its own stack and supports full preemptive scheduling. The transplantation of FreeRTOS in STM32 is roughly implemented by three files: a .h file defines compiler-related data types and interrupt processing macro definitions; a .c file implements task stack initialization, system heartbeat management and task switching requests; and a .s file implements specific task switching, as shown in Figure 5.
Figure 5 FreeRTOS file structure
FreeRTOS can realize functions such as creating tasks, deleting tasks, suspending tasks, resuming tasks, setting task priorities, and obtaining task-related information. In the program design of embedded solar drying real-time monitoring and control system, the xTaskCreate() function is called to create three tasks: monitoring, communication, and control. The program tasks are executed in the set priority order to realize the established functions.
The monitoring task (vmonitorTask) realizes real-time monitoring of the temperature and humidity in the drying room and the blower speed. The embedded processor saves the real-time parameters obtained by the parameter sensor.
The communication task (vcommunicateTask) realizes real-time communication between the host computer and the embedded processor. The embedded processor receives the drying temperature and humidity upper limit values sent by the PC host computer, and sends the collected temperature, humidity and blower speed parameters to the PC host computer for real-time display.
The control task (vcontrolTask) realizes the temperature and humidity control in the drying room. The drying temperature set by the PC host computer is used as the system control target quantity, the real-time temperature measured by the parameter sensor is used as the input quantity to call the PID algorithm, and the output quantity is used as the inverter working frequency to adjust the blower speed to realize the constant temperature control of the drying room. When the humidity in the drying room exceeds the upper humidity limit set by the PC host computer, the relay controls the exhaust fan to complete the emptying of the over-humidified exhaust gas.
The program task execution block diagram is shown in Figure 6.
Figure 6 Program task execution block diagram
3.2 Application of PID Control
The system parameters of solar drying equipment during operation cannot be obtained through effective measurement methods, so it is impossible to establish an accurate mathematical model. Therefore, the structure and parameters of the system controller must be determined based on engineering experience and on-site debugging. Based on comprehensive consideration of the feasibility of various control theories and reference to engineering practice, the embedded solar drying real-time monitoring and control system uses digital PID control technology to achieve constant temperature control of the drying chamber.
The embedded processor uses the drying temperature set by the host computer as the system control target and uses the real-time temperature in the drying room as the input to call the PID algorithm. The PID output is used as the inverter operating frequency to adjust the blower speed in real time, thereby increasing or decreasing the amount of hot air supplied in real time to achieve constant temperature control of the drying room.
Considering the characteristic requirements of temperature regulation, this system adopts PI control. That is, first determine the setting range of proportional coefficient and integral coefficient according to the characteristics of the controlled object and general practice, then manually adjust the blower speed to record the temperature change curve in the drying room and analyze it, and finally determine the proportional coefficient in the PID algorithm to be 0.4 and the integral coefficient to be 6.
3.3 Host computer software design
This system uses KingView software from Beijing Asia Control Company to complete the design of the host computer monitoring and control interface. The host computer software realizes the real-time display of parameters such as temperature and humidity in the drying room and the setting of the upper limit of constant temperature drying temperature and humidity. The design uses Access2010 database as the record database to facilitate data storage and analysis.
A solar drying monitoring and control system was newly built using KingView software. The single-chip communication protocol was selected and the communication with the embedded processor was realized through the RS 485 interface. The upper computer software interface adopts a partition design, and the interface consists of a display area and an operation area. The display area includes real-time display of temperature and humidity, speed, exhaust fan status, and temperature and humidity change trend charts. The operation area can realize manual setting of the constant temperature drying temperature and humidity upper limit.
The upper computer software interface is shown in Figure 7.
Figure 7 KingView host software running interface
4. Run test results and analysis
At present, the embedded solar drying real-time monitoring and control system designed in this paper has been running smoothly in the grass drying operation of a farm for more than 6 months. In the early drying operation, by setting different temperature and humidity conditions and analyzing the temperature and humidity data collected by the system and the quality of the dried materials, the optimal drying temperature and humidity upper limit are determined for reference in the later large-scale drying operation. In the actual operation of the system, the error between the actual temperature value and the set value in the drying room can be kept within 0.5℃, which is ideal. The grass dried by this system is a constant temperature and humidity drying with the optimal temperature and humidity conditions during the drying process, and the aromatic amino acids and proteins are well preserved. Therefore, the dried grass has good palatability and high digestible energy intake of livestock, that is, the drying quality of the grass is good, and the unit power consumption is only 0.15 kW.h/kg. Table 1 is part of the data collected by the system in the drying operation on June 7, 2013. The system sets the drying temperature to 51℃ and the humidity upper limit to 48%.
5 Conclusion
This paper introduces in detail the design of an embedded solar drying real-time monitoring and control system based on STM32 and FreeRTOS. The solution uses an STM32 embedded microprocessor with a Contex-M3 core to miniaturize the system and facilitate performance improvement and expansion with various peripherals. The embedded real-time operating system FreeRTOS is ported to STM32 to make the system run more stable, with high real-time performance and strong anti-interference ability. The overall cost of the system is relatively low, suitable for promotion and use, and it has been verified by actual production applications: the drying equipment using this embedded solar drying real-time monitoring and control system is more energy-efficient and efficient, and the quality of the dried materials is also improved.
Previous article:Application of digital power following technology in wind-solar hybrid power generation system
Next article:Simple design of transmission type visibility measurement device
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- [NUCLEO-L552ZE Review] + Low Power Measurement Tool
- Lithium battery charging and discharging integrated chip
- Bluetooth module connection problem
- Ethernet LED is not on
- AM57x Processors for Smart Grid Applications
- The pinout has changed, where should I modify?
- EMC signal integrity test 1---get out of the metaphysics
- Bluetooth protocol specifications (HCI, L2CAP, SDP, RFOCMM)
- Keep up with the future and enter the NXP Technology Center lecture hall to watch the removable development board, AI-IoT series of books, and red envelopes
- A USB20 communication design for real-time image system.pdf