Share this

Development of a Control System for a Diamond Synthesizing Machine Based on the Combination of IPC and PLC

2026-04-06 08:48:42 · · #1
Abstract: Taking the transformation of the control system of a diamond synthesis machine as an example, this paper proposes a DCS control system based on the combination of IPC and PLC. In the system design, the upper and lower computers operate independently, and information is transmitted via serial communication. Fault-tolerant technology is introduced, greatly improving the reliability and stability of the system. Object-oriented technology and multi-threading technology are adopted, making system maintenance and upgrades very convenient. More than six months of operation have shown that this control system has greatly improved the control accuracy and quality of diamond products, reduced the labor intensity of operators, and improved the scientific level of management. Keywords: Diamond synthesis machine; Control system; IPC and PLC combination; Serial communication 1 Introduction The traditional diamond synthesis machine control system consists of a PLC and a display terminal. Its disadvantages are as follows: (1) All the work of the system (such as information detection, processing and system control) is completed by PLC, and its control accuracy is poor, resulting in poor quality of synthesized diamond; (2) The plane size of the display terminal is too small, which makes it inconvenient for operators to observe the status of the system, and often causes misoperation; (3) The diamond synthesis process is complex and there are many parameters that need to be controlled, but the original control system cannot save the parameters. When adjusting some parameters according to the requirements of different products and processes, all parameters must be reset each time, which is very troublesome; (4) The interface is not user-friendly; (5) The system cannot automatically assess the work quality of the operators. Therefore, in order to improve the control accuracy and facilitate operation, it is urgent to develop a new control system. In view of the above problems, the author organically combined IPC and PLC to develop a control system. 2 Development of the control system 2.1 System structure and configuration Since the above-mentioned disadvantages exist when using PLC control alone, PLC has high stability and reliability and strong anti-interference ability, which is very suitable for field control; while microcomputer control has high flexibility and convenience, but poor anti-interference ability. Combining the advantages of PLC control and microcomputer control, a new control method of IPC+PLC is proposed, which organically combines IPC and PLC control, and can also utilize existing PLC systems. The most advanced and mature DCS mode is adopted here [1][2]. The control station adopts Siemens' S7-200 system, and the operator station is an industrial control computer with a very user-friendly Windows 98 system. Data transmission between the operator station and the control station is carried out through RS-232 serial communication protocol; in addition, the operator station controls the frequency converter through RS-485 serial port to realize the fine-tuning control function in diamond synthesis. Since the software accounts for a large proportion in this project, and in order to better meet the system functional requirements, the control software and operation software are developed by ourselves, which not only meets the system requirements, improves the system performance, facilitates maintenance and upgrade work, but also reduces costs. 2.1.1 System Structure The newly designed control system adopts the advanced IPC+PLC mode. The operator station consists of an industrial control unit, and the control station consists of a Siemens S7-200. The main functions of the host computer system are: parameter setting, real-time monitoring, adjustment operation and information query. The main functions of the slave computer system are: real-time control, data acquisition, etc. 2.1.2 Hardware configuration There are 20 digital inputs, 19 digital outputs, 1 analog input and 2 analog outputs in this system. The hardware configuration is shown in Table 1. [align=center] Table 1 Main hardware configuration[/align] 2.1.3 System software configuration The development of the entire system software is based on the Windows 98 platform, because Windows 98 has a good user interface, powerful functions, and is widely used and easy to operate. The slave PLC program development adopts SIEMENS' STEP7, which has the following functions: (1) good user interface; (2) hardware configuration and parameter setting; (3) communication definition, mainly time-driven cyclic data transmission and event-driven data transmission through MPI; (4) programming, the provided languages ​​are ladder diagram, function block diagram and statement list; (5) program download, testing, startup and maintenance. The upper computer monitoring software is developed using VC++6.0, which has the following advantages: (1) VC++ and Windows98 have good compatibility and high reliability; (2) It adopts object-oriented technology, and the maintenance and upgrade costs of the software are small; (3) MFC encapsulates many components, and the software development cycle is short and the cost is low; (4) It has powerful functions and can develop high-quality software to meet different needs; (5) It can easily communicate with the PLC through the serial port; (6) The operation interface is user-friendly. 2.2 Application software compilation 2.2.1 Lower computer PLC program The lower computer program is compiled using the ladder diagram method in STEP7 [3], and its functional structure diagram is shown in Figure 1. [align=center] Figure 1 PLC program functional structure diagram[/align] Among them: The difficulty in compiling the lower computer program lies in the compilation of the communication program and the PID control program sub-module. For the communication program module, since the PLC program needs to obtain the set parameters and some control instructions from the upper computer and feed back the field status to the operator. Here, it is necessary to define the communication protocol and the format of the communication instructions. The microcomputer sends instructions to the PLC's PORT0 (or PORT1) port through the COM port. The PLC receives the instructions through RCV, then decodes the instructions, calls the corresponding read/write subroutines to implement the operations required by the instructions, and returns the status information of the instruction execution. For the PID control program module, since the typical PID control algorithm has two drawbacks, namely differential mutation phenomenon and start-up loop phenomenon, the standard PID algorithm has been improved according to the specific field environment and user needs. This paper adopts the parameter self-tuning PID control algorithm, which achieves a good control effect. In addition, the PID control module has good scalability, which facilitates the maintenance and upgrading of the software. 2.2.2 Upper computer monitoring system program The monitoring system program uses VC++6.0 to develop a dialog-type application [4][5], and its functional structure diagram is shown in Figure 2. [align=center] Figure 2 Functional structure diagram of the monitoring system [/align] Among them, the specific work performed by some functional modules in the monitoring system is as follows. (1) Communication module This module realizes the data transmission problem between the lower computer PLC and plays a bridging role between the upper and lower computers. (2) Parameter setting: All parameters required by the control system are set through this module, and parameter settings can be saved and read. (3) Fault alarm: When a fault occurs on site, this module will provide alarm information and reflect it in a timely manner for operators to handle and refer to. (4) Real-time information display: Display the actual value in the current system and compare it with the preset value to judge the quality of the control algorithm and whether the system is working properly. (5) Adjustment operation: Provide users with some manual operation panels so that staff can easily make adjustments and control operations. (6) Report: Record historical data for future analysis and print data at any time for staff to observe the system's operating status. (7) Frequency converter control: This module is used to control the frequency converter to maintain the pressure during the diamond synthesis process and produce high-quality diamonds. (8) Information management system: The information management system is developed using database development technology to register the operator's work, attendance, workload, etc., and provides management functions such as query and summary. Since both the communication module and the inverter control module need to communicate via serial port, a general serial communication class CSerialPort was designed during the software development process. This class encapsulates the basic data and methods of serial communication to solve the communication problems of different types of serial ports such as RS-232 and RS-485. The main member variables and member functions in the CSerialPort class header file are as follows: Class CSerialPort { Private: HANDEL m_hPort; DCB m_Dcb; COMMTIMEOUTS m_TimeOuts; DWORD m_Error; Public: CSerialPort(); // Constructor virtual ~ CSerialPort(); // Destructor // InitPort() function initializes the serial port BOOL InitPort(); DCB GetDCB(); // Get DCB parameters // SetDCB() function sets DCB parameters BOOL SetDCB(); // GetTimeOuts() function gets timeout parameters COMMTIMEOUTS GetTimeOuts(); // SetTimeOuts() function sets timeout parameters BOOL SetTimeOuts(); // WritePort() function performs write operations to the serial port Void WritePort(CString port, CString); CString ReadPort(CString port); // Read operations from the serial port BOOL ClosePort(CString port); //Close serial port}; The important functions of this class are explained below: The `InitPort()` function completes the serial port initialization work, including opening the serial port, setting DCB parameters, and setting the communication timeout. The `CreateFile()` function is used to open the serial port. The `SetDCB()` function is used to set DCB parameters, including the transmission baud rate, whether to perform parity check, the length per byte, and the stop bits. The `WritePort()` function is used to write data to the serial port. Since the system needs to communicate with multiple serial ports, the serial port number is passed as a parameter to this function; this function first encodes the data to be sent (adding checksum to reduce the bit error rate), and then calls the Windows API function `WriteFile()` to send the data to the serial port. The `ReadPort()` function is used to read data from the serial port. It first calls the API function `ReadFile()` to read the data sent by the lower-level machine and put it into a buffer, then processes the data and converts it into a string (CString) type before returning it. 2.3 Solution of several key technical issues in the software design of the control system 2.3.1 Technical issues in the design of the host computer VC++ program (1) Since the host computer and the slave computer need to communicate in real time and the host computer also needs to monitor and display the system in real time, multi-threading technology is adopted in the design of the host computer program. When the monitoring system starts working, the AfxBeginThread() function [4] is used to create an auxiliary thread to manage serial communication. With this design, when serial communication is performed, the main thread can continue to complete the monitoring function and handle other tasks. The main code of the auxiliary thread function is as follows: UINT SerialPro(void* param) { Ccrystal* mdlg=( Ccrystal*)param; CString str; int flag=1; … … //Return if serial port initialization fails //Loop to read and write serial port until the end while(flag) { … … //Assign the data to be sent to variable str here //Write data to serial port mdlg->serial.WritePort(hport, str); _sleep(100); //Let the auxiliary thread sleep for 100 milliseconds //Read data from serial port and assign it to variable str str=mdlg->serial.ReadPort(); … … //Process the data obtained from serial port here} } (2) Since database development was added to the system development, database planning is also a key task. The database development uses SQL Server, and the host computer uses ADO in Visual C++ for database programming. 2.3.2 Technical Issues in Lower-Level PLC Programming The lower-level PLC mainly performs real-time control, so the quality of the PLC program directly affects the overall system performance. Therefore, the control algorithm requires careful design. This paper separates the PID control algorithm into a sub-module. This approach facilitates future maintenance and upgrades; if a better control method is found, only the PID control module needs modification, resulting in lower system maintenance costs. 2.3.3 Communication Program Design between IPC and PLC The IPC and PLC use a master-slave response method. The IPC has transmission priority and issues read/write commands to the PLC as needed; the lower-level PLC passively responds to commands from the upper-level PLC. When the upper-level PLC reads data, it sends a read command to the PLC, which responds and transmits the data back to the upper-level PLC. When writing data, the upper-level PLC sends a write command and data to the PLC, which receives it. If the PLC fails to respond correctly, it returns a failure flag. To establish correct communication between the IPC and PLC, the following steps are necessary: ​​First, define the communication protocol, such as instruction format, and make corresponding settings in the PLC's special registers; second, determine the microcomputer's serial port and set the port parameters for data transmission, such as baud rate, data length, and parity check method; finally, due to the error rate during data transmission, data verification is required, and a self-designed data verification algorithm is used here. 3. Application This control system is applied in a diamond processing plant in Shandong. After more than six months of operation, the control system described in this paper is performing well. Compared with the original simple PLC control system, it has greatly improved control accuracy and the quality of diamond products, significantly reduced the workload of operators, and virtually eliminated misoperation. Now, this control system can automatically record the operators' work status and the quality of the products produced, and can also monitor employee attendance, thus elevating the company's management to a new level. While achieving good economic benefits, it has also achieved good social benefits. 4. Conclusions and Recommendations 1. By organically combining IPC and PLC, leveraging their respective advantages, and utilizing existing equipment, the current diamond synthesis machine control system effectively solves the problem of its inability to meet production needs. This improves the control accuracy and quality of diamond products, achieving significant social and economic benefits. This undoubtedly provides an economical and effective method for the transformation of traditional equipment and control systems. 2. Computer monitoring of operator performance and product quality enhances the scientific level of enterprise management. 3. The application of object-oriented technology in the control system software design reduces future maintenance and upgrade costs, making it suitable for further widespread adoption. 4. The lower-level PLC control system uses a parameter self-tuning PID control algorithm. Other control algorithms, such as fuzzy control, adaptive control, and neural network control, can be adopted based on actual conditions. 5. With slight modifications to the control system, multiple PLC operator stations can be controlled by the IPC as needed. References: [1] He Yanqing. Principles and Applications of Distributed Control Systems [M]. Beijing: Chemical Industry Press, 1999. [2] Lai Shouhong. Microcomputer Control Technology [M]. Beijing: Machinery Industry Press, 1998. [3] Yin Hongye. PLC Programmable Controller Tutorial [M]. Beijing: Aviation Industry Press, 1997. [4] David J. Kruglinshi. Visual C++ Technology Inside [M]. Translated by Pan Aimin et al. Beijing: Tsinghua University Press, 1999. [5] Lin Junjie. Classics of Visual C++6 Programming [M]. Beijing: Science Press, 1999.
Read next

CATDOLL 115CM Nanako TPE (Customer Photos 2)

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22