A method of industrial robot return to position based on ensemble learning

By constructing the position determination space and designing the return-to-initial bit path in an industrial robot, and combining the decision tree and the k-nearest neighbor algorithm to make path decisions, the difficulty of the robot returning to the original bit in a complex environment is solved, and efficient and safe return-to-initial bit motion is achieved.

CN115847411BActive Publication Date: 2025-03-11HENAN MASCH DESIGN & RESEAROH INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211543845.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-03
Publication Date
2025-03-11
Estimated Expiration
2042-12-03

AI Technical Summary

Technical Problem

Under the constraints of a multi-link mechanism, it is difficult for industrial robots to return from any starting position to the initial position in a narrow and irregular working environment to avoid collision.

Method used

Using an integrated learning method, the path planning and execution of the robot's return to the initial bit is realized by constructing the location judgment space, designing the path path path path paths, and using the decision tree and the k-nearest neighbor algorithm.

Benefits of technology

It effectively solves the difficulty of the robot returning to the initial position in a complex environment, improves the success rate and path optimization of the initial position, and ensures the safe movement of the robot under the constraints of the multi-link mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115847411B_ABST
    Figure CN115847411B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for returning an industrial robot to its original position based on ensemble learning. By designing the path for the robot to return to its original position, collecting sample information such as the robot's posture and tool type, classifying the posture information by combining the k-nearest neighbor algorithm and constructing a return-to-initial position space, training a decision tree model by reconstructing samples of the robot's feature information, and finally using the decision tree model to determine the path for returning to the original position and execute the robot's return-to-initial position program, the task of automatically returning the industrial robot to its original position is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial robot automation control, and in particular to an industrial robot return method based on ensemble learning. Background Art

[0002] The main working mode of an industrial robot is to achieve different mechanical actions through a tool (TOOL) installed on the end flange. In order to describe the position and posture of the tool in the coordinate system, it is necessary to establish a tool coordinate system TCS (Tool Coordinate System). The origin of the tool coordinate system is the TCP point (Tool Center Point). The TCP position information of an industrial robot is generally converted into a one-dimensional array representation: [x, y, z, rx, ry, rz], where the first three items of the array: [x, y, z] represent the coordinate components of the TCP in each axis in the base coordinate system; the last three items: [rx, ry, rz] represent the angle value between each axis vector and each axis vector of the base coordinate system.

[0003] Most of the industrial robots widely used at present are teach-and-reproduce type robots. Their working principle is to teach several positions, move to the taught positions according to the designed program logic, or move to the offset position of the taught position after calculation based on the taught position, and then perform step-by-step work by switching different types of tools.

[0004] In a production scenario, TCP has an initial position. During robot operation, TCP stops at another position for some reason and now needs to end subsequent work steps. The process of moving from the current position to the initial position is the process of the robot returning to the initial position.

[0005] Theoretically, it is very simple for a TCP to move from one position in space to another. However, in actual working conditions, the following reasons cause the TCP to often not be able to return directly from the starting position to the initial position:

[0006] 1. The working environment is small and irregular;

[0007] 2. There is an obstacle blocking the two pose paths;

[0008] 3. The TCP may carry different kinds of tools and need to be moved to different initial positions;

[0009] 4. Mechanical constraints of the robot’s multi-link mechanism, etc.

[0010] Therefore, the problem of returning to the initial position is to solve the problem of moving the TCP, which may carry a variety of tools, from any starting position to the initial position without causing collision under the constraints of the robot's multi-link mechanism. Summary of the invention

[0011] In view of the problems existing in the process of the industrial robot returning to the initial position, the present invention provides an industrial robot returning to the initial position method based on ensemble learning.

[0012] The solution adopted by the present invention to solve the technical problem is an industrial robot return method based on ensemble learning, comprising the following steps:

[0013] S1. Construct the position determination space, construct the cube space with the teaching point as the neutral, construct the cube space with the working area as the center, and construct the quadrant space in the whole area;

[0014] S2. Classify and design the return-to-initial position path, respectively design the return-to-initial position path in the teaching point cube, the return-to-initial position path in the working area cube, and the return-to-initial position path in the quadrant area, and number each return-to-initial position path;

[0015] S3, decision on the path back to the initial position. The decision on the path back to the initial position is based on a decision tree algorithm, and the robot's initial state data is counted as samples to train the decision tree model;

