Bus communication method and motion control system

By setting up a hybrid bus connection method in series and parallel in the motion control system, the problems of low communication efficiency and difficulty in synchronization control in the prior art are solved, and efficient multi-slave synchronization control and time synchronization accuracy are achieved.

CN117872846BActive Publication Date: 2025-05-13GUANGZHOU ZHIYUAN ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311724968.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-05-13
Estimated Expiration
2043-12-14

AI Technical Summary

Technical Problem

The prior art cannot guarantee communication efficiency on the basis of maintaining a simple wiring structure, and it is difficult for the host to control or query multiple slaves simultaneously, affecting the time synchronization accuracy of multi-axis motion.

Method used

By setting up a hybrid bus connection method in series and parallel, the host can broadcast command frames through the sending bus and listen to response frames from the receiving bus. The last slave transmits the response frames forward step by step to the host, realizing the host's synchronous control and query of multiple slaves.

Benefits of technology

On the basis of maintaining a simple wiring structure, communication efficiency is improved, the host controls the synchronous control of multiple slaves is realized, and the time synchronization accuracy requirements for multi-axis motion is met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117872846B_ABST
    Figure CN117872846B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a bus communication method and a motion control system, the method comprising: the host broadcasts the command frame through the sending bus, and listens to the response frame of the corresponding command frame from the receiving bus; when the last-stage slave in the series of multiple slaves receives the command frame, the last-stage slave sends the response frame generated by the corresponding command frame to the slave of the previous stage through the receiving bus; each non-last-stage slave processes the information of the corresponding command frame on the received response frame, and transmits the processed response frame forward through the receiving bus; when the host listens to the response frame from the receiving bus, it reads the response content corresponding to each target slave from the response frame. By setting a hybrid bus connection mode of series and parallel connection, the host can synchronously control or query multiple slaves on the basis of maintaining a simple wiring structure, without the need to inquire one by one, thereby improving communication efficiency and meeting the time synchronization accuracy requirements of multi-axis motion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a bus communication method and a motion control system. Background Art

[0002] At present, for products involving motion control such as robots and robotic arms, each joint axis will use the installation method of motor modules in series, where the cables used for series connection will include functions such as power supply, grounding and communication. Taking motion control through series servos as an example, during the motion control process, the host communicates with the slave through a single bus half-duplex serial method, such as RS485, RS232 serial communication, etc. Since data transmission and reception use the same UART communication line, although the wiring structure is simple, it does not involve an arbitration mechanism. Multiple slaves sending data to the bus at the same time will cause level confusion. Therefore, when communicating, the host usually uses a one-to-one inquiry method for the slaves, or a communication method in which the host sends a broadcast but the slave does not respond.

[0003] However, the question-and-answer communication method between the host and the slaves is inefficient. The host needs to inquire all the slaves one by one to obtain the status of each slave, which makes it impossible for the host to synchronously control multiple slaves. It can only send commands one by one in sequence, which affects the time synchronization accuracy of multi-axis motion. Therefore, while maintaining a simple wiring structure, the communication efficiency cannot be guaranteed, and it is difficult for the host to synchronously control or query multiple slaves. Summary of the invention

[0004] The embodiments of the present application provide a bus communication method and a motion control system, which solve the problem that the communication efficiency cannot be guaranteed while maintaining a simple wiring structure, and it is difficult for the host to synchronously control or query multiple slaves. By setting a hybrid bus connection method of series and parallel, the host can synchronously control or query multiple slaves while maintaining a simple wiring structure without inquiring one by one, thereby improving communication efficiency and meeting the time synchronization accuracy requirements of multi-axis motion.

[0005] In a first aspect, an embodiment of the present application provides a bus communication method, which is applied to a motion control system, wherein the motion control system includes a host and multiple slaves, wherein the multiple slaves are connected to the host in parallel via a transmitting bus, and the host is connected to the multiple slaves in series via a receiving bus;

[0006] The method comprises:

