Design of single chip intelligent pneumatic pump control system

Publisher:AngelicHeartLatest update time:2011-08-04 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

During the pneumatic wiping of the gun barrel, the problem of gas metering will be encountered. Accurate flow measurement is an important content in the current measurement and control system field. With the C8051F020 single-chip microcomputer as the core, an intelligent pneumatic pump control system can be designed to realize the state detection and control of the pneumatic pump.

C8051F020 microcontroller function introduction:
8051F020 device is a fully integrated mixed-signal system-level MCU chip with 64 digital I/O pins. Its main features are: 1) High-speed, pipelined 8051-compatible CIP-51 core (up to 25MIPS); 2) Full-speed, non-intrusive in-system debug interface (on-chip); 3) True 12-bit, 100ks/s 8-channel ADC with PGA and analog multiplexer; 4) True 8-bit 500ks/s ADC with PGA and 8-channel analog multiplexer; 5) Two 12-bit DACs with programmable data update mode; 6) 64KB of in-system programmable FLASH memory; 7) 4352 (4096+256)B of on-chip RAM; 8) External data memory interface with addressable 64KB address space; 9) Hardware-implemented SPI, SMBus/I2C and two UART serial interfaces; 10) 5 general-purpose 16-bit timers; 11) Programmable counter/timer array with 5 capture/compare modules; 12) On-chip watchdog timer, VDD monitor and temperature sensor.


The C8051F020 with on-chip VDD monitor, watchdog timer and clock oscillator is a true stand-alone system-on-chip. All analog and digital peripherals can be enabled/disabled and configured by user firmware. The FLASH memory also has in-system reprogramming capability for non-volatile data storage and allows field updates of the 8051 firmware. On-chip JTAG debugging circuitry allows non-intrusive (no on-chip resources), full-speed, in-system debugging using the product MCU installed on the final application system. When using JTAG debugging, all analog and digital peripherals are fully functional. Each MCU can operate with a voltage of 2.7 to 3.6V over the industrial temperature range (-45 to +85°C). Port I/O, /RST and JTAG pins all allow 5V input signal voltage.

System working principle and structural design
The pneumatic pump control system should realize effective control of gas flow, including collecting gas flow information and real-time control of gas flow. The control system is a monitoring and regulation system with a single-chip microcomputer as the core. It can independently complete the collection, processing and display of gas flow information, and can also communicate with the host computer through a standard RS-485 interface. The system principle structure block diagram is shown in Figure 1. It is a small distributed data acquisition and control system, mainly composed of a microcontroller, a gas flow sensor and its compensation bridge, a keyboard and a liquid crystal display module, an action actuator and a host computer.

Figure 1 System working principle diagram


The system uses C8051F020 as the microcontroller of the system. Its main functions are: 1) to sample the gas flow by setting its internal differential circuit; 2) to make judgments based on the two given flow limits (upper and lower limits) and give corresponding instructions to the action actuator; 3) to transmit the processed sampled flow to the LCD through the I/O port and to the host computer through the 485 bus.


The host computer will display the received sampled gas flow and two flow limits in real time to achieve real-time monitoring of the flow. The system also allows the upper and lower flow limits to be modified from the host computer.


The main functions of the keyboard and LCD display module are: the two flow limit values ​​can be modified through the keyboard; the LCD display will display the sampling flow, upper and lower flow limits, and the gas flow adjustment process.


The flow analog signal measured by the gas flow sensor is linearly compensated by a balanced bridge, and then sent to the A/D converter through a multi-way switch to be converted into a digital quantity and transmitted to the C8051F020 microcontroller.


The actuator mainly receives the command from the microcontroller, provides a signal to the system load, controls the opening size of the regulating valve, makes the actual flow gradually approach, reaches the given flow, and completes the automatic adjustment process. For example, when the sampled flow is lower than the upper limit, a signal is output to actuator 1; when it is higher than the upper limit, a control signal is output to actuator 2.

Hardware design of the system
The hardware design of the system adopts a modular structure, which is compact and easy to debug and maintain. The system hardware circuit design includes four parts: single-chip core control module, gas flow detection module, LCD display module, control execution module and communication module.


1 Single-chip microcomputer core control module
The design of the single-chip microcomputer core control module mainly includes the design of the minimum system of the C8051F020 single-chip microcomputer, the keyboard and the LCD display circuit. Among them, AIN0.0 and AIN0.1 are used as the input terminals of the gas flow sampling; P0.0 and P0.1 provide input/output signals for communication; P1 port is used as the keyboard lead-out terminal; some pins of P6 port and P5 port are used as the data port and control port of the LCD; P2.4 and P2.5 are used as the control signal output terminals of the executable mechanism 1 and 2 respectively. The CGM12864B dot matrix LCD display screen is composed of two column drive circuits KS0108 with controllers and one row drive circuit KS0107, which are the main hardware circuits. The display is composed of a 128×64 pixel LCD chip. KS0108 divides the display area into left and right half screens, and the entire screen is divided into 8 pages with 64 rows from top to bottom, and each page has 8 rows. Its LCD display circuit is shown in Figure 2.