[0016] S4, TCP position and posture determination, collect the characteristic information of the robot, including posture information, current tool information, etc.; split the posture information into position information and posture information; classify the position information and posture information using the k-nearest neighbor algorithm to obtain the position classification number and posture classification number;

[0017] S5, reconstructing the robot feature information, and importing the reconstructed robot feature information into the trained decision tree model to obtain the regression path number;

[0018] S6. Execute the robot regression program of the classification design according to the path number.

[0019] In step S2, the return-to-initial position paths in the constructed position determination space are numbered respectively: the return-to-initial position paths of the small cube type centered on the teaching point are directly numbered; the return-to-initial position paths of the working area cube type are distinguished and numbered according to the return-to-initial position paths corresponding to the postures; and the return-to-initial position paths of the object area type are distinguished and numbered according to the return-to-initial position paths corresponding to the tool type and posture.

[0020] The data counted in step S3 include the TCP's position data, posture data, tool type number and the robot's path number for returning to the initial position, wherein the position data, posture data and tool type number serve as the characteristic values ​​of the sample, and the robot's path number for returning to the initial position in this state serves as the target value of the sample.

[0021] In step S3, the C4.5 algorithm in the decision tree is used, and the basis for dividing the sample features is the information gain ratio. Suppose a feature A in the sample, its feature entropy is:

[0022]

[0023] Where: i represents the n values ​​of feature A; |D| represents the total number of samples before division; |D i | represents the number of samples divided.

[0024] Information gain of feature A:

[0025] I(D,A)=H(D)-H A (D)

[0026] Where: H(D) represents the total entropy of the sample; H A (D) represents the feature entropy of feature A.

[0027] Information gain ratio:

[0028]

[0029] Where: I(D,A) represents information gain; H A (D) represents characteristic entropy.

[0030] Among them, step S3 uses the k-nearest neighbor algorithm to convert the discrete TCP position data and posture data into category data, classifies the discrete TCP position data, and establishes data samples distributed in each cubic space for training the k-nearest neighbor model;

[0031] Use the KNeighborsClassifier class in the sklearn module to model the k-nearest neighbor algorithm, count the position and posture data samples, standardize to eliminate the influence of outliers on the overall data average, and standardize each column of data, that is, each data in an axial direction or in a rotation direction around a certain direction axis. The calculation method is as follows:

[0032]

[0033] Where: x represents the current data; μ represents the mean value of the data column; σ represents the standard deviation of the data column. The total data set after standardization is divided into 80% training set and 20% test set. x' is the data after standardization of the current data.

[0034] The training set and the labels corresponding to the training set are input into the KNeighborsClassfier.fit() function for model training. The result is that the discrete position data and posture data of TCP are converted into classifications of space numbers and posture numbers. The position number and posture number of TCP will replace the discrete coordinate data as the eigenvalues ​​of the path decision algorithm. Use the KNeighborsClassfier.score() function to import the eigenvalues ​​and target values ​​of the test set samples to evaluate the accuracy of the model.

[0035] In order to make the model classification more accurate, the hyperparameter n_neighbors of the k-nearest neighbor algorithm was tuned, the training set was divided into ten equal parts for cross-validation, and a grid search was performed on the pre-set n_neighbors value to obtain the hyperparameters of the model under the data sample.

[0036] There are three hyperparameters in the decision tree model: the maximum depth of the tree (max_depth); the number of samples that each child node of a node must contain after branching (min_samples_leaf); the number of samples that a node must contain (min_samples_split). To tune the hyperparameters, divide the training set into ten equal parts for cross-validation, and perform a grid search on the preset max_depth = [3,5], min_samples_leaf = [5,8,10], min_samples_split = [1,2,3] to obtain the hyperparameters optimized for the model under the data sample. Enter the training set and the label corresponding to the training set into

[0037] The DecisionTreeClassifier.fit() function is used to train the model. This model is used to determine the path number corresponding to the initial position under the characteristics of a certain position number, posture number and tool type. The DecisionTreeClassifier.score() function is used to import the test set data to evaluate the model. The joblib.dump() function is used to save the evaluated model in pkl format.

[0038] Beneficial effects of the present invention:

[0039] The present invention first constructs and divides the reachable space of robot movement, and classifies the discrete numerical posture data; then designs the path for the robots in different types of spatial states to return to the initial position, so that the robots in different states can move to the initial position in a reasonable way; then statistics and model training are performed on the classified posture data, and the trained model is used to make path decisions for the robot data input in real time; finally, the corresponding motion program is executed in combination with the path design for returning to the initial position. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a schematic diagram of the cubic space constructed with teaching points.