[0007] The host broadcasts a command frame through the sending bus, and monitors a response frame corresponding to the command frame from the receiving bus, wherein the command frame includes command information corresponding to at least one target slave among the slaves;

[0008] When a last-stage slave among the plurality of slaves connected in series receives the command frame, the last-stage slave sends a response frame generated corresponding to the command frame to a slave at a previous stage through the receiving bus;

[0009] Each non-final slave performs information processing corresponding to the command frame on the received response frame, and transmits the processed response frame forward through the receiving bus;

[0010] When the host monitors the response frame from the receiving bus, the host reads the response content corresponding to each of the target slaves from the response frame.

[0011] Optionally, the last-stage slave sends the response frame generated corresponding to the command frame to the previous-stage slave through the receiving bus, including:

[0012] When the final slave determines that the command frame contains command information corresponding to its own slave identification, the final slave extracts the command information associated with its own slave identification from the command frame, generates corresponding response content based on the associated command information, generates a response frame including the corresponding response content, and sends the response frame to the previous slave through the receiving bus;

[0013] When the final slave determines that there is no command information corresponding to its own slave ID in the command frame, it generates a response frame with empty response content corresponding to its own slave ID, and sends the response frame to the previous slave through the receiving bus.

[0014] Optionally, the command frame includes a target slave identifier corresponding to at least one target slave among the multiple slaves and command information;

[0015] Accordingly, each non-final slave performs information processing corresponding to the command frame on the received response frame, and transmits the processed response frame forward through the receiving bus, including:

[0016] In the case where each target slave in the non-final slave determines that its own slave identification matches the target slave identification, each of the target slaves extracts command information associated with its own slave identification from the command frame, generates corresponding response content based on the command information, adds the corresponding response content to the received response frame, and transmits the response frame forward;

[0017] In the case that the non-target slaves among the non-final slaves determine that their own slave identification does not match the target slave identification, each of the non-target slaves forwards the received response frame.

[0018] Optionally, before the host broadcasts the command frame through the sending bus, the method further includes:

[0019] When the host and the plurality of slaves are in a powered-on state, the host broadcasts a positioning command frame through the sending bus and starts a first timing, and stops the first timing when a positioning success frame corresponding to the positioning command frame is monitored through the receiving bus;

[0020] Each of the slaves generates a positioning response frame corresponding to the received positioning command frame, sends the positioning response frame to the slave of the previous stage through the receiving bus, and starts the second timing until the positioning response frame sent by the slave of the next stage is received through the receiving bus, and stops the second timing;

[0021] When the first slave among the slaves determines that the corresponding second timing duration exceeds the set second threshold, the first slave marks the local end as the final slave and transmits the generated positioning success frame forward through the receiving bus.

[0022] Optionally, the method further includes:

[0023] When the host determines that the corresponding first timing duration exceeds a set first threshold, the host outputs an alarm message indicating that the corresponding slave fails to locate.

[0024] Optionally, the positioning success frame is provided with a count field, and the count field is set to be incremented each time the positioning success frame is forwarded;

[0025] The method further comprises:

[0026] Each non-final slave extracts a count value from the count field corresponding to the received positioning success frame, and records the count value as the bus position number of the local end.

[0027] Optionally, the method further includes:

[0028] The host extracts a counting result from a counting field corresponding to the received positioning success frame, and records the counting result as the current number of slaves.

[0029] Optionally, after reading the response content corresponding to each of the target slaves from the response frame, the method further includes:

[0030] The host verifies the response content of each target slave, and when determining that there is a target slave with abnormal response content, outputs alarm information of the abnormal response of the corresponding slave.

[0031] Optionally, the method further includes:

[0032] When the second slave among the slaves meets the information reporting condition, the second slave transmits the generated information reporting frame forward through the receiving bus.

[0033] In a second aspect, an embodiment of the present application further provides a motion control system, including: a host and multiple slaves, wherein the host and the multiple slaves communicate using the bus communication method described in any embodiment of the present application.

