Bus communication method, slave station and bus communication system

The full-duplex communication mechanism enables fast interaction between the master station and the slave station, solving the problems of communication delay and dynamic performance degradation, and improving the performance of the bus communication system.

CN116016010BActive Publication Date: 2024-08-30SUZHOU GAOCHUANG MOTION CONTROL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210977239.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2024-08-30
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

In a master-multiple-slave network structure, the communication cycle between the master station and the slave stations is long, which leads to a decrease in the dynamic performance of the system and a large communication delay, which affects the dynamic performance of the slave station control.

Method used

Adopting a full-duplex communication mechanism, the master station can receive the return data from the slave station while issuing control instructions, and trigger the output and upload of calculation results and target data through the preset delay time, ensuring that there is no delay in instruction issuance and data upload. Realize fast interaction between master station and slave station.

Benefits of technology

It shortens the communication cycle between the master station and the slave station, reduces the communication delay, improves the dynamic performance of the bus communication system, and realizes the back-and-forth interaction between the master station and the slave station.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016010B
    Figure CN116016010B
Patent Text Reader

Abstract

The present application discloses a bus communication method, a slave station and a bus communication system, the method comprising: receiving a first moment control instruction from a master station, starting a first task and a second task, wherein the first task comprises performing calculations according to the instructions of the first moment control instruction and obtaining calculation results, the second task comprises collecting target data, outputting the calculation results of the first task after a first preset delay time has passed since the first moment, and uploading the collected target data to the master station after a second preset delay time has passed since the first moment, so that the master station generates a second moment control instruction based on the target data, thereby utilizing a full-duplex communication mechanism, there is no delay caused by the topological structure in the issuance of control instructions and the uploading of target data, the communication cycle between the master station and the slave station is shortened, the communication delay between the master station and the slave station is reduced, and the dynamic performance of the communication system is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electrical control technology, and in particular to a bus communication method, a slave station and a bus communication system. Background Art

[0002] In a master-slave network structure, the control of slaves is achieved through communication between the master and slaves. In the current control method, the communication cycle between the master and slaves is long, resulting in a decrease in the dynamic performance of the system, and the data delay between the master and slaves is large, resulting in a decrease in the dynamic performance of the slave control.

[0003] It should be noted that the information disclosed in this background technology section is only for understanding the background technology of the present application concept, and therefore, it may contain information that does not constitute the prior art. Summary of the invention

[0004] The first purpose of the present application is to propose a bus communication method to shorten the communication cycle between the master station and the slave station, reduce the communication delay, and improve the dynamic performance of the system.

[0005] The second objective of the present application is to propose another bus communication method.

[0006] The third objective of the present application is to provide a slave station of a bus communication system.

[0007] The fourth objective of the present application is to provide a bus communication system.

[0008] To achieve the above-mentioned purpose, the first aspect of the present application provides a bus communication method, which is applied to n slave stations in a bus communication system, and the bus communication system also includes a master station, and the master station performs full-duplex communication with the n slave stations, wherein n is an integer greater than 1, and the method includes: receiving a first moment control instruction from the master station, starting a first task and a second task, wherein the first task includes performing calculations according to the instructions of the first moment control instruction and obtaining calculation results, and the second task includes collecting target data; after a first preset delay time has passed since the first moment, outputting the calculation results of the first task; after a second preset delay time has passed since the first moment, uploading the collected target data to the master station, so that the master station can generate a second moment control instruction based on the target data.

[0009] According to the bus communication method proposed in the embodiment of the present application, by utilizing the full-duplex communication mechanism, the master station can receive the return data of any slave station on the bus while issuing control instructions, and all slave stations can immediately receive the data sent by the master station, and all data uploaded by the slave stations can also be immediately received by the master station. There is no delay caused by the topological structure in the issuance of instructions and the uploading of target data, which shortens the communication cycle between the master station and the slave station, reduces the communication delay between the master station and the slave station, and effectively improves the dynamic performance of the bus communication system; and, when the slave station receives the control instruction, it will start the calculation task and the data acquisition task to output the calculation results and generate new control instructions for the master station, so as to realize the reciprocating interaction between the master station and the slave station.

[0010] To achieve the above-mentioned purpose, the second aspect embodiment of the present application proposes another bus communication method, which is applied to a bus communication system, wherein the bus communication system includes a master station and n slave stations, and the master station performs full-duplex communication with the n slave stations, wherein n is an integer greater than 1, and the method includes: the master station sends corresponding first-time control instructions to the n slave stations in turn; the slave station receives the first-time control instruction from the master station, starts a first task and a second task, wherein the first task includes performing calculations according to the instructions of the first-time control instruction and obtaining calculation results, and the second task includes collecting target data; the slave station outputs the calculation results of the first task after a first preset delay time from the first moment; the slave station uploads the collected target data to the master station after a second preset delay time from the first moment; the master station receives the target data uploaded by the slave station, and generates corresponding second-time control instructions based on the target data.

[0011] To achieve the above-mentioned purpose, the third aspect of the present application provides a slave station of a bus communication system, wherein the bus communication system includes a master station and n slave stations, and the master station performs full-duplex communication with the n slave stations, wherein n is an integer greater than 1, and the slave station includes: an RX module, used to receive a first moment control instruction from the master station; a task start module, used to start a first task and a second task, wherein the first task includes performing calculations according to the instructions of the first moment control instruction and obtaining calculation results, and the second task includes collecting target data; a data output module, used to output the calculation results of the first task after a first preset delay time has passed since the first moment; and a TX module, used to upload the collected target data to the master station after a second preset delay time has passed since the first moment, so that the master station can generate a second moment control instruction based on the target data.

[0012] To achieve the above-mentioned purpose, the fourth aspect of the present application provides a bus communication system, characterized in that it includes a master station and n slave stations, and the master station performs full-duplex communication with the n slave stations, wherein n is an integer greater than 1; the master station includes: a first TX module, which is used to send corresponding first-time control instructions to the n slave stations in sequence; a first RX module, which is used to receive the target data uploaded by the slave station; and an instruction generation module, which is used to generate corresponding second-time control instructions based on the target data uploaded by the slave station; the slave station includes: a second RX module, which is used to receive the first-time control instruction from the master station; a task startup module, which is used to start a first task and a second task, wherein the first task includes calculating and obtaining the calculation result according to the instruction of the first-time control instruction, and the second task includes collecting target data; a data output module, which is used to output the calculation result of the first task after a first preset delay time has passed since the first moment; and a second TX module, which is used to upload the collected target data to the master station after a second preset delay time has passed since the first moment.

[0013] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a flowchart of a bus communication method applied to a slave station according to an embodiment of the present application.

[0015] Figure 2 It is a schematic diagram of the topological structure of a bus communication system according to an embodiment of the present application.

[0016] Figure 3 It is a flowchart of a bus communication method applied to an inverter unit of a multi-axis servo system according to an embodiment of the present application.

[0017] Figure 4 It is a schematic diagram of the bus communication topology structure of a multi-axis servo system according to an embodiment of the present application.

[0018] Figure 5 It is a schematic diagram of the working timing of the inverter unit in one embodiment of the present application.

[0019] Figure 6 It is a flowchart of a bus communication method applied to a bus communication system according to an embodiment of the present application.

[0020] Figure 7 It is a structural block diagram of the communication transceiver timing when the data interaction cycle is 2 preset cycles in an embodiment of the present application.

[0021] Figure 8It is a structural block diagram of the communication transceiver timing when the data interaction cycle is n-1 preset cycles in an embodiment of the present application.

[0022] Fig. 9 It is a structural block diagram of the communication transceiver timing between a master station and n slave stations in one embodiment of the present application.

[0023] Fig.10 It is a schematic diagram of the change of the communication receiving and sending status between the master station and three slave stations in one embodiment of the present application.

[0024] Fig.11 It is a flowchart of a bus communication method applied to a multi-axis servo system according to an embodiment of the present application.

[0025] Fig.12 It is a structural block diagram of the communication transmission and reception timing between the rectifier unit and n inverter units in one embodiment of the present application.

[0026] Fig.13 It is a structural block diagram of the communication and reception timing between the rectifier unit and three inverter units in one embodiment of the present application.

[0027] Fig.14 It is a structural block diagram of a slave station of a bus communication system according to an embodiment of the present application.

[0028] Fig.15 It is a structural block diagram of the inverter unit of a multi-axis servo system according to an embodiment of the present application.

[0029] Fig.16 It is a structural block diagram of a bus communication system according to an embodiment of the present application.

[0030] Fig.17 It is a structural block diagram of a multi-axis servo system according to an embodiment of the present application.

[0031] Fig.18 It is a structural block diagram of the connection relationship between the rectifier unit Rec and the inverter unit Inv1 in a multi-axis servo system according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] The embodiments of the present application are described in detail below. Examples of the embodiments described below are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0033] The following describes the bus communication method, bus communication system, computer-readable storage medium, master station of the bus communication system, slave station of the bus communication system, rectifier unit of the multi-axis servo system, inverter unit of the multi-axis servo system, and multi-axis servo system of the embodiments of the present application with reference to the accompanying drawings.

[0034] See also Figure 1 , the embodiment of the present application provides a bus communication method, which is applied to a slave station in a bus communication system, and specifically includes the following steps 110, 120 and 130. First of all, it should be noted that the bus communication topology structure of the bus communication system in this embodiment can be found in Figure 2 The bus communication system includes a master station and n slave stations. The master station performs full-duplex communication with the n slave stations, where n is an integer greater than 1, forming a one-master-multiple-slave communication architecture.

[0035] S110, the slave station receives the first moment control instruction from the master station, and starts the first task and the second task, wherein the first task includes performing calculations according to the instructions of the first moment control instruction and obtaining calculation results, and the second task includes collecting target data.

[0036] The control instructions sent by the master station include instructions for the slave stations. The master station broadcasts the control instructions of each slave station on the bus in turn. After the slave station receives the control instructions corresponding to itself through the bus, it starts the first task and the second task according to the instructions contained in the instructions. That is to say, the first task and the second task can be triggered at the same time and run in parallel, and the triggering time of the first task and the second task can be triggered immediately when the control instruction is received. Among them, the first task is a calculation task, and the corresponding calculation results are obtained by executing the calculation task. The parameters involved in the calculation in the calculation task can be configured by the slave station itself, or can be extracted from the control instructions sent by the master station. The second task is a data acquisition task, which is used to obtain the target data. The target data can be the operating parameters of the slave station itself, or the operating parameters of the lower-level device connected to the slave station, or other data expected by the user.