[0041] Figure 2 It is a schematic diagram of a cubic space constructed with the center point of the working area.

[0042] Figure 3 It is a schematic diagram of quadrant space.

[0043] Figure 4 It is a schematic diagram of a mixture of multiple cubic spaces.

[0044] Figure 5 It is a schematic diagram of the design of returning the teaching point cube to the initial position.

[0045] Figure 6 It is a schematic diagram of the design of returning to the initial position within the working area cube.

[0046] Figure 7 It is a schematic diagram of the design of the quadrant area returning to the initial position.

[0047] Figure 8 This is a schematic diagram of the cube space threshold setting.

[0048] Fig. 9 This is a partial original data table of the present invention.

[0049] Fig.10 It is a data table after partial reconstruction of the present invention. DETAILED DESCRIPTION

[0050] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0051] Embodiment 1: The prerequisite for solving the problem of industrial robot returning to the initial position is to correctly determine the initial position of the robot when returning to the initial position, wherein the position information of the TCP has the greatest weight in the decision of returning to the initial position. The present invention constructs a position determination space for determining the TCP position.

[0052] The robot's TCP is randomly moved to different positions in the position determination space several times with a posture close to the teaching point, and the position data of the TCP in the rectangular coordinate system is recorded, and the position data is used as the feature value of the sample.

[0053] According to the starting posture information of TCP when it returns to the initial position, the current tool type and other features, a suitable return-to-initial position path is designed to enable the robot to complete the return-to-initial position action. The correspondence between the robot's position information, posture information, tool type and other features and the return-to-initial position path is established, providing a template for the sample of the return-to-initial position model and constructing a decision tree model.

[0054] In production scenarios, due to malfunctions and other reasons, the robot will stop in a non-initial position. According to the pre-constructed position judgment space, the position information and other relevant feature information of the robot TCP in the position judgment space are judged, and the relevant position information is subdivided into position information and posture information to facilitate subsequent classification processing.

[0055] The subdivided position information and posture information are classified using relevant algorithms to obtain the position classification number and posture classification number of the robot TCP at this time. The obtained position classification number and posture classification number are compared with the sample data, and similar values ​​are taken to reconstruct the feature information of the robot TCP to make it conform to the decision tree model established in advance.

[0056] The reconstructed robot TCP feature information is imported into the pre-trained decision tree model, and the feature information is used to find the corresponding regression path in the model. The robot's regression program installs the regression path to execute and complete the robot's return to the initial position.

[0057] Embodiment 2: The present invention provides three methods for defining position judgment spaces for determining TCP posture. Appropriate space division can improve the success rate of the robot returning to the initial position and optimize the design of the path.

[0058] 1. Construct a cube space with the teaching point as the center: The most common working mode of industrial robots is to rely on the teaching point to complete different processes step by step. The general process is to move TCP to the working point in advance and record the coordinates of several working points p1, p2...pn. When working, TCP completes a certain process at point p1, moves to point p2 to complete another process, and returns to point p1 to end a task after completing all processes. In this working mode, the starting position of the robot when returning to the initial position may be exactly at the teaching point position or because the error is only offset by a very small distance, TCP may still be in the initial position. In this case, it is undoubtedly the best way to move TCP to the nearest teaching point and then return to the initial position, so a small cube space centered on the teaching point should be constructed to determine whether TCP is at a certain teaching point position. The vector description of the teaching point p in the base coordinate system is:

[0059]

[0060] [p x ,p y ,p z ] is the component of each axis of the teaching point in the base coordinate system. By adding or subtracting a smaller value n from each axis component of point p, we can get the cubic space C composed of eight component value coordinates. t :

[0061]

[0062] The cubic space thus formed is the cubic space constructed by the teaching point p, such as Figure 1 shown.

[0063] 2. Construct a cubic space with the center of the working area: Another commonly used working mode of industrial robots is to obtain points p1, p2...pn after position calculation based on a teaching point p in the working area. After TCP completes several processes at points p1, p2...pn, it returns to point p to end a task. In this working mode, the starting position of the robot when it returns to the initial position is most likely located somewhere in the working area. Assuming that n working points are calculated from point p, point p2 / n is the center point of the working area. The vector description of the starting point p of the working area in the base coordinate system is,

[0064]