[0034] In the embodiment of the present application, the host broadcasts the command frame through the sending bus, and listens to the response frame of the corresponding command frame from the receiving bus, and the command frame includes the command information of at least one target slave in the corresponding slave; when the last slave in the series of multiple slaves receives the command frame, the last slave sends the response frame generated by the corresponding command frame to the slave of the previous level through the receiving bus; each non-last slave processes the information of the received response frame corresponding to the command frame, and transmits the processed response frame forward through the receiving bus; when the host listens to the response frame from the receiving bus, it reads the response content corresponding to each target slave from the response frame. By setting a hybrid bus connection mode of series and parallel, the host can synchronously control or query multiple slaves on the basis of maintaining a simple wiring structure, without the need to inquire one by one, thereby improving communication efficiency and meeting the time synchronization accuracy requirements of multi-axis motion. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A flowchart of a bus communication method provided in an embodiment of the present application;

[0036] Figure 2 A flowchart of a bus communication method including a process of generating a response frame by a final-stage slave provided in an embodiment of the present application;

[0037] Figure 3 A flowchart of a bus communication method including a process of a non-final slave transmitting a response frame forward provided in an embodiment of the present application;

[0038] Figure 4 A flowchart of a bus communication method including a final slave positioning process provided in an embodiment of the present application;

[0039] Figure 5 A schematic diagram of the structure of a motion control system provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of a process of a host sending a command frame of a motion control system provided in an embodiment of the present application;

[0041] Figure 7 A schematic diagram of a process of a host receiving a response frame of a motion control system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.

[0043] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0044] The bus communication method provided in the embodiment of the present application is applied to application scenarios where products such as robots and mechanical arms require synchronous control of multiple machines. Taking the synchronous control of multiple servos as an example, the host can be a controller for controlling the slave to perform joint movements, and the slave can be multiple bus servos, wherein the bus servos may include a motor module, a control module, and a bus interface, and the control module may include a microcontroller, a drive circuit, and a communication interface, and the microcontroller may be used to execute a control algorithm, and the drive circuit may be used to control the rotation of the motor, and the communication interface may be used to communicate with the bus. Of course, the aforementioned application scenarios are only exemplary descriptions, and the bus communication method can also be applied in other motion control scenarios, which are not limited in the present application.

[0045] Figure 1 A flowchart of a bus communication method provided in an embodiment of the present application, the bus communication method can be applied to a motion control system, the motion control system includes a host and multiple slaves, wherein the multiple slaves are connected in parallel to the host via a sending bus, the host can send commands to the multiple slaves simultaneously through the sending bus, the host is connected in series with the multiple slaves through a receiving bus, and each slave can transmit the response content of the command sent by the host forward through the receiving bus, and reach the host in a step-by-step transmission manner.

[0046] like Figure 1 As shown, the bus communication method specifically includes the following steps:

[0047] Step S101: The host broadcasts a command frame through a sending bus, and monitors a response frame corresponding to the command frame from a receiving bus, wherein the command frame includes command information of at least one target slave among the corresponding slaves.

[0048] Among them, the host can generate corresponding command frames according to different control requirements and send them to the slaves. For example, the command frame can be used to obtain the slave status, control the slave action, etc. Since multiple slaves are connected to the host at the same time through the sending bus, the host can broadcast the command frame through the sending bus, so that each slave can receive the command frame synchronously. It is worth noting that since the command information corresponding to different slaves may be different, the host can associate the slave identifier with the corresponding command content in the command frame. After receiving the command frame, the slave can read the command content corresponding to its own slave identifier, so that the host can independently control each slave according to the needs of the actual application scenario. Of course, the host can select the target slave from the connected slaves for control according to the specific task requirements. Correspondingly, the host can generate command information corresponding to the slave identifier of the target slave, so that only the target slave that matches its own slave identifier needs to respond to the command frame, improving the accuracy and flexibility of control. Taking the servo control as an example, the control action of each slave may be different, so the host needs to generate corresponding control commands for different slaves according to the target posture requirements. The corresponding control commands can be associated with the slave identifier, so that the host can send the command frame to each slave synchronously through the sending bus, and can also meet the independent control of different slaves. In addition, after the host broadcasts the command frame through the sending bus, it can monitor the receiving bus to receive the response frame generated by the slave corresponding to the command frame. The response frame can contain feedback information generated after each target slave takes action in response to the command frame, for example, returning status query results, returning action execution results, etc.