[0037] Each time the master station sends a control instruction to the slave station, it is the control instruction at the current moment. Taking slave station 1 as an example, the control instruction currently sent by the master station to slave station 1 may be generated after slave station 1 uploaded the target data in the previous data interaction cycle. Therefore, the instructions contained in the control instruction at the current moment correspond to the latest state of the controlled object (slave station or lower-level device or other device), so that the slave station obtains the target data in the latest state. Among them, a data interaction cycle (referred to as the interaction cycle) refers to the time it takes to complete a data transmission and reception between the master station and the same slave station, starting from the master station generating the control instruction of the slave station, through the master station's instruction issuance, the slave station's instruction reception and execution, and the slave station's data upload, until the master station receives the data uploaded by the slave station, an interaction cycle between the master station and the slave station is completed.

[0038] Since full-duplex communication is used between the master and slaves, the master can receive target data fed back by another slave while issuing instructions to one of the slaves. The master sends control instructions to each slave in a round-robin manner, and the slave uploads data to the master after completing the acquisition of the target data. For the master, the data upload of the slave is also round-robin, thus forming a reciprocating interaction.

[0039] S120, the slave station outputs a calculation result of the first task after a first preset delay time has passed since the first moment.

[0040] The first moment refers to the moment when the slave station receives the first moment control instruction. From the moment when the slave station receives the first moment control instruction, when the first preset delay time is reached, the output of the task result of the first task is triggered, that is, the calculation result of the calculation task is output. It can be understood that when the first preset delay time is reached, the slave station has calculated the task result of the first task.

[0041] After completing the calculation according to the control instruction, each slave station will output the calculation result to the designated object, and the designated object will receive and use the calculation result. For example, the designated object controls its own action through the calculation result.

[0042] S130, the slave station uploads the collected target data to the master station after a second preset delay time has passed since the first moment, so that the master station generates a control instruction at the second moment according to the target data.

[0043] From the moment the slave receives the first moment control instruction, when the second preset delay time is reached, the uploading of the task result of the second task is triggered, that is, the target data is uploaded to the master station by broadcasting on the bus. It can be understood that when the second preset delay time is reached, the slave station has already obtained the target data.

[0044] After each slave station completes the acquisition of the target data according to the control instruction, it will broadcast the target data through the bus. The master station will receive the target data uploaded by each slave station in turn, and generate a new control instruction for the corresponding slave station through the target data. Assuming that the target data is acquired according to the instruction of the control instruction at the first moment, the control instruction generated by the master station according to the target data is the control instruction at the second moment. It should be noted that the first moment and the second moment do not refer to specific moment values, but to different data interaction cycles.

[0045] According to the bus communication method proposed in the embodiment of the present application, by utilizing the full-duplex communication mechanism, the master station can receive the return data of any slave station on the bus while issuing control instructions, and all slave stations can immediately receive the data sent by the master station, and all data uploaded by the slave stations can also be immediately received by the master station. There is no delay caused by the topological structure in the issuance of instructions and the uploading of target data, which shortens the communication cycle between the master station and the slave station, reduces the communication delay between the master station and the slave station, and effectively improves the dynamic performance of the bus communication system; and, when the slave station receives the control instruction, it will start the calculation task and the data acquisition task to output the calculation results and generate new control instructions for the master station, so as to realize the reciprocating interaction between the master station and the slave station.

[0046] In some embodiments, the slave station in step 110 receives the first time control instruction from the master station, which may specifically include step 111 and step 112. S111, the slave station identifies the data frame broadcast on the bus. S112, when the slave station identifies the preset matching frame, it starts to receive the first time control instruction.

[0047] A matching frame is a designated data frame used to identify data packets. The matching frames of different slave stations are different, so as to distinguish the expected recipients of the data packets, so that the control instructions can be recognized and received by the correct slave station. All slave stations will monitor the data on the bus and identify the data frames of all data broadcast on the bus. If the preset matching frame, that is, the matching frame corresponding to the slave station itself, is not identified, it is determined that the data packet is sent to other slave stations, so there is no need to further process the data packet; if the preset matching frame is identified, it is determined that the data packet is sent to the slave station, so it will receive the data packet. By receiving several data packets, the master station will form the current control instruction sent to the slave station, so that the control instruction can be received by the designated expected recipient.

[0048] In some embodiments, step 120 may specifically include step 121 and step 122. S121, when the slave station receives the first moment control instruction, triggers the first delay timer to start timing. S122, when the timing value of the first delay timer reaches the first preset delay time, the slave station outputs the calculation result of the first task, wherein the first preset delay time is set as the execution time of the first task.

[0049] The slave station is configured with a first delay timer for timing the expected execution time of the first task. In response to the received first moment control instruction, the slave station immediately starts the first task and also triggers the first delay timer to start timing. Since the execution time of the first task (i.e. the expected execution time) is predictable or known, the first preset delay time delay1 can be set in advance as the execution time of the first task. When the execution of the first task is completed and the calculation result is obtained, the timing value of the first delay timer just reaches the first preset delay time delay1. At this time, the calculation result of the first task can be directly output without waiting for a period of time before outputting it. As a result, when the specified object receives the calculation result, the calculation result received is the latest calculation result, thereby reducing the delay and reducing the calculation error.

[0050] In some embodiments, step 130 may specifically include step 131 and step 132. S131, when the slave station receives the first time control instruction, triggers the second delay timer to start timing. S132, when the timing value of the second delay timer reaches the second preset delay time, the slave station uploads the collected target data to the master station, wherein the second preset delay time is set to the execution time of the second task.

[0051] The slave station is also equipped with a second delay timer, which is equivalent to a data transmission timer and is used to time the expected execution time of the second task. In response to the received first moment control instruction, the slave station immediately starts the second task and also triggers the second delay timer to start timing. Since the execution time of the second task (i.e., the expected execution time) is also predictable or known, the second preset delay time delay2 can be set in advance as the execution time of the second task. When the execution of the second task is completed and the target data is obtained, the timing value of the second delay timer just reaches the second preset delay time delay2. At this time, the target data of the second task can be directly output without waiting for a period of time before outputting. As a result, when the master station receives the target data, the received target data is the latest target data, thereby reducing the delay and reducing the error of the instruction content when the master station generates the control instruction.

[0052] In some embodiments, each slave station is connected to a target device, the second task is to collect target data of the target device, and outputting the calculation result of the first task is specifically: the slave station sends the calculation result of the first task to the target device to drive the target device to run.

[0053] Specifically, the slave station is connected to the target device, and the target device communicates with the master station through the slave station. The object indicated in the control instruction issued by the master station may include the target device, and the target device is instructed to perform corresponding actions by issuing the control instruction. That is, after receiving the control instruction, the slave station can obtain target data according to the control instruction, where the target data can be the operating data of the target device; it can also control the action of the target device according to the control instruction.

[0054] The target device can be an actuator such as a motor or a hydraulic cylinder. At this time, the target data can be status information such as the position information of the motor and the piston position information of the hydraulic cylinder. The calculation result of the first task can be control information such as the current parameters of the motor and the pressure parameters of the hydraulic cylinder, so as to drive the rotation of the motor and the extension and retraction of the hydraulic cylinder.

[0055] The target device can also be a detection device such as a temperature sensor, a speed sensor, etc. In this case, the target data can be status information such as the temperature data of the temperature sensor, the speed data of the speed sensor, etc. The calculation result of the first task can be control information such as the detection accuracy of the temperature sensor, the detection period of the speed sensor, etc., so as to drive the temperature sensor and the speed sensor to perform data detection.

[0056] The target device can also be an automated device such as an intelligent terminal or a robot. In this case, the target data can be status information such as the CPU resource usage of the intelligent terminal and the current load information of the robot. The calculation result of the first task can be control information such as the working mode of the intelligent terminal and the operating power of the robot, so as to drive the intelligent terminal to perform calculations and the robot to transport goods.

[0057] In addition, the embodiment of the present application also provides another bus communication method, which is applied to the inverter part of a multi-axis servo system, wherein the multi-axis servo system corresponds to the bus communication system, the inverter part of the multi-axis servo system corresponds to the slave station of the bus communication system, and the master station of the bus communication system is the rectifier part of the multi-axis servo system. Figure 3 The bus communication method applied to the inverter unit of this embodiment specifically includes the following steps 210, 220 and 230.

[0058] First of all, it should be noted that the bus communication topology of the multi-axis servo system in this embodiment can be found in Figure 4The bus communication system includes a rectifier Rec and n inverters Inv1 to Invn. The rectifier Rec and the n inverters Inv1 to Invn perform full-duplex communication, where n is an integer greater than 1, to form a master-multiple-slave communication architecture. Each inverter Inv is connected to a motor M, for example, inverter Inv1 is connected to motor M1, inverter Inv2 is connected to motor M2, and inverter Invn is connected to motor Mn. The multi-axis servo system may be a multi-axis servo system with a common DC bus, and the rectifier Rec and each inverter Inv are separately arranged.

[0059] S210, the inverter unit Inv receives the first moment current loop instruction from the rectifier unit Rec, and starts the current loop calculation task and the motor position acquisition task, wherein the current loop calculation task includes performing the current loop calculation according to the instruction of the first moment current loop instruction and obtaining the calculation result, and the motor position acquisition task includes acquiring the motor position of the motor M. The current loop instruction is also called the torque instruction or the Q-axis current instruction.

[0060] S220, the inverter unit Inv outputs the calculation result of the current loop calculation task after a first preset delay time delay1 from the first moment. Outputting the calculation result of the current loop calculation task specifically includes: sending the calculation result of the current loop calculation task to the motor M to drive the motor M to operate.

[0061] S230, the inverter unit Inv uploads the collected motor position to the rectifier unit Rec after a second preset delay time delay2 from the first moment, so that the rectifier unit Rec generates a current loop instruction at the second moment according to the motor position.