[0065] Working area center point p 2 / n The vector description in the base coordinate system is,

[0066]

[0067] [p x , p y , p z ] is the component of point p in each axis of the base coordinate system, [p' x , p' y , p' z ] is the component of each axis of point p2 / n in the base coordinate system, and the distance from each axial component of point p2 / n to the edge of the working area is [|p x -p' x |,|p y -p' y |,|p z -p' z |], the coordinate component value of the center point of the working area is added or subtracted along each axis by one distance to the edge of the working area to obtain the cube space C composed of eight component value coordinates w :

[0068]

[0069] The cubic space thus formed is the cubic space constructed by the center point p2 / n of the working area, such as Figure 2 shown.

[0070] 3. Full-area construction quadrant space: The robot usually has multiple working points and areas. TCP moves between different points and areas to complete different processes. Therefore, when returning to the initial position, TCP may be on the path between teaching points or between working areas. That is, when returning to the initial position, the starting position of TCP is outside the two cube spaces mentioned above.

[0071] In order to make the robot return to its initial position no matter where it is, it is necessary to divide all reachable areas of the robot into quadrants in addition to the two types of cubic spaces. The origin o of the base coordinate system is used as the dividing point of the quadrant area. The vector description of point o in the base coordinate system is:

[0072]

[0073] The overall space is divided into eight regions along the axes of the dividing point o, and the range of each region is represented by Q i :

[0074]

[0075] The area divided by these eight ranges is the quadrant space, such as Figure 3 shown.

[0076] The same type of spatial regions may overlap or even completely cover each other, such as Figure 4 As shown, when TCP is in a certain defined space, it is also likely to be in another defined space.

[0077] In order to define the uniqueness of the space where the TCP is located, it is necessary to prioritize different types of spaces. The cube constructed with the teaching point as the center is characterized by the smallest space, the largest number, the smallest probability of overlapping with the same type of cube space, and the largest probability of overlapping with other types of cube space. This type of space is given the highest priority; the cube constructed with the working area as the center is characterized by a relatively large space and a small number. The same type of cube space will have overlapping parts and may cover multiple cubes constructed with the teaching point as the center. This type of space is given a medium priority; the quadrant space divided into the entire domain is characterized by the largest space, eight in number, and completely covers the first two types of cube space. This type of space is given the lowest priority.

[0078] The present invention makes decisions on the robot's return-to-initial position path based on a decision tree algorithm. Therefore, it is necessary to design a suitable return-to-initial position path based on the starting posture information of the TCP when it returns to the initial position, the current tool type and other features to enable the robot to complete the return-to-initial position action, and establish a correspondence between the robot's position information, posture information, tool type and other features and the return-to-initial position path to provide a template for the sample of the return-to-initial position model.

[0079] Since three space division methods are used, the design methods of the return-to-initial position path corresponding to the spaces divided by different methods are also different.

[0080] Among them Figure 5 As shown in the figure, the path design of the teaching point cube type returning to the initial position: when the starting position of the robot returning to the initial position is in a small cube with a teaching point as the center, the way to return to the initial position should first move to the teaching point corresponding to this cube. After arriving, the position and posture of the robot are completely determined; then the teaching point in the reverse operation process returns to the initial position, such as Figure 5 shown.

[0081] like Figure 6 As shown in the figure, the path design of the work area cube type returning to the initial position: a non-interference teaching point should be taught in the work area cube as the transition point of the robot's path back to the initial position. When the starting position of the robot returning to the initial position is in a certain work area cube, considering that the robot may have multiple postures in the same work area, the way to return to the initial position should first be combined with the current posture of the robot to determine whether it needs to be transformed to a posture close to the transition point and then move to the transition point in this work area. After arriving, the position and posture of the robot are completely determined; then move to the teaching point adjacent to the transition point in the work cube; finally, reverse the running process to return the teaching point to the initial position.

[0082] like Figure 7 As shown in the figure, the quadrant area type return to initial position path design: in the eight quadrant areas, several non-interference teaching points should be taught in advance according to the number of tools that may be switched as transition points of the robot's return to initial position path. When the starting position of the robot's return to initial position is in a quadrant area, it means that the robot is running on the path between working areas or teaching points. In this state, the robot may have a variety of tools and postures, so the return to initial position method should first select the target transition point in combination with the current tool type of the robot; judge whether it is necessary to change to a posture close to the transition point through the current posture and then move to the transition point in this working area. After arriving, the position and posture of the robot are completely determined; then move to the teaching point adjacent to the transition point of the quadrant area; finally, reverse the operation process to return the teaching point to the initial position.