[0049] Step S102: When the last slave in the series of multiple slaves receives a command frame, the last slave sends a response frame generated corresponding to the command frame to the previous slave via a receiving bus.

[0050] Wherein, after the host broadcasts the command frame by sending the bus, multiple slaves connected in parallel will receive the command frame synchronously. In order to avoid data competition caused by multiple slaves responding at the same time, resulting in the loss of response data of individual slaves, the embodiment of the present application transmits the response frame step by step through the data link formed by the host and multiple slaves in series, which can orderly and completely integrate the response content of all slaves and avoid the problem of data competition. In the specific implementation process, the final slave is the object of generating the initial response frame. When the final slave receives the command frame, the response frame can be generated corresponding to the command frame. It can be understood that when the target slave corresponding to the command frame includes the final slave, the response frame generated by the final slave needs to include its own response content. When the target slave corresponding to the command frame does not include the final slave, the response content of the response frame generated by the final slave can be empty, and the target slave can supplement the respective response content in the subsequent step-by-step transmission process. Optionally, in addition to generating the initial response frame by the final slave, the initial response frame can also be generated by the slave at the end of the data link in the series connection in the target slave to improve the response efficiency, which is not limited in this application.

[0051] Step S103: Each non-final slave performs information processing on the received response frame corresponding to the command frame, and transmits the processed response frame forward through the receiving bus.

[0052] Among them, in the process of step-by-step transmission of the response frame, after each non-final slave receives the response frame, it is necessary to perform corresponding information processing according to the command content of the command frame. If the non-final slave currently receiving the response frame is the target slave, the information processing may be that the non-final slave executes the command content and associates the generated response content with its own slave identifier and adds it to the response frame. If the non-final slave currently receiving the response frame is not the target slave, the information processing may be that the response frame does not need to be processed and the response frame is directly forwarded. Thus, after each non-final slave receives the response frame sent by the slave of the next level and completes the corresponding information processing, it continues to send the updated response frame to the slave of the previous level, effectively ensuring the orderliness of the slave response, which is conducive to the host receiving the response content of all slaves completely, accurately distinguishing the response content of each slave, and mastering the response of the slave.

[0053] Step S104: When the host monitors a response frame from the receiving bus, the host reads the response content corresponding to each target slave from the response frame.

[0054] Among them, after the response frame generated by the last-level slave is updated step by step and transmitted forward to the first-level slave, the first-level slave completes the information processing of the corresponding response frame and transmits the final response frame to the host through the receiving bus. After the host receives the response frame, it can read the response content corresponding to each target slave from the response frame. Specifically, the associated response content can be read by identifying the slave identifier of each target slave.

[0055] Optionally, after the host completes reading the response content of each target slave, the response content of each target slave can be verified. When it is determined that there is a target slave with abnormal response content, an alarm message of the corresponding slave response abnormality is output, wherein the verification method can check the format, size, and field value of the response content. For format abnormalities or value abnormalities, an alarm message of the slave response abnormality can be output to remind developers to promptly use the slave identifier corresponding to the abnormal response content to troubleshoot and repair the slave that may have an abnormality.

[0056] In one embodiment, since the master-slave connection mode provided by the bus communication method of the present application supports full-duplex communication, when the second slave among the slaves meets the information reporting conditions, the second slave can transmit the generated information reporting frame forward through the receiving bus. As a result, the slave can report information according to its own settings at any time, and avoid data conflicts caused by different slaves sending information at the same time by forward transmission.