[0062] The rectifier Rec can be configured with a TX0 port for sending data and a RX0 port for receiving data, and each inverter Inv can be configured with a TX port for sending data and a RX port for receiving data, for example, the inverter Inv1 is configured with a TX1 port and a RX1 port, the inverter Inv2 is configured with a TX2 port and a RX2 port, and the inverter Invn is configured with a TXn port and a RXn port. The rectifier Rec is connected to n inverters through a bus and performs full-duplex communication. The rectifier Rec is equivalent to a master station (Master), and each inverter Inv is equivalent to a slave station (Slave), forming a one-master-multiple-slave communication architecture, wherein the TX0 of the rectifier Rec communicates with the RX1~RXn of each inverter through the data downlink line in the bus, and the RX0 of the rectifier Rec communicates with the TX1~TXn of each inverter through the data uplink line in the bus.

[0063] The rectifier unit Rec is used to perform control operations of the multi-axis servo system, perform position loop control and speed loop control of all axes in the multi-axis servo system, and send current loop instructions of the corresponding axis to each inverter unit through the bus; the inverter unit is used to perform current loop calculations based on the instructions sent by the rectifier unit and then control the motor, as well as to collect the position information of the motor of this axis and feed back the position information of the motor of this axis to the rectifier unit through the bus.

[0064] In addition, the rectifier unit can also be used to convert the AC signal into a DC signal and send it to the inverter unit. The inverter unit can also be used to perform PWM carrier modulation on the DC signal received from the rectifier unit, and output the modulated AC control voltage to the corresponding motor to drive the motor to run and drive the load to operate.

[0065] After the inverter Inv1 receives the first current loop instruction corresponding to Inv1 sent by the rectifier Rec, the inverter Inv1 starts to perform the current loop calculation task and the motor position acquisition task of the motor M1. Among them, the current loop instruction may include positioning data and speed data. The inverter Inv1 will perform the current loop calculation based on the positioning data and speed data, send the calculation result to the PWM module (Pulse Width Modulation) for modulation, and control the operation of the motor M1 based on the modulation result. The inverter Inv1 also collects the position information of the motor of this axis according to the instruction sent by the rectifier Rec and feeds back the position information of the motor of this axis to the rectifier Rec through the bus. The way in which other inverters Inv2~Invn drive the corresponding motors M2~Mn respectively and the way in which the motor position is acquired can be obtained by the way of the inverter Inv1, which will not be repeated here.

[0066] In this embodiment, the data interaction cycle (referred to as interaction cycle) is the time taken to complete a data transmission and reception between the rectifier and the same inverter. It starts with the rectifier generating a current loop instruction of the inverter, and goes through the instructions of the rectifier, the instructions of the inverter, and the information of the inverter, until the rectifier receives the information uploaded by the inverter. Thus, an interaction cycle between the rectifier and the inverter is completed.

[0067] According to the bus communication method proposed in the embodiment of the present application, by utilizing the full-duplex communication mechanism, the rectifier unit can receive the return data of any inverter unit on the bus while issuing the current loop instruction, and all inverter units can immediately receive the data sent by the rectifier unit, and all data uploaded by the inverter units can also be immediately received by the rectifier unit, and there is no delay caused by the topological structure in the issuance of instructions and the uploading of motor positions, which shortens the communication cycle between the rectifier unit and the inverter unit, reduces the communication delay between the rectifier unit and the inverter unit, and effectively improves the dynamic performance of the multi-axis servo system; and, when the inverter unit receives the current loop instruction, it will start the current loop task and the motor position acquisition task to output the calculation results and generate a new current loop instruction for the rectifier unit, so as to realize the reciprocating interaction between the rectifier unit and the inverter unit.

[0068] In some embodiments, the inverter unit Inv in step 210 receives the first moment current loop instruction from the rectifier unit Rec, which may specifically include steps 211 and 212. S211, the inverter unit Inv identifies the data frame broadcast on the bus. S212, when the inverter unit Inv identifies the preset matching frame, it starts to receive the first moment current loop instruction.

[0069] For the current loop instructions sent to different inverter units Inv, a data frame is provided. The value of the data frame is different for different inverter units. After the instruction is broadcast to the bus, each inverter unit Inv starts to identify the data frame of the instruction. If the inverter unit Inv1 recognizes that the data frame is the same as the preset matching frame of the inverter unit, it is determined that the instruction is sent to the inverter unit Inv1, otherwise it is determined that the instruction is sent to other inverter units.

[0070] In some embodiments, step 220 may specifically include step 221 and step 222. S221, when the inverter unit Inv receives the current loop instruction at the first moment, it triggers the first delay timer to start timing. S222, when the timing value of the first delay timer reaches the first preset delay time, the inverter unit Inv outputs the calculation result of the current loop calculation task, wherein the first preset delay time is set to the execution time of the current loop calculation task.

[0071] In some embodiments, when the inverter unit Inv outputs the calculation result of the current loop calculation task, it also resets the timing value of the PWM timer, so that the PWM module outputs according to the latest current loop calculation result.

