Development of Single Chip Control System for Beverage Filling Machine

I. Introduction:

Today, beverage filling machines are widely classified into two types according to their scale. One is a large-scale filling production line. This production line is suitable for large-scale enterprises, with large investment, high degree of automation, and complicated control system. The class is a small-scale single-machine beverage filling machine. This single-machine system is suitable for small enterprises, with small investment, relatively low automation, and simple control system. This paper introduces the design of the single-chip system of beverage filling machine in combination with the development of a beverage filling machine automatic control system.

Second, the working diagram of the filling machine and the requirements for the control system:

The working diagram of the filling machine system is shown in Figure 1. The functional requirement is that it can fill 11 kinds of bottled beverages of 50 ml, 80 ml, 100 ml, 120 ml, 150 ml, 180 ml, 200 ml, 250 ml, 300 ml, 350 ml, 500 ml, and should be able to be produced according to the production. The actual situation of online modification of product specifications and corresponding delay time, online display of daily output, monthly output, total output. The control flow is as follows: the solenoid valves 1, 2 are energized, and the control levers 1 and 2 are extended. After a delay of 0.5 seconds, the solenoid valve 2 is de-energized, so that the bar 2 is retracted, and the empty beverage bottle is transported and counted by the conveyor belt. After counting 8 times, the lever 2 is extended. After a delay of 0.2-2 seconds, the solenoid valve 4 is electrically controlled to control a row of 8 nozzles to move down, then delay for a period of time (this time is adjustable), and the solenoid valve 3 is energized. Control the movement of the piston, start filling according to the capacity set at the beginning, and judge whether the piston reaches the specified position through the infrared photoelectric switch, that is, whether the beverage bottle is filled, after the delay of 0.1-0.20 seconds, the solenoid valve 3 loses electricity under the piston. After the container is refilled with the beverage, after a delay of 0.1-0.25 seconds, the solenoid valve 4 is de-energized, a row of nozzles is moved up, and then the solenoid valve 1 is de-energized to control the lever 1 to be retracted, and the bottle filled with the beverage is transported through the conveyor belt. And start counting, after counting 8 full, and then return. In addition to controlling the above-mentioned mechanical motion, the control system should have a liquid crystal display function to display various parameters and states, and the capacity, delay time, and clock can be set.

Third, the composition of the control system:

1, the principle block diagram

This system uses PHILIPS89C51 microcontroller. The principle block diagram of the control circuit with the single chip as the core is shown in Fig. 2. For simplicity, the system interfaces are addressed using line-selected slice addressing.

2. Introduction to the interface between the MCU and each module

(1). Interface with OCM4*8C liquid crystal display module

OCM4*8C liquid crystal display module is a 128*64 dot matrix Chinese character graphic liquid crystal display module, which can display Chinese characters and graphics, with 8192 Chinese characters (16*16 dot matrix) and 128 characters (8*16 dot matrix). 64*256 dot matrix display RAM (GDRAM). It can interface directly with the CPU and provides two interfaces to connect to the microprocessor: 8-bit parallel and serial connection. The system adopts 8-bit parallel connection mode, its interface is shown in Figure 3. RS, R/W, E are OCM4*8C data/command control bits, read/write control bits and enable control, respectively. PSB is parallel and serial. Transmission control, LEDA, LEDK for backlight power supply positive and negative with P2.4 port to control the backlight off.

(2). Interface with clock chip SD2000C

The SD2000C is a high-precision real-time clock chip with a built-in crystal oscillator and an IIC bus interface. Built-in disposable rechargeable battery, available for 5-10 years. The built-in serial NVSRAM is a non-volatile SRAM with up to 10 billion erases. It has: BCD code input/output of year, month, day, week, hour, minute and second; automatic calendar to 2099 (including leap year automatic conversion function); built-in voltage regulator circuit and power failure detection circuit; built-in power management circuit When the VDD is greater than or equal to 3.0V, the internal battery does not consume power; the built-in 16Kbit serial NVSRAM. Since the 89C51 single-chip microcomputer has no IIC serial bus communication port, this design uses the two-bit general-purpose I/O port of the single-chip microcomputer to connect with the IIC bus of the clock chip. According to the IIC communication rule, the serial data communication is realized by software. The connection mode is shown in Fig. 5. SDA and SCL are real-time clock serial data buses, and SDAE and SCLE are SRAM serial data buses.

*Note: For details on the usage and programming of OCM4*8C liquid crystal display module and clock chip SD2000C, see references [3], [4].

(3). Interface with the keyboard

The system is provided with a running key, a parameter setting key, a modified command key, a parameter selection pull-up key, a pull-down key, a left shift key, a right shift key, and a confirm key. In order to reduce the panel size, a key is actually used to set 5 keys. The state of the key is connected to the data port P0 of the single-chip microcomputer through the tri-state buffer, and the state of the key is recognized by the combination of the interrupt and the query. The specific use of the five keys can be found in the main program flow chart, which is shown in Figure 6.

(4). Interface with input

The input signal consists of three parts. The first part is the capacity control photodetection signal (11 channels), the second part is the conveyor motor and the air pressure operating state monitoring input (2 channels). The MCU reads the information through the tristate buffer. The three parts of the unfilled beverage bottle and the filled beverage bottle are counted by the counting input of the single chip microcomputer.

(5). Interface with output

As can be seen from the foregoing, the relay output of the system has 6 channels, of which 4 channels are used to control two rotary solenoid valves and two shift lever solenoid valves, and the other two control conveyor belt motors and air compressors are operated.

Fourth, the system software design

According to the working principle and control requirements of the system, consider the overall structural design of the software, and correctly handle the connection between the entities. For this reason, the software adopts a modular structure design, from top to bottom, gradually refinement, and uses subroutines to form each module. . The entire software system is well readable, modifiable, easy to debug and maintain. Due to limited space.

V. Conclusion

This system selects 8-bit single-chip microcomputer 89C51 as the core control chip, which has the characteristics of low cost, small size, high integration and high reliability. It is an ideal choice. In the design method, the idea of ​​software engineering is quoted in the design of the single-chip system, so that the information flow of the system and the overall function design are simple and clear.

references

[1] Zhang Youde, Zhao Zhiying, Tu Shiliang. Principle, Application and Experiment of Single Chip Microcomputer [Experimental Edition] [M].

Shanghai: Fudan University Press, 1995

[2] Hu Hancai. The principle of single chip microcomputer and its interface technology [M]. Beijing: Tsinghua University Press, 1995

[3]Guangdong Jinpeng Technology Co., Ltd. Chinese module C-type LCD graphic display instructions

[4] Shenzhen Weifan Technology Co., Ltd. SD2000C application circuit and program