[0057] As can be seen from the above, the host broadcasts the command frame through the sending bus, and listens to the response frame of the corresponding command frame from the receiving bus. The command frame includes the command information of at least one target slave in the corresponding slave; when the last slave in the series of multiple slaves receives the command frame, the last slave sends the response frame generated by the corresponding command frame to the slave of the previous level through the receiving bus; each non-last slave processes the information of the received response frame corresponding to the command frame, and transmits the processed response frame forward through the receiving bus; when the host listens to the response frame from the receiving bus, it reads the response content corresponding to each target slave from the response frame. By setting a hybrid bus connection mode of series and parallel, the host can synchronously control or query multiple slaves on the basis of maintaining a simple wiring structure without asking one by one, thereby improving communication efficiency and meeting the time synchronization accuracy requirements of multi-axis motion.

[0058] Figure 2 A flowchart of a bus communication method including a process of generating a response frame by a final slave is provided in an embodiment of the present application, such as Figure 2 As shown, the bus communication method specifically includes the following steps:

[0059] Step S201: The host broadcasts a command frame through a sending bus, and monitors a response frame corresponding to the command frame from a receiving bus, wherein the command frame includes command information of at least one target slave among the corresponding slaves.

[0060] Step S202, when the last-stage slave among the multiple slaves connected in series receives a command frame, and when the last-stage slave determines that there is command information corresponding to its own slave identifier in the command frame, the last-stage slave extracts the command information associated with its own slave identifier from the command frame, generates corresponding response content based on the associated command information, generates a response frame containing the corresponding response content, and sends the response frame to the previous-stage slave through the receiving bus.

[0061] Step S203, when the last slave among the multiple slaves connected in series receives a command frame, and when the last slave determines that there is no command information corresponding to its own slave identifier in the command frame, it generates a response frame with an empty response content corresponding to its own slave identifier, and sends the response frame to the previous slave through the receiving bus.

[0062] Step S204: Each non-final slave performs information processing on the received response frame corresponding to the command frame, and transmits the processed response frame forward through the receiving bus.

[0063] Step S205: When the host monitors a response frame from the receiving bus, the host reads the response content corresponding to each target slave from the response frame.

[0064] Among them, the final slave generates a corresponding response frame for forward transmission according to whether there is command information matching its own slave identification in the command frame, and effectively serves as the initiator of the forward transmission of the response frame, which is beneficial for multiple slaves in series to process and transmit the response frames in sequence, and realize one question and multiple answers between the host and slaves in the case of avoiding data conflicts.

[0065] Figure 3 A flowchart of a bus communication method including a process of a non-final slave transmitting a response frame forward is provided in an embodiment of the present application, wherein the command frame includes a target slave identifier corresponding to at least one target slave among multiple slaves and command information, such as Figure 3 As shown, the bus communication method specifically includes the following steps:

[0066] Step S301: The host broadcasts a command frame through a sending bus, and monitors a response frame corresponding to the command frame from a receiving bus, wherein the command frame includes command information of at least one target slave among the corresponding slaves.

[0067] Step S302: When the last slave in the series of multiple slaves receives a command frame, the last slave sends a response frame generated corresponding to the command frame to the previous slave via a receiving bus.

[0068] Step S303: when each target slave in the non-final slave determines that its own slave identifier matches the target slave identifier, each target slave extracts command information associated with its own slave identifier from the command frame, generates corresponding response content based on the command information, adds the corresponding response content to the received response frame, and transmits the response frame forward;

[0069] Step S304: When a non-target slave in the non-final slave stage determines that its own slave identifier does not match the target slave identifier, each non-target slave transmits the received response frame forward.

[0070] Step S305 : When the host monitors a response frame from the receiving bus, the host reads the response content corresponding to each target slave from the response frame.

