1 Introduction
Steelmaking and metallurgical enterprises are pillar industries of the national macro-economy, but also major electricity consumers, making their energy-saving potential undeniable. Currently, although most steelmaking and metallurgical enterprises use digital meters, manual meter readings are still employed, resulting in a lack of real-time monitoring and control of electricity consumption and prominent energy regulation issues. Therefore, achieving automatic metering, data collection, and networked management of electricity is an inevitable path for steelmaking and metallurgical enterprises.
Compared to RS-485, the CAN bus offers advantages such as high real-time performance, high reliability, and strong security. Compared to other fieldbuses, the CAN bus exhibits outstanding reliability, real-time performance, and flexibility. This paper utilizes the CAN bus to achieve real-time data acquisition from digital meters and manages the data via the internet to achieve energy conservation and efficiency improvement in steelmaking and metallurgical enterprises.
2 System Overall Design
The overall system architecture is shown in Figure 1. The main server is equipped with an Oracle database to store data from various nodes in the industrial field. Regional host computers are equipped with an Access database for temporary data storage and backup; the database is periodically emptied. Digital data collected from various data acquisition nodes (i.e., digital meters) in the distributed industrial field is transmitted to the regional host computers via the CAN bus, and then from the host computers to the main server via the internet. The main server performs statistical analysis on the collected data and uses appropriate algorithms to obtain processing results. Control commands are then transmitted to the corresponding regional host computers via the internet, and the host computers then transmit the data to the respective control nodes via the CAN bus. In the entire fieldbus control network system, the field intelligent device layer is the core of the entire network system. Only by ensuring reliable, accurate, and complete data transmission between bus devices can the upper-layer network obtain information to realize its monitoring functions. Therefore, this paper mainly introduces the communication and control between field devices.
3. Distributed monitoring system based on CAN bus
3.1 Introduction to CAN Bus
CAN bus is a data communication protocol standard developed by Bosch, a German company, to solve the data exchange problem between control and testing instruments in modern vehicles. CAN bus conforms to the ISO/OSI model and consists of three layers: the physical layer, the data link layer, and the application layer. CAN communication media can be twisted-pair cable, coaxial cable, or fiber optic cable, and can be easily connected via standard connectors. The transmission rate can reach 1 Mbps (communication distance <40m), and the maximum direct transmission distance can reach 10km (communication rate <5kbps). Up to 110 devices can be connected within the same bus segment. Currently, CAN is the only fieldbus that has achieved international standardization.
3.2 Partitioning of CAN Nodes
Each CAN bus subsystem adopts a master-slave distributed structure. The master node is the CAN gateway, and the slave nodes are divided into data acquisition nodes and control nodes. The CAN gateway is used to complete the communication between the CAN bus and the host computer (PC); the data acquisition nodes are used to collect field data, mainly including: phase A voltage, phase B voltage, phase C voltage, phase A current, phase B current, phase C current, frequency, power factor, reactive power, active power, and acquisition time; the control nodes mainly complete the control commands transmitted by the host computer. The distributed monitoring system is composed of the data acquisition nodes and control nodes distributed throughout the plant area. It communicates with the host computer through the CAN gateway, and the host computer is connected to the system master server through the Internet to realize data acquisition, information processing, and networked control in the industrial field. Figure 2 is a hardware node diagram of a CAN bus subsystem.
3.3 Development of the CAN communication protocol
In the CAN subsystem, the message structure adopts the standard frame structure of the CAN 2.0b protocol. A data frame consists of seven different bit fields: Start of Frame, Arbitration Field, Control Field, Data Field, CRC Field, Acknowledgment Field, and End of Frame. The Arbitration Field consists of an 11-bit identifier (ID28–ID18) and RTR bits, sent sequentially from ID28 to ID18, and the high 7 bits (ID28–ID22) cannot all be recessive. Based on the bit-by-bit arbitration principle of the CAN bus and the characteristics of each part of the distributed monitoring system, the 11-bit identifier of the Arbitration Field is designed as follows.
(1) ID28 to ID26 are defined as priority levels. Levels 0 to 7 can be specified, with the node with the highest priority sending data first. When messages of the same priority level are sent simultaneously, arbitration continues bit by bit within the arbitration domain until a node wins.
(2) ID25 to ID24 are designated as high-speed and low-speed CAN identifiers. They are used to distinguish between high-speed and low-speed CAN messages. 00 indicates high speed and 01 indicates low speed.
(3) id23~id18 are used for the classification of node signals and can be reserved for allocation when making specific network configurations.
4 System Hardware Design
4.1 Hardware Circuit Design of CAN Bus Node
CAN bus hardware nodes are divided into master nodes and slave nodes. The master node is a CAN gateway, while slave nodes are divided into data acquisition nodes and control nodes. Since the CAN gateway handles a relatively large amount of data, a TI TMS320LF2407 DSP processor with a built-in CAN driver is used. Data acquisition nodes and control nodes only need to acquire and process information relevant to their own node; therefore, Microchip's PIC16F876 microcontroller and MCP2510 CAN controller are used. The PIC microcontroller offers fast processing speed, low cost, and strong anti-interference capabilities, making it suitable for data acquisition and control in industrial settings. The hardware circuit diagrams of the master and slave nodes are shown in Figures 3 and 4.
4.2 Internet Communication Network Design
Internet nodes use ordinary industrial control computers, which can communicate with other host computers and system servers via Ethernet cards, which will not be described in detail here.
5 System Software Design
The system software is divided into main program, data acquisition and processing, output control and display, and CAN bus communication programs. Data acquisition is further divided into programs for digital signal scanning, analog signal acquisition, and pulse signal acquisition. The CAN bus communication program includes CAN initialization, data transmission, and data reception.
5.1 CAN node main program
The main program of the system mainly includes microprocessor initialization, CAN controller initialization, data acquisition and processing, output control and display, etc. The flowchart of the main program of the system is shown in Figure 5.
5.2 CAN bus communication program
The CAN bus communication program includes CAN initialization, data transmission, and data reception. Initializing the CAN controller involves: hardware enabling, software reset, setting alarm limits, setting the bus baud rate, setting interrupt mode, setting acceptance filter mode, setting the operating mode, and starting the CAN. During initialization, it is crucial that the baud rates of the data transmitting and receiving devices are identical; otherwise, communication between the devices will be impossible.
After CAN initialization is complete, the data receiving and sending phase begins. To ensure the integrity of the sent data, a polling method is used; simultaneously, to ensure the real-time performance of the received data, an interrupt method is used. The data sending and receiving flowchart is shown in Figure 6.
When sending data, the data to be sent is packaged into a frame format conforming to the CAN protocol and written to the send buffer, then sent automatically. Before writing to the send buffer, its status must be checked; data is only written if there is free space in the send buffer. After successful transmission, the success of data transmission is determined by checking the CAN status register or configuring a successful transmission interrupt.
When receiving data via interrupts, the receive interrupt must be enabled during the initialization process. In the interrupt service routine, the CAN interrupt enable register is read to check for a receive interrupt flag; if present, the receive buffer is read. To prevent data overflow in the receive buffer, a circular receive data queue can be created to temporarily store the data. The main program then retrieves bus data by querying this queue.
6. Test Results
After installation and debugging, the system has been running stably and reliably for a period of time without any abnormalities. Figure 7 shows the data received by the system's main server, where ady represents phase a voltage, adl represents phase a current, plv represents frequency, wg represents reactive power, yg represents active power, and cjsj represents acquisition time.
7. Conclusion
This paper uses CAN bus transmission technology to solve the signal transmission problem between various components of the data acquisition and control system at the Dagushan Ore Dressing Plant of Ansteel Group. The CAN bus-based data acquisition and control system for the mining plant simplifies the system's transmission wiring, significantly improves system reliability and real-time transmission response, and lays the physical foundation for the enterprise to achieve energy conservation, cost accounting, process optimization, and the establishment of a MES information management system. References (omitted)