CN113119117B - Robot control method, controller, robot and control system - Google Patents

Robot control method, controller, robot and control system Download PDF

Info

Publication number
CN113119117B
CN113119117B CN202110302928.5A CN202110302928A CN113119117B CN 113119117 B CN113119117 B CN 113119117B CN 202110302928 A CN202110302928 A CN 202110302928A CN 113119117 B CN113119117 B CN 113119117B
Authority
CN
China
Prior art keywords
time
current
countdown
robot
setting instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110302928.5A
Other languages
Chinese (zh)
Other versions
CN113119117A (en
Inventor
苏宪伟
谢铮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ubtech Robotics Corp
Original Assignee
Ubtech Robotics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ubtech Robotics Corp filed Critical Ubtech Robotics Corp
Priority to CN202110302928.5A priority Critical patent/CN113119117B/en
Publication of CN113119117A publication Critical patent/CN113119117A/en
Application granted granted Critical
Publication of CN113119117B publication Critical patent/CN113119117B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1661Programme controls characterised by programming, planning systems for manipulators characterised by task planning, object-oriented languages
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J13/00Controls for manipulators
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1679Programme controls characterised by the tasks executed

Abstract

The application is applicable to the technical field of robots and provides a control method, a controller, a robot and a control system of the robot, wherein the method comprises the following steps: acquiring a total countdown, wherein the total countdown is the time from the current time to the start of the robot to execute the target task; calculating a current countdown based on the total countdown and a current absolute time in the controller, wherein the current countdown is a time from the current time calculated by the controller to a time when the robot starts to execute the target task; generating a setting instruction based on the current countdown and transmitting the setting instruction to at least one robot, wherein the setting instruction is used for instructing the at least one robot to set the time of a timer in the at least one robot based on the current countdown; according to the method and the device, the time between the current time and the time when the robot starts to execute the target task can be corrected through the current absolute time, so that the robot is accurately controlled.

Description

Robot control method, controller, robot and control system
Technical Field
The application belongs to the technical field of robots, and particularly relates to a control method, a controller, a robot and a control system of the robot.
Background
With the continuous progress of science and technology, robots have been applied in more and more fields.
In controlling the robot, the communication between the controller and the robot is generally accomplished using WIFI. WIFI communication often has communication delay, and the delay time is uncontrollable. Therefore, when the controller controls the robot, the time when the robot receives the instruction sent by the controller may be different from the time when the controller sends the instruction, and the time when the robot starts to execute the task is not accurate.
Disclosure of Invention
The embodiment of the application provides a control method, a controller, a robot and a control system of the robot, and can solve the problem that the robot cannot be accurately controlled at present.
In a first aspect, an embodiment of the present application provides a control method for a robot, which is applied to a controller, and includes:
acquiring a total countdown, wherein the total countdown is the time from the current time to the start of the robot to execute the target task;
calculating a current countdown based on the total countdown and current absolute time in the controller, wherein the current countdown is the time between the current time calculated by the controller and the time when the robot starts to execute the target task;
and generating a setting instruction based on the current countdown time, and sending the setting instruction to at least one robot, wherein the setting instruction is used for instructing the at least one robot to set the time of a timer in the at least one robot based on the current countdown time.
In a second aspect, an embodiment of the present application provides a control method for a robot, where the method is applied to a robot, and includes:
acquiring a setting instruction sent by a controller, wherein the setting instruction comprises a current countdown, the current countdown is calculated by the controller based on a total countdown and current absolute time in the controller, and the current countdown is the time between the current time calculated by the controller and the time when the robot starts to execute the target task;
and setting the time of a timer in the robot based on the current countdown, and executing the target task when the time in the timer is out of time.
In a third aspect, an embodiment of the present application provides a controller, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the control method of the robot according to any one of the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a robot, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the control method of the robot according to any one of the second aspect when executing the computer program.
In a fifth aspect, an embodiment of the present application provides a control system for a robot, including: a controller and at least one robot.
In a sixth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement the control method for the robot in any one of the above first aspects.
In a seventh aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the control method for the robot in any one of the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: the method comprises the steps of obtaining a total countdown, calculating the current countdown based on the total countdown and the current absolute time in a controller, generating a setting instruction based on the current countdown, and sending the setting instruction to at least one robot; according to the method and the device, the time between the current time and the time when the robot starts to execute the target task can be corrected through the current absolute time, so that the robot is accurately controlled.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic application scenario diagram of a control method of a robot according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a control method of a robot applied to a controller according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a topology of a robot centralized control network according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a method for calculating the current countdown time of FIG. 1 according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a control method of a controller according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a robot control method applied to a robot according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a setting method of a timer according to an embodiment of the present application;
fig. 8 is a schematic flowchart of a control method of a robot according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a controller according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a robot according to an embodiment of the present disclosure;
FIG. 11 is a schematic structural diagram of a controller according to another embodiment of the present application;
fig. 12 is a schematic structural diagram of a robot according to another embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Fig. 1 is a schematic view of an application scenario of a control method of a robot according to an embodiment of the present application, where the control method of the robot may be used to implement accurate control of the robot, and may also implement synchronous control of multiple robots. The controller 10 is configured to obtain a total countdown that the robot starts to perform the target task from the beginning, generate a setting instruction at each preset time interval, and send the setting instruction to at least one robot 20. After receiving each setting instruction, robot 20 updates the time of the timer based on the respective setting instruction, and starts executing the target task when the time of the timer expires.
The following describes a control method of a robot according to an embodiment of the present invention in detail with reference to fig. 1.
Fig. 2 shows a schematic flow chart of a control method of the robot provided by the present application, applied to a controller, and referring to fig. 2, the method is described in detail as follows:
s101, acquiring a total countdown, wherein the total countdown is the time from the current time to the time when the robot starts to execute the target task.
In this embodiment, the total countdown may be a time input by a human, or may be a time acquired from another device. The total countdown may also be a time preset in the controller.
In this embodiment, if the controller needs to control a plurality of robots at the same time, the total countdown is the time when the plurality of robots start to execute the countdown of the target task at the same time.
Specifically, the total countdown may be a countdown number. The countdown value can be obtained according to the acquired countdown time and countdown precision. Specifically, the total countdown can be obtained according to the ratio of the countdown time to the countdown accuracy.
As an example, if the robot needs to execute the target task after 1s, then 1s is the acquired countdown time. If the countdown accuracy is 1ms, the total countdown is 1000. If the countdown accuracy is 1us, the total countdown is 1000000. If the robot needs to perform the target task after 5s and the countdown accuracy is 1ms, the total countdown is 5000.
In this embodiment, the controller may be a centralized controller.
In this embodiment, the task that the robot needs to perform is the target task.
It should be noted that the controller and at least one robot are both devices connected to the same wireless router through WIFI, as shown in fig. 3, a robot centralized control network topology is schematic, and therefore, the controller and multiple robots are devices in the same network. The total countdown may also be taken as the total command send duration for the target task.
In this embodiment, one robot may correspond to one target task, or a plurality of robots may correspond to the same target task.
And S102, calculating the current countdown based on the total countdown and the current absolute time in the controller, wherein the current countdown is the time between the current time calculated by the controller and the time when the robot starts to execute the target task.
In this embodiment, a monotonic clock is provided in the controller, and a monotonic absolute time can be obtained from the monotonic clock. In the present application, the absolute time obtained from the current time is used as the current absolute time. Specifically, the absolute time is usually a long integer number. For example, the current time is 9 points and 20 minutes, the obtained absolute time is 10000ms, and 10000ms is the current absolute time; if the current time is 9: 40 min, the obtained absolute time is 10090ms, and 10090ms is the current absolute time.
In this embodiment, the current countdown is the time left by the robot from the execution of the target task at the current time, and is the corrected time, which is the actual time left by the robot from the execution of the task.
By way of example, if the current countdown is 950ms, it indicates that the robot is 950ms away from the target task.
S103, generating a setting instruction based on the current countdown, and sending the setting instruction to at least one robot, wherein the setting instruction is used for instructing the at least one robot to set the time of a timer in the at least one robot based on the current countdown.
In this embodiment, the current countdown and/or the target task may be included in the setting instruction.
In this embodiment, after the controller obtains the setting instruction, the controller may send the setting instruction to the robot, and after the robot receives the setting instruction, the robot determines the time of the timer in the robot according to the current countdown in the setting instruction. The time of the timer characterizes the actual countdown that the robot needs to perform the target task. When the time of the timer expires, the robot starts to perform the target task.
In this embodiment, the controller may transmit the setting instruction to the at least one robot in the form of a broadcast. Specifically, the setting instruction may be sent to the robot in a form of a User Datagram Protocol (UDP-User Datagram Protocol) broadcast or multicast, where the User Datagram Protocol includes current countdown.
In the embodiment of the application, the total countdown of the distance from the robot to the start of executing the target task is obtained, then the current countdown is calculated based on the total countdown and the current absolute time in the controller, and finally a setting instruction is generated based on the current countdown and is sent to at least one robot; the robot sets the time of the timer based on the current countdown in the setting instruction; the time of the timer can be corrected through the current absolute time, so that the robot is accurately controlled.
Specifically, the current countdown is calculated by taking the absolute time in the controller as the current absolute time at preset time intervals, and a setting instruction is generated based on the current countdown so as to send the setting instruction to at least one robot, and the setting instruction is stopped being sent to the robot until the current countdown is smaller than a preset value.
In this embodiment, the maximum value of the transmission delay in the WIFI communication is uncertain, but there is a limit to the minimum value. And the minimum delay time difference of data communication of the WIFI network card devices of the same type in the same wireless network is not large, so that the minimum delay time is found by a method of sending successive approximation for multiple times, and the time of the robot executing the target task is closer to the time sent by the controller. If a plurality of robots need to be controlled simultaneously, the time of receiving instructions of each robot is similar by a method of sending successive approximation for multiple times, namely the time of executing target tasks by the plurality of robots is closer, so that synchronous centralized control of the plurality of robots based on WIFI communication is realized to the maximum extent.
In the present embodiment, the preset time interval may be set as needed, for example, the preset time interval may be 50ms, 40ms, or 30 ms.
In this embodiment, the absolute time in the current controller is used as the current absolute time, and one current absolute time can be obtained every preset time interval. And calculating a current countdown according to the acquired current absolute time at each preset time interval, and generating each setting instruction according to each current countdown. I.e. a set command is generated every predetermined time interval. And when the current countdown calculated at the current time is less than the preset value, no setting instruction is generated, namely no setting instruction is sent to the robot, and the controller stops running. Specifically, the preset value may be set as required, and the preset value may be set to 0 in the present application.
As an example, the preset time interval is set to 50 ms.
Obtaining a first current countdown based on the current absolute time 10000 and the total countdown, generating a first setting instruction based on the first current countdown, and sending the first setting instruction to at least one robot;
after 50ms, the absolute time in the controller is 10052, taking 10052 as the current absolute time. Obtaining a second current countdown based on the current absolute time 10052 and the total countdown, generating a second setting instruction based on the second current countdown, and sending the second setting instruction to at least one robot;
after 50ms, the absolute time in the controller is 10105, with 10105 as the current absolute time. Obtaining a third current countdown based on the current absolute time 10105 and the total countdown, generating a third setting instruction based on the third current countdown, and sending the third setting instruction to at least one robot;
and after 50ms, acquiring the nth current countdown, and if the nth current countdown is less than the preset value 0, not generating an nth setting instruction. The controller ends the operation.
In this embodiment, the preset number of times that the controller sends the instruction to the robot may also be obtained according to the total countdown and the preset time interval. Specifically, the ratio of the total count-down time to the preset time interval is used as the preset number of times.
As an example, if the total count-down is 2000ms and the preset time interval is 50ms, the preset number of times is 40.
The method comprises the following steps that a controller generates a setting instruction at every preset time interval and sends the setting instruction to a robot; according to the method and the device, the probability that the robot receives the instruction sent by the controller can be improved by sending the current countdown timers with different times to the robot, and the robot can continuously update the time of the timer so as to more accurately execute the target task; if the controller needs to control a plurality of robots at the same time, the countdown difference among the plurality of robots can be continuously approached to the minimum, and the requirement on synchronous control of the plurality of robots is further met.
As shown in fig. 4, in a possible implementation manner, the implementation process of step S102 may include:
and S1021, calculating a current time difference value based on the current absolute time and a first absolute time, wherein the first absolute time is the absolute time of the current time difference value calculated by the controller for the first time.
In this embodiment, a first difference between the current absolute time and the first absolute time is calculated, and the first difference is used as the current time difference, where the current absolute time is the same as the first absolute time when the controller calculates the current time difference for the first time.
In particular, it can be according to the formula TC=TD-T1Calculating a difference value of the current time, wherein TCFor the current time difference, TDFor the current absolute time, T1Is the first absolute time.
In this embodiment, when the controller calculates the current time difference value for the first time, the current absolute time obtained for the first time is the first absolute time, and therefore, when the current time difference value is calculated for the first time, the current time difference value is 0.
In this embodiment, because the current time cannot be obtained simply according to the product of the preset time interval and the number of calculations due to the influence of factors such as task scheduling and data transmission time consumption of the system in the controller, the current absolute time is used to represent that the current time is more accurate, the influence of extra time consumed by task scheduling, command transmission and the like of the controller on the current countdown broadcasted is eliminated, and the current countdown executed by the command each time is accurate.
As an example, if the first absolute time is 10000ms, the preset time interval is 50 ms. After the current time difference is calculated for the first time, at an interval of 50ms, the current absolute time obtained may be 10052ms instead of 10050 ms.
S1022, calculating the current countdown time based on the current time difference and the total countdown time.
In this embodiment, a second difference between the total countdown and the current time difference is calculated, and the second difference is used as the current countdown.
In particular, it can be according to the formula TS=T0-TCWherein, TSFor the current countdown, T0For total count-down, TCIs the current time difference.
In this embodiment, the theoretical time for the robot to start executing the target task, that is, the real remaining time, is obtained by subtracting the current time difference from the total countdown.
In the embodiment of the application, the time interval of the robot from the beginning of executing the task can be accurately obtained according to the current absolute time, and the time reference of the controller can be prevented from being influenced by external factors such as system setting.
In a possible implementation manner, the method may further include:
as shown in fig. 5, the preset time interval is set to 50ms, the robot counts down for 1s from the target task, the count down precision is 1ms, and the total count down time is 1000 ms. The number of retransmissions is 20. For ease of explanation, absolute time is the number of milliseconds from start-up to the present of the controller.
S201, the first obtained current countdown is: the current absolute time is obtained to be 10000 ms. The current countdown is 1000-0 to 1000 ms. A first setting instruction is generated based on 1000ms, and the first setting instruction is transmitted to the plurality of robots.
S202, after 50ms, if the current absolute time is 10052 obtained by delaying for an additional 2ms, the current countdown is 1000- (10052-10000) to 948 ms. A second setting instruction is generated based on 948ms, and the second setting instruction is transmitted to the plurality of robots.
S203, after 50ms, if the extra delay is 3ms, and the obtained current absolute time is 10105, the current countdown is 1000- (10105-. A third setting instruction is generated based on 895ms, and the third setting instruction is transmitted to the plurality of robots.
And the like, and the transmission is stopped until the current countdown is less than 0.
Fig. 6 shows a schematic flowchart of a control method of the robot provided by the present application, applied to at least one robot, and referring to fig. 6, the method is described in detail as follows:
s301, a setting instruction sent by the controller is obtained, wherein the setting instruction comprises a current countdown, the current countdown is calculated by the controller based on the total countdown and the current absolute time in the controller, and the current countdown is the time when the robot starts to execute the target task, wherein the current countdown is the distance between the current time calculated by the controller and the current absolute time in the controller.
S302, setting the time of a timer in the robot based on the current countdown, and executing the target task when the time in the timer is overtime.
Specifically, based on the current countdown, determining a current target countdown in the robot; and setting the time of a timer in the robot based on the current target countdown, and executing the target task when the time in the timer is overtime, wherein the time of the timer is the countdown of the robot for executing the target task.
In this embodiment, after receiving the setting instruction, the robot analyzes the setting instruction to obtain the current countdown time from the setting instruction, and then determines the current target countdown time in the robot according to the current countdown time. The robot determines whether the target task needs to be performed based on the current target countdown.
In this embodiment, the robot may set the time of the periodizer, i.e. set the trigger time of the target task, after obtaining the current target countdown. The time of the timer characterizes the time from the execution of the target task. After the time set by the timer is finished, namely the counting of the current target countdown is finished, the robot starts to execute the target task.
Specifically, after the robot receives the setting instruction for the last time and sets the time in the completion timer based on the setting instruction received for the last time, the target task is started to be executed after the time in the timer is reduced to 0.
In the embodiment of the application, the setting instruction is obtained, the time of the timer is set according to the current countdown in the setting instruction, and the target task is executed when the time of the timer is overtime. According to the method and the device, the setting instruction is continuously acquired, the time of the timer is continuously updated according to the current countdown in the setting instruction, the time of the timer approaches the countdown time calculated by the controller, if a plurality of robots exist, the time difference of the timer of each robot is minimum, the synchronous control of the plurality of robots is realized, and the plurality of robots can almost simultaneously execute the target task.
As shown in FIG. 7, in one possible implementation manner, the implementation process of step S302 may include
And S3021, when the setting instruction is the received first setting instruction, setting the time of a timer in the robot to be the current countdown in the first setting instruction.
In this embodiment, when the robot receives the setting instruction for the first time, the current countdown in the setting instruction is the total countdown of the robot distance to execute the task. At this time, no time has been set in the timer, and therefore, the current countdown in the first setting instruction may be set as the current target countdown. Accordingly, the time of the timer in the robot may be set to the current countdown in the first setting instruction.
As an example, if the current countdown in the first setting instruction is 1000ms, the time of the timer may be set to 1000 ms.
S3022, when the setting instruction is the received ith setting instruction, determining whether the current countdown in the ith setting instruction is less than the current time of the timer, wherein i is greater than 1.
In this embodiment, if the robot does not receive the setting instruction for the first time, that is, there is already a time in the timer and the time in the timer is decreasing, it is necessary to determine whether the current time in the timer needs to be updated. Specifically, whether the current time in the timer needs to be updated may be determined according to the current countdown in the ith setting instruction and the current time of the timer.
S3023, when the current countdown in the ith setting instruction is smaller than the current time, replacing the current time of the timer with the current countdown in the ith setting instruction.
In this embodiment, if the current countdown in the ith setting instruction is less than the current time in the timer, it indicates that the current time in the timer is inaccurate, that is, the time for executing the target task is inaccurate, and therefore, the current time in the timer needs to be updated.
Specifically, since the current countdown is calculated based on the current absolute time, the current countdown is an accurate time. When the current countdown in the ith setting instruction is less than the current time, the current countdown in the ith setting instruction is taken as the current target countdown, that is, the current time in the periodical is changed into the current countdown time, and the timer needs to continue to run on the basis of the current countdown in the ith setting instruction.
S3024, when the current countdown in the ith setting instruction is greater than or equal to the current time, keeping the current time of the timer unchanged.
In this embodiment, if the current countdown in the ith setting instruction is greater than or equal to the current time, it indicates that the time when the robot receives the ith setting instruction is delayed from the time when the controller sends the ith setting instruction. Since the time in the timer is continuously reduced, if the robot does not receive the setting instruction in time, the current countdown in the ith setting instruction is greater than or equal to the current time in the timer. Therefore, the current countdown time in the ith setting instruction is inaccurate, the current time in the timer is not modified based on the time in the timer, and the timer can continue to run based on the current time.
As shown in fig. 8, in a possible implementation manner, the method may further include:
s401, receiving a first setting instruction, and if the current countdown in the first setting instruction is 1000ms, setting the time of the timer to 1000 ms.
S402, receiving a second setting command, and if the current countdown in the second setting command is 948ms and the current time in the timer is 950ms, updating the time of the timer to 948 ms.
S402, receiving a third setting instruction, and if the current countdown in the second setting instruction is 895ms and the current time in the timer is 890ms, keeping the time in the timer unchanged.
And according to the analogy, the time of the timer is set according to the last setting instruction until the last setting instruction is obtained.
When the time of the timer expires, the robot starts to perform the target task.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 9 shows a block diagram of a controller provided in the embodiment of the present application, corresponding to the control method of the robot described in the above embodiment, and only the part related to the embodiment of the present application is shown for convenience of description.
Referring to fig. 9, the controller 500 may include: a data acquisition module 510, a first calculation module 520, and an instruction generation module 530.
The data obtaining module 510 is configured to obtain a total countdown, where the total countdown is time when the robot starts to execute the target task from the current time;
a first calculating module 520, configured to calculate a current countdown based on the total countdown and a current absolute time in the controller, where the current countdown is a time when the current time calculated by the controller is distant from a time when the robot starts to execute the target task;
an instruction generating module 530, configured to generate a setting instruction based on the current countdown time, and send the setting instruction to at least one robot, where the setting instruction is used to instruct the at least one robot to set a time of a timer in the at least one robot based on the current countdown time.
In a possible implementation manner, the first calculating module 520 may specifically include:
a difference calculation unit, configured to calculate a difference between the current times based on the current absolute time and a first absolute time, where the first absolute time is an absolute time at which the controller calculates the difference between the current times for the first time;
and the time calculation unit is used for calculating the current countdown time based on the current time difference and the total countdown time.
In one possible implementation, when the controller calculates the current time difference for the first time, the current absolute time is the same as the first absolute time.
In a possible implementation manner, the connection with the instruction generating module 530 may further include:
and the circulating module is used for calculating the current countdown by taking the absolute time in the controller as the current absolute time at preset time intervals, and generating a setting instruction based on the current countdown so as to send the setting instruction to at least one robot.
Fig. 10 shows a block diagram of a robot according to an embodiment of the present application, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 10, the robot 600 may include: an instruction fetch module 610 and a time setting module 620.
The instruction obtaining module 610 is configured to obtain a setting instruction sent by a controller, where the setting instruction includes a current countdown, the current countdown is calculated by the controller based on a total countdown and a current absolute time in the controller, and the current countdown is a time between the current time calculated by the controller and a time when the robot starts to execute the target task;
and a time setting module 620, configured to set a time of a timer in the robot based on the current countdown, and execute the target task when the time in the timer expires.
In a possible implementation manner, the time setting module 620 may specifically be configured to:
when the setting instruction is a received first setting instruction, setting the time of a timer in the robot as the current countdown in the first setting instruction;
when the setting instruction is the received ith setting instruction, judging whether the current countdown in the ith setting instruction is less than the current time of the timer or not, wherein i is greater than 1;
when the current countdown in the ith setting instruction is smaller than the current time, replacing the current time of the timer with the current countdown in the ith setting instruction;
and when the current countdown in the ith setting instruction is greater than or equal to the current time, keeping the current time of the timer unchanged.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides a controller, and referring to fig. 11, the controller 700 may include: at least one processor 710, a memory 720, and a computer program stored in the memory 720 and operable on the at least one processor 710, wherein the processor 710, when executing the computer program, implements the steps of any of the method embodiments described above, such as the steps S101 to S103 in the embodiment shown in fig. 2. Alternatively, the processor 710, when executing the computer program, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 510 to 530 shown in fig. 9.
Illustratively, the computer program may be divided into one or more modules/units, which are stored in the memory 720 and executed by the processor 710 to accomplish the present application. The one or more modules/units may be a series of computer program segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal device 700.
Those skilled in the art will appreciate that fig. 11 is merely an example of a terminal device and is not limiting and may include more or fewer components than shown, or some components may be combined, or different components such as input output devices, network access devices, buses, etc.
The Processor 710 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 720 may be an internal storage unit of the terminal device, or may be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. The memory 720 is used for storing the computer programs and other programs and data required by the terminal device. The memory 720 may also be used to temporarily store data that has been output or is to be output.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
Embodiments of the present application further provide a controller, referring to fig. 12, the robot 800 may include: at least one processor 810, a memory 820, and a computer program stored in the memory 820 and operable on the at least one processor 810, wherein the processor 810, when executing the computer program, implements the steps of any of the method embodiments described above, such as the steps S301 to S302 in the embodiment shown in fig. 6. Alternatively, the processor 810, when executing the computer program, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 610 to 620 shown in fig. 10.
Illustratively, a computer program may be partitioned into one or more modules/units, which are stored in the memory 820 and executed by the processor 810 to accomplish the present application. The one or more modules/units may be a series of computer program segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal device 800.
Those skilled in the art will appreciate that fig. 12 is merely an example of a terminal device and is not intended to limit the terminal device and may include more or fewer components than shown, or some of the components may be combined, or different components such as input output devices, network access devices, buses, etc.
The Processor 810 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 820 may be an internal storage unit of the terminal device, or may be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. The memory 820 is used for storing the computer programs and other programs and data required by the terminal device. The memory 820 may also be used to temporarily store data that has been output or is to be output.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The embodiment of the application also provides a control system of the robot, which comprises the controller and at least one robot in the control method of the robot.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the embodiments of the control method for a robot.
The embodiment of the application provides a computer program product, and when the computer program product runs on a mobile terminal, the steps in each embodiment of the control method for the robot can be realized when the mobile terminal executes the computer program product.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A control method of a robot is applied to a controller, and comprises the following steps:
acquiring a total countdown, wherein the total countdown is the time from the time when the total countdown is started to be calculated to the time when the robot starts to execute the target task;
calculating a current countdown based on the total countdown and a current absolute time in the controller, wherein the current absolute time is a current time of a monotonic clock in the controller, and the current countdown is a time from a time when the controller starts to calculate the current countdown to a time when the robot starts to execute the target task;
generating a setting instruction based on the current countdown and transmitting the setting instruction to at least one robot, wherein the setting instruction is used for instructing the at least one robot to set the time of a timer in the at least one robot based on the current countdown;
said calculating a current countdown based on the total countdown and a current absolute time in the controller, comprising:
calculating a current time difference value based on the current absolute time and a first absolute time, wherein the first absolute time is the absolute time when the controller calculates the current time difference value for the first time, and the absolute time is the time of the monotonic clock;
calculating the current countdown based on the current time difference and the total countdown.
2. The control method of a robot according to claim 1, wherein the current absolute time is the same as the first absolute time when the controller calculates the current time difference value for the first time.
3. The method of controlling a robot according to claim 1, comprising, after transmitting the setting instruction to at least one of the robots:
calculating the current countdown with the absolute time in the controller as the current absolute time at preset time intervals, and generating a setting instruction based on the current countdown to transmit the setting instruction to at least one robot.
4. A control method of a robot is applied to the robot, and comprises the following steps:
acquiring a setting instruction sent by a controller, wherein the setting instruction comprises a current countdown, the current countdown is calculated by the controller based on a total countdown and a current absolute time in the controller, the current countdown is the time from the moment when the controller starts to calculate the current countdown to the moment when the robot starts to execute a target task, and the current absolute time is the current time of a monotonic clock in the controller;
setting the time of a timer in the robot based on the current countdown, and executing the target task when the time in the timer is overtime;
the setting the time of the timer in the robot based on the current countdown comprises:
when the setting instruction is a first received setting instruction, setting the time of a timer in the robot as the current countdown in the first setting instruction;
when the setting instruction is the received ith setting instruction, judging whether the current countdown in the ith setting instruction is less than the current time of the timer or not, wherein i is greater than 1;
when the current countdown in the ith setting instruction is smaller than the current time, replacing the current time of the timer with the current countdown in the ith setting instruction;
and when the current countdown in the ith setting instruction is greater than or equal to the current time, keeping the current time of the timer unchanged.
5. A controller comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the control method of the robot according to any one of claims 1 to 3 when executing the computer program.
6. A robot comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the control method of the robot according to claim 4 when executing the computer program.
7. A control system for a robot, characterized in that it comprises a controller according to claim 5 and at least one robot according to claim 6.
8. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a control method of a robot according to any one of claims 1 to 3 or claim 4.
CN202110302928.5A 2021-03-22 2021-03-22 Robot control method, controller, robot and control system Active CN113119117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110302928.5A CN113119117B (en) 2021-03-22 2021-03-22 Robot control method, controller, robot and control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110302928.5A CN113119117B (en) 2021-03-22 2021-03-22 Robot control method, controller, robot and control system

Publications (2)

Publication Number Publication Date
CN113119117A CN113119117A (en) 2021-07-16
CN113119117B true CN113119117B (en) 2022-05-17

Family

ID=76773718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110302928.5A Active CN113119117B (en) 2021-03-22 2021-03-22 Robot control method, controller, robot and control system

Country Status (1)

Country Link
CN (1) CN113119117B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679481A (en) * 2022-02-23 2022-06-28 达闼机器人股份有限公司 Robot control method and device, storage medium and robot cluster

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610553A (en) * 2016-01-04 2016-05-25 杭州亚美利嘉科技有限公司 Robot terminal and server instruction synchronization control method, device and system
CN105680972A (en) * 2016-01-20 2016-06-15 山东大学 Network synchronous control method of robot cluster cooperation tasks
CN106534283A (en) * 2016-11-02 2017-03-22 旗瀚科技有限公司 A system and method for synchronously controlling a plurality of robots
CN108736999A (en) * 2017-04-18 2018-11-02 华为技术有限公司 A kind of method for synchronizing time and device
CN109976243A (en) * 2017-12-28 2019-07-05 深圳市优必选科技有限公司 Robot synchronisation control means, device and equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7149606B2 (en) * 2005-03-01 2006-12-12 Fanul Robotics America, Inc. Synchronizing controllers linked by a communications network
JP6973427B2 (en) * 2019-02-15 2021-11-24 株式会社安川電機 Communication systems, communication methods, and programs

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610553A (en) * 2016-01-04 2016-05-25 杭州亚美利嘉科技有限公司 Robot terminal and server instruction synchronization control method, device and system
CN105680972A (en) * 2016-01-20 2016-06-15 山东大学 Network synchronous control method of robot cluster cooperation tasks
CN106534283A (en) * 2016-11-02 2017-03-22 旗瀚科技有限公司 A system and method for synchronously controlling a plurality of robots
CN108736999A (en) * 2017-04-18 2018-11-02 华为技术有限公司 A kind of method for synchronizing time and device
CN109976243A (en) * 2017-12-28 2019-07-05 深圳市优必选科技有限公司 Robot synchronisation control means, device and equipment

Also Published As

Publication number Publication date
CN113119117A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
US7432674B2 (en) Control system
US11351820B2 (en) Tire positioning method and apparatus, electronic control unit and tire pressure sensor
CN111210136B (en) Robot task scheduling method and server
CN113119117B (en) Robot control method, controller, robot and control system
US10594424B2 (en) Time synchronization slave apparatus capable of adjusting time synchronization period, and method of determining time synchronization period
CN107561933B (en) Speed adjusting method and device, computer equipment and storage medium
EP3361635B1 (en) Control system and pulse output device
CN107402534A (en) Adjusting method, EtherCAT main websites and computer-readable recording medium
US11379391B2 (en) Real-time automation device having a real-time data bus
CN109660310B (en) Clock synchronization method and device, computing equipment and computer storage medium
CN112068414B (en) Multi-system timing method, device, equipment and medium
CN114172915A (en) Message synchronization method, automatic driving system, storage medium and electronic equipment
CN116126501A (en) Task allocation method, device, intelligent equipment and storage medium
CN115934130A (en) ECU (electronic control Unit) upgrading method, device, equipment and medium
CN108737001B (en) Data processing method and related equipment
CN114328003A (en) Method for realizing data reverse order processing through CRC hardware module
EP1524532A1 (en) Neural network based extension of GPS based timing
CN113204516A (en) Method and device for time synchronization of processors
CN111010286A (en) Intelligent registration method and device based on serial bus, electronic equipment and medium
JP2019133206A (en) Motor drive system, motor control system and mobile robot
JP2021060870A (en) Electronic control device
CN111582407A (en) Task processing method and device, readable storage medium and electronic equipment
CN111168668A (en) Robot control method and robot
CN112463125B (en) Timing method and equipment of virtual timer
CN114328002B (en) Data sampling method in encoder, single chip microcomputer and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant