Disclosure of Invention
The invention provides a control method of a robot running system for solving the technical problems, which can quickly respond when an upper computer or a lower computer or a motor driver is abnormal, prevent unexpected runaway and avoid the situation that the robot cannot stop in time when encountering obstacles.
The technical scheme adopted by the invention is as follows:
a control method of a robot operation system, the system comprising: the control method comprises the following steps: receiving a speed control instruction sent by the upper computer; delaying a first preset time, and judging whether the lower computer receives the speed control instruction or not; if the lower computer is determined not to receive the speed control instruction, controlling the lower computer to send an emergency stop control instruction to the motor driver; delaying a second preset time, and judging whether the motor driver receives the emergency stop control instruction or not; and if the motor driver does not receive the emergency stop control instruction, controlling the motor driver to stop running.
According to an embodiment of the present invention, the method for controlling a robot operating system further includes: if the lower computer is determined to receive the speed control command, sending the speed control command to the motor driver; delaying the second preset time, and controlling the motor driver to operate according to the speed control instruction if the motor driver is determined to receive the speed control instruction.
According to an embodiment of the present invention, after determining that the lower computer receives the speed control instruction, the method further includes: acquiring mileage data of the driving motor, and controlling the lower computer to send the mileage data to the upper computer; and delaying for a third preset time, and updating the mileage data if the upper computer is determined to receive the mileage data.
According to an embodiment of the present invention, the method for controlling a robot operating system further includes: and if the upper computer is determined not to receive the mileage data, controlling the upper computer to send an emergency stop control instruction to the motor drive controller.
According to an embodiment of the present invention, the method for controlling a robot operating system further includes: and if the lower computer is determined to receive an alarm triggering instruction, controlling the lower computer to send the emergency stop control instruction to the motor driver.
According to one embodiment of the invention, the alarm triggering instruction comprises: one or more of an emergency stop trigger instruction, an anti-collision trigger instruction, a falling prevention trigger instruction and an ultrasonic close range trigger instruction.
The invention also proposes a control device for a robot operating system, said system comprising: host computer, next machine and motor drive, controlling means includes: the receiving module is used for receiving the speed control instruction sent by the upper computer; the first judgment module is used for judging whether the lower computer receives the speed control instruction or not when delaying for a first preset time; the control module is used for determining that the lower computer does not receive the speed control instruction and controlling the lower computer to send an emergency stop control instruction to the motor driver; the second judgment module is used for judging whether the motor driver receives the emergency stop control instruction or not when delaying for a second preset time; the control module is further used for determining that the motor driver does not receive the emergency stop control instruction and controlling the motor driver to stop running.
According to one embodiment of the invention, the control module comprises: the speed control module is used for determining that the lower computer receives the speed control instruction, and then sending the speed control instruction to the motor driver; the motor driving module is used for delaying the second preset time, determining that the motor driver receives the speed control instruction, and controlling the motor driver to operate according to the speed control instruction; the speed control module further comprises: the mileage data sending submodule is used for determining that the lower computer receives the speed control instruction, acquiring mileage data of the driving motor and controlling the lower computer to send the mileage data to the upper computer; the mileage updating submodule is used for delaying a third preset time, and updating the mileage data if the upper computer is determined to receive the mileage data; and the drive control module is used for controlling the upper computer to send an emergency stop control instruction to the motor drive controller when the upper computer does not receive the mileage data.
The invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and is characterized in that when the processor executes the program, the control method of the robot running system is realized.
The invention also proposes a non-transitory computer-readable storage medium on which a computer program is stored, which program, when executed by a processor, implements the control method of the robot operating system described above.
The invention has the beneficial effects that:
the method comprises the steps of firstly receiving a speed control instruction sent by an upper computer, delaying for a first preset time, and judging whether a lower computer receives the speed control instruction, wherein when the lower computer does not receive the speed control instruction, the lower computer is controlled to send an emergency stop control instruction to a motor driver; and then delaying for a second preset time, and judging whether the motor driver receives an emergency stop control instruction, wherein when the motor controller does not receive the emergency stop control instruction, the motor driver is controlled to stop running. From this, can appear when unusual at host computer or next computer or motor drive, quick response prevents unexpected out of control, avoids appearing the condition that the robot can not in time stop when meeting the obstacle.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a control method of a robot operating system according to an embodiment of the present invention.
In one embodiment of the present invention, a robot operation system includes: host computer, next machine and motor drive. The upper computer can be an industrial personal computer, and the lower computer can be a control chip. The lower computer is arranged between the upper computer and the motor driver, so that the robot can respond quickly.
As shown in fig. 1, a control method of a robot operating system according to an embodiment of the present invention may include the steps of:
and S1, receiving a speed control command sent by the upper computer.
And S2, delaying a first preset time, and judging whether the lower computer receives a speed control instruction, wherein the first preset time can be calibrated according to the actual situation, for example, the first preset time can be 300 ms.
And S3, if the lower computer is determined not to receive the speed control command, controlling the lower computer to send an emergency stop control command to the motor driver.
And S4, delaying a second preset time, and judging whether the motor driver receives the emergency stop control instruction, wherein the second preset time can be calibrated according to the actual situation, for example, the second preset time can be 300 ms.
And S5, controlling the motor driver to stop running if the motor driver does not receive the emergency stop control instruction.
Specifically, in the normal operation process of the robot, the upper computer sends a speed control instruction to the lower computer according to an actual condition, and determines whether the lower computer receives the speed control instruction sent by the upper computer after a first preset time (for example, the first preset time is 300ms), wherein if the lower computer does not receive the speed control instruction, the lower computer sends an emergency stop control instruction (that is, the rotating speed of the motor is 0) to the motor driver. If the motor driver does not receive the emergency stop control instruction after the second preset time (such as 300ms), the motor is directly controlled to stop running immediately, and the robot is prevented from being accidentally out of control.
According to an embodiment of the present invention, the method for controlling a robot operating system further includes: determining that the lower computer receives the speed control instruction, and sending the speed control instruction to the motor driver; and delaying the second preset time, and controlling the motor driver to operate according to the speed control instruction if the motor driver is determined to receive the speed control instruction.
Specifically, when the lower computer receives a speed control instruction sent by the upper computer, the speed control instruction is sent to the motor driver, after second preset time, whether the motor driver receives the speed control instruction sent by the lower computer or not is judged, and if the speed control instruction is received, the motor driver is controlled to control the motor to work according to the speed control instruction; if the robot is not received, the motor is directly controlled to stop running immediately, and the robot is prevented from being out of control accidentally.
According to an embodiment of the present invention, after determining that the lower computer receives the speed control command, the method further includes: acquiring mileage data of the driving motor, and controlling the lower computer to send the mileage data to the upper computer; and delaying for a third preset time, and updating the mileage data if the upper computer is determined to receive the mileage data. The third preset time may be calibrated according to actual conditions, for example, the third preset time may be 200 ms.
Further, according to an embodiment of the present invention, the control method of the robot operating system further includes: and if the upper computer is determined not to receive the mileage data, controlling the upper computer to send an emergency stop control instruction to the motor drive controller.
Specifically, when the lower computer sends a speed control instruction to the motor driver, mileage data of the motor driver is obtained, and the mileage data is sent to the upper computer, so that the upper computer can send the speed control instruction according to the mileage data. After a third preset time (such as 200ms), if the upper computer receives the mileage data, updating the mileage data, and sending a speed control instruction according to the mileage data; and if the upper computer does not receive the mileage data, sending an emergency stop control instruction to the motor drive controller so that the motor drive controller controls the motor to stop working.
According to an embodiment of the present invention, the method for controlling a robot operating system further includes: and if the lower computer is determined to receive the alarm triggering instruction, controlling the lower computer to send an emergency stop control instruction to the motor driver. Wherein, the alarm triggering instruction comprises: one or more of an emergency stop trigger instruction, an anti-collision trigger instruction, a falling prevention trigger instruction and an ultrasonic close range trigger instruction.
Specifically, when the lower computer receives one or more of an emergency stop switch triggering instruction, an anti-collision triggering instruction, a falling prevention triggering instruction and an ultrasonic short-distance triggering instruction, the lower computer directly sends an emergency stop control instruction to the motor driver so that the motor driver controls the motor to stop working, wherein the anti-collision triggering instruction is an instruction triggered when a person is likely to be hit in front, the falling prevention triggering instruction is an instruction triggered when a falling (such as a pit) is likely to occur in front, and the ultrasonic short-distance triggering instruction is an instruction triggered when an obstacle exists in front for a certain distance.
In summary, the invention first receives the speed control instruction sent by the upper computer, delays for a first preset time, and determines whether the lower computer receives the speed control instruction, wherein when the lower computer does not receive the speed control instruction, the lower computer is controlled to send the emergency stop control instruction to the motor driver; and then delaying a second preset time, and judging whether the motor controller receives an emergency stop control instruction, wherein when the motor controller does not receive the emergency stop control instruction, the motor controller is controlled to stop running. From this, can appear when unusual at host computer or next computer or motor drive, quick response prevents unexpected out of control, avoids appearing the condition that the robot can not in time stop when meeting the obstacle.
Corresponding to the embodiment, the invention further provides a control device of the robot running system.
Fig. 2 is a block diagram schematically illustrating a control apparatus of a robot operating system according to an embodiment of the present invention.
In one embodiment of the invention, the operating system comprises: host computer, next machine and motor drive. The upper computer can be an industrial personal computer, and the lower computer can be a control chip. The lower computer is arranged between the upper computer and the motor driver, so that the robot can respond quickly.
As shown in fig. 2, a control device of a robot operating system according to an embodiment of the present invention includes: the device comprises a receiving module 10, a first judging module 20, a control module 30 and a second judging module 40.
The receiving module 10 is configured to receive a speed control instruction sent by an upper computer. The first judging module 20 is configured to judge whether the lower computer receives the speed control instruction when delaying a first preset time. The control module 30 is configured to determine that the lower computer does not receive the speed control command, and control the lower computer to send an emergency stop control command to the motor driver. The second judging module 40 is configured to judge whether the motor controller receives the emergency stop control instruction when delaying for a second preset time. The control module 30 is further configured to determine that the motor driver does not receive the emergency stop control command, and control the motor driver to stop operating. The first preset time and the second preset time may be calibrated according to actual conditions, for example, the first preset time may be 300ms, and the second preset time may be 300 ms.
Specifically, in the normal operation process of the robot, the upper computer sends a speed control instruction to the lower computer according to an actual condition, the receiving module 10 receives the speed control instruction sent by the upper computer to the lower computer in real time, the first judging module 20 judges whether the lower computer receives the speed control instruction sent by the upper computer after a first preset time (for example, the first preset time is 300ms), and if the lower computer does not receive the speed control instruction, the control module 30 sends an emergency stop control instruction (that is, the rotating speed of the motor is 0) to the motor driver. The second determining module 40 determines that the motor driver does not receive the emergency stop control command after a second preset time (e.g. 300ms), and the second control module 50 directly controls the motor to stop running immediately, so as to prevent the robot from being accidentally out of control.
According to one embodiment of the present invention, as shown in FIG. 3, the control module 30 includes: the speed control module 31 is used for determining that the lower computer receives a speed control instruction and sending the speed control instruction to the motor driver; and the motor driving module 32 is configured to delay the second preset time, determine that the motor driver receives the speed control instruction, and control the motor driver to operate according to the speed control instruction.
Specifically, when the first judging module 20 judges that the lower computer receives a speed control instruction sent by the upper computer, the control module 30 sends the speed control instruction to the motor driver through the speed control module, after a second preset time, the second judging module 40 judges whether the motor driver receives the speed control instruction sent by the lower computer, and if so, the control module 30 controls the motor driver to control the motor to work according to the speed control instruction through the motor driving module; if the robot does not receive the command, the control module 30 directly controls the motor to stop running immediately through the motor driving module, so that the robot is prevented from being out of control accidentally.
According to an embodiment of the invention, the speed control module 31 further comprises: the mileage data sending submodule is used for determining that the lower computer receives the speed control instruction, acquiring mileage data of the driving motor and controlling the lower computer to send the mileage data to the upper computer; and the mileage updating submodule is used for delaying the third preset time, determining that the upper computer receives the mileage data, and updating the mileage data.
According to one embodiment of the invention, the control module 30 further comprises: and the drive control module 33 is used for determining that the upper computer does not receive the mileage data, and controlling the upper computer to send an emergency stop control instruction to the motor drive controller.
Specifically, when the lower computer sends a speed control instruction to the motor driver, mileage data of the motor driver is acquired through the mileage data sending submodule, and the mileage data is sent to the upper computer, so that the upper computer can send the speed control instruction according to the mileage data. After a third preset time (such as 200ms), if the upper computer receives the mileage data, the mileage updating submodule updates the mileage data and sends a speed control instruction according to the mileage data; if the upper computer does not receive the mileage data, the driving control module 33 sends an emergency stop control instruction to the motor driving controller, so that the motor driver controls the motor to stop working.
According to an embodiment of the present invention, the control module 30 controls the lower computer to send the emergency stop control command to the motor driver when the lower computer receives the alarm triggering command. Wherein, the alarm triggering instruction comprises: one or more of an emergency stop trigger instruction, an anti-collision trigger instruction, a falling prevention trigger instruction and an ultrasonic close range trigger instruction.
Specifically, when the lower computer receives one or more of an emergency stop switch triggering instruction, an anti-collision triggering instruction, a falling prevention triggering instruction and an ultrasonic close-range triggering instruction, the control module 30 controls the lower computer to directly send the emergency stop control instruction to the motor driver so that the motor driver controls the motor to stop working, wherein the anti-collision triggering instruction is an instruction triggered when a person is likely to be touched in front, the falling prevention triggering instruction is an instruction triggered when a falling (such as a pit) is likely to occur in front, and the ultrasonic close-range triggering instruction is an instruction triggered when an obstacle exists in front for a certain distance.
The control device of the robot operation system receives a speed control instruction sent by an upper computer through a receiving module, judges whether a lower computer receives the speed control instruction through a first judging module when delaying for a first preset time, controls the lower computer to send an emergency stop control instruction to a motor driver when the lower computer does not receive the speed control instruction, judges whether the motor driver receives the emergency stop control instruction through a second judging module when delaying for a second preset time, and controls the motor driver to stop operating when the motor driver does not receive the emergency stop control instruction.
The invention further provides a computer device corresponding to the embodiment.
The computer device according to the embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for controlling the robot operating system according to the above-described embodiment of the present invention may be implemented.
According to the computer equipment provided by the embodiment of the invention, when the processor executes a computer program stored on the memory, the processor firstly receives a speed control instruction sent by the upper computer, delays for a first preset time and judges whether the lower computer receives the speed control instruction, wherein when the lower computer does not receive the speed control instruction, the lower computer is controlled to send an emergency stop control instruction to the motor driver; and then delaying for a second preset time, and judging whether the motor driver receives an emergency stop control instruction, wherein when the motor driver does not receive the emergency stop control instruction, the motor driver is controlled to stop running. From this, can appear when unusual at host computer or next computer or motor drive, quick response prevents unexpected out of control, avoids appearing the condition that the robot can not in time stop when meeting the obstacle.
The invention also provides a non-transitory computer readable storage medium corresponding to the above embodiment.
A non-transitory computer-readable storage medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, can implement the control method of the robot operating system according to the above-described embodiment of the present invention.
According to the non-transitory computer readable storage medium of the embodiment of the invention, when the processor executes the computer program stored on the processor, the processor firstly receives the speed control instruction sent by the upper computer, delays for a first preset time and judges whether the lower computer receives the speed control instruction, wherein when the lower computer does not receive the speed control instruction, the lower computer is controlled to send the emergency stop control instruction to the motor driver; and then delaying for a second preset time, and judging whether the motor driver receives an emergency stop control instruction, wherein when the motor driver does not receive the emergency stop control instruction, the motor driver is controlled to stop running. From this, can appear when unusual at host computer or next computer or motor drive, quick response prevents unexpected out of control, avoids appearing the condition that the robot can not in time stop when meeting the obstacle.
In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The meaning of "plurality" is two or more unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.