


Summary:The PLC batching system of the storage tank includes five stages: feeding and waiting, weighing, discharging and waiting, discharging and returning.Establish mutual communication protocol through the host computer and PLC.After the PLC control is executed, the data is sent back to the host computer.If there is a communication failure, the PLC enters the offline working state, and the host computer is responsible for restoring communication.
The weighing and dosing system is an important part of the tank mixing production process. Due to the poor environment at the feeding site, it is not suitable for manual control by the operator directly on site. And kettle mixing production of talcum powder (mainly used to remove slag S, P, etc.) dosage, manual weighing time is long, and in the end of mixing in order to adjust the composition of the diethylenetriamine, adding titanium dioxide powder, iron powder, etc., expensive, I hope that the weighing of the deviation of a small, due to the process of charging most of the repetitive operation, the operation of the locks, the operators work with high labor intensity, often overweight and other mishandling of weighing The operation is cumbersome and labor-intensive for the operator, often resulting in misoperation such as overweight weighing, which causes unnecessary production heat downtime. Therefore, how to shorten the dosing time, improve the accuracy of alloy dosing, reduce the mixing cost, reduce the operator's work intensity is an urgent problem. Domestic has studied some automatic dosage, most of them are based on single-chip computer, poor stability, safety and reliability is not high, as well as programming and human-computer interaction difficulties. In addition by the mixing production process and equipment limitations, the development of a set of fully functional automatic batching system, not only the control process is complex, but also a huge investment in equipment. On the other hand, considering that most of the existing AC storage tank mixing adopts PLC control system, if we make full use of the existing PLC resources, we can use PLC as the main control and ordinary PC as the upper computer, and utilize the pipeline technology of WIN9X and the interrupt communication mechanism of PLC to ensure the real-time communication between the upper PC and PLC. Through the electronic scale to collect weight signals directly, automatic control of weighing, the operator through the keyboard or mouse in the host computer human-machine interface (HMI) to enter charging information (charging type, weight, etc.), monitoring the whole process of charging control, printing the results of charging and production reports, to achieve the charging process of measurement, control and management of integration, is not a practicable and effective method.
1 Control strategy for feeding process
Automatic dosage system consists of 8 high level bins, valves, vibration material motor, an electronic scale and weighing trolley, as well as a set of position detection devices.
The feeding process includes five stages: feeding waiting, weighing, discharging waiting, discharging and withdrawal. In the feeding waiting stage, the trolley stops at the position of the feeding port after the reactor and waits for the control command. In the weighing stage, according to the feeding parameters input by the operator, the trolley automatically walks to the specified material position, locks the position when it is in place, and the vibration motor of the silo opens to vibrate the material. Through the electronic weighing continuously collect the amount of feed, when the feeding set value reaches a set value of an amount of time in advance to stop, where the amount of time in advance can be calculated by turning off the motor to stop the vibration of the time or based on experience. When the added material is slagging agent (such as talcum powder, alumina powder, etc.), it immediately enters the discharging stage, otherwise it enters the discharging waiting stage, and the trolley stops where it is, waiting for the arrival of the discharging order. In the discharging stage, the charging trolley automatically walks to the charging port in front of the kettle or the charging port after the kettle according to the type of charging, opens the charging valve after the trolley is in place, and the trolley stops automatically at the waiting position for charging (i.e., after the kettle) after the completion of discharging and waits for the next charging. When there is a misoperation of charging or there are leftover materials in the trolley, then it will carry out the refunding program.
Feeding real-time control process is completed by a Siemens 115U PLC controller, and at the same time use the communication with the upper PC, in the upper computer to complete the feeding parameter settings, data management, statistical reports, printing and other functions.
Considering the importance and safety and reliability of the automatic feeding system, the original means of manual feeding operation is still retained, thus the automatic feeding system has two working modes: automatic control and manual operation. In the automatic mode, the operator only needs to input a small amount of information such as the type (bin number) and weight of the feeding material, and the PLC system automatically completes the whole process of weighing and feeding. In manual operation mode, it is completely by the operator to complete manually.
2 dosage hardware composition
The hardware structure of the mixer mainly consists of UPS, PC, printer, serial conversion card and PLC, electronic scales, valves, motors, position detection devices and other actuators. The upper computer communicates with PLC through RS232/RS485 serial conversion card to transmit data in a high-speed, stable and accurate way.
For security reasons, two PCs are powered by UPS and work in hot backup mode, so that the dosage system can still run reliably if any one of the PCs fails. All the field equipment control work is done by PLC, the upper computer is only responsible for providing human-computer interaction interface, dosage data input and display, storage, statistics and report printing. When the two upper computer fails at the same time, the PLC automatically switches to manual operation mode, which can still ensure the normal production. At the same time, the PLC is equipped with a battery, which can save all the system setup parameters and field status data. During the system operation, PLC has been communicating with the upper computer in real time, so as to ensure the consistency between the data displayed on the interface and the actual data on the site, and the operation commands and setting parameters issued by the operator on the upper computer can be sent to PLC in real time for execution.
3 dosage soft meter overall design
Mixer software includes two parts: the host computer and PLC. These two parts are written separately, and establish the communication protocol between each other. The host computer and PLC have their own function modules, the host computer through the communication subroutine, PLC through the communication interrupt subroutine through the RS232/RS485 serial bus conversion card to establish a communication link between each other, the data in the form of frames in the transfer between the two.
In order to take into account the communication speed and execution efficiency of the automatic feeder, the data communication format between the upper PC and PLC is equipped with two kinds of data frames, i.e., query frame and control frame, the query frame requires only one identification byte, and the control frame contains control information and requires 128 bytes or more. These two types of data frames are described as follows:
① Control frame ---- more than one byte. The first byte is the identifier, the value is 0. The following bytes contain all the control information, such as material level number, material weight, discharge port selection, lead time, whether to calibrate the scale, whether to pause, etc. The format is shown in Figure 4A. The format is shown in Figure 4A:
② The query frame ---- contains only one identification byte with a value of 1
The handshaking mechanism between the host computer and PLC is as follows:
PLC always receives the data frame from the host computer in interrupt mode. If it is a query frame, it immediately transmits the current control information to the upper computer; if it is a control frame, it waits for the execution to finish and then sends back data to the upper computer. If the communication fails, the PLC goes offline and the host computer is responsible for restoring the communication.
In order to maintain the consistency of parameter settings and control status between the host computer and PLC, PLC is responsible for saving all the system setup parameters and field status data. When the host computer is first turned on, it first sends a query frame to get the actual status data of the current PLC (including field data and system data previously set by the operator). Then the host computer sends commands to PLC all the time: if there is a control action, it sends a control frame; if not, it sends a query frame. Under normal circumstances, the PLC receives the query frame from the host computer and immediately sends a data response frame with the same format to the host computer. Since the PLC has been executing the main program in a loop, while handling the communication with the upper computer in an interrupt mode, and this interrupt has the highest priority, thus ensuring that the control commands of the upper computer can be responded to in a timely manner.
3.1 `Upper computer software
The upper computer is divided into main module, dosing parameter setting, process screen, statistical report, communication and other modules. It is mainly for feeding parameter input, process screen display, statistical report, printing and database generation and maintenance. In order to real-time, high-speed and stable communication between the host computer and PLC. The upper computer sets up a separate communication subroutine, which runs independently in the background, and the data exchange between the main program and the communication subroutine is realized through the pipeline. The upper computer software is realized by VB6.0 with good graphical user interface on Win95.
3.2 Main Program
The main program carries out unified management for each module and is responsible for the initialization of the whole system, setting of charging parameters, data updating of the process simulation screen and statistical reports, printing, database generation and maintenance, and so on.
In order to make the process simulation screen intuitive and simple, not easy to make mistakes. The interface design adopts the method of integrating the state display and operation key. That is, the control on the screen has been real-time display of the actual state of the corresponding object, while the operator can click on the mouse to directly select the material and enter the material weight and other parameters, and the data uploaded by the PLC for the refresh of the screen state.
In the database management, in order to facilitate statistical analysis and reporting by workshop or operation area personnel, three types of forms (i.e., daily, monthly and yearly) are designed. And the tables are named by date, such as: Day19990903.db, Month199909.db, Year1999.db, etc.. Meanwhile, in order to facilitate the labor competition and production index comparison between shifts, the database management has set up the operator shift signing system, for which two forms (i.e. monthly and yearly statements) have been set up, and the production of each shift is recorded in their respective monthly and yearly statements, which are named A199909.db, A1999.db, B199909.db, A1999.db, B1999.db, B1999.db, B1999.db, B1999.db, B1999.db, B1999.db, and B1999.db. ,B1999.d
b...... and so on. Such database design facilitates horizontal comparison between shifts, and is also conducive to production reports and statistical analysis of the entire reactor production.
3.3 Inter-process communication and synchronization
The weighing and feeding machine uses the anonymous pipeline provided by WIN95 in the software in order to realize the communication between processes. The pipe is first created by calling the CreatePipe function in WIN32API. This function returns two handles, one for reading and one for writing. In the main process, after the establishment of the pipe, you need to pass the handle to the communication sub-process, the sub-process can read the data in the pipe. Since anonymous pipes can only pass data in one direction, in order to realize the communication sub-process to pass data to the main process, in the sub-process also need to create a pipe, and pass the read handle to the main process. The easiest way to accomplish this operation is to use the standard input and standard output handles that each program uses by default. By setting the standard handles in the master process, which the child process inherits from the master process, two-way communication between the master process and the communicating child process can be achieved by setting the handle of the pipeline created by the child process to the standard handle and having the master process inherit it. When a process writes data to the pipe, the write operation returns immediately, thus ensuring real-time high-speed data transfer between the master process and the communicating subprocesses. Due to the unidirectional nature of the Windows anonymous pipe data transfer, it ensures that no conflict arises between the master process and the communication sub-processes, and handles the synchronization problem of inter-process communication very well.
3.4 Communication subroutine
The communication subroutine is the link between the upper PC and the PLC. It is responsible for ensuring that setting data and control commands from the user of the main process are sent to the PLC in a timely manner, and then refreshing the communication pipeline according to the data sent back from the PLC.
Communication between the communication subroutine and the PLC using serial communication, commonly used serial communication methods are two: one is to call the Windows API function, its programming is cumbersome, the use of more complex; the other is to use the VB6.0 serial communication control (i.e., Windows MSCOMM32.OCX6.0), the control to achieve asynchronous communication in two ways: that is, query mode The control realizes asynchronous communication in two ways: query and event-driven. Considering the reliability requirements of real-time control, event-driven communication is chosen. This is a very powerful serial communication method, which can detect the occurrence of communication events at any time to ensure the high reliability of communication.
4 Conclusion
This weighing and batching machine upper computer and PLC between the use of strict algorithmic control, pipeline communication technology, reducing the amount of system communication, improve the speed and efficiency of communication. The upper computer image intuitive process simulation drawing.