[0083] In order to facilitate the standardized statistics of sample data, model training and path decision of input samples, the return-to-initial position paths need to be numbered. The return-to-initial position paths of the small cube class centered on the teaching point are directly numbered; the return-to-initial position paths of the working area cube class should be distinguished and numbered according to the return-to-initial position paths corresponding to the posture; the return-to-initial position paths of the object area class should be distinguished and numbered according to the return-to-initial position paths corresponding to the tool type and posture.

[0084] The determination of the path back to the initial position in the present invention is based on a decision tree algorithm. In order to train this model, it is necessary to collect statistics on the robot's initial state data as training samples. The statistical data includes the TCP's position data, posture data, tool type number, and the robot's path number back to the initial position, where the position data, posture data, and tool type number are used as the sample's characteristic values, and the robot's path number back to the initial position in this state is used as the sample's target value, such as Fig. 9 Shown are some of the original data in this invention.

[0085] Since the decision tree algorithm has a poor response to the feature values ​​of discrete numerical types, it is necessary to use the k-nearest neighbor algorithm to convert the discrete TCP position data and posture data into category data. To this end, the TCP position data and posture data are further processed.

[0086] In order to classify the discrete TCP position data, it is necessary to establish data samples distributed in each cubic space for training the k-nearest neighbor model. First, the constructed cubic spaces are numbered, and then the robot's TCP is moved to each cubic space with a posture close to the teaching point, randomly moved to different positions several times, and the TCP's position data in the rectangular coordinate system and the number of the space it is in are recorded. Among them, the position data is used as the feature value of the sample, and the space number is used as the target value of the sample.

[0087] Since the robot will work in different postures in the working area, in addition to the space number, all its working postures need to be numbered in the same cube space. When recording data in the working area cube, the robot's TCP needs to be moved to the working area cube space in various postures similar to those during work, and randomly moved to different positions several times with different working postures, and the posture data of TCP in the rectangular coordinate system and the posture number in the space are recorded.

[0088] Combine the statistical samples of position data and posture data, the position data and posture data are used as the feature values ​​of the samples, and the space number and posture number are used as the target values ​​of the samples.

