Disclosure of Invention
In view of the above, the present invention is directed to a robot-based workpiece processing method with fast and efficient positioning.
The technical scheme adopted by the invention is as follows: the workpiece processing method based on the robot comprises the following steps:
acquiring an operating position, wherein the operating position comprises a platform position and at least one machining position of a workpiece;
determining the absolute value of the angle change of the driving parts according to the operation position, wherein the number of the driving parts is at least one;
obtaining a processing path according to the angle change absolute value and the ant colony algorithm;
and processing the processing position according to the processing path.
Further, the step of determining an absolute value of an angle change of the driving member according to the operation position includes:
determining the angle of the driving piece relative to a preset reference object according to the platform position and each machining position;
and determining the absolute value of the angle change between the platform position and the machining position and between each machining position according to the angle.
Further, the step of determining the absolute value of the change of the angle between the platform position and the machining position and between each machining position according to the angle specifically includes:
and determining the absolute value of the angle change between the platform position and the machining position and between each machining position according to different preset scale factors of the driving piece and the angle.
Further, the step of obtaining the processing path according to the absolute value of the angle change and the ant colony algorithm includes the steps of:
traversing all the operation positions according to the angle change absolute value and the preset traversal times;
obtaining the processing path according to the traversal result and a preset finishing threshold;
and the processing path is a path with the minimum sum obtained by adding all the angle change absolute values in one traversal process.
Further, the step of traversing all the operation positions according to the absolute value of the angle change and the preset traversal times includes the following steps:
randomly determining an operation position as a starting point and adding a tabu table;
determining the access probability from the starting point to the rest operation positions except the tabu table according to the angle change absolute value;
according to the access probability, one of the rest operation positions is accessed and a taboo table is added;
taking the accessed operation position as a new starting point, returning to the step of determining the access probability from the new starting point to the rest operation positions except the tabu table according to the angle change absolute value until all the operation positions are traversed, and completing one-time traversal;
providing a new tabu table, returning to the step of randomly determining an operation position as a starting point and adding the new tabu table until the traversal times reach the preset traversal times;
wherein the absolute value of the angle change is inversely proportional to the access probability.
Further, the step of determining, according to the absolute value of the angle change, an access probability from a starting point to a remaining operation position other than the tabu table includes:
determining the access probability from a starting point to the rest operation positions except the tabu table according to the residual information amount, the angle change absolute value, a preset information heuristic factor and a preset expected heuristic factor;
wherein, the residual information amount, the information heuristic factor and the expected heuristic factor are all in direct proportion to the access probability;
the amount of residual information is the amount of pheromone remaining on the path formed when the remaining operation positions are visited from the start point and the new start point.
Further, the method also comprises the following steps:
determining a pheromone residual factor according to a preset pheromone volatilization coefficient;
and updating the residual information quantity after each traversal is completed and/or the traversal of the preset traversal times is completed according to the pheromone residual factor.
The present invention also provides a robot-based workpiece processing apparatus, comprising:
the device comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring operation positions, and the operation positions comprise a platform position and at least one processing position of a workpiece;
the determining module is used for determining the absolute value of the angle change of at least one driving piece according to the operation position;
the processing module is used for obtaining a processing path according to the angle change absolute value and the ant colony algorithm;
and the driving piece is used for driving the platform to process the processing position according to the processing path.
The present invention also provides a robot-based workpiece processing apparatus, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the robot-based workpiece processing method.
The invention also provides a storage medium storing instructions executable by a processor, and the processor executes the robot-based workpiece processing method when executing the instructions executable by the processor.
The invention has the beneficial effects that: determining an angle change absolute value of the driving piece according to the operation position, obtaining a processing path according to the angle change absolute value and an ant colony algorithm, and then processing the processing position; according to the method, the absolute value of the angle change of the driving piece is determined, the processing path is obtained according to the absolute value of the angle change and the ant colony algorithm, and the optimal path for processing the workpiece can be obtained according to the minimum angle change of the driving piece, so that the robot can be quickly positioned according to the optimal path, the processing strategy is simplified, and the efficiency for processing the workpiece is improved.
Detailed Description
The invention will be further explained and explained with reference to the drawings and the embodiments in the description. The step numbers in the embodiments of the present invention are set for convenience of illustration only, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
As shown in fig. 1, the robot-based workpiece processing method includes the steps of:
acquiring an operating position, wherein the operating position comprises a platform position and at least one machining position of a workpiece;
determining the absolute value of the angle change of the driving parts according to the operation position, wherein the number of the driving parts is at least one;
obtaining a processing path according to the angle change absolute value and the ant colony algorithm;
and processing the processing position according to the processing path.
Further as a preferred embodiment, the step of determining the absolute value of the angular change of the driving member according to the operation position includes:
determining the angle of the driving piece relative to a preset reference object according to the platform position and each machining position;
and determining the absolute value of the angle change between the platform position and the machining position and between each machining position according to the angle.
Further, as a preferred embodiment, the step of determining the absolute value of the change of the angle between the platform position and the machining position and between each machining position according to the angle specifically includes:
and determining the absolute value of the angle change between the platform position and the machining position and between each machining position according to different preset scale factors of the driving piece and the angle.
As shown in fig. 2, in this embodiment, the robot includes a base, a driving member (including a motor and a driving rod connected to each other), a driven rod, and a movable platform (platform), wherein the driving member is used to drive the platform to process a processing position according to a processing path, the platform is used to place processing tools such as a gripper, a nozzle, and a suction cup, the platform position refers to a position of a platform center, and the platform center refers to a point where a portion of the processing position is directly acted on by the processing tool. The absolute value of the angle change of the driving piece refers to the absolute value of the angle change of the driving rod, and the rotating angle of the motor is equivalent to the rotating angle of the driving rod in the machining process.
The processing mode can be means such as some glue, snatch, drilling, spot welding. The machining position refers to a position where machining is needed, and the machining position and the platform position are obtained by means of coordinate measurement, and the coordinate measurement may be performed by means of a sensor, a vision system, or manual measurement, and the like, which is not limited herein. Meanwhile, the measurement of the angle can also be obtained by a manual method or a visual system, for example: the method comprises the steps of shooting a workpiece picture by adopting a high-speed camera through building a vision system, then carrying out image acquisition processing and transmitting the image to an upper computer, extracting the characteristics of the workpiece processing position in the picture by utilizing image processing software by the upper computer (the specific software can use image processing software such as OPEncv), converting the acquired image coordinate into a three-dimensional coordinate of the real world (the part needs to be calibrated by the camera of the camera and then converted in the upper computer), calculating the joint angle change of the robot according to the position of the three-dimensional coordinate (through inverse kinematics calculation of the robot), and obtaining the angle of each position.
As shown in fig. 3, in the present embodiment, the set of operation positions is C ═ C
0,c
1,c
2,c
3,…,c
n},c
nRepresents the nth processing position, the 0 th processing position is c
0Representing the platform position (initial position), and the value of n is 0-11, wherein c
1To c
11Representing the machining position where machining is actually required,
c
i,c
jrespectively representing the ith and jth elements (i.e., operation positions), l
ijAnd L is a set of paths formed by connecting the elements (namely, operation positions) in the set C in pairs.
At the same time, the user can select the desired position,
as absolute value of angular change, i.e. /)
ijThe angle change of each motor (or driving rod) with weight value takes the sum of absolute values:
dij=w1|ci1-cj1|+w2|ci2-cj2|+…+ws|cis-cjs|
in this embodiment, the number of the driving members is s, and the value range is 1-3, theta
nsRepresenting the angle of the s driving rods with respect to the x-axis (preset reference object) when the platform is located at the nth machining position, for example, when s is 3 and n is 1, the platform is located at the first machining position c
1When the temperature of the water is higher than the set temperature,
θ
11angle of the first drive rod with respect to the x-axis, θ
12Angle of the second drive rod with respect to the x-axis, theta
13The angle of the third drive rod with respect to the x-axis. The determined angle of the driving member relative to the x-axis (preset reference object) according to the position of the center of the platform at each operation position can be specifically referred to table 1, and the first driving rod and the second driving rod are sequentially represented from left to rightThe angle of the moving rod and the third driving rod relative to the x axis specifies that the motor rotates anticlockwise around the z axis to the positive direction. w is a
1~w
sWhen the types (models) of the motors are different, the motors can achieve the equivalent purpose by adjusting the corresponding motor scale factors. When the models of the motors are the same, w
1=w
2=…=w
s=1,d
ijIs the absolute value, | c, of the change in angle
is-c
jsAnd | represents the numerical value after the absolute value of the angle change of the s-th motor when the platform is positioned at the jth element and the angle change of the s-th motor when the platform is positioned at the ith element.
TABLE 1
Further preferably, the step of obtaining the processing path according to the angle change absolute value and the ant colony algorithm includes the steps of:
traversing all the operation positions according to the angle change absolute value and the preset traversal times;
obtaining the processing path according to the traversal result and a preset finishing threshold;
and the processing path is a path with the minimum sum obtained by adding all the angle change absolute values in one traversal process.
Further as a preferred embodiment, the step of traversing all the operation positions according to the absolute value of the angle change and the preset number of traversal times includes the following steps:
randomly determining an operation position as a starting point and adding a tabu table;
determining the access probability from the starting point to the rest operation positions except the tabu table according to the angle change absolute value;
according to the access probability, one of the rest operation positions is accessed and a taboo table is added;
taking the accessed operation position as a new starting point, returning to the step of determining the access probability from the new starting point to the rest operation positions except the tabu table according to the angle change absolute value until all the operation positions are traversed, and completing one-time traversal;
providing a new tabu table, returning to the step of randomly determining an operation position as a starting point and adding the new tabu table until the traversal times reach the preset traversal times;
wherein the absolute value of the angle change is inversely proportional to the access probability.
Further preferably, the step of determining, according to the absolute value of the angle change, an access probability from a starting point to an operation position remaining outside a tabu table includes:
determining the access probability from a starting point to the rest operation positions except the tabu table according to the residual information amount, the angle change absolute value, a preset information heuristic factor and a preset expected heuristic factor;
wherein, the residual information amount, the information heuristic factor and the expected heuristic factor are all in direct proportion to the access probability;
the amount of residual information is the amount of pheromone remaining on the path formed when the remaining operation positions are visited from the start point and the new start point.
Further as a preferred embodiment, the method further comprises the following steps:
determining a pheromone residual factor according to a preset pheromone volatilization coefficient;
and updating the residual information quantity after each traversal is completed and/or the traversal of the preset traversal times is completed according to the pheromone residual factor.
In this embodiment, the ant colony algorithm refers to a probabilistic algorithm for finding the optimized path, and the mentioned ant is not an actual ant, but is only used for convenience of description, and may actually be an individual or a parameter customized in the programming.
As shown in fig. 4, the specific implementation steps of the ant colony algorithm are as follows:
1) initializing ant colony (i.e. a certain number of ants)) Nodes to be traversed (i.e., operation positions or elements), initialization pheromones (a substance generated on the path when an ant k accesses (transfers) from one node to another during traversal of the ant k), a certain number of ants k are randomly placed on each node (e.g., element i), while a node variable e is set to 0, the number of ants k is represented by m in this embodiment, m is 50,
b
i(t) represents the number of ants located at element i at time t; after one ant k completes the traversal of all the nodes once, the other ant starts to traverse, and meanwhile, in the traversal process of one ant k, the traversed nodes are added into the tabu
k(k is 1,2, …, m), the ant k can only access (transfer) the nodes except the tabu table, and the next step allows the selected node to access to be allowed
k={C-tabu
k}。
2) Randomly selecting 1 ant to perform traversal process, namely, randomly selecting a node as a starting point, and adding the starting point into a tabukPerforming the following steps;
3) according to the absolute value d of the angle changeijDetermining from the starting point to tabu tablekRemaining operating positions (nodes) beyond that, i.e. allowedkAccess probability (transition probability) p ofk ij(t), the higher the probability of transition to the node, and the traversal order is from i element to j element:
wherein i, j, v all represent nodes (elements), τ
ij(t) is the path l at time t
ijThe amount of information (residual information) on each path is equal at the initial time in this embodiment, and τ is set
ij(0) Const is constant, 1 in this embodiment, so τ
ij(0)=1,τ
iv(t) is the element at time t i and one of the elements that can be selected nextOne element forms the amount of information on the path; first heuristic function
Second heuristic function
d
ijRepresents the angle change weighted absolute value of the current position (i element added last in the tabu table) where the ant passes and the element j, d
ivIndicating allowed
kThe sum of the angle change weighted absolute values of all the elements v and i; alpha is an information heuristic factor (representing the relative importance of the track, reflecting the action of the information accumulated by the ants in the moving process when the ants move, the larger the value of the factor is, the more the ant tends to select the path passed by other ants, and the stronger the collaboration among the ants); beta is an expected heuristic factor, represents the relative importance of visibility, reflects the degree of importance of heuristic information of ants in the process of movement in the process that the ants select the path, and the larger the value of the factor is, the closer the state transition probability is to the greedy rule.
As can be seen from this example, the absolute value of the change in angle dijThe smaller, the first heuristic function ηijThe greater (t) is, the access probability (transition probability) pk ijThe larger (t) is, the larger dijAnd pk ij(t) is inversely proportional; tau isijThe larger the (t), alpha, beta, pk ijThe larger (t) is, the larger the information heuristic factor α is, the proportional ratio is, in this embodiment, the heuristic factor β is 1, and the heuristic factor β is expected to be 5, that is, β > α, so that when the ant k selects a node, the heuristic information is more emphasized, that is, the absolute value d of the angle change is more emphasizedijThe influence of (c).
4) According to the access probability of the previous step, the next node is accessed, the accessed node is used as a new starting point, and the absolute value d is returned according to the angle changeijDetermining the probability of access from the new starting point to the remaining operating positions outside the tabu table (i.e. adding the new starting point to the tabu table tabu)kAnd determining a new starting point to allowed again according to the stepskNext one of (2)The access probability of the node, and the access of the next node is carried out according to the access probability) until all the operation positions are traversed, all the nodes are accessed and allowedkIf no node exists, one traversal is completed, and then as shown in fig. 4, k + ═ 1, the next ant starts to traverse;
5) new tabu table providing blankkFor example, the former traversal is completed by 2 nd ant, and the new tabu table therein is tabu3Returning to the step of randomly determining an operation position as a starting point and adding a new tabu table, namely, randomly selecting one ant from the nodes to perform the traversal process until the traversal number reaches a preset traversal number, where the number of ants in the embodiment is m equal to 50, so that the preset traversal number is 50, and obtaining a traversal result after completing 50 traversals;
6) in order to avoid that the residual pheromone is too much to cause the residual information to overwhelm the heuristic information, in this embodiment, the residual information amount is updated after each ant completes one traversal and all ants complete one traversal (i.e. complete the preset number of traversals or refer to as the end of one cycle), for example, the information amount on the path (i, j) at the time t + b may be adjusted according to the following rule:
wherein rho represents pheromone volatilization coefficient, 1-rho represents pheromone residual factor, and in order to prevent infinite accumulation of information, the value range of rho is as follows:
0.1 in this example; delta tau
ij(t) represents the path (i, j) (i.e. /) in the present cycle
ij) Increment of pheromone above, initial time delta tau
ij(0)=0,Δτ
k ij(t) indicates that the kth ant is in the current cycleThe amount of information left in the loop on path (i, j), Q represents the pheromone strength, and is a constant that affects the convergence rate of the algorithm to some extent, which is 1 in this embodiment; l is
kThe total length of the path taken by the kth ant in the cycle is shown.
7) Performing iteration processing, where the preset ending threshold in this embodiment refers to a maximum iteration number, which is set to 200, the iteration number (node variable e) is set to be 0 at an initial value, the maximum iteration number is to ensure that the algorithm can find an optimal path solution, and specific parameters may be adjusted according to actual conditions. And performing 200 iterations, namely performing 200 iterations, wherein one iteration comprises 50 iterations, and outputting search results (including 200 traversal results), namely the optimized machining path, namely, adding all the angle change absolute values obtained in a certain traversal process to obtain a path with the minimum sum, namely, a path with the shortest path length passing through the center of the platform. As shown in fig. 5, the comparison between the minimum value and the average value of the absolute value of the angle change is shown, and it can be seen that the iteration number is 30 and tends to converge, so that the optimal solution of the processing path has been found. The directed graph optimizing process related to outputting the search result in the ant colony algorithm is a known means, and therefore is not described in detail.
In summary, the steps of the robot-based workpiece processing method are described as follows:
1) acquiring an operation position, including a platform position and all processing positions of a workpiece, specifically coordinates of the operation position;
2) according to the coordinates of each operating position, determining the angle of the driving part relative to a preset reference object (x axis) when the platform center is positioned at the initial platform position and when the platform center is positioned at each processing position, thereby determining the absolute value d of the angle change between the initial platform position and each processing position and between every two processing positionsij;
3) According to the absolute value d of the change in angleijResidual information amount τij(t), parameters such as a preset information heuristic factor alpha and a preset expected heuristic factor beta and the like, and determining the transition probability p between node transitions in the traversal processk ij(t) according to the transition profileRate pk ij(t) traversing;
4) traversing for preset traversing times;
5) performing iteration processing according to a preset finishing threshold value (maximum iteration times) and outputting a search result (namely the optimal machining path);
6) and transmitting the processing path to a robot system, and controlling a motor (driving piece) of the robot system to process the workpiece.
The present invention also provides a robot-based workpiece processing apparatus, comprising:
the device comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring operation positions, and the operation positions comprise a platform position and at least one processing position of a workpiece;
the determining module is used for determining the absolute value of the angle change of at least one driving piece according to the operation position;
the processing module is used for obtaining a processing path according to the angle change absolute value and the ant colony algorithm;
and the driving piece is used for driving the platform to process the processing position according to the processing path.
In this embodiment, the obtaining module, the determining module, and the processing module may be disposed on the robot, or may be disposed on other devices, and implement data transmission or control with the robot through data transmission and other manners.
The embodiment of the invention also provides a workpiece processing device based on the robot, which comprises:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the robot-based workpiece processing method.
The contents in the above method embodiments are all applicable to the present system embodiment, the functions specifically implemented by the present system embodiment are the same as those in the above method embodiment, and the beneficial effects achieved by the present system embodiment are also the same as those achieved by the above method embodiment.
In summary, compared with the prior art, the invention has the following advantages:
1) according to the absolute value of the angle change and the ant colony algorithm, the processing path is obtained, the optimal path for processing the workpiece can be obtained according to the minimum angle change of the driving piece, the robot can be quickly positioned according to the optimal path, the processing strategy is simplified, and the efficiency for processing the workpiece is improved;
2) the driving piece is enabled to process the workpiece with the minimum angle change, so that the energy-saving effect can be achieved while the processing time is reduced;
3) the real-time performance is good, the optimal path can be rapidly solved according to the position of the actual workpiece to be machined, and the robot can make a machining strategy;
4) the method has good applicability, and is suitable for the processing path planning of all industrial robots driven by motors (driving parts);
5) and adding a step of more residual information quantity, so that the situation that the residual information submerges the heuristic information due to excessive residual pheromones can be avoided, and the reliability of the ant colony algorithm is ensured.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, while the invention is described in the context of functional modules and illustrated in the form of block diagrams, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated into a single physical device and/or software module or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The embodiment of the invention also provides a storage medium, which stores instructions executable by the processor, and the processor executes the workpiece processing method based on the robot when executing the instructions executable by the processor.
It can also be seen that the contents in the above method embodiments are all applicable to the present storage medium embodiment, and the realized functions and advantageous effects are the same as those in the method embodiments.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
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.
In the description herein, references to the description of the term "one embodiment," "the present embodiment," "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 do not necessarily 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.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.