Figure 2 LCD display circuit diagram


2 Gas flow detection module
This module is mainly composed of a gas flow sensor, a shaping amplifier circuit, a multi-way switch and an A/D converter conversion circuit. It mainly completes the shaping and amplification of the analog quantity corresponding to the gas flow detected by the sensor, and converts it into a digital quantity that can be received by the C8051F020 microcontroller.


When the measured gas passes through the flowmeter within the specified flow rate and pressure range, its instantaneous volume flow rate Qi is
Qi=N/ξi (1)
where N is the number of pulses output within 1s; ξi is the flowmeter coefficient.


When detecting gas flow, the CPU internal timer/counter CTC1 continuously samples the number of pulses output by the flow meter, and calculates the measured flow once per second through hardware interrupts to obtain the instantaneous volume flow Qi and cumulative volume flow Qv of the measured gas.


3 Control execution module
The main function of the control execution module is to control external auxiliary equipment, such as air compressors. The external circuit interface of this system can be easily connected to the external circuit through a triode circuit. The circuit diagram of the single-chip microcomputer controlling the external relay is shown in Figure 3.

Figure 3 Relay circuit diagram [page]

4 Communication module
In order to realize long-distance effective data communication between the single-chip microcomputer and the host computer, the communication module uses the MAX485 chip, which is designed according to the RS485 standard. P0.0 and P0.1 of the P0 port are configured as TX0 and RX0 pins, which are connected to RO and DI of the MAX485. Since the microcomputer serial port uses the RS232 standard and the single-chip microcomputer serial port output is the TTL standard, the conversion between standard signals must be realized. The circuit design is shown in Figure 4.

Figure 4 RS485 communication circuit diagram

Gas flow control
Based on the gas flow measurement, the deviation is calculated after comparing the given value with the actual measured instantaneous flow, and then the gas flow is adjusted. Since the accurate mathematical model of the gas flow system is difficult to obtain, the fuzzy control algorithm has the characteristics of human intelligent thinking, good adaptability, and strong robustness, which is suitable for this type of system. Therefore, the use of fuzzy control algorithm to automatically control the gas flow can achieve good control characteristics. The block diagram of the fuzzy controller is shown in Figure 5.


The fuzzy controller adopts a two-dimensional structure with dual input and single output. The input variables are instantaneous flow deviation e and deviation change c, and the output variable is the control amount u. Their fuzzy subsets are
E={NL, NM, NS, NO, PO, PS, PM, PL}
C={NL, NM, NS, O, PS, PM, PL}
U={NL, NM, NS, O, PS, PM, PL}
and their domains are
E={-6,-5,-4,-3,-2,-1,-0, +0, 1, 2, 3, 4, 5, 6}
C={-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 6}
U={-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 6, 7}.
When the instantaneous flow rate changes, the regulating valve can be driven to control its opening size and change law so that the deviation approaches zero. According to the parameter characteristics of gas flow, actual operation experience on site and the theoretical knowledge of experts, a fuzzy control rule table is summarized, as shown in Table 1.


The selection of fuzzy control rules is the key issue of fuzzy controller. In order to better improve the control accuracy, this system adopts a control rule with 4 adjustment factors:
0<α1<α2<α3<α4<1, and this system selects: α1=0.26, α2=0.58, α3=0.76, α4=0.86. After substituting the above formula into the calculation, after repeated modification and actual debugging, a practical fuzzy control query table is obtained, as shown in Table 2.

System software design and anti-interference measures
The software design includes the design of the system's lower and upper computers.


1 Lower computer program design
The lower computer program mainly performs the initialization of the C8051F020 single-chip microcomputer system, port configuration, A/D initialization, LCD and keyboard scanning initialization. In order to prevent malfunction and inadvertent change of system parameters, resulting in human measurement errors, the system can set a "password" to ensure the reliability and accuracy of the measurement. The specific process is shown in Figure 6.


The control algorithm in fuzzy control is implemented by the program. It includes two parts: one is to calculate the fuzzy control query table offline, and the other is to input variables online in the real-time control process, and perform fuzzy quantization on them, and then look up the fuzzy control query table and output it to control the opening angle of the regulating valve to achieve the control of gas flow.


2 Host computer part
The host computer program is designed using Lab Windows/CVI, which mainly realizes the reception and display of the sampled gas flow and two flow limits, and can also modify the flow limit and send it to the slave computer.


3 Anti-interference measures
In order to improve the stability of the control system and enhance the anti-interference ability, an isolated power transformer can be used, and the signal channel can use photoelectric isolation and filtering technology; Watchdog technology and software traps can be used to prevent the program from running away and realize task recovery; power supply anti-interference measures can be taken.

Conclusion: This design successfully achieves the expected functions of the system and can effectively resist interference.

Reference address:Design of single chip intelligent pneumatic pump control system

Previous article:Important factors in the MCU decryption process
Next article:Clock Interrupt in MCU Programming

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号