This application claims priority to Chinese Patent Application No. 201611253810.3, filed Dec. 30, 2016. which is hereby incorporated by reference herein in its entirety.
The present disclosure; relates to data setting field, and particularly to a parameter setting method for hoses and a controller for robots.
Controller Area Network (CAN) bus is a serial communication protocol for real-time applications. It adopts twisted pair to transmit signals, which is one of the most widely used field buses in the world.
Nowadays, robots are characterized by the attributes below; 1. Motors of each of the execution nodes are directed to heavy loading, large currents, and frequently on and off, strong electric magnetic interfere source; 2. A lot of execution nodes; 3. A lot of nodes have to be controlled by a high speed and synchronous manner when performing various action; 4. The demand toward high reliability clue to human interactions; 5. Facing more complex electric-magnetic environment when operating in a more dangerous environment in the future.
Based on above, bad environments and mission complexity lead to higher reliability toward data processing and communication system, and thus the CAN bus protocol has to be enhanced.
To clarify the purpose, technical solutions, and the advantages of the disclosure, embodiments of the invention will now be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the invention are shown. The figure and the embodiment described according to figure are only for illustration, and the present disclosure is not limited to these embodiments. It should be noted that the relational terms herein, such as “first” and “second”, are used only for differentiating one entity or operation, from another entity or operation, which, however do not necessarily require or imply that there should be any real, relationship or sequence. Moreover, the terms “comprise”, “include” or any other variations thereof are meant to cover non-exclusive including, so that the process, method, article or device comprising a series of elements do not only comprise those elements, but also comprise other elements that are not explicitly listed or also comprise the inherent elements of the process, method, article or device. In the case that there are no more restrictions, an element qualified by the statement “comprises a . . . ” does not exclude the presence of additional identical elements in the process, method, article or device that comprises the said element.
The disclosure provides a CAN2.0B bus protocol solution, for communication between a Table of a robot and a plurality of execution nodes, i.e., servos. The solution relates to modify standard data frame and extended data frame described in the CAN2.0B, such that identifiers of arbitration field and fields of segments of data field in the standard data frame and the extended data frame are configured with new functions. The identifier field of the arbitration field in the standard data frame and the extended data frame is modified respectively as Table A-1 and Table A-2.
Wherein M1 and M0 indicates fame mode, and the values of M1 and M0 may include 00, 01, 10, and 11;
CH8-CH0 indicate the communication channels of the nodes, which ranges from 0 to 511. When Channel=0, the data frame is a broadcast frame. All nodes may receive the broadcast frame.
Wherein M1 and M0 indicate the frame mode, and the values of M1 and M0 may include 00, 01, 10, and 11;
Wherein EM0 indicates the extended frame mode. The values of the EM0 include 0 and 1. The definition of the frame modes of the extended frame is shown as Table A-11.
N is a reserved bit, which has not been configured temporarily.
END indicates whether the frame is the last frame during the data transmission. When END is equal to “0”, the frame is not the last frame. When END is equal to “1”, the frame is the last frame.
I7-I0 is an 8 bit self-increasing cycle code, indicating the sequence number of the data, which ranges from 0 to 255.
CH15-CH0 indicates communication channel of node. The value ranges from 0 to 65535. When the value of the “Channel” is equal to 0, the data frame is the broadcast frame. All nodes may receive the broadcast frame.
Data field In the standard data fame and in the extended data frame is modified as Table B-1.
Wherein CMD relates to secondary instruction. Nodes may conduct their own instruction set, see Table B-2.
D0˜D6 relate to data earned by secondary instruction.
D0˜D7 relate to data carried by each frame during data transmission. The 8 bits are configured to enhance the transmission efficiency.
As shown in
In one embodiment, in step S101, a main controller sends the parameters to a node, wherein the parameters are encapsulated into M number of data frames, and the M number of data frames are sent to the node, wherein M is a positive integer equal to or greater than 1, and M is equal to or less than 128. Wherein the step of sending the N-th data frame further includes reporting an abnormal data transmission and resending the data frames, wherein N is the positive integer equal to or less than M.
The step of reporting the abnormally transmitted data frame and the resending the data frames further includes: sequentially sending a first data frame to the (N−1)-th data frame to the node for one time and sending the N-th data frame to the node for one or more than one time when N number of the data frames is transmitted, wherein N is equal to a preset number between one and M, or N is equal to or greater than M/2, or when the last data frame is transmitted, i.e., when N=M; receiving a message reporting an abnormal data transmission from the node, wherein the message of the abnormal data transmission includes the number of the abnormally transmitted data frames and the sequence number of the abnormally transmitted data frames; rereading the data frames being transmitted abnormally to the node upon receiving the message. Wherein the abnormally transmitted, data frames are a portion or all of the data frames from the first data frame to the (N−1)-th data frame.
Block abnormal instructions indicating main controller abnormal block transmission of the main controller are shown as Table 1.
Block abnormal instructions indicating abnormal block transmission of node are shown as Table 2.
The usage of for block abnormal instruction, such as 0XF6 (for main controller) and 0XF5 (for the nodes) are the same. The difference resides in the transmitting directions between main controller and nodes.
The process of the parameter block transmission will be described hereinafter. The sending terminal sequentially sends the first to the (N−1)-th data frames to the receiving terminal, wherein the sending terminal is the main controller and the receiving terminal is the node. The sending terminal resends the N-th data frame to the receiving terminal repeatedly when the N number of the data frames have been sent, wherein N is a preset number between one and M, or N is equal to or greater than M/2. Besides, when the last date frame is transmitted, i.e., the M-th data frame (N=M), the M-th date frame is also resent to the receiving terminal repeatedly. The receiving terminal sends a message reporting an abnormal data transmission to the sending terminal upon receiving a duplicate data frame. The sending terminal receives the message of the abnormal data transmission from the receiving terminal. As shown in Table 1 and Table 2, the message of the abnormal data transmission includes the number of the abnormally transmitted data frames and the sequence number of the abnormally transmitted data frames during the data transmission. The sending terminal resends the corresponding data frames to the receiving terminal according to the sequence number of the abnormally transmitted data frames upon receiving the message, that is, when the number of the abnormally transmitted data frame is not equal to 0. In order to check whether there is an abnormal data transmission or not, the sending terminal resends the N-th data frame to the receiving terminal. The receiving terminal sends the message of the abnormal data transmission to the sending terminal upon receiving the duplicate N-th data frame. The sending terminal stops resending the N-th data frame to the receiving terminal upon determining no abnormal data frame has been transmitted, that is, when the number of the abnormal data frames is equal to 0. The sending terminal continues sending the (N+1)-th data frame through the (M−1)-th data frame to the receiving terminal when N number of the data frames have been sent, wherein N is greater than or equal to M/2. When N=M, the data transmission is completed.
In step S102, sending a request instruction frame of parameter setting to the node, wherein the request instruction frame of parameter setting requests the node to conduct a configuration, according to the parameters.
Request instructions of parameter setting are shown as Table 3.
In step S103, the main controller receives the response instruction frame of parameter setting from the node, wherein the response instruction frame of parameter setting reports a parameter configuration result to the main controller.
Response instructions of parameter setting are shown as Table 4.
In the embodiment, the parameter setting method for system bus can realize the transmission accuracy and the setting of the parameters for each node of the robot.
For sake of convenience of description, the same configuration between the previous embodiment and this embodiment is no longer detailed described, but focuses only on the difference between the previous embodiment and the embodiment. In
As shown In
Alternatively, in step S201, the main controller sends the instruction frame of parameter request to the node. The instruction frame of parameter request may include the node information, the parameter information, the frame-mode indication information, and the frame-type indication information. The instruction frame of parameter request is sent by the main controller to request the node to receive the parameters to be set.
Instructions of parameter request are shown as Table 5.
In step S202, the main controller receives the instruction frame of parameter response from the node. The instruction frame of parameter response may include the node information, the parameter information, the frame-mode indication information, and the frame-type indication information. The instruction frame of parameter response is sent by the node to reply the main controller to receive the parameter setting data.
The instructions of parameter response are shown in Table 6.
In one scenario, main controller of a robot may upgrade the data on the node 10. The receiving buffer is 128 bits. The CMD instructions relating to the operations are shown as Table B-2.
Main controller sends the parameter received request to the node 10. The corresponding fields m the message are set as; MIM0EM0=100, channel=10, CMD=0XF4, and D1-D4=128.
The node 10 sends the parameter response request to the main controller. The corresponding fields in the message are set as: MIM0EM0=110, channel=10, CMD=0XF4, and D1-D4=128.
After the main controller receives the response, the main controller starts to send the parameters to the node by utilizing a block data transmission method.
The main controller sends the parameter setting request to the node 10. The corresponding fields in the message are set as: MIM0EM0=100, channel=10, CMD=0XF2, and D1-D4=128.
The node receives the request and validates the parameters to determine whether to store the parameters or not.
The node sends the parameter setting response to the main controller. The corresponding fields in the message are set as: MIM0EM0=110, channel=10, CMD=0XF1, and D1=parameter setting completed condition.
The parameter setting process is completed.
In the embodiment, the parameter setting method for system bus can realize the transmission accuracy and the setting of the parameters for each node of the robot.
For sake of convenience of description, the same configuration between the previous embodiment and this embodiment is no longer detailed described, but focuses only on the difference between the previous embodiment and the embodiment.
As shown in
In one embodiment, in step S301, the node receives the parameters from the main controller. In step S302, the node receives the request instruction frame of parameter setting from the main controller. In step S303, the node/validates the received parameters to determine whether to store the parameters or not. In step S304, conducting a configuration according to the parameters after validating, and sending the response instruction frame of parameter setting to the main controller to report the parameter configuration result. Wherein the parameters are encapsulated into M number of data frames, and the M number of data frames are sequentially received by the node, M is the positive integer equal to or greater than 1, and M is equal to or less than 128. The node further reports the abnormal data transmission and resends the data frames when receiving the N-th data frame. The process of reporting the abnormal data transmission and the resending process is the same as the previous embodiment, and thus will be omitted hereinafter. Wherein N is the positive integer equal to or less than M, and N is equal to or greater than M/2, or N is equal to M.
In the embodiment, the parameter setting method for system bus can realize the transmission accuracy and the setting of the parameters for each node of the robot.
For sake of convenience of description, the same configuration between the previous embodiment and this embodiment is no longer detailed described, but focuses only on the difference between the previous embodiment and the embodiment. In
As shown in
In one embodiment, in step S401, the node receives the instruction frame of parameter request from the main controller. In step S402, the node sends the request instruction frame of parameter response to the main controller. In step S303, the node validates the received parameters to determine whether to store the parameters or not. In step S304, conducting a configuration according to the parameters after validating, and sending the response instruction frame of parameter setting to the main controller to report the parameter configuration result. Wherein the parameters are encapsulated into M number of data frames, and the M number of data frames are sequentially received by the node, M is the positive integer equal to or greater than 1, and M is equal to or less than 128. The node further performs reporting the abnormal data transmission and the resending the data frames when receiving the N-th data frame. The process of reporting the abnormal data transmission and the resending the data frames is the same as the previous embodiment, and thus will be omitted hereinafter. Wherein N is the positive integer equal to or less than M, and N is equal to or greater than M/2, or N is equal to M.
In the embodiment, the parameter setting method for system bus can realize the transmission accuracy and the setting of the parameters for each node of the robot.
In one embodiment, the parameter setting method for buses, includes step S701: sending the parameters to the node; step S702: sending the parameter setting request to the node, wherein the parameter setting request is configured to request the node to perform setting according to the parameters; step S703: receiving the parameter setting response from the node.
In one embodiment, after the step of sending the parameters to the node, the method further includes sending the parameter receiving request to the node; and receiving the parameter receiving response from the node.
In one embodiment, the parameters are encapsulated into M number of data frames, and the M number of data frames are sequentially sent to the node, wherein M is the positive integer equal to or greater than 1, and M is equal to or less than 128.
In one embodiment, the parameter setting method for system bus includes receiving the message reporting the abnormal data transmission, from the node; and, resending the data frames being transmitted abnormally upon receiving the message.
In one embodiment, the message of the abnormal data transmission includes the number of the abnormally transmitted data frames and the sequence number of the abnormally transmitted data frames during the data transmission.
In one embodiment, before the step of receiving the message of the abnormal data transmission, the method further including sending the N-th data frame to the node for one or more than one time, wherein N is a positive integer. Alternatively, the N-th data frame, is the last data frame in the data transmission; or N is equal to or greater than M/2.
In one embodiment, after the step of resending the data frames being transmitted abnormally, the method further including sending the N-th data frame to the node for one or more than one time.
In one embodiment, before the step of sending the N-th data frame to the node for one or more than one time, the method further includes sequentially sending the first to the (N−1)-th data frames. Wherein the abnormally transmitted data frames during the data transmission are a portion or all of the data frames from the first data frame to the (N−1)-th data frame.
In one embodiment, the parameter setting method for system bus includes receiving the parameters from the main controller; receiving the parameter setting request from the main controller; validating the parameters; conducting configuration according to the parameters after validating, and sending the parameter setting response to the main controller.
In one embodiment, before the step of receiving the parameters from the main controller, the method further includes receiving the parameter receiving request from the main controller; and sending the parameter receiving response to the main controller.
In one embodiment, the parameters are encapsulated by the main controller into M number of data frames, the M number of data frames are sequentially receiving by the node, wherein M is the positive integer equal to or greater than 1, and M is equal to or less than 128.
In one embodiment the parameter setting method for system bus further includes sending the message of the abnormal data transmission to the main controller when the number of the abnormally transmitted data frames in the data transmission reaches a threshold value or when receiving the N-th data frame more than one time, wherein N is the positive integer.
In one embodiment, the N-th data frame is the last data frame in the data transmission; or N is equal to or greater than M/2.
In one embodiment, after the step of sending the message of the abnormal data transmission, the method further includes re-receiving the data frames being transmitted abnormally.
In one embodiment, after the step of re-receiving the data frames being transmitted abnormally, the method further includes receiving the N-th data frame from the receiving node one or more than one time.
In one embodiment, the parameter receiving request and/or the parameter receiving response may include the node information, the parameter information, the frame-type indication information, the frame-type indication information.
In one embodiment, the parameter selling request the parameters are encapsulated into M number of data frames, and the M number of data frames are sent to the node, wherein M is a positive integer equal to or greater than 1, and M is equal to or less than 128.
In one embodiment, the parameter setting response the parameters are encapsulated into M number of data frames, and the M number of data frames are sent to the node, wherein M is a positive integer equal to or greater than 1, and M is equal to or less than 128.
The technical effect of the parameter setting method for buses in the embodiment is described above, and is not described in detail here.
In the embodiment, the parameter setting device for system bus of the robot includes a first parameter setting transmitting unit 501 and a first parameter setting receiving unit 502.
The first parameter setting transmitting unit 501 is configured to send the parameters and the instruction frame of parameter setting to the node, wherein the instruction frame of parameter setting is configured to request the node to conduct configuration according to the parameters.
The first parameter setting receiving unit 502 is configured to receive the response instruction frame of parameter setting from the node.
The first parameter setting transmitting unit 501 is further configured to send the instruction frame of parameter request to the node before sending the parameters.
The first parameter setting receiving unit 502 is further configured to receive the instruction frame of parameter response from the node.
The controller for robots in the embodiment can realize the parameter transmission and setting for each node of the robots.
In the embodiment, the parameter setting device for system bus of the robot includes a second parameter setting receiving unit 601, a validating unit 602, and a second parameter setting transmitting unit 603.
The second parameter setting receiving unit 601 is configured to receive the parameters and the request instruction frame of parameter setting from the main controller.
The validating unit 602 is configured to validate the parameters and to conduct the corresponding configuration according to the parameters after validating.
The second parameter setting transmitting unit 603 is configured to send the response Instruction frame of parameter setting to the main controller.
The parameter setting device for system bus of the robot in the embodiment can realize the parameter transmission and setting for each node of the robots.
In one embodiment, the parameter setting device for system bus of the robots includes the first parameter setting transmitting unit configured to send the parameters and the parameter setting request to the node, the parameter setting request is configured to request the node to conduct configuration according to the parameters; and the first parameter setting receiving unit configured to receive the parameter setting response from the node.
In one embodiment, the first parameter setting transmitting unit is further configured to send the parameter receiving request to the node before sending the parameters; and the first parameter setting receiving unit receives the parameter receiving response.
In one embodiment, the parameters are encapsulated into M number of data frames, and the first parameter setting transmitting unit includes the first transmitting unit configured to sequentially sends the M number of data frames, wherein M is the positive integer equal to or greater than 1, and M is equal to or less than 128.
In one embodiment, the parameter setting device for system bus of the robot further includes a first receiving unit configured to receive the message reporting the abnormal data transmission, and a resending unit configured to resend the data frames being transmitted abnormally.
In one embodiment, the first receiving unit receives the message of the abnormal data transmission after the first transmitting unit sends the N-th data frame for one or more than one time, N is the positive integer.
In one embodiment, the N-th data frame is the last data frame in the data transmission; or N is equal to or greater than M/2, M is the total number of the data frames in the data transmission.
In one embodiment, the first transmitting unit sends the N-th data frame for one or more than one time after the resending unit resends the data frames being transmitted abnormally.
In one embodiment, the first transmitting unit sequentially sends the first to the (N−1)-th data frame for one time. The abnormally transmitted data frames in the data transmission are a portion or all of the number of the data frames from the first data frame to the (N−1)-th data frame.
In one embodiment, the parameter setting device for system bus of the robot includes a second parameter setting receiving unit configured to receive the parameters and the parameter setting request from the main controller; a validating unit configured to validate the parameters and conduct the corresponding configuration according to the parameters after validating; and a second parameter setting transmitting unit configured to send the parameter setting response to the main controller.
In one embodiment, the second parameter setting receiving unit is configured to receive the parameter receiving request from the main controller before receiving the parameters from the main controller. The second parameter setting transmitting unit is further configured to send the parameter receiving response to the main controller.
In one embodiment, the parameters are encapsulated, into M number of data frames. The second parameter setting receiving unit includes a second receiving unit configured to sequentially receive the M number of data frames, M is the positive integer equal to or greater than 1, and M is equal to or less than 128.
In one embodiment, the parameter setting device for system bus of the robot further includes a second transmitting unit configured to send the message of the abnormal data transmission; and a re-receiving unit configured to re-receive the data frames being transmitted abnormally.
In one embodiment, the second transmitting unit sends the message of the abnormal data transmission after the second receiving unit receives the N-th data frame one or more than one time, N is the positive integer.
In one embodiment, the N-th data frame is the last data frame in the data transmission; or N is equal, to or greater than M/2, M is the total number of the data frames in the data transmission.
In one embodiment, the second receiving unit receives the N-th data frame one or more than one time after the re-receiving unit re-receives the message of the abnormal data transmission.
In one embodiment the second receiving unit sequentially the first data frame to (N−1)-th data frames one time. The abnormally transmitted data frame during the data transmission are a portion or all of the total number of the data frames from the first data frame to the (N−1)-th data frame.
In one embodiment, the parameter setting device for system bus of the robot further includes a calculating unit configured to calculate the number of the abnormally transmitted data frames during the data transmission.
In one embodiment, the second transmitting unit sends the message of the abnormal data transmission when the number calculated by the calculating unit reaches the threshold value.
The technical effect of the parameter setting device for system bus of the robot in the embodiments is described as above, and not described in detail here.
In an example, the present disclosure further provides non-transitory computer readable medium, for example, memory including the instructions that can be executed by the processor to utilize the above method. The non-transitory computer readable medium may be a read only memory (ROM), a random access memory (RAM), magnetic tapes or optical data storage devices.
A person skilled in the art should understand that the disclosed combinations of various exemplary logical blocks, modules, circuits, and algorithm steps described in the present disclosure may be implemented as electronic hardware, computer software or a combination of both. In order to clearly describe such interchangeability of the hardware and software, functions of the various exemplary components, blocks, modules, circuits, and algorithm steps have been generally described thereof. Whether such functions are implemented as software or hardware depends on the specific application and the design restrictions applied to the entire system. A person skilled in the art may implement the above described functions in various manners in combination with the specific applications. However, such implementation decisions shall not be construed as causing a departure from the scope of the present disclosure.
While the foregoing disclosure illustrates exemplary embodiments of the present disclosure, it should be noted that without departing from the scope defined by the claims of the disclosed premise, various modifications and changes can be made. A method according to an embodiment of the disclosure described herein required functions, steps and/or actions need not be performed in any particular order. In addition, although elements of the present disclosure may be described or claimed in the individual form, but they can also be envisaged more unless explicitly restricted to the singular.
The above description is merely the embodiments in the present disclosure, the claim is not limited to the description thereby. The equivalent structure or changing of the process of the content of the description and the figures, or to implement to other technical field directly or indirectly should be included in the claim.
The CAN protocol relates to a point-to-multipoint and serial communication protocol for real-time applications. The CAN adopts twisted pair to transmit signals, which is one of the most widely used field buses in the world. The CAN protocol is robust, and thus may be widely used in the field of automation and other applications.
Number | Date | Country | Kind |
---|---|---|---|
201611253810.3 | Dec 2016 | CN | national |