[0071] The command frame may include a slave identifier corresponding to each target slave and the associated command content, thereby distinguishing the control content of the host for different target slaves. The non-final slave may include a target slave and a non-target slave. In the process of forward transmission of the response frame step by step, when the target slave determines that there is its own slave identifier in the command frame, it generates a response content corresponding to the matching command information and adds it to the received command frame to complete the update of the command frame. When the non-target slave determines that there is no slave identifier in the command frame, it does not need to process the command frame and can directly transmit the command frame forward. The orderly response of multiple slaves based on the same command frame is realized, and the response content of the response frame is combined in sequence based on the serial order of the slaves, which reduces the complexity of distinguishing the response content corresponding to different slaves and improves the processing efficiency of the host receiving the final response frame.

[0072] Figure 4 A flowchart of a bus communication method including a final slave positioning process provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the bus communication method specifically includes the following steps:

[0073] Step S401: When the host and multiple slaves are powered on, the host broadcasts a positioning command frame through a sending bus and starts a first timing until a positioning success frame corresponding to the positioning command frame is monitored through a receiving bus, and then stops the first timing.

[0074] Among them, after the host and the slave are powered on, the final slave can be located first, and the host can broadcast the positioning command frame through the sending bus to notify the slave to confirm whether it is at the end of the serial communication link. In addition, the first timing can be the cumulative time from the host sending the positioning command frame to receiving the positioning success frame. By judging the first timing duration corresponding to the first timing, it can be determined whether the final slave is successfully located, and the response rate of the slave can be effectively estimated, which is conducive to adjusting the real-time control requirements of different application scenarios.

[0075] Step S402, each slave generates a positioning response frame corresponding to the received positioning command frame, sends the positioning response frame to the slave of the previous level through the receiving bus, and starts the second timing until the positioning response frame sent by the slave of the next level is received through the receiving bus, and stops the second timing.

[0076] Among them, after receiving the positioning command frame, each slave will send a positioning response frame to the slave of the previous level. It can be understood that since the last-level slave has no slave of the next level connected to it, the non-last-level slave will receive the positioning response frame, while the last-level slave will not receive the positioning response frame. Therefore, the slave can determine whether it is at the end position of the communication link connected in series through the receiving bus. Among them, the second timing can be to record the cumulative time from sending the positioning response frame to the previous level to receiving the positioning response frame sent to the next level. Through the second timing duration corresponding to the second timing, each slave can determine whether it has received the positioning response frame of the next level within the effective time, so as to determine whether it is the last-level slave.

[0077] Step S403: When the first slave among the slaves determines that the corresponding second timing duration exceeds the set second threshold, the first slave marks the local end as the final slave and transmits the generated positioning success frame forward through the receiving bus.

[0078] The second threshold value may be the maximum waiting time for the current slave to receive the positioning response frame sent by the slave at the next level. If the second threshold value is exceeded, it may be regarded as not receiving the positioning response frame sent by the slave at the next level. Thus, the first slave may mark the local end as the final slave when determining that the corresponding second timing time exceeds the set second threshold value, and complete the determination of the final slave. The final slave may generate a positioning success frame for forward transmission to notify the host to complete the positioning process.

[0079] Optionally, when the host determines that the corresponding first timing duration exceeds a set first threshold, the host outputs an alarm message indicating that the corresponding slave fails to locate.

[0080] Among them, the first threshold can be the maximum waiting time from the host sending a positioning command frame to receiving a positioning success frame. When the first timing time exceeds the first threshold, it can be regarded as an abnormal positioning response of the slave, and an alarm message of slave positioning failure is output, which is conducive to developers to conduct abnormality troubleshooting in time.

[0081] In one embodiment, the positioning success frame is provided with a count field, and the count field is set to be incremented each time the positioning success frame is forwarded. In the specific implementation process, it may also include:

[0082] Each non-final slave extracts a count value from the count field corresponding to the received positioning success frame, and records the count value as the bus position number of the local end.

[0083] For example, the initial value of the count field of the positioning success frame sent by the last-level slave is 0. After the positioning success frame reaches the slave of the previous level, the count field will automatically accumulate 1. Therefore, the "1" read from the count field by the slave of the previous level can be used as its bus position number. Similarly, the count field of the positioning success frame will accumulate 1 each time it passes through a slave, completing the automatic numbering of the slaves. At the same time, each slave can know its bus position, which is beneficial to the communication management of the slaves.