[0072] See also Figure 5 In response to receiving the current loop instruction, the inverter unit Inv1 triggers the first timer to start timing, and when the timing value of the first timer reaches the first preset delay time delay1, the PWM carrier of the PWM timer is triggered ( Figure 5 The timing value (dashed triangle wave in the figure) is reset, and the PWM timer after reset starts timing from the initial value, for example, forming a triangle wave waveform from zero, so that the PWM module can perform PWM waveform modulation according to the latest current loop calculation result while starting timing from the initial value.

[0073] In some embodiments, step 230 may specifically include step 231 and step 232. S231, when the inverter unit Inv receives the current loop instruction at the first moment, it triggers the second delay timer to start timing. S232, when the timing value of the second delay timer reaches the second preset delay time, the inverter unit Inv uploads the collected motor position to the rectifier unit Rec, wherein the second preset delay time is set to the execution time of the motor position acquisition task.

[0074] In some embodiments, the inverter unit Inv in the motor position acquisition task acquires the motor position specifically including: the inverter unit Inv initiates communication with the encoder on the motor so that the encoder latches the motor position and feeds back the latched information to the inverter unit, and solves the received latched information to obtain the motor position.

[0075] The encoder is a motor mechanical position detection device that can be installed on the motor bearing and rotate with the bearing to detect the motor position information and send the motor position information through RS485 communication. Because the position latch time is performed immediately after the inverter Inv1 receives the current loop command, the position loop and speed loop of the rectifier can effectively compensate for the position information fed back by the inverter.

[0076] In some embodiments, the execution time of the motor position acquisition task includes: the sum of the time for the inverter Inv to communicate with the encoder and the time for resolving the received latch information.

[0077] The second preset delay time delay2 is set to the execution time of the motor position acquisition task, which is used to ensure that the motor position information returned by the inverter Inv1 is the latest, and to reduce the delay in the position feedback signal of the position control loop and the speed control loop. The execution time of the motor position acquisition task includes two parts, one is the duration of the communication between the inverter Inv1 and the encoder, that is, the time it takes for the inverter Inv1 to initiate communication with the encoder on the motor and the encoder to latch the motor position and feed back the latched information to the inverter Inv1, and the other is the time it takes for the inverter Inv1 to resolve the received latched information to obtain the motor position.

[0078] It should be noted that for details not disclosed in the bus communication method applied to the inverter part of this embodiment, please refer to the details disclosed in the embodiment of the bus communication method applied to the slave station in the embodiment of the present application, and no further details will be given here.

[0079] Also, see Figure 6 , the present application embodiment provides a bus communication method, which is applied to a bus communication system, and specifically includes the following steps 310 to 350. First of all, it should be noted that the bus communication topology structure of the bus communication system in this embodiment can be found in Figure 2 The bus communication system includes a master station and n slave stations. The master station performs full-duplex communication with the n slave stations, where n is an integer greater than 1, forming a one-master-multiple-slave communication architecture.

[0080] S310, the master station sends corresponding first moment control instructions to n slave stations in sequence.

[0081] Specifically, the master station may send corresponding current time control instructions to n slave stations in sequence every preset period, for example, sending the first time control instruction to slave station 1. For the same slave station, the sending time and receiving time of the master station are staggered, and the staggered time is greater than or equal to 1 preset period and less than n preset periods.

[0082] The preset cycle is the time interval between the master station sending control instructions to two adjacent slave stations in the sending order. For example, the time interval between the master station sending instructions to slave station 1 and the master station sending instructions to slave station 2 is a preset cycle, and n preset cycles form the overall communication cycle of the system. Starting from the time when the master station starts to generate control instructions for slave station 1 until the master station receives the target data uploaded by slave station 1, the period is equivalent to the time of a data interaction cycle, and the data interaction cycle can be one or more preset cycles.

[0083] See also Figure 7 , when the phase offset time is 2 preset cycles and there are 5 slave stations (Inv1~Inv5), after the master station sends instructions to slave station 1, slave station 1 starts to acquire target data according to the instructions. The target data acquisition takes 2 preset cycles t0 (the target data acquisition process of the slave station is not shown in the figure). After completing the data acquisition, the master station will receive the target data fed back by slave station 1 when the master station sends instructions to slave station 3 after an interval of 2 preset cycles t0.

[0084] When the phase offset time is n-1 preset cycles, please refer to Figure 8 , continue to assume that there are 5 slave stations (Inv1~Inv5), then the phase staggered time is 4 preset cycles. After the master station sends instructions to slave station 1, the master station will receive the target data fed back by slave station 1 when the master station sends instructions to slave station 5 after an interval of 4 preset cycles t0.

[0085] It is understandable that even though the time taken for different slave stations to collect target data may vary due to differences in hardware equipment, data processing methods and computing performance, the master station can still issue multiple task instructions during the data interaction cycle of each slave station to shorten the overall communication cycle of the system.

[0086] S320, the slave station receives the first moment control instruction from the master station, and starts the first task and the second task, wherein the first task includes performing calculations according to the instructions of the first moment control instruction and obtaining calculation results, and the second task includes collecting target data.

[0087] The first task is a calculation task. By executing the calculation task, the corresponding calculation results are obtained. The parameters involved in the calculation task can be configured by the slave station itself or extracted from the control instructions issued by the master station. The second task is a data acquisition task, which is used to obtain the target data. The target data can be the operating parameters of the slave station itself, the operating parameters of the lower-level device connected to the slave station, or other data expected by the user.

[0088] S330, the slave station outputs the calculation result of the first task after a first preset delay time has passed since the first moment.

[0089] The first moment refers to the moment when the slave station receives the first moment control instruction. From the moment when the slave station receives the first moment control instruction, when the first preset delay time is reached, the output of the task result of the first task is triggered, that is, the calculation result of the calculation task is output. It can be understood that when the first preset delay time is reached, the slave station has calculated the task result of the first task.

[0090] S340, the slave station uploads the collected target data to the master station after a second preset delay time has passed since the first moment.

[0091] From the moment the slave receives the first moment control instruction, when the second preset delay time is reached, the uploading of the task result of the second task is triggered, that is, the target data is uploaded to the master station by broadcasting on the bus. It can be understood that when the second preset delay time is reached, the slave station has already obtained the target data.

[0092] S350, the master station receives the target data uploaded by the slave station, and generates a corresponding second moment control instruction according to the target data.

[0093] For the communication timing between the master station and slave stations 1 to n, please refer to Fig. 9, TX is the sending port, and RX is the receiving port. Both interaction cycles T1 and T2 are used to characterize the interaction between the master station and slave station 1. During interaction cycle T1, the master station receives, through port RX0, the target data obtained by slave station 1 during the data acquisition process of interaction cycle T1 and uploaded through port TX1 (the actions of slave stations 2 to n uploading target data during cycle T1 are not shown in the figure). This target data is the latest data obtained by slave station 1 and represents the latest operating parameters of the slave station or the operating parameters under the latest operating state of the slave station's subordinate devices. After entering interaction cycle T2 from interaction cycle T1, the master station generates a new control instruction (control instruction at the second moment) based on the target data received in the previous interaction cycle T1 and sends this new instruction to port RX1 of slave station 1 through port TX0 in the current interaction cycle T2. During interaction cycle T2, after slave station 1 acquires data for a period of time, it feeds back new target data to the master station. The master station will generate a new control instruction based on this in the next interaction cycle of interaction cycle T2 and send it to slave station 1, thereby realizing the reciprocating interaction between the master station and the slave station. The communication sending and receiving timings between the master station and other slave stations 2 to n can be obtained from the communication sending and receiving timings between the master station and slave station 1, which will not be elaborated here.

[0094] According to the bus communication method proposed in the embodiments of the present application, by using the full-duplex communication mechanism, the master station can receive the return data of any slave station on the bus while sending control instructions, and all slave stations can immediately receive the data sent by the master station. The data uploaded by all slave stations can also be immediately received by the master station. There is no delay caused by the topological structure in both the issuance of instructions and the upload of target data, shortening the communication cycle between the master station and the slave station, reducing the communication delay between the master station and the slave station, and effectively improving the dynamic performance of the bus communication system. Moreover, when the slave station receives the control instruction, it will start the calculation task and data acquisition task to output the calculation result and generate a new control instruction for the master station, realizing the reciprocating interaction between the master station and the slave station.

[0095] In some embodiments, the master station sequentially sends corresponding control instructions at the first moment to n slave stations according to a preset sending order. Moreover, when the master station sends the control instruction at the first moment to the mth slave station, it also receives the target data fed back by the slave station ranked at the next position after the mth slave station in the preset sending order, where m < n. And when the master station sends the control instruction at the current moment to the slave station ranked at the last position in the preset sending order, it also receives the target data fed back by the slave station ranked at the first position in the preset sending order.

[0096] Specifically, please continue to refer to Fig. 9, the master station can send control instructions to the n slave stations in sequence according to the preset sending order, for example, in the order of slave 1, slave 2... slave n, slave 1, slave 2..., the control instructions are sent to the n slave stations in a round-robin manner. In this process, for any slave m, when the master station sends a control instruction to it, it will also receive the target data fed back by the m+1th slave station within the unit time period of sending the control instruction. Similarly, when entering the next preset cycle, the master station sends a control instruction to the m+1th slave station, and it will also receive the target data fed back by the m+2th slave station within the unit time period. When the master station sends a control instruction to the nth slave station, it receives the target data fed back by the 1st slave station.

[0097] In the process of sending control instructions to each slave station, each slave station starts to obtain target data when receiving the corresponding control instruction. The acquisition process occurs at Fig. 9 During the "target data acquisition" process, after the target data is obtained, it will be fed back to the master station. The time when each slave station receives the control instruction is different, and the time consumed in the "target data acquisition" process may be different, so the feedback time is also different. However, if the "target data acquisition" process of each slave station takes roughly the same time, the slave station order when the master station receives the target data fed back by each slave station is the same as the slave station order when the master station sends the control instruction. For example Figure 7 and Fig. 9 In the process, commands are issued according to the slave station numbers from small to large, and the target data will also be received according to the slave station numbers from small to large.

[0098] Fig. 9 In the timing shown, within the unit time period when slave 1 feeds back the target data, the master station also sends a control instruction to slave n. Therefore, the master station will execute the actions of sending control instructions and receiving target data in all unit time periods. However, within the same unit time period, the slave station to which the instruction is sent and the slave station that uploads the target data are different slave stations. In each data interaction cycle, the master station can send corresponding instructions to each slave station, each slave station obtains the target data according to the instruction, and the master station also receives the target data uploaded by each slave station.

[0099] For the status changes of the communication between the master station and the slave station during the data exchange cycle, please refer to Fig.10, assuming that there are three slave stations, namely slave 1, slave 2 and slave 3, the controlled order of the three slave stations is: slave 1-slave 2-slave 3-slave 1…. The interaction cycle between the master station and slave station 1 starts with the master station generating a control instruction for slave station 1. When the master station sends instruction com1 to slave station 1, it may also receive target data fed back by slave station 2 to prepare to generate instruction com2 to be sent to slave station 2; then the master station generates instruction com2, and sends instruction com2 to slave station 2, and may receive target data fed back by 3 to prepare to generate instruction com3 to be sent to slave station 3; then the master station generates instruction com3, and sends instruction com3 to slave station 3, and may receive new target data fed back by 1 to prepare to generate new instruction com1' to be sent to slave station 1, at which point the current interaction cycle ends; then the next interaction cycle begins, the master station generates a new instruction com1', and sends instruction com1' to slave station 1, and may receive new target data fed back by 2 to prepare to generate a new instruction com2' to be sent to slave station 2, thus forming a reciprocating interaction.

[0100] In some embodiments, the slave station in step 320 receives the first time control instruction from the master station, which may specifically include step 321 and step 322. S321, the slave station identifies the data frame broadcast on the bus. S322, when the slave station identifies the preset matching frame, it starts to receive the first time control instruction.

[0101] In some embodiments, step 330 may specifically include step 331 and step 332. S331, when the slave station receives the first moment control instruction, triggers the first delay timer to start timing. S332, when the timing value of the first delay timer reaches the first preset delay time, the slave station outputs the calculation result of the first task, wherein the first preset delay time is set as the execution time of the first task.

[0102] In some embodiments, step 340 may specifically include step 341 and step 342. S341, when the slave station receives the first time control instruction, triggers the second delay timer to start timing. S342, when the timing value of the second delay timer reaches the second preset delay time, the slave station uploads the collected target data to the master station, wherein the second preset delay time is set to the execution time of the second task.

[0103] In some embodiments, each slave station is connected to a target device, the second task is to collect target data of the target device, and outputting the calculation result of the first task is specifically: the slave station sends the calculation result of the first task to the target device to drive the target device to run.

[0104] It should be noted that the details not disclosed in the bus communication method applied to the bus communication system of this embodiment, such as the contents of step 320, step 330 and step 340, and the contents of the target device, target data and data interaction cycle, please refer to the details disclosed in the embodiment of the bus communication method applied to the slave station in the embodiment of the present application, and will not be repeated here.

[0105] In addition, the embodiment of the present application provides a bus communication method, which is applied to a multi-axis servo system, wherein the multi-axis servo system corresponds to a bus communication system, the slave station of the bus communication system is the inverter part of the multi-axis servo system, and the master station of the bus communication system is the rectifier part of the multi-axis servo system. First of all, it should be noted that the bus communication topology structure of the multi-axis servo system in this embodiment can be found in Figure 4 The bus communication system includes a rectifier Rec and n inverters Inv1 to Invn. The rectifier Rec and the n inverters Inv1 to Invn perform full-duplex communication, where n is an integer greater than 1, to form a master-multiple-slave communication architecture. Each inverter Inv is connected to a motor M, for example, inverter Inv1 is connected to motor M1, inverter Inv2 is connected to motor M2, and inverter Invn is connected to motor Mn. The multi-axis servo system may be a multi-axis servo system with a common DC bus, and the rectifier Rec and each inverter Inv are separately arranged.

[0106] See also Fig.11 The bus communication method applied to the multi-axis servo system of this embodiment specifically includes the following steps 410 to 450.

[0107] S410, the rectifier unit Rec sends corresponding first-moment current loop instructions to n inverter units Inv in sequence.

[0108] When the rectifier unit Rec sends the corresponding current loop instructions to the n inverter units Inv1~Invn in sequence every preset cycle, for the same inverter unit Inv, the sending time and receiving time of the rectifier unit Rec are staggered, and the staggered time is greater than or equal to 1 preset cycle and less than n preset cycles.

[0109] See also Figure 7 , when the phase stagger time is 2 preset cycles and there are 5 inverters (Inv1 to Inv5), the rectifier will receive the motor position feedback from Inv1 after 2 preset cycles t0. Figure 8 When the phase staggered time is n-1 preset cycles, it is continued to be assumed that there are 5 inverter units (Inv1~Inv5), and the rectifier unit will receive the motor position feedback from Inv1 after an interval of 4 preset cycles t0.

[0110] S420, the inverter unit Inv receives the first moment current loop instruction from the rectifier unit Rec, and starts the current loop calculation task and the motor position acquisition task, wherein the current loop calculation task includes performing the current loop calculation according to the instruction of the first moment current loop instruction and obtaining the calculation result, and the motor position acquisition task includes acquiring the motor position of the motor M.

[0111] After the inverter Inv1 receives the first current loop instruction corresponding to Inv1 sent by the rectifier Rec, the inverter Inv1 starts to perform the current loop calculation task and the motor position acquisition task of the motor M1. Among them, the current loop instruction may include positioning data and speed data. The inverter Inv1 will perform the current loop calculation based on the positioning data and speed data, send the calculation result to the PWM module (Pulse Width Modulation) for modulation, and control the operation of the motor M1 based on the modulation result. The inverter Inv1 also collects the position information of the motor of this axis according to the instruction sent by the rectifier Rec and feeds back the position information of the motor of this axis to the rectifier Rec through the bus. The way in which other inverters Inv2~Invn drive the corresponding motors M2~Mn respectively and the way in which the motor position is acquired can be obtained by the way of the inverter Inv1, which will not be repeated here.

[0112] S430, the inverter unit Inv outputs the calculation result of the current loop calculation task after a first preset delay time delay1 from the first moment. Outputting the calculation result of the current loop calculation task specifically includes: sending the calculation result of the current loop calculation task to the motor M to drive the motor M to operate.

[0113] The first moment refers to the moment when the inverter unit Inv receives the current loop instruction at the first moment. Since the inverter unit Inv receives the current loop instruction at the first moment, when the first preset delay time delay1 is reached, the output of the calculation result of the current loop calculation task is triggered. It can be understood that when the first preset delay time delay1 is reached, the inverter unit Inv has calculated the calculation result of the current loop calculation task.

[0114] S440, the inverter unit Inv uploads the collected motor position to the rectifier unit Rec after a second preset delay time delay2 from the first moment.

[0115] Since the inverter unit Inv receives the current loop instruction at the first moment, when the second preset delay time delay2 is reached, the uploading of the task result of the motor position acquisition task is triggered, that is, the motor position is uploaded to the rectifier unit Rec by broadcasting on the bus. It can be understood that when the second preset delay time delay2 is reached, the inverter unit Inv has already acquired the motor position.

[0116] S450, the rectifier unit Rec receives the motor position uploaded by the inverter unit Inv, and generates a corresponding second-moment current loop instruction according to the motor position.

[0117] Each time the current loop instruction sent by the rectifier unit Rec to the inverter unit is the current loop instruction at the current moment. Taking the inverter unit Inv1 as an example, the current loop instruction currently sent by the rectifier unit Rec to the inverter unit Inv1 can be generated after processing the motor position information uploaded by the inverter unit Inv1 in the previous data interaction cycle between the rectifier unit Rec and the inverter unit Inv1. Therefore, the current loop instruction at the current moment refers to the instruction used to control the operating parameters of the motor in the latest operating state.

[0118] See also Fig.12 , in the interactive cycle T1, the rectifier Rec receives the motor position information collected during the data processing of the interactive cycle T1 uploaded by the inverter Inv1 through the TX1 port through the RX0 port (the action of the partial inverter in T1 uploading the motor position is not shown in the figure), and then starts to perform position loop calculation and speed loop calculation according to the motor position, obtains positioning data and speed data, and generates a new current loop instruction based on the positioning data and speed data. After entering the interactive cycle T2 from the interactive cycle T1, the motor position information, as the latest motor position collected by the inverter Inv1, represents the latest position state of the motor M1. Therefore, the rectifier Rec generates a new current loop instruction based on the motor position information received in the previous interactive cycle T1, and sends the instruction to the RX1 port of the inverter Inv1 through the TX0 port in the current interactive cycle T2. In the interaction cycle T2, after a period of data processing, the inverter Inv1 will feed back new motor position information to the rectifier Rec, and the rectifier Rec will generate a new current loop instruction in the next interaction cycle of the interaction cycle T2 and send it to the inverter Inv1, thereby realizing the reciprocating interaction between the rectifier and the inverter. The communication transmission and reception timing of the rectifier and other inverters Inv2~Invn can be obtained from the inverter Inv1, which will not be repeated here.

[0119] According to the bus communication method proposed by the embodiments of the present application, by utilizing the full-duplex communication mechanism, the rectifying unit can receive the return data of any inverter unit on the bus while sending the current loop instruction, and all inverter units can immediately receive the data sent by the rectifying unit. The data uploaded by all inverter units can also be immediately received by the rectifying unit. There is no delay caused by the topological structure in the sending of the instruction and the uploading of the motor position, shortening the communication cycle between the rectifying unit and the inverter unit, reducing the communication delay between the rectifying unit and the inverter unit, and effectively improving the dynamic performance of the multi-axis servo system. Moreover, when the inverter unit receives the current loop instruction, it will start the current loop task and the motor position acquisition task to output the calculation result and generate a new current loop instruction by the rectifying unit, realizing the reciprocating interaction between the rectifying unit and the inverter unit.

[0120] In some embodiments, the rectifying unit Rec sequentially sends the corresponding current loop instruction at the first moment to n inverter units Inv1 to Invn according to the preset sending order. Moreover, when the rectifying unit Rec sends the current loop instruction at the first moment to the m-th inverter unit Invm, it also receives the motor position feedback from the inverter unit located at the next position after the m-th inverter unit Invm in the preset sending order, where m < n. And when the rectifying unit Rec sends the current loop instruction at the current moment to the inverter unit Invn located at the end of the preset sending order, it also receives the motor position feedback from the inverter unit Inv1 located at the first position in the preset sending order.

[0121] Specifically, please continue to refer to Fig.12 , the rectifying unit Rec can sequentially send the current loop instruction to n inverter units according to the preset order, for example, in the order of Inv1, Inv2... Invn, Inv1, Inv2..., and send the current loop instruction to the n inverter units in a rotating manner. During this process, for any inverter unit Invm, when the rectifying unit Rec sends the current loop instruction to it, within the unit time period of sending the current loop instruction, it will also receive the motor position feedback from the (m + 1)-th inverter unit. Similarly, when entering the next preset cycle, the rectifying unit Rec sends the current loop instruction to the (m + 1)-th inverter unit, and within this unit time period, it will also receive the motor position feedback from the (m + 2)-th inverter unit. When the rectifying unit Rec sends the current loop instruction to the n-th inverter unit Inv, it receives the motor position feedback from the first inverter unit Inv1.

[0122] During the process of sending the current loop instruction to each inverter unit Inv, when each inverter unit receives the corresponding current loop instruction, it starts to collect the motor position, and the collection process occurs at Fig.12During the "motor position acquisition" process, the motor position will be fed back to the rectifier Rec after it is acquired. The time when each inverter Inv receives the current loop command is different, and the time consumed in the "motor position acquisition" process may be different, so the time to feedback the motor position is also different. When the "motor position acquisition" process of each inverter Inv takes roughly the same time, the order in which the rectifier Rec receives the motor position feedback from each inverter Inv is the same as the order in which the rectifier Rec sends the current loop command. For example Fig.12 In the process, the commands are issued according to the inverter numbers from small to large, and the motor positions are also received according to the inverter numbers from small to large.

[0123] Fig.12 In the timing shown, within the unit time period when the inverter unit Inv1 feeds back the motor position, the rectifier unit Rec also sends a current loop instruction to the inverter unit Invn. Therefore, the rectifier unit Rec will execute the actions of sending the current loop instruction and receiving the motor position in all unit time periods, but within the same unit time period, the inverter unit to which the instruction is sent and the inverter unit that uploads the motor position are different inverter units. In each data interaction cycle, the rectifier unit can send corresponding instructions to each inverter unit, and each inverter unit performs motor control and motor position acquisition according to the instructions, and the rectifier unit also receives the motor position uploaded by each inverter unit.

[0124] For details on the state changes in the communication between the rectifier Rec and the inverter Inv during the data exchange cycle, please refer to Fig.13, assuming that there are three inverter units Inv, namely, inverter unit Inv1, inverter unit Inv2 and inverter unit Inv3, the controlled order of the three inverter units is: inverter unit Inv1-inverter unit Inv2-inverter unit Inv3-inverter unit Inv1... The interaction cycle between the rectifier unit Rec and the inverter unit Inv1 starts with the current loop instruction generated by the rectifier unit Rec for the inverter unit Inv1. When the rectifier unit Rec sends the instruction com1 to the inverter unit Inv1, it may also receive the motor position feedback from the inverter unit Inv2 to prepare to generate the instruction com2 to be sent to the inverter unit Inv2; then the rectifier unit Rec generates the instruction com2, and sends the instruction com2 to the inverter unit Inv2, and may also receive the motor position feedback from 3 to prepare to generate the instruction com3 to be sent to the inverter unit Inv3; then The rear rectifier Rec generates instruction com3 and sends instruction com3 to the inverter Inv3. At the same time, it may receive the new motor position feedback from 1 to prepare to generate a new instruction com1' to send to the inverter Inv1. At this time, the current interaction cycle ends; then the next interaction cycle begins, the rectifier Rec generates a new instruction com1', and sends instruction com1' to the inverter Inv1. At the same time, it may receive the new motor position feedback from 2 to prepare to generate a new instruction com2' to send to the inverter Inv2, thereby forming a reciprocating interaction.

[0125] In some embodiments, the inverter unit Inv in step 420 receives the first moment current loop instruction from the rectifier unit Rec, which may specifically include step 421 and step 422. S421, the inverter unit Inv identifies the data frame broadcast on the bus. S422, when the inverter unit Inv identifies the preset matching frame, it starts to receive the first moment current loop instruction.

[0126] In some embodiments, step 430 may specifically include step 431 and step 432. S431, when the inverter unit Inv receives the current loop instruction at the first moment, it triggers the first delay timer to start timing. S432, when the timing value of the first delay timer reaches the first preset delay time delay1, the inverter unit Inv outputs the calculation result of the current loop calculation task, wherein the first preset delay time is set to the execution time of the current loop calculation task.

[0127] In some embodiments, when the inverter unit Inv outputs the calculation result of the current loop calculation task, it also resets the timing value of the PWM timer, so that the PWM module outputs according to the latest current loop calculation result.

[0128] In some embodiments, step 440 may specifically include step 441 and step 442. S441, when the inverter unit Inv receives the current loop instruction at the first moment, it triggers the second delay timer to start timing. S442, when the timing value of the second delay timer reaches the second preset delay time delay2, the inverter unit Inv uploads the collected motor position to the rectifier unit Rec, wherein the second preset delay time is set to the execution time of the motor position acquisition task.

[0129] In some embodiments, the inverter unit Inv in the motor position acquisition task acquires the motor position specifically including: the inverter unit Inv initiates communication with the encoder on the motor so that the encoder latches the motor position and feeds back the latched information to the inverter unit, and solves the received latched information to obtain the motor position.

[0130] In some embodiments, the execution time of the motor position acquisition task includes: the sum of the time for the inverter Inv to communicate with the encoder and the time for resolving the received latch information.

[0131] It should be noted that for details not disclosed in the bus communication method applied to the multi-axis servo system in this embodiment, please refer to the details disclosed in the embodiments of the bus communication method applied to the slave station and the bus communication method applied to the bus communication system in the embodiments of the present application, and they will not be repeated here.

[0132] Also, see Fig.14 The present application embodiment also provides a slave station 10 of a bus communication system. The topological structure of the bus communication system of this embodiment is similar to Figure 2 The bus communication topology structure in is the same, the bus communication system includes a master station and n slave stations 10, the master station performs full-duplex communication with the n slave stations 10, wherein n is an integer greater than 1. Moreover, this embodiment corresponds to the bus communication method embodiment applied to the slave station. The slave station 10 includes: an RX module, a task start module 13, a data output module 14 and a TX module. Specifically, the slave station 10 can use an FPGA chip (Field Programmable Gate Array, field programmable logic gate array) or a CPLD chip (Complex Programmable logic device, complex programmable logic device) or a CLB module (Configurable Logic Block, configurable logic module) to implement parallel logic processing functions.

[0133] The RX module is connected to the master station via a bus, and is used to receive the first moment control instruction from the master station. Specifically, the RX module may include an RX port 11, and the connection with the master station is achieved via the RX port 11.

[0134] The task starting module 13 is connected to the RX module, and is used to start the first task tsk1 and the second task tsk2, wherein the first task tsk1 includes performing calculations according to the instructions of the control instruction at the first moment and obtaining calculation results, and the second task tsk2 includes collecting target data.

[0135] The data output module 14 is used for outputting the calculation result of the first task tsk1 after a first preset delay time delay1 has passed since the first moment.

[0136] The TX module is used to upload the collected target data to the main station after a second preset delay time delay2 from the first moment, so that the main station generates a second moment control instruction according to the target data. Specifically, the TX module includes a TX port 15, through which the target data is uploaded to the main station.

[0137] According to the slave station of the bus communication system proposed in the embodiment of the present application, by utilizing the full-duplex communication mechanism, the master station can receive the return data of any slave station on the bus while issuing control instructions, and all slave stations can immediately receive the data sent by the master station, and all data uploaded by the slave stations can also be immediately received by the master station. There is no delay caused by the topological structure in the issuance of control instructions and the uploading of target data, which shortens the communication cycle between the master station and the slave station, reduces the communication delay between the master station and the slave station, and effectively improves the dynamic performance of the communication system; and, when receiving the control instruction, the slave station will start the calculation task and the data acquisition task to output the calculation results and generate new control instructions for the master station, so as to realize the reciprocating interaction between the master station and the slave station.

[0138] In some embodiments, the RX module includes: a frame matching unit 12, which is connected to the RX port 11 and is used to identify data frames of broadcast data on the bus, and start receiving a first moment control instruction when a preset matching frame is identified.

[0139] In some embodiments, the slave station 10 may include a first delay timer timer1. When the slave station 10 receives the first moment control instruction, the first delay timer timer1 is triggered to start timing. When the timing value of the first delay timer timer1 reaches the first preset delay time delay1, the data output module 14 outputs the calculation result of the first task, wherein the first preset delay time is set to the execution time of the first task.

[0140] In some embodiments, the slave station 10 may include a second delay timer timer2. When the slave station 10 receives the first time control instruction, the second delay timer timer2 is triggered to start timing. When the timing value of the second delay timer timer2 reaches the second preset delay time delay2, the TX module 15 uploads the collected target data to the master station, wherein the second preset delay time delay2 is set to the execution time of the second task.

[0141] In some embodiments, each slave station 10 is connected to a target device 16, the second task is to collect target data of the target device 16, and the data output module 14 outputs the calculation result of the first task, specifically sending the calculation result of the first task to the target device 16 to drive the target device 16 to run.

[0142] It should be noted that for details not disclosed in the embodiment of the slave station of the bus communication system of the embodiment of the present application, please refer to the details disclosed in the embodiment of the bus communication method applied to the slave station in the embodiment of the present application, and no further details will be given here.

[0143] In addition, the embodiment of the present application further provides an inverter unit Inv of a multi-axis servo communication system, wherein the multi-axis servo system corresponds to a bus communication system, the inverter unit Inv of the multi-axis servo system corresponds to a slave station of the bus communication system, and the master station of the bus communication system is a rectifier unit Rec of the multi-axis servo system. Fig.15 The inverter unit Inv of the multi-axis servo communication system of this embodiment specifically includes an RX module, a task starting module 23, a data output module 24 and a TX module.

[0144] First of all, it should be noted that the topological structure of the bus communication system of this embodiment is similar to Figure 4 The bus communication topology structure is the same as that in the embodiment, the bus communication system includes a rectifier Rec and n inverters Inv1~Invn, the rectifier Rec and the n inverters Inv1~Invn perform full-duplex communication, and n is an integer greater than 1. Each inverter Inv is connected to a motor M, for example, the inverter Inv1 is connected to the motor M1, the inverter Inv2 is connected to the motor M2, and the inverter Invn is connected to the motor Mn. The multi-axis servo system can be a multi-axis servo system with a common DC bus, and the rectifier Rec and each inverter Inv are separately arranged. In addition, this embodiment corresponds to an embodiment of the bus communication method applied to the inverter.

[0145] The RX module is connected to the rectifier Rec via a bus, and is used to receive the first moment current loop instruction from the rectifier Rec. Specifically, the RX module may include an RX port 21, and the connection with the rectifier Rec is achieved via the RX port 21.

[0146] The task starting module 23 is connected to the RX module, and is used to start the current loop calculation task tsk3 and the motor position acquisition task tsk4, wherein the current loop calculation task tsk3 includes calculating according to the instructions of the current loop instruction at the first moment and obtaining the calculation result, and the motor position acquisition task tsk4 includes acquiring the motor position of the motor M.

[0147] The data output module 24 is used to output the calculation result of the current loop calculation task tsk3 after the first preset delay time delay1 from the first moment. Outputting the calculation result of the current loop calculation task tsk3 specifically includes: sending the calculation result of the current loop calculation task tsk3 to the motor M to drive the motor M to run.

[0148] The TX module is used to upload the collected motor position to the rectifier Rec after a second preset delay time delay2 from the first moment, so that the rectifier Rec generates a current loop instruction at the second moment according to the motor position. Specifically, the TX module includes a TX port 25, through which the motor position is uploaded to the rectifier Rec.

[0149] According to the inverter part of the bus communication system proposed in the embodiment of the present application, by utilizing the full-duplex communication mechanism, the rectifier part can receive the return data of any inverter part on the bus while issuing the current loop instruction, and all inverter parts can immediately receive the data sent by the rectifier part, and all data uploaded by the inverter parts can also be immediately received by the rectifier part, and there is no delay caused by the topological structure in the issuance of instructions and the uploading of motor positions, which shortens the communication cycle between the rectifier part and the inverter part, reduces the communication delay between the rectifier part and the inverter part, and effectively improves the dynamic performance of the multi-axis servo system; and, when the inverter part receives the current loop instruction, it will start the current loop task and the motor position acquisition task to output the calculation results and generate a new current loop instruction for the rectifier part, so as to realize the reciprocating interaction between the rectifier part and the inverter part.

[0150] In some embodiments, the RX module includes: a frame matching unit 22, which is connected to the RX port 21 and is used to identify data frames of broadcast data on the bus, and start receiving the first moment current loop instruction when a preset matching frame is identified.

[0151] In some embodiments, the inverter unit Inv may include a first delay timer timer3. When the inverter unit Inv receives the current loop instruction at the first moment, the first delay timer timer3 is triggered to start timing. When the timing value of the first delay timer timer3 reaches the first preset delay time delay1, the data output module 24 outputs the calculation result of the current loop calculation task, wherein the first preset delay time is set to the execution time of the current loop calculation task.

[0152] In some embodiments, when the inverter unit Inv outputs the calculation result of the current loop calculation task, it also resets the timing value of the PWM timer, so that the PWM module outputs according to the latest current loop calculation result.

[0153] In some embodiments, the inverter unit Inv may include a second delay timer timer4. When the inverter unit Inv receives the current loop instruction at the first moment, it triggers the second delay timer time4 to start timing. When the timing value of the second delay timer timer4 reaches the second preset delay time delay2, the TX module uploads the collected motor position to the rectifier unit Rec, wherein the second preset delay time delay2 is set to the execution time of the motor position acquisition task.

[0154] In some embodiments, the inverter unit Inv in the motor position acquisition task acquires the motor position specifically including: the inverter unit Inv initiates communication with the encoder on the motor M so that the encoder latches the motor position and feeds back the latched information to the inverter unit Inv, and the received latched information is resolved to obtain the motor position.

[0155] In some embodiments, the execution time of the motor position acquisition task includes: the sum of the time for the inverter Inv to communicate with the encoder and the time for resolving the received latch information.

[0156] It should be noted that for details not disclosed in the inverter part of the multi-axis servo communication system of this embodiment, please refer to the details disclosed in the embodiment of the bus communication method applied to the inverter part in the embodiment of the present application, and no further details will be given here.

[0157] Also, see Fig.16 An embodiment of the present application provides a bus communication system, specifically including a master station 30 and n slave stations 40, the master station 30 performs full-duplex communication with the n slave stations 40, wherein n is an integer greater than 1.

[0158] The master station 30 includes: a first TX module, a first RX module and an instruction generation module 32 .

[0159] The first TX module is used to send corresponding first moment control instructions to n slave stations in sequence. Specifically, the first TX module may include a first TX port 33, and send control instructions to the slave station 40 through the first TX port 33. The first RX module is used to receive target data uploaded by the slave station 40. Specifically, the first RX module may include a first RX port 31, and receive data uploaded by the slave station 40 through the first RX port 31. The instruction generation module 32 is used to generate corresponding second moment control instructions according to the target data uploaded by the slave station 40.

[0160] The slave station 40 includes: a second RX module, a task starting module, a data output module and a second TX module.

[0161] The second RX module is used to receive the first moment control instruction from the main station 30. Specifically, the second RX module may include a second RX port 41, and the control instruction issued by the main station 30 is received through the second RX port 41. The task start module is used to start the first task tsk5 and the second task tsk6, wherein the first task tsk5 includes calculating and obtaining the calculation result according to the instruction of the first moment control instruction, and the second task tsk6 includes collecting target data. The data output module 44 is used to output the calculation result of the first task tsk5 after the first preset delay time has passed since the first moment. The second TX module is used to upload the collected target data to the main station 30 after the second preset delay time has passed since the first moment. Specifically, the second TX module may include a second TX port 45, and the target data is uploaded to the main station 30 through the second TX port 45.

[0162] According to the bus communication system proposed in the embodiment of the present application, by utilizing the full-duplex communication mechanism, the master station can receive the return data of any slave station on the bus while issuing control instructions, and all slave stations can immediately receive the data sent by the master station, and all data uploaded by the slave stations can also be immediately received by the master station. There is no delay caused by the topological structure in the issuance of control instructions and the uploading of target data, which shortens the communication cycle between the master station and the slave station, reduces the communication delay between the master station and the slave station, and effectively improves the dynamic performance of the communication system; and, when receiving the control instruction, the slave station will start the calculation task and the data acquisition task to output the calculation results and generate new control instructions for the master station, so as to realize the reciprocating interaction between the master station and the slave station.

[0163] In some embodiments, the first TX module of the master station 30 sequentially sends corresponding first-time control instructions to n slave stations according to a preset sending order. Moreover, when the master station 30 sends a first-time control instruction to the m-th slave station, it also receives target data fed back by the slave station ranked at the position immediately after the m-th slave station in the preset sending order, where m < n. In addition, when the master station 30 sends a current-time control instruction to the slave station ranked at the last position in the preset sending order, it also receives target data fed back by the slave station ranked at the first position in the preset sending order.

[0164] In some embodiments, the second RX module includes: a frame matching unit 42. The frame matching unit 42 is connected to the second RX port 41 and is configured to identify data frames of the broadcast data on the bus and start receiving the first-time control instruction when a preset matching frame is identified.

[0165] In some embodiments, the slave station 40 may include a first delay timer timer5. When the slave station 30 receives the first-time control instruction, it triggers the first delay timer timer5 to start timing. When the timing value of the first delay timer timer5 reaches a first preset delay time delay1, the data output module 44 outputs the calculation result of the first task tsk5, where the first preset delay time is set to the execution time of the first task tsk5.

[0166] In some embodiments, the slave station 40 may include a second delay timer timer6. When the slave station 40 receives the first-time control instruction, it triggers the second delay timer timer6 to start timing. When the timing value of the second delay timer timer6 reaches a second preset delay time delay2, the second TX module uploads the collected target data to the master station, where the second preset delay time delay2 is set to the execution time of the second task tsk6.

[0167] In some embodiments, each slave station 40 is connected to a target device 46. The second task tsk6 is to collect target data of the target device 46. Moreover, the data output module 44 outputs the calculation result of the first task tsk5, specifically by sending the calculation result of the first task tsk5 to the target device 46 to facilitate driving the target device 46 to operate.

[0168] It should be noted that for the details not disclosed in the bus communication system of this embodiment, please refer to the details disclosed in the embodiment of the bus communication method applied to the bus communication system in the embodiments of this application, which will not be elaborated here.

[0169] In addition, please refer to Fig.17, the embodiment of the present application also provides a multi-axis servo system, including a rectifier Rec and n inverters Inv1 to Invn, where n is an integer greater than 1. Each inverter can be connected to a motor M, for example, inverter Inv1 is connected to motor M1, inverter Inv2 is connected to motor M2, and inverter Invn is connected to motor Mn. The multi-axis servo system can be a multi-axis servo system with a common DC bus, and the rectifier Rec and each inverter Inv are separately arranged. It should be noted that, Fig.17 Only one inverter unit Inv1 is shown.

[0170] The rectifying unit Rec includes: a first TX module, a first RX module and an instruction generating module 52 .

[0171] The first TX module is used to send the corresponding first moment current loop instructions to the n inverter units Inv1~Invn in sequence. Specifically, the first TX module may include a TX0 port, and the current loop instruction is sent through the TX0 port. The first RX module is used to receive the motor position uploaded by the inverter unit Inv. Specifically, the first RX module may include an RX0 port, and the motor position uploaded by the inverter unit Inv is received through the RX0 port. The TX0 port and the RX0 port can be the communication ports of the MCU (Microcontroller Unit) of the rectifier unit Rec. The instruction generation module 52 is used to generate the corresponding second moment current loop instruction according to the motor position uploaded by the inverter unit Inv.

[0172] The inverter unit Inv includes: a second RX module, a task starting module 63, a data output module 64 and a second TX module.

[0173] The second RX module is used to receive the current loop instruction at the first moment from the rectifier Rec. Specifically, the second RX module of the inverter Inv1 may include an RX1 port, through which the current loop instruction issued by the rectifier Rec is received. The task start module 63 is used to start the current loop calculation task tsk7 and the motor position acquisition task tsk8, wherein the current loop calculation task tsk7 includes calculating and obtaining the calculation result according to the instruction of the current loop instruction at the first moment, and the motor position acquisition task tsk8 includes collecting the motor position. The data output module 64 is used to output the calculation result of the current loop calculation task tsk7 after the first preset delay time delay1 from the first moment. The second TX module is used to upload the collected motor position to the rectifier Rec after the second preset delay time delay2 from the first moment. Specifically, the second TX module may include a TX1 port, through which the motor position is uploaded to the rectifier Rec. The TX1 port and the RX1 port can be the communication ports of the MCU (Microcontroller Unit) of the inverter Inv1.

[0174] The rectifier unit Rec is connected to n inverter units through a bus and performs full-duplex communication. The rectifier unit Rec is equivalent to a master station (Master), and each inverter unit Inv is equivalent to a slave station (Slave), forming a one-master-multiple-slave communication architecture.

[0175] Each inverter can use FPGA chip (Field Programmable Gate Array) or CPLD chip (Complex Programmable logic device) or CLB module (Configurable Logic Block) to realize parallel logic processing function, parallel processing current loop startup, encoder communication startup, PWM Timer delay startup and inverter feedback data transmission delay startup, to ensure that the timing of each inverter is aligned and the delay is small. Please refer to Fig.18, taking the communication between the rectifier unit Rec and the inverter unit Inv1 as an example, the rectifier unit Rec sends the corresponding current loop command at the current moment to the inverter unit Inv1. After the transmission delay time of the rectifier unit, the command is received by the inverter unit Inv1. The inverter unit Inv1 performs current loop control (current loop calculation) according to the received command, and controls the operation of the motor M1 according to the calculation result. At the same time, when the inverter unit Inv1 receives the command, it starts to collect and calculate the encoded position to obtain the position of the motor at the current moment. The inverter unit Inv1 uploads the position of the motor at the current moment to the rectifier unit Rec. After the transmission delay time of the inverter unit, the position of the motor at the current moment is received by the rectifier unit Rec. Then, the rectifier unit Rec performs position loop control (position loop calculation) and speed loop control (speed loop calculation) according to the received motor position, and generates the current loop command to be sent to the inverter unit Inv1 in the next interaction cycle with the inverter unit Inv1 according to the calculation result.

[0176] According to the multi-axis servo system proposed in the embodiments of the present application, by using the full-duplex communication mechanism, the rectifier unit can receive the return data of any inverter unit on the bus while sending the current loop command, and all inverter units can immediately receive the data sent by the rectifier unit. The data uploaded by all inverter units can also be immediately received by the rectifier unit. There is no delay caused by the topological structure in the issuance of the command and the upload of the motor position, shortening the communication cycle between the rectifier unit and the inverter unit, reducing the communication delay between the rectifier unit and the inverter unit, and effectively improving the dynamic performance of the multi-axis servo system; moreover, when the inverter unit receives the current loop command, it will start the current loop task and the motor position acquisition task to output the calculation result and generate a new current loop command by the rectifier unit, realizing the reciprocating interaction between the rectifier unit and the inverter unit.

[0177] In some embodiments, the rectifier unit Rec sequentially sends the corresponding current loop commands at the first moment to n inverter units Inv1 to Invn according to the preset sending order. Moreover, when the rectifier unit Rec sends the current loop command at the first moment to the mth inverter unit Invm, it also receives the motor position feedback by the inverter unit ranked at the next position after the mth inverter unit Invm in the preset sending order, where m < n, and when the rectifier unit Rec sends the current loop command at the current moment to the inverter unit Invn ranked at the end in the preset sending order, it also receives the motor position feedback by the inverter unit Inv1 ranked at the first in the preset sending order.

[0178] In some embodiments, the second RX module of the inverter unit Inv includes: a frame matching unit 62. The frame matching unit 62 is connected to the RX0 port and is used to identify the data frame of the broadcast data on the bus, and starts to receive the current loop command at the first moment when the preset matching frame is identified.

[0179] In some embodiments, the inverter unit Inv may include a first delay timer timer5. When the inverter unit Inv receives the current loop instruction at the first moment, the first delay timer timer5 is triggered to start timing. When the timing value of the first delay timer timer5 reaches the first preset delay time delay1, the data output module 64 outputs the calculation result of the current loop calculation task tsk7, wherein the first preset delay time delay1 is set as the execution time of the current loop calculation task tsk7.

[0180] In some embodiments, when the inverter unit Inv outputs the calculation result of the current loop calculation task tsk7, it also resets the timing value of the PWM timer, so that the PWM module outputs according to the latest current loop calculation result.

[0181] In some embodiments, the inverter unit Inv may include a second delay timer timer6. When the inverter unit Inv receives the current loop instruction at the first moment, the second delay timer timer6 is triggered to start timing. When the timing value of the second delay timer timer6 reaches the second preset delay time delay2, the TX1 port of the second TX module uploads the collected motor position to the rectifier unit Rec, wherein the second preset delay time delay2 is set to the execution time of the motor position acquisition task tsk8.

[0182] In some embodiments, the inverter unit Inv in the motor position acquisition task acquires the motor position specifically including: the inverter unit Inv initiates communication with the encoder on the motor M so that the encoder latches the motor position and feeds back the latched information to the inverter unit Inv, and the received latched information is resolved to obtain the motor position.

[0183] In some embodiments, the execution time of the motor position acquisition task includes: the sum of the time for the inverter Inv to communicate with the encoder and the time for resolving the received latch information.

[0184] It should be noted that for details not disclosed in the multi-axis servo system of this embodiment, please refer to the details disclosed in the embodiment of the bus communication method applied to the multi-axis servo system in the embodiment of the present application, and no further details will be given here.

[0185] The overall communication process of the multi-axis servo system can be found in Figure 5 and Fig.17Taking the inverter Inv1 as an example, after the rectifier Rec generates the current loop instruction com1 for controlling the inverter Inv1, it broadcasts the instruction com1 to the bus through the TX0 port. At this time, each inverter Inv receives the instruction com1 through the RX port and identifies the instruction com1 through its own configured frame matching unit. Since the instruction com1 corresponds to the inverter Inv1, only the data frame identified by the inverter Inv1 from the instruction com1 is compatible with the unique identifier of the inverter Inv1 itself, that is, the matching frame is identified, and other inverters will not recognize the matching frame.

[0186] After identifying the matching frame, the inverter Inv1 immediately starts to respond to the current loop instruction at the current moment and can start to perform the following four actions at the same time:

[0187] The first action is: the inverter unit Inv1 starts to perform current loop calculation (current loop control) according to the positioning data and speed data contained in the instruction com1, outputs the calculation result to the PWM module, and outputs the corresponding signal to control the operation of the motor M through the modulation of the PWM module.

[0188] The second action is: the inverter unit Inv1 triggers the first delay timer timer5 to start timing, and when the timing value of the first timer reaches the first preset delay time delay1, it triggers the timing value of the PWM timer (PWM-Timer) to reset, so that the PWM timer starts timing from zero again, wherein the first preset delay time delay1 is set to the calculation duration of the current loop calculation performed by the inverter unit Inv1, thereby making the current loop calculation result updated to the PWM module the latest.

[0189] The third action is: the inverter Inv1 starts to communicate with the encoder installed on the motor M, sends a collection signal to the encoder, and the encoder latches the motor position information after receiving the collection signal, and feeds back the latched motor position at the current moment to the inverter Inv1, thereby completing the communication with the encoder, and then the inverter Inv1 solves the information fed back by the encoder to obtain the current position of the motor. Since the latch is started according to the data frame sending time of the rectifier, the position loop and speed loop of the rectifier Rec can effectively compensate for the position information fed back by the inverter Inv1.

[0190] The fourth action is: the inverter Inv1 triggers the data transmission timer (second delay timer timer6) to start timing, and when the timing value of the data transmission timer reaches the second preset delay time delay2, it triggers the current position of the motor to be broadcast to the bus through the TX1 port to send it to the rectifier Rec. Among them, the second delay time delay2 is set to the sum of the time when the inverter Inv1 communicates with the encoder and the time when the inverter Inv1 resolves the position information, so that the motor position information uploaded by the inverter Inv1 is the latest, reducing the delay in the position feedback signal of the position control loop and the speed control loop.

[0191] Among the above four actions, the first and second actions are used for motor control, and the third and fourth actions are used for information feedback to the rectifier Rec. The rectifier Rec receives the current position of the motor sent by the inverter Inv1 through the RX0 port, performs position loop calculation and speed loop calculation based on the motor position information, and calculates the positioning data and speed data respectively. The calculated positioning data and speed data are used to generate a new current loop instruction com1', and the instruction com1' is used for the motor control of the inverter Inv1 in the next interactive cycle.

[0192] Since there are n motors and n inverters in the multi-axis servo system, the communication process between the rectifier Rec and each of the inverters Inv2 to Invn is the same as the communication process between the rectifier Rec and the inverter Inv1. However, for the rectifier Rec, the communication process between the rectifier Rec and all the inverters Inv1 to Invn can be: the rectifier Rec sends corresponding current loop instructions com1, com2, ..., comn to Inv1, Inv2, ..., Invn in a pre-set order. In the embodiment, after the rectifier unit Rec sends the current loop instruction com1 to the inverter unit Inv1, the inverter unit Inv1 starts to control the motor and collect the motor position information after receiving the instruction com1. After the inverter unit Inv1 completes the motor position information collection and uploads it to the rectifier unit Rec, the rectifier unit Rec can generate a new current loop instruction based on it, and then start the next round of current loop instruction sending work. Before the rectifier unit Rec generates and sends a new current loop instruction to the inverter unit Inv1, the rectifier unit Rec has completed the instruction sending work of Inv2~Invn.

[0193] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0194] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0195] In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can expressly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. Relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0196] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0197] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A bus communication method, characterized in that: The method is applied to n slave stations in a bus communication system, wherein the bus communication system further comprises a master station, and the master station performs full-duplex communication with the n slave stations, wherein n is an integer greater than 1, and the method comprises: receiving a first moment control instruction from the master station, and starting a first task and a second task, wherein the first task includes performing calculations according to the instructions of the first moment control instruction and obtaining calculation results, and the second task includes collecting target data; After a first preset delay time has passed since a first moment, outputting a calculation result of the first task; After a second preset delay time has passed since the first moment, the collected target data is uploaded to the master station, so that the master station generates a control instruction at the second moment according to the target data.

