Share this

Servo motor communication control based on CAN bus

2026-04-06 03:51:54 · · #1
Abstract: This paper introduces the characteristics of CAN bus and servo motor, and discusses the communication and control characteristics of servo motor based on CAN bus. Keywords: servo motor; servo controller; CAN bus 1 Introduction CAN (Controller Area Network) bus is a serial communication local area network that effectively supports distributed control or real-time control. Due to its high performance, high reliability, good real-time performance and unique design, it has been widely used in data communication between various detection and actuators in control systems, and its application has become increasingly popular in the industrial control field. Servo motors have excellent characteristics such as compact structure, easy control, stable operation and fast response, and have increasingly become an important actuator in modern industrial automation systems. They have been widely used in important industries such as printing machinery, papermaking machinery, textile machinery, industrial robots, high-speed elevators, and CNC machine tools, where the degree of automation is high and precise control of speed, position, torque, etc. is required. Servo motors produced by Lenz GmbH in Germany provide a CAN bus interface, making it easy to connect to the CAN bus for data transmission and control, expanding the function and application range of servo motors, and enabling servo motors to be better and more flexibly applied in modern industrial control systems. 2. Characteristics of CAN Bus As a network specifically used in industrial automation, CAN bus has the following advantages: (1) Simple and convenient to use. Many CAN controller chips, such as SJA1000T and Philips 82C250, implement most of the CAN physical layer and data link layer. When using it, the user only needs to do two things: initialize the CAN controller and perform data transmission and reception operations on the CAN bus. (2) High efficiency and reliability. CAN adopts a short frame structure, and the data field length in the data frame is at most 8B, so the transmission speed is fast (the maximum communication rate can reach 1Mbps) and the probability of interference is low. At the same time, as a multi-master node, the CAN bus obtains bus control through bus arbitration and has a complete error handling mechanism, which ensures the safe and reliable transmission of data under various interference environments. (3) Good system expandability. CAN bus is message-oriented encoding, not device-oriented encoding, so it is very convenient and flexible to add or delete nodes on CAN, and it is easy to expand the system. 3. Servo Motor Connection to CAN Network: Lenz servo motor controllers, due to their dedicated X4 CAN bus interface, can easily connect to CAN bus-based industrial control systems using ordinary twisted-pair cables, just like other CAN nodes. Lenz servo controllers and servo motors establish feedback through a rotary transformer or photoelectric encoder, forming a high-precision servo control system. The servo motors upload their operating status and information to the servo controllers in real time. As nodes on the CAN bus, servo controllers can communicate with the host computer, receiving various operation, control, and parameter setting commands via the CAN bus. Simultaneously, servo controllers can also exchange data rapidly with each other, establishing coordination or control relationships. The host computer gains CAN bus support by connecting a CAN-enabled communication adapter card and is responsible for monitoring and managing the operation and status of the entire system. As the application of CAN bus in industrial control becomes increasingly widespread, many companies have launched interface adapter cards supporting CAN bus, such as Advantech's PCL-841 communication card, Beijing Huakong's HK-CAN20 communication card, and Beijing Sanxingda's intelligent CAN-PC bus adapter card PCCAN, etc. Users can use these interface adapter cards to run complex communication tasks and perform digital communication and coordination management between various CAN nodes and the host computer. The servo controller's functional modules and CAN bus-based data channels: Lenz servo motor servo controllers have a rich library of internal functional modules, such as common logic function modules, arithmetic function modules, signal type conversion modules, ramp function generation modules, phase integration modules, and more specialized digital-frequency input/output modules, digital-frequency processing modules, servo control processing modules, speed setting processing modules, etc. Users can freely configure the controller's signal flow using these functional blocks, making the controller easily adaptable to different practical applications. To realize CAN bus-based applications, the servo controller provides dedicated CAN bus functional module groups CAN-IN and CAN-OUT as process data channels for process data transmission. Function blocks CAN-IN1 and CAN-OUT1 are used solely for communication and data transmission between the servo controller and the host computer. The input function block CAN-IN1 receives data from the host computer. CAN-IN1 has 8 bytes of data space available for user configuration, and can provide various control signals, including binary signals, 16-bit analog signals, 16-bit speed signals, and 32-bit phase signals, to other internal functional modules. The host computer can send commands to the CAN-IN1 module configured according to the actual application to achieve various functions such as servo motor speed setting, motor fast stop, motor forward/reverse switching, switching between normal mode speed and constant low speed, motor enable, and motor disable. Similarly, the CAN-OUT1 function module also has 8 bytes of data space available for user use, and can be configured to provide the host computer with various motor status information, actual motor speed, and actual motor phase information in real time. Function blocks CAN-IN2, CAN-IN3, CAN-OUT2, and CAN-OUT3 are used for rapid data exchange between servo controllers. By configuring the correspondence between the CAN-OUT2 or CAN-OUT3 of one servo controller and the CAN-IN2 or CAN-IN3 of another servo controller, a data transmission channel between servo controllers can be established. During motor operation, various data information from one servo controller is transmitted to the other. A common example is using the speed command from one servo controller, after certain calculations, as the speed command signal for another servo controller, enabling the two servo motors to operate at proportional speeds. This feature is crucial for the coordinated control of multiple servo motors. The host computer can also monitor this type of data information transmitted on the CAN bus. Simultaneously, the servo controller provides two parameter input channels and two parameter output channels. On the CAN bus, the host computer can set and modify various parameters within the servo controller through the two parameter input channels, such as the acceleration and deceleration times of the servo motor, the gearbox gear ratio, cascade coefficients, etc.; and read various parameters of the servo controller through the two parameter output channels, such as the current temperature of the servo motor, the currently configured acceleration and deceleration times, and the actual voltage and current of the motor, etc. Therefore, basically any parameter that can be found in the servo controller's parameter code table can be read. Through the CAN bus interface and various data channels, the servo motor can send its relevant data information to the CAN bus; simultaneously, it can also receive various data information and control commands required by the servo motor from the bus. 5. CAN Communication Protocol As a low-level network for industrial control with high real-time requirements, the CAN protocol is divided into only three layers: physical layer, data link layer, and application layer. The CAN communication protocol has four different frame formats: data frame, remote frame, error frame, and overload frame. Since the CAN communication protocol only provides general requirements, in practical applications, the protocol needs to be specified, and applicable protocol rules need to be established. Based on the characteristics of the servo motor servo controller and following the CAN communication protocol standard, the communication protocol rules for the servo controller were formulated. Each information frame of the servo controller is divided into two parts: a frame header and a data field. The frame header occupies 2 bytes, with the first 11 bits being the identifier, followed by one RTR bit, and finally four data length bits (DLC) (i.e., the actual length of the data sent, in bytes). The data field occupies 8 bytes. The 11-bit information identifier reflects the node's priority level, and bus arbitration is implemented through it. The smaller the identifier of the information frame, the higher the priority of the information frame. Except for special information such as bus status, the servo controller has a specific formula for calculating the identifier of the transmitted information: Information Identifier = Base Identifier + Set Controller Node Address. The servo controller's node address can be set in the parameter code table. The servo controller has unified regulations for the base identifier of the information. For example, the base identifier for the synchronization trigger signal is 128, the base identifier for information from the controller's CAN-OUT1 channel is 384, the base identifier for information sent to the controller's CAN-IN1 channel is 512, the base identifier for information sent to the controller through parameter channel 1 is 1536, and the base identifier for information received through parameter channel 1 is 1408. For the 8-bit data field, the user needs to determine the usage principles to be followed according to the specific information to be sent. For example, when setting parameters through a parameter channel, the first byte is the command code, the second and third bytes are the index number corresponding to the parameter, the fourth byte is the secondary index corresponding to the parameter, and the last four bytes are the size of the parameter data to be set. However, when sending information to the process data channel CAN-IN1 of a servo controller, it directly sends data information without a command code or index number. 6. Software Design of the Host Computer For servo motors that communicate and control via the CAN bus, after configuring the internal control signal flow of the servo controller, as well as the CAN-based interface function modules and data channels according to the actual application requirements, the remaining issue to be addressed is the software design of the host computer. Since the CAN communication adapter card connected to the host computer generally provides CAN driver functions, the communication part with the CAN bus can be directly called during the development of the host computer software. For example, the main tasks of the host computer's communication with CAN—initializing the CAN adapter card, sending CAN information packets, and receiving CAN information packets—all have readily available functions, providing convenience for users to communicate using CAN. Initializing the CAN communication adapter card mainly involves initializing its various registers, setting necessary parameters such as interrupt vectors, baud rate, and interrupt mask, to prepare for normal communication. To transmit CAN packets, the 11-bit information identifier of the packet is first determined and filled into the frame header. The data to be transmitted is then entered into the data field, and the packet is sent to all CAN nodes or a specific CAN node via the transmit function. For CAN packets received using the receive function, their source is determined by their 11-bit information identifier. The data in the data field is processed to obtain valid information, which is then displayed or stored, and control commands are sent as needed. The software control flowchart is shown in Figure 2. The host computer continuously calls the CAN drive function to send control commands or parameter setting commands to the servo controllers of each servo motor, driving the servo motors to start and stop. Simultaneously, it receives various data and status information from the servo controllers, such as speed, phase, rotation direction, and torque, and analyzes and processes this information. Then, according to the actual control needs of the system, it sends corresponding commands to the servo controllers to drive the motors, ensuring that the servo motor operation always changes according to the user's requirements, thereby achieving management and control of the servo motors. 7. Conclusion The introduction of the Lenz servo motor CAN interface improves the automation level of servo motors, making communication and control of servo motors in industrial control networks more convenient, flexible, and reliable. The increasingly widespread application of the CAN bus in modern industrial control systems provides broad application prospects for servo motors with CAN interfaces.
Read next

CATDOLL Nanako 109CM TPE (Soft Silicone Head with Pale Tone)

Height: 109cm Weight: 15.6kg Shoulder Width: 26cm Bust/Waist/Hip: 52/50/57cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22
CATDOLL Tami Soft Silicone Head

CATDOLL Tami Soft Silicone Head

Articles
2026-02-22
CATDOLL Chu Soft Silicone Head

CATDOLL Chu Soft Silicone Head

Articles
2026-02-22
CATDOLL 102CM Ling Anime Doll

CATDOLL 102CM Ling Anime Doll

Articles
2026-02-22