[0084] In one embodiment, the host can also verify the number of slaves through the positioning success frame. The specific implementation process includes:

[0085] The host extracts the counting result from the counting field corresponding to the received positioning success frame, and records the counting result as the current number of slaves.

[0086] After receiving the positioning success frame, the host can read the count result from the count field to determine the number of currently connected slaves, which is helpful for recording the changes in slave deployment after power-on, and is convenient for slave management and control.

[0087] Step S404: the host broadcasts the command frame through the sending bus, and monitors the response frame corresponding to the command frame from the receiving bus, wherein the command frame includes command information of at least one target slave among the corresponding slaves;

[0088] Step S405: When the last slave in the series of multiple slaves receives a command frame, the last slave sends a response frame generated corresponding to the command frame to the previous slave via a receiving bus;

[0089] Step S406, each non-final slave performs information processing on the received response frame corresponding to the command frame, and transmits the processed response frame forward through the receiving bus;

[0090] Step S407: When the host monitors a response frame from the receiving bus, the host reads the response content corresponding to each target slave from the response frame.

[0091] As described above, each time the host and the slave are powered on, the final slave can be positioned. When the number of slaves changes, the final slave after the change can also be effectively determined to ensure the normal communication process of the host controlling the slave, and flexibly adapt to the slave settings of different application scenarios.

[0092] Figure 5 A schematic diagram of a motion control system provided in an embodiment of the present application, the motion control system includes a host 1 and multiple slaves 2, such as Figure 5 As shown, the main control module 101 of the host 1 is provided with a main sending port 1011 and a main receiving port 1012, and the slave control module 201 of each slave 2 is provided with a slave sending port 2011, a first slave receiving port 2012 and a second slave receiving port 2013. The main sending port 1011 corresponding to the host 1 is connected to the first slave receiving ports 2012 corresponding to the plurality of slaves 2 via the sending bus 102, the main receiving port 1012 corresponding to the host 1 is connected to the slave sending port 1011 corresponding to the first-level slave 2 via the receiving bus 103, and the slave sending port 2011 corresponding to each slave 2 is connected to the second slave receiving port 2013 corresponding to the slave 2 of the previous level.

[0093] In the aforementioned Figure 5 On the basis of Figure 6 A schematic diagram of a process of a host sending a command frame of a motion control system provided in an embodiment of the present application, such as Figure 6 As shown, the host 1 can broadcast the same command frame from the main transmission port 1011 to multiple slaves 2 through the transmission bus 102, and the multiple slaves 2 can synchronously receive the command frame through the first slave receiving port 2012. Figure 7 A schematic diagram of a process of a host receiving a response frame of a motion control system provided in an embodiment of the present application, such as Figure 7 As shown, after multiple slaves 2 receive the command frame, the slave 2 at the last level starts to send a response frame from the sending port 2011 to the second slave receiving port 2013 of the slave 2 at the previous level, and so on. The response frame is transmitted forward step by step to the main receiving port 1012 of the host 1.

[0094] The motion control system provided above can be used to execute the bus communication method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0095] It is worth noting that in the embodiment of the above-mentioned bus communication system, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.