2. The method according to claim 1, characterized in that Receiving a first time control instruction from the master station, comprising: Identify data frames of data broadcast on the bus; When the preset matching frame is identified, the first moment control instruction starts to be received.

3. The method according to claim 1, characterized in that After a first preset delay time has passed since a first moment, outputting a calculation result of the first task includes: When the first moment control instruction is received, triggering a first delay timer to start timing; When the timing value of the first delay timer reaches a first preset delay time, the calculation result of the first task is output, wherein the first preset delay time is set as the execution time of the first task.

4. The method according to claim 1, characterized in that: After a second preset delay time has passed since the first moment, uploading the collected target data to the main station includes: When the first moment control instruction is received, triggering the second delay timer to start timing; When the timing value of the second delay timer reaches a second preset delay time, the collected target data is uploaded to the master station, wherein the second preset delay time is set as the execution time of the second task.

5. The method according to any one of claims 1 to 4, characterized in that Each of the slave stations is connected to a target device, the second task is to collect target data of the target device, and outputting the calculation result of the first task specifically includes: sending the calculation result of the first task to the target device to drive the target device to run.

6. The method according to claim 5, characterized in that The bus communication system is a multi-axis servo system, the master station is a rectifier unit, the slave station is an inverter unit, the target device is a motor, the target data is a motor position, the first moment control instruction includes a current loop instruction, and the calculation in the first task is a current loop calculation according to the current loop instruction.