[0089] K-Nearest Neighor (KNN) is a supervised algorithm that uses the Euclidean distance method to measure different feature values ​​for classification. Its working principle is that there is a sample data set (C1, C2....C n ), also called the training sample set, and each piece of data in the sample set has a label (L1, L2...L n ), that is, the correspondence between each data in the sample set and its corresponding category. After inputting new data without labels (C1', C2'...C n '), calculate the Euclidean distance between each feature of the new data and the feature corresponding to the data in the sample set, and the calculation method is as follows:

[0090]

[0091] Where: d(C j , C′ j ) represents the feature C′ of the new data j With sample data feature C j The Euclidean distance between them; k represents the number of selected neighbors.

[0092] Then sort the data in ascending order according to the Euclidean distance, and select the category with the most occurrences in the k most similar data as the category of the new data. The method is as follows:

[0093]

[0094] Where: L′ represents the classification label of the new data; k represents the number of selected neighbors; d(C,C′ j ) represents the feature C′ of the new data j With sample data feature C j The Euclidean distance between .

[0095] The present invention uses the KNeighborsClassifier class in the sklearn module to model the k-nearest neighbor algorithm. Using the position and posture data samples in Section 3.1, since the discrete coordinate value data in the data sample may have recording errors, standardization can eliminate the influence of outliers on the overall data average. Each column of data, that is, each data in an axial direction or a rotation direction around a certain direction axis, is standardized, and the calculation method is as follows:

[0096]

[0097] In the formula: x represents the current data; μ represents the mean value of the data column; σ represents the standard deviation of the data column, and x′ represents the data after the current data is standardized;

[0098] The total data set after normalization is divided into 80% training set and 20% test set.

[0099] In order to make the model classification more accurate, the hyperparameter n_neighbors of the k-nearest neighbor algorithm is tuned. The training set is divided into ten equal parts for cross-validation, and a grid search is performed on the pre-set n_neighbors value to obtain the optimal hyperparameter of the model under this data sample.

[0100] The training set and the labels corresponding to the training set are input into the KNeighborsClassifier.fit() function for model training. The result is to convert the discrete position data and posture data of TCP into the classification of space number and posture number. The position number and posture number of TCP will replace the discrete coordinate data as the feature value of the path decision algorithm.

[0101] Finally, use the KNeighborsClassfier.score() function to import the feature values ​​and target values ​​of the test set samples to evaluate the accuracy of the model.

[0102] like Figure 8 As shown in the figure, due to the classification of the location data using the k-nearest neighbor algorithm, no matter whether the TCP is in a certain cube space, there will be n samples with the closest distance to match and classify the data. In order to eliminate the TCP location data that is not in a certain cube space, it is necessary to set the distance threshold of each cube space, that is, on the basis that the TCP location data has n nearest neighbors in a cube, add a distance threshold for judging the cube. If the threshold exceeds the limit, it will be judged downward according to the priority of the cube space judgment.

[0103] The decision tree (DT) algorithm is a supervised learning model, which is a tree structure consisting of internal nodes and leaf nodes. Each internal node corresponds to the division of a feature in the sample, and the leaf node corresponds to the classification of the sample. Starting from the root node, a feature is divided, and according to the division result, the sample is assigned to its child nodes. Each child node corresponds to a value of the feature, and the sample is recursively divided and classified until a leaf node is reached.

[0104] The present invention adopts the C4.5 algorithm in the decision tree, and the basis for dividing the sample features is the information gain ratio. Suppose a feature A in the sample, its feature entropy:

[0105]

[0106] Where: i represents the n values ​​of feature A; |D| represents the total number of samples before division; |D i | represents the number of samples divided.

[0107] Information gain of feature A:

[0108] I(D,A)=H(D)-H A (D)

[0109] Where: H(D) represents the total entropy of the sample; H A (D) represents the feature entropy of feature A.

[0110] Information gain ratio:

[0111]

[0112] Where: I(D,A) represents information gain; HA(D) represents feature entropy.

[0113] The pruning strategy adopts the pre-pruning method. Pre-pruning means that in the process of constructing a decision tree, each node is estimated before being divided. If the division of the current node cannot improve the generalization performance of the decision tree model, the current node will not be divided and the current node will be marked as a leaf node. The risk of overfitting is reduced by actively removing some branches.

[0114] After the TCP position data and posture data in the collected data samples are classified by the k-nearest neighbor algorithm, the discrete coordinate data is converted into labeled classification data. The position and posture classification labels replace the original coordinate data and posture data for training the decision tree model. The reconstructed data samples will use the TCP position classification number, TCP posture classification number, and tool type number as feature values, and the initial path number as the target value, such as Fig.10 Shown are some of the reconstructed data in the present invention.

[0115] The present invention uses the DecisionTreeClassifier class in the sklearn module to model the decision tree algorithm. The sample data reconstructed in Section 3.3.2 is used for model training. The total data set is divided into 80% training set and 20% test set.

[0116] The decision tree model has three hyperparameters: the maximum depth of the tree (max_depth); the number of samples that each child node of a node must contain after branching (min_samples_leaf); and the number of samples that a node must contain (min_samples_split). In order to achieve a better pruning effect in the path decision back to the initial position, the hyperparameters need to be tuned. The training set is divided into ten equal parts for cross-validation, and a grid search is performed on the pre-set max_depth = [3,5], min_samples_leaf = [5,8,10], min_samples_split = [1,2,3] to obtain the optimal hyperparameters of the model under this data sample.

[0117] The training set and the labels corresponding to the training set are input into the DecisionTreeClassifier.fit() function for model training. This model is used to determine the path number corresponding to the initial position under the characteristics of a certain position number, posture number and tool type.

[0118] Use the DecisionTreeClassifier.score() function to import the test set data to evaluate the model. Use the joblib.dump() function to save the evaluated model in .pkl format.

[0119] When the robot regresses, the feature information of the robot is first collected, including posture information, current tool information, etc.; the posture information is split into position information and attitude information; the position information and attitude information are classified using the k-nearest neighbor algorithm to obtain the position classification number and the attitude classification number; the robot feature information is reconstructed; the reconstructed robot feature information is imported into the trained decision tree model to obtain the regression path number; and the robot regression program designed by classification is executed according to the path number.

Claims

1. An industrial robot return method based on ensemble learning, characterized in that: The following steps are involved: S1. Construct the position determination space, construct the cube space with the teaching point as the neutral, construct the cube space with the working area as the center, and construct the quadrant space in the whole area; S2. Classify and design the return-to-initial position path, respectively design the return-to-initial position path in the teaching point cube, the return-to-initial position path in the working area cube, and the return-to-initial position path in the quadrant area, and number each return-to-initial position path; S3, decision on the path back to the initial position. The decision on the path back to the initial position is based on the decision tree algorithm. The robot's initial state data is counted as samples to train the decision tree model. The decision tree algorithm adopts the C4.5 algorithm in the decision tree. The basis for dividing the sample features is the information gain ratio. Suppose a feature A in the sample, its feature entropy: Where: i represents the n values ​​of feature A; |D| represents the total number of samples before division; |D i | indicates the number of divided samples; Information gain of feature A: I(D,A)=H(D)-H A (D) Where: H(D) represents the total entropy of the sample; H A (D) represents the feature entropy of feature A; Information gain ratio: Where: I(D,A) represents information gain; The k-nearest neighbor algorithm is used to convert the discrete TCP position data and posture data into category data, the discrete TCP position data is classified, and data samples distributed in each cubic space are established for training the k-nearest neighbor model; Use the KNeighborsClassifier class in the sklearn module to model the k-nearest neighbor algorithm, count the position and posture data samples, standardize to eliminate the influence of outliers on the overall data average, and standardize each column of data, that is, each data in an axial direction or in a rotation direction around a certain direction axis. The calculation method is as follows: In the formula: x represents the current data; μ represents the mean value of the data column; σ represents the standard deviation of the data column. The total data set after standardization is divided into 80% training set and 20% test set. ′ The data after standardization of the current data; The training set and the labels corresponding to the training set are input into the KNeighborsClassfier.fit() function for model training. The result is to convert the discrete position data and posture data of TCP into the classification of space number and posture number. The position number and posture number of TCP will replace the discrete coordinate data as the feature value of the path decision algorithm. Use the KNeighborsClassfier.score() function to import the feature value and target value of the test set sample to evaluate the accuracy of the model. The decision tree model has three hyperparameters: the maximum depth of the tree (max_depth); the number of samples that each child node of a node must contain after branching; (min_samples_leaf); the minimum number of samples a node must contain (min_samples_split), tune the hyperparameters, divide the training set into ten equal parts for cross-validation, and perform grid search on the preset max_depth = [3,5], min_samples_leaf = [5,8,10], min_samples_split = [1,2,3] to obtain the hyperparameters optimized for the model under the data sample. Input the training set and the labels corresponding to the training set into the DecisionTreeClassifier.fit() function for model training. This model is to determine the corresponding path number back to the initial position under the characteristics of a certain position number, posture number and tool type. Use the DecisionTreeClassifier.score() function to import the test set data to evaluate the model, and use the joblib.dump() function to save the evaluated model in .pkl format; S4, TCP position and posture determination, collect the characteristic information of the robot, including posture information and current tool information; split the posture information into position information and posture information; classify the position information and posture information using the k-nearest neighbor algorithm to obtain the position classification number and posture classification number; S5, reconstructing the robot feature information, and importing the reconstructed robot feature information into the trained decision tree model to obtain the regression path number; S6. Execute the robot regression program of the classification design according to the path number.

2. The industrial robot return method based on ensemble learning according to claim 1, characterized in that: In S2, the return-to-initial position paths of the small cube class centered on the teaching point are directly numbered; the return-to-initial position paths of the working area cube class should be distinguished and numbered according to the return-to-initial position paths corresponding to the postures; the return-to-initial position paths of the object area class should be distinguished and numbered according to the return-to-initial position paths corresponding to the tool types and postures.

3. The industrial robot return method based on ensemble learning according to claim 1, characterized in that: S3 statistical data includes TCP's position data, posture data, tool type number and the robot's path number for returning to the initial position, where the position data, posture data and tool type number are used as the characteristic values ​​of the sample, and the robot's path number for returning to the initial position in this state is used as the target value of the sample.

4. The industrial robot return method based on ensemble learning according to claim 1, characterized in that: The hyperparameter n_neighbors of the k-nearest neighbor algorithm is tuned, the training set is divided into ten equal parts for cross-validation, and a grid search is performed on the pre-set n_neighbors value to obtain the hyperparameters of the model under the data sample.

Citation Information

Patent Citations

  • Outdoor multi-robot cooperative operation system and method thereof

    CN111240319A

  • Industrial robot pose precision online compensation method based on deep reinforcement learning

    CN113510709A