Research on Networked Motion Control System Based on CAN Bus
2026-04-06 05:11:43··#1
Abstract: With the development of computer technology, motion control systems are moving towards networked control after their widespread application. This paper mainly discusses the limitations of traditional motion control systems, analyzes the communication characteristics of fieldbus motion control systems, proposes a multi-axis motion control system based on CAN bus, and finally designs a hardware and software system for CAN bus communication based on SJA1000. Experimental results show that the system has advantages such as simple connection, reliable communication, good real-time performance, and ease of implementation. Keywords: Motion control; CAN bus; Bus communication; SJA1000 [b][align=center]Research of networked motion-system based on CANbus SHU Zhi-bing, ZHANG Jie[/align][/b] Abstract: With the development of computer technology, motion control systems are widely used, and network-based systems are deeply researched. This paper discusses the drawbacks of conventional motion control systems, analyzes the communication characteristics of fieldbus control systems, and designs a motion control system based on CANbus. Finally, it presents the hardware and communication software design of CANbus based on SJA1000. The system is proven to be simpler to connect, more reliable, and easier to implement experimentally. Key words: Motion control; CANbus; Communication; SJA1000 1 Introduction A motion control system takes the driving device of mechanical motion—the electric motor—as the controlled object, the controller as the core, and power electronics and power conversion devices as the actuators. The electric drive control system is composed under the guidance of automatic control theory. In the electrical age, electric motors have always played a very important role in modern production and life. In recent years, due to the large-scale growth of the market for electronic manufacturing equipment such as semiconductor manufacturing equipment, the motion control system of machine equipment has the following technical requirements: (1) Multi-axis motion control. Due to the increase in automation, the number of axes required on a single machine has increased. It is common for a machine to have more than a dozen axes. With the increase in the number of axes, how to coordinate the movements of each axis is an important issue. (2) Small size. Due to the limitation of factory space, the size of the machine should be as small as possible. The size of the controller inside the machine is required to be smaller and smaller, and the wiring space is also smaller and smaller. (3) More precise. As the semiconductor process has been refined to below 100nm, the motion precision required for process and testing related equipment must also be more precise. Other equipment such as LCD equipment and SMD process equipment also have the same requirements. (4) More stable. Because the investment in all equipment is substantial, the cost of system downtime becomes even more prominent. Therefore, all machine equipment manufacturers must pursue system stability. They must also consider the ability to quickly replace damaged components without errors. A comprehensive analysis of these requirements reveals a seemingly conflicting demand: multi-axis motion control within a single controller, smaller controller size, and easier wiring and maintenance. It can be said that fieldbus technology arose to meet the needs of these new machines. 2. Communication Characteristics of Fieldbus Motion Control Systems Fieldbuses used for motion control employ two communication control strategies: event-triggered and time-triggered. In event-triggered mode, after the control unit detects an event, it calculates the correct response according to a predetermined algorithm and then sends the response information to the digital servo drive. The delay between the event occurrence and the reception of the response information must be finite; that is, the maximum value must be known, and its value is the real-time performance indicator of the communication protocol. However, events in event-triggered systems are random and unpredictable, leading to uncertainty in fieldbus communication. Stations in the system may compete for the transmission medium, causing communication conflicts and unreliability, making it difficult to guarantee high real-time performance. Event-triggered systems are typically aperiodic, making aperiodic data transmission the simplest implementation. However, periodic data transmission can also be used, in which case it's necessary to identify which period's data is valid. Time-triggered systems are usually periodic, with the control unit periodically calculating control data and then promptly sending it to the servo driver. Control and communication are driven by a global clock, ensuring the system's behavior is deterministic not only functionally but also temporally. Stations do not compete for the transmission medium, making the entire system reliable. In time-triggered control, the communication cycle time should equal the control cycle time, or be divisible by it. In periodic time-triggered systems, the communication cycle time must be fixed and free from significant fluctuations; that is, data transmission must be deterministic, also known as real-time performance. In general, the performance requirements of fieldbus communication protocols used for motion control are threefold: (1) Reliable communication to suit the harsh environment of industrial sites; (2) Real-time data transmission. Both periodic and non-periodic data transmission must have high real-time performance, with a response time typically of (1~10) ms. (3) Synchronization of command execution and status feedback. In order to achieve synchronous motion accuracy of each axis, each axis must execute position control commands and sample the current position simultaneously after receiving the command value, and send it to the control unit. 3 Overall Design of CAN Bus Motion Control System CAN bus (Controller Area Network) is a common application. Data transmission and control via CAN bus make the performance of servo motors more stable and can be applied to motion control systems more effectively and flexibly. As shown in Figure 1, the motion control system based on CAN bus has two significant characteristics compared with the typical structure of the control system. First, its controlled object is a servo motion control object, and second, its networked controller includes two parts: CAN bus communication medium and CAN controller node. Multiple CAN controller nodes are interconnected in parallel via the CAN bus communication medium to form a single-layer CAN bus-based servo motion control system. When more axes of motion control are needed, simply add new motion control nodes and connect them as new CAN bus nodes to the CAN bus to form a distributed multi-axis motion control system, without requiring any hardware modifications to the original motion control nodes. It can also be interconnected with IE (Industry Ethernet) or Intranet/Internet via an Internet gateway to form a multi-layered networked servo motion control system. The design of the CAN bus-based motion control system mainly focuses on the design of the CAN controller nodes, including both hardware and software. Hardware design mainly involves selecting appropriate chips and hardware circuits to design the five basic components of the CAN controller node shown in Figure 1: the main controller, the interface module between the main controller and the sensor/actuator, the interface module between the main controller and the CAN bus controller, the CAN bus controller, and the CAN bus transceiver. Software design mainly involves selecting appropriate system software and application development software to design various interface driver software, system management software, and control function software. 4 System Hardware Design The main controller uses the AT89C51 microcontroller as the processing core and the PCA82C250 as the CAN bus transceiver. Figure 2 shows the circuit diagram of the CAN bus system based on the SJA1000. To enhance anti-interference capability, the TX0 and RX0 pins of the SJA1000 are not directly connected to the TXD and RXD pins of the PCA82C250, but are connected to the PCA82C250 through a high-speed optocoupler 6N137. This achieves electrical isolation between the CAN nodes on the bus. The two sides of the optocoupler 6N137 use two completely independent power supplies, VCC and +5V. The interface between the SJA1000 and the microcontroller is relatively simple. AD0-AD7 are directly connected to the P0 port of the AT89C51. The RD, WR, and ALE signals are also directly connected to the corresponding pins of the AT89C51. MODE is connected to +5V to set the SJA1000 controller to Inter1 mode. The SJA1000's chip select signal CS is determined by the P2.0 pin of the AT89C51. Therefore, the SJA1000's address space in the system starts from address 0. This address plus the offset of the SJA1000's internal register address can be used to access the SJA1000's internal RAM space. The SJA1000's interrupt output signal INT is connected to the INT0 pin of the AT89C51, allowing the AT89C51 to respond to message transmission and reception in interrupt or polling mode. 5. System Programming The process of establishing communication based on the SJA1000's CAN bus includes system initialization, receiving, and transmitting. 5.1 SJA1000 Initialization Program After power-on, the AT89C51 first runs its own reset program, and then calls the SJA1000 configuration program. Before setting the SJA1000 registers, the configuration program must check whether the SJA1000 is in reset mode by reading the reset mode/request flag, because the registers to be written to with configuration information can only be written in reset mode. In the initialization program, the SJA1000 is first set to reset state, and then the SJA1000 is set to use PeliCAN mode, with the CLKOUT pin output frequency being 1/2 of the external crystal oscillator frequency, in single acceptance filter mode. The SJA1000 initialization flow (diagram omitted). When clearing the SJA1000's reset mode/request flag to enter working mode, it is necessary to first check whether the flag has been cleared and whether working mode has been entered before proceeding to the next step. After entering working mode, the CAN controller's interrupt can be enabled, and normal message sending or receiving begins. 5.2 SJA1000 Message Transmission and Reception According to the CAN protocol specification, message transmission is independently handled by the CAN controller SJA1000. During message transmission, the AT89C51 microcontroller must send the message to be transmitted into the system transmit buffer. Before moving the data from the system transmit buffer to the CAN controller transmit buffer, it must determine whether the transmit buffer has been released. Message reception is also independently handled by the CAN controller SJA1000. Received messages are stored in the receive buffer, and the receive buffer status flag RBS and receive interrupt flag RI in the status register are set. If message reception is enabled, the microcontroller can read new messages from the receive buffer and store them in the microcontroller's memory or external data storage, then release the receive buffer. The SJA1000 message reception process can be controlled by an SJA1000 interrupt request or by querying the SJA1000 control segment status flags. 6. Summary This paper analyzes that traditional motion control systems no longer meet the requirements of electronic manufacturing equipment and the communication characteristics of fieldbus motion control systems. A networked motion control system scheme based on the SJA1000 CAN bus is proposed, making a valuable new exploration for the networked research and application of AC servo systems. The CAN bus can well meet the high requirements of fieldbus motion control systems for real-time response, and the use of the CAN bus also gives the system excellent scalability. This lays a solid foundation for the development of multi-axis or multi-point distributed motion control networks. References: 1. Rao Yuntao, Zou Jijun, Zheng Yongyun. Fieldbus CAN Principles and Application Technology [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003. 2. Shu Zhibing et al. AC Servo Motion Control System [M]. Beijing: Tsinghua University Press, 2006. 3. Yang Jinyan, Zheng Yingqiang, Zhang Zhenren. Data Transmission Expansion Technology and Application Examples [M]. Beijing: Posts & Telecom Press, 2005.