7. The method according to claim 6, characterized in that When outputting the calculation result of the first task, the timing value of the PWM timer is also reset, so that the PWM module outputs according to the latest current loop calculation result.

8. The method according to claim 6, characterized in that The second task of collecting the motor position specifically includes: Initiating communication with an encoder on the motor so that the encoder latches the motor position and feeds back the latched information to the inverter; The received latch information is resolved to obtain the motor position.

9. The method according to claim 8, characterized in that The execution time of the second task includes: the sum of the duration of communicating with the encoder and the duration of resolving the received latch information.

10. A bus communication method, characterized in that: Applied to a bus communication system, the bus communication system includes a master station and n slave stations, and the master station communicates with the n slave stations in full duplex, where n is an integer greater than 1. The method includes: The master station sequentially sends corresponding first - moment control instructions to the n slave stations; The slave station receives the first - moment control instruction from the master station and starts a first task and a second task. Among them, the first task includes performing calculations according to the indication of the first - moment control instruction and obtaining a calculation result, and the second task includes collecting target data; After a first preset delay time from the first moment, the slave station outputs the calculation result of the first task; After a second preset delay time from the first moment, the slave station uploads the collected target data to the master station; The master station receives the target data uploaded by the slave station and generates a corresponding second - moment control instruction based on the target data.

