Design of CAN bus control system for engineering equipment
2026-04-06 06:20:10··#1
1. Introduction The digitalization, informatization, and integrated construction management of engineering equipment represent a current development trend in engineering equipment. Since the 1990s, manufacturing industries in developed countries have been exploring related technologies, with advanced technologies being widely applied in the design of advanced engineering equipment. Simultaneously, intelligent controllers, represented by microcomputers, have been widely adopted, leading to an unprecedented increase in information flow between intelligent nodes. Networking onboard electronic devices according to certain protocols and effectively integrating information to achieve resource and function sharing has become a development trend. Fieldbus technology refers to transforming individual, distributed measurement and control devices into network nodes, connecting them through a fieldbus to form a network system and control system capable of communicating and jointly completing automated control tasks. CAN (Controller Area Network), also known as a control area local area network, is a bus-type serial communication network. First proposed by Bosch in the 1980s, it has been widely used due to its high reliability, strong real-time performance, flexibility, convenience, and ease of testing and maintenance. In the field of engineering equipment, CAT980G loaders produced by CAT (USA), WA380-3 and WA500-3 from Komatsu (Japan), and Kawasaki KLD80ZⅢ (Japan) all adopt CAN bus technology to improve the overall control technology level of the equipment. Based on the technical characteristics of CAN bus, this paper designs an engineering equipment control system based on CAN bus, using distributed intelligent control to improve the control technology and information level of engineering equipment. 2 System Composition and Functional Characteristics 2.1 System Composition Traditional engineering equipment control systems adopt centralized control, and generally lack intelligent capabilities except for the main controller. The CAN bus-based control system adopts distributed intelligent bus control, making each functional module an intelligent terminal, which is then connected via CAN bus and supplemented by a certain communication protocol. This not only improves the reliability and intelligence level of the entire system but also reduces the complexity of the system. The system consists of a main controller, control box, sensors, actuators, and virtual instruments, and all components are interconnected via CAN bus. The main controller is responsible for the information coordination and processing of the system; the operation terminal is the main means for the operator to intervene in the operation process; the sensor is responsible for sensing the status of the system; the actuator is responsible for completing the action processed by the main controller; the virtual instrument provides a visual human-machine interface, which informs the operator of the current status of the equipment in the form of text or graphics; the debugging and diagnostic instrument is responsible for locating the source of system faults. Each module is an independent intelligent terminal. There can be multiple modules, as long as they are assigned different identifiers (ID numbers). The modules are connected in parallel through a 4-core shielded cable. Two of the 4 cores (power positive and power negative) are used to power the terminal, and the other two (CANH and CANL) are used for communication between terminals. The composition of this system is shown in Figure 1. Figure 1 Composition of intelligent control system based on CAN bus 2.2 System functional characteristics Compared with the traditional centralized control system, this control system has the following functional characteristics: (1) Anti-misoperation function. Designers can easily shield the possible misoperations in this system through software programming, and only open the allowed operations. At the same time, they can also issue audible and visual alarms as needed to inform the operator of operation errors; (2) Operation guide function. The intelligent control box and the sharing of system data enable designers to light up the corresponding indicator lights through software programming according to the operation process, so as to inform the operator of the permitted operation. This realizes the "foolproof" operation of the equipment; (3) System self-diagnosis and self-recovery. The intelligent terminal can easily diagnose its own status and send relevant information to the bus for other intelligent nodes to process, so that the equipment user can easily judge the problem without mastering too much professional knowledge; at the same time, for internal errors of the bus, the bus system can automatically recover through its own software (4) Status indication. The current status of the system is displayed through virtual instruments or indicator lights on the control box. (5) Data sharing, comprehensive information, and high reliability. All data of the system can be received on the CAN bus, which can easily realize information sharing, reduce the duplication of data processing, and reduce the requirements of the main controller; at the same time, the CAN bus has the characteristics of low inter-line interference and strong anti-interference ability. The system adopts modular management, and each module is distributed according to its function, which simplifies the wiring and shortens the length of the wire harness, thereby reducing the generation of coupling current and reducing inter-line interference. Meanwhile, in terms of software, the CAN bus adopts short frame transmission, which makes the bus data message have strong anti-interference ability during transmission; (6) Strong expandability, fast product upgrade, and high cost performance. (7) Flexible parameter configuration. Parameters can be configured through the CAN bus. For example, the threshold and control polarity (positive and negative control) of the switch quantity can be set according to the manufacturer's requirements. The analog quantity can be corrected according to the sensor performance curve provided by the manufacturer. The relevant position quantity can also be conveniently calibrated on the bus, shortening the product debugging time. 3 Bus communication protocol design The CAN communication protocol mainly describes the application information transmission method between devices based on basic CAN communication. The definition of the CAN communication layer is consistent with the Open Systems Interconnection (OSI) reference model, but only the bottom two layers are defined: the physical layer and the data link layer. Since the application layer is not specified, the CAN protocol itself is not complete. An application layer protocol is needed to define the identifier (11/29 bits) and the allocation and use of 8 bytes of data in the CAN message. Currently, commonly used high-level protocols internationally include CANopen, J1939, and DeviceNet. However, since engineering equipment typically has few control nodes, it's entirely possible to design efficient application-layer protocols based on its own characteristics. Several practical design methods are given below. 3.1 Message ID Design: When allocating communication identifiers (ID numbers), low ID numbers should be used for critical information frames or frames requiring rapid response, such as the position signals of various operating mechanisms in equipment control that require real-time feedback. High ID numbers should be used for information frames that transmit signals only for monitoring and not for real-time control, such as status information like oil temperature, oil pressure, and vehicle attitude. Furthermore, correctly setting the Acceptance Code Register (ACR) and Acceptance Mask Register (AMR) in the acceptance filter can mask ID number information irrelevant to the node, improving the response speed of valid information. 3.2 Looping and Querying of Messages For critical information frames involved in control, a timed looping method should generally be adopted to ensure real-time information updates. For temporary data services such as software/hardware version queries and parameter calibration, a client/server (C/S) approach is primarily used for message frame transmission. This involves defining specific information frames, and the server processing and sending the corresponding feedback frame upon receiving a parameter query or calibration request from the client. 3.3 Heartbeat Detection When a data source node exits the bus (due to fault or manual exit), the data in the receiving node's corresponding receive data buffer must be reset to prevent data inconsistency and undesirable events. Therefore, the source node is generally required to send a "heartbeat" message periodically. This involves designing a specific information frame or designating a specific bit in the information frame to represent the node's "heartbeat." After the node starts working, it sends a "heartbeat" message frame or changes the high/low level of the defined "heartbeat bit" every certain period. If no "heartbeat" message is received from the node within a certain time, it can be determined that the node is not on the bus, and appropriate event handling can be performed. Figure 2 Data Calibration Flowchart 3.4 Transmission Error Check To improve the reliability of data communication, for critical data frames (such as calibration data frames), a checksum method is used to prevent data transmission errors. That is, the data source node defines the last data byte as the check byte, and uses methods such as cumulative summation and other checksum methods, using the lower 8 bits (i.e., the low-order byte) of the calculation result as the check data value. After receiving the data frame, the data receiving node compares the results through calculation, and only performs the corresponding assignment processing after the result is correct. 3.5 Data Query and Parameter Calibration Data query and calibration adopt a communication method of repeatedly sending control information until specific feedback information is received. The process is shown in Figure 2. 4 CAN Bus Operation Terminal Design Designing the operation terminal as an intelligent node using CAN bus communication can reduce the number of connecting cable cores and improve operational reliability; at the same time, the data transmission content is rich, capable of transmitting status information and message information, improving the level of informatization; and it can increase the communication distance, improving the adaptability of the work. (1) Hardware design is based on the PIC18F458 microcontroller system with CAN bus controller. It is connected to other node buses through the CAN bus transceiver MCP2551. The peripherals include switch input circuit, analog input circuit, digital tube display circuit, switch output circuit, CAN transceiver and power supply circuit, etc., as shown in Figure 3. Figure 3 Hardware principle block diagram of CAN bus operation terminal 5 Main controller design The main controller is the main execution unit for acquiring operation signals. It controls the execution elements of the working mechanism after processing the system's operation signals to prevent misoperation. The main controller adopts the EPEC series high reliability programmable controller (PLC). This series of controllers is widely used in engineering machinery at home and abroad. It has two CAN communication ports and can also be used as a multi-protocol gateway. This type of controller has the following advantages: anti-electromagnetic interference, anti-vibration, oil resistance, strong environmental adaptability, compact structure, good sealing, and self-protection capability. It can work for a long time in harsh outdoor environments and can directly drive a variety of actuators, such as electro-hydraulic proportional valves and servo motors. It is especially suitable for use in mobile equipment. Of course, from the perspective of CAN system operation integration, STW, INTER CONTROL, and other controllers also have good performance, each with its own characteristics, and can be selected according to control requirements. 6. Virtual Instrument Design The virtual instrument is mainly used for terminal display to provide various operational information. A PC104 motherboard is selected as the hardware for the embedded computer system. The hardware configuration table is shown in Table 1. The software uses the real-time VxWorks operating system, and the porting is completed using the VxWorks BSP package. Table 1: Virtual Instrument Hardware Configuration Table. The virtual instrument can complete work status display, sensor data calibration, video display, etc., providing a good human-machine interface. It can also access navigation and positioning information through the RS232 interface, improving the informatization level of the equipment. 7. CAN Bus Debugging and Diagnostic Instrument Design The debugging and diagnostic instrument is based on BIT technology and adopts an embedded system architecture. The hardware is based on an ARM controller. The ARM series processor adopts a 32-bit embedded RISC structure, with internal multi-stage pipelines to improve the execution speed of processor instructions. Its powerful functions, combined with peripheral circuits, integrate signal acquisition, processing, fault diagnosis, and network communication functions, making it particularly suitable as a development platform for intelligent instruments and equipment. The HMS30C7202 is a 32-bit processor based on the ARM720T, encompassing all the basic functions of a PC. It features high performance and low power consumption, abundant on-chip resources, and extremely high integration, making it highly suitable for embedded system applications. The debugging and diagnostic equipment hardware consists of a core module based on the ARM chip HMS30C7202 plus peripheral circuitry, as shown in Figure 4. To fully utilize the efficiency of the ARM chip and improve task-level response time, a real-time kernel µC/OS-II is used for resource management. µC/OS-II is a complete, portable preemptive real-time multitasking operating system with high execution efficiency, small footprint, excellent real-time performance, and strong scalability. The user interface is developed based on the MiniGUI platform, greatly improving human-computer interaction performance. Figure 4 Hardware Architecture of the Debugging and Diagnostic Instrument 8 Conclusion Intelligentization and informatization are the development directions of engineering machinery equipment. Applying advanced fieldbus technology will undoubtedly make the intelligentization and informatization of equipment easier to achieve. The CAN bus-based engineering equipment control system designed in this paper features comprehensive functions, good versatility, and ease of use. Its advanced technical architecture aligns with the overall development trend of distributed intelligent control in engineering equipment control systems. Applications in multiple military and civilian equipment demonstrate the system's reliability, good real-time performance, convenient functional expansion, good maintainability and testability, and promising prospects for widespread application. The innovation of this paper lies in applying CAN bus technology to the engineering equipment control system, enhancing its intelligence, versatility, maintainability, and testability, thereby improving the overall performance of the engineering equipment. Through the integration of related equipment control systems, the application of this technology has already generated nearly 200,000 yuan in economic benefits. References: [1] Zou Kuanming. CAN bus principle and application design [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1996. [2] Yu Xingmin. CAN bus application design in distributed systems [J]. Machinery and Electronics, 2003, (1): 59-61 [3] Liu Jingmeng. Embedded technology and its application in engineering machinery monitors [J]. Engineering Machinery, 2003, 12 (06): 5-8 [4] Shao Zhong. The core of the walking machinery control system - STW controller [J]. Construction Machinery Technology and Management, 2006, (7): 44 [5] Sun Lihui, Yuan Liang. Design of multi-machine redundant system based on CAN bus [J]. Computer Measurement and Control, 2002, 10 (12): 824-826 [6] Wang Biao et al. Design of debugging and diagnostic instrument based on embedded architecture [J]. Engineering Equipment Research, 2006, (6): 19-22 [7] Wang Dayu. Application of CAN bus technology in intelligent bulldozer control system [J]. Construction Machinery, 2005, (6): 82-83 [8] Qi Yongqing et al. Application of PLC based on CAN bus in multi-task collaborative control [J]. Engineering Machinery, 2003, (02): 1-3 [9] Zhou Yongchao, Li Wen, Qu Anlian. Design of virtual instrument based on software engineering [J]. Microcomputer Information, 2005, 11-1: 111-113.