[0096] It should be noted that the numbering of each step in this scheme is only used to describe the overall design framework of this scheme, and does not represent the necessary order relationship between the steps. On the basis that the overall implementation process conforms to the overall design framework of this scheme, it belongs to the protection scope of this scheme, and the order of precedence in the form of text during description is not an exclusive limitation on the specific implementation process of this scheme. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0097] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0098] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A bus communication method, applied to a motion control system, characterized in that: The motion control system comprises a host and a plurality of slaves, wherein the plurality of slaves are connected in parallel with the host via a transmitting bus, and the host is connected in series with the plurality of slaves via a receiving bus; The method comprises: The host broadcasts a command frame through the sending bus, and monitors a response frame corresponding to the command frame from the receiving bus, wherein the command frame includes command information corresponding to at least one target slave among the slaves; When a last-stage slave among the plurality of slaves connected in series receives the command frame, the last-stage slave sends a response frame generated corresponding to the command frame to a slave at a previous stage through the receiving bus; Each non-final slave performs information processing corresponding to the command frame on the received response frame, and transmits the processed response frame forward through the receiving bus; When the host monitors the response frame from the receiving bus, the host reads the response content corresponding to each of the target slaves from the response frame; The last-stage slave sends the response frame generated corresponding to the command frame to the previous-stage slave through the receiving bus, including: When the final slave determines that the command frame contains command information corresponding to its own slave identification, the final slave extracts the command information associated with its own slave identification from the command frame, generates corresponding response content based on the associated command information, generates a response frame including the corresponding response content, and sends the response frame to the previous slave through the receiving bus; When the final slave determines that there is no command information corresponding to its own slave ID in the command frame, it generates a response frame with empty response content corresponding to its own slave ID, and sends the response frame to the previous slave through the receiving bus.

2. The bus communication method according to claim 1, characterized in that: The command frame includes a target slave identifier corresponding to at least one target slave among the multiple slaves and command information; Accordingly, each non-final slave performs information processing corresponding to the command frame on the received response frame, and transmits the processed response frame forward through the receiving bus, including: In the case where each target slave in the non-final slave determines that its own slave identification matches the target slave identification, each of the target slaves extracts command information associated with its own slave identification from the command frame, generates corresponding response content based on the command information, adds the corresponding response content to the received response frame, and transmits the response frame forward; In the case that the non-target slaves among the non-final slaves determine that their own slave identification does not match the target slave identification, each of the non-target slaves forwards the received response frame.

3. The bus communication method according to claim 1, characterized in that: Before the host broadcasts the command frame through the sending bus, it also includes: When the host and the plurality of slaves are in a powered-on state, the host broadcasts a positioning command frame through the sending bus and starts a first timing, and stops the first timing when a positioning success frame corresponding to the positioning command frame is monitored through the receiving bus; Each of the slaves generates a positioning response frame corresponding to the received positioning command frame, sends the positioning response frame to the slave of the previous stage through the receiving bus, and starts the second timing until the positioning response frame sent by the slave of the next stage is received through the receiving bus, and stops the second timing; When the first slave among the slaves determines that the corresponding second timing duration exceeds the set second threshold, the first slave marks the local end as the final slave and transmits the generated positioning success frame forward through the receiving bus.

4. The bus communication method according to claim 3, characterized in that: Also includes: When the host determines that the corresponding first timing duration exceeds a set first threshold, the host outputs an alarm message indicating that the corresponding slave fails to locate.

5. The bus communication method according to claim 3, characterized in that: The positioning success frame is provided with a count field, and the count field is set to be incremented each time the positioning success frame is forwarded; The method further comprises: Each non-final slave extracts a count value from the count field corresponding to the received positioning success frame, and records the count value as the bus position number of the local end.

6. The bus communication method according to claim 5, characterized in that: Also includes: The host extracts a counting result from a counting field corresponding to the received positioning success frame, and records the counting result as the current number of slaves.

7. The bus communication method according to claim 1, characterized in that: After reading the response content corresponding to each of the target slaves from the response frame, the method further includes: The host verifies the response content of each target slave, and when determining that there is a target slave with abnormal response content, outputs alarm information of the abnormal response of the corresponding slave.

8. The bus communication method according to claim 1, characterized in that: The method further comprises: When the second slave among the slaves meets the information reporting condition, the second slave transmits the generated information reporting frame forward through the receiving bus.

9. A motion control system, characterized in that: include: A host and a plurality of slaves, wherein the host and the plurality of slaves communicate using a bus communication method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Implement method for high speed single bus communication

    CN104811273A

  • Unibus communication method, device, system and equipment

    CN116578521A

  • Automatic access control method and system of terminal resistor

    CN116826909A