11. The method according to claim 10, characterized in that The master station sequentially sends corresponding first - moment control instructions to the n slave stations according to a preset sending order. Moreover, when the master station sends a first - moment control instruction to the m - th slave station, it also receives the target data fed back by the slave station ranked at the position immediately after the m - th slave station in the preset sending order, where m < n. And when the master station sends a current - moment control instruction to the slave station ranked at the last position in the preset sending order, it also receives the target data fed back by the slave station ranked at the first position in the preset sending order.

12. A slave station of a bus communication system, characterized in that: The bus communication system includes a master station and n slave stations, and the master station communicates with the n slave stations in full duplex, where n is an integer greater than 1. The slave station includes: An RX module, configured to receive the first - moment control instruction from the master station; A task start module, configured to start a first task and a second task. Among them, the first task includes performing calculations according to the indication of the first - moment control instruction and obtaining a calculation result, and the second task includes collecting target data; A data output module, configured to output the calculation result of the first task after a first preset delay time from the first moment; and A TX module, configured to upload the collected target data to the master station after a second preset delay time from the first moment, so that the master station generates a second - moment control instruction based on the target data.

13. A bus communication system, characterized in that: Including a master station and n slave stations, the master station communicates with the n slave stations in full duplex, where n is an integer greater than 1; The master station includes: A first TX module, configured to sequentially send corresponding first - moment control instructions to the n slave stations; A first RX module, configured to receive the target data uploaded by the slave station; and An instruction generation module, configured to generate a corresponding second - moment control instruction based on the target data uploaded by the slave station; The slave station includes: A second RX module, configured to receive the first - moment control instruction from the master station; A task start module, configured to start a first task and a second task. Among them, the first task includes performing calculations according to the indication of the first - moment control instruction and obtaining a calculation result, and the second task includes collecting target data; a data output module, configured to output the calculation result of the first task after a first preset delay time has passed since a first moment; and The second TX module is used to upload the collected target data to the main station after a second preset delay time has passed since the first moment.

Citation Information

Patent Citations

  • Control device, lower computer, electric injection table and injection molding machine

    CN109702960A

  • Synchronous serial port based bidirectional non-address cascaded earthquake data transmission system and using method thereof

    CN110095808A