Robot joint control method, electronic device, and storage medium
By constructing a task objective function and using the CMA-ES algorithm to automatically adjust the PD controller parameters, the problem of low accuracy in adjusting robot joint controller parameters is solved, achieving a more efficient and precise control effect.
Patent Information
- Application Number
- CN202510384709.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-03-28
AI Technical Summary
In existing technologies, the parameter adjustment process of robot joint controllers is greatly affected by human intervention, resulting in low accuracy of parameter adjustment and consequently affecting the accuracy of robot joint control.
By constructing a task objective function and using the Covariance Matrix Adaptive Evolutionary Algorithm (CMA-ES) to solve for the controller parameters, the parameters of the PD controller are automatically adjusted to improve accuracy.
It improves the efficiency and accuracy of robot joint controller parameter adjustment, reduces human intervention, and accelerates the improvement of control performance, especially in complex scenarios.
Smart Images

Figure CN120335280B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of robots, and in particular to a robot joint control method, an electronic device and a storage medium. BACKGROUND
[0002] At present, in a robot joint control system, a PD controller (proportional-derivative controller) is widely used in joint motion control. The PD controller can effectively adjust the motion trajectory of the robot joint, reduce overshoot, and improve response speed by combining a proportional (P) and a derivative (D) control link. In a running robot joint motor control system, one or more PD controllers are used to ensure that some physical quantities (such as joint angle or torque) remain constant or within a given range. Since these quantities may be naturally related and influence each other, the controllers are usually coupled, and thus the parameters of the PD controller need to be adjusted.
[0003] In the prior art, a manual parameter adjustment method is adopted, that is, a control engineer with knowledge and experience manually adjusts the controller parameters in a single controller system or multiple but decoupled controller systems using simple empirical rules (such as the Ziegler-Nichols rule).
[0004] Therefore, the inventors have found that the prior art has the following technical problems: due to manual parameter adjustment operation, the robot controller parameter adjustment process is greatly affected by human factors, resulting in low parameter adjustment accuracy, and thus low robot joint control accuracy. SUMMARY
[0005] The embodiments of the present application provide a robot joint control method, an electronic device and a storage medium to reduce manual intervention in the robot controller parameter adjustment process and thus improve the accuracy of robot joint control.
[0006] In a first aspect, the embodiments of the present application provide a robot joint control method, comprising the steps of:
[0007] obtaining a controller model and a target function respectively; the controller model is used to represent the relationship between a preset gain parameter combination and a control parameter;
[0008] taking the target function as an input parameter of a covariance matrix self-adaptive evolutionary algorithm to calculate a gain parameter value corresponding to the preset gain parameter combination;
[0009] taking the gain parameter value as an input parameter of the controller model to calculate an initial control parameter; and controlling the joint of the robot to perform a task according to the initial control parameter to obtain an execution result.
[0010] In a possible implementation, the obtaining the controller model comprises: constructing a controller model according to a first relationship, the preset gain parameter combination, and the control parameter, where the first relationship is used to represent a relationship among a current joint position of a robot joint, a target joint position, and a first input parameter.
[0011] In a possible implementation, the preset gain parameter combination comprises a proportional gain and a derivative gain, and in the first relationship, the control parameter is equal to a sum of a first product and a second product, the first product is a product of the first input parameter and the proportional gain, and the second product is a product of a result of differentiating the first input parameter and the derivative gain.
[0012] In a possible implementation, the obtaining the gain parameter value corresponding to the preset gain parameter combination by taking the target function as an input parameter of a covariance matrix self-adaptive evolution algorithm comprises: in a case where a current iteration number exceeds a preset proportion of a total iteration number, determining an adjusted mean vector based on a mean vector generated in a current iteration round and a current optimal solution, the total iteration number being an input parameter of the covariance matrix self-adaptive evolution algorithm; performing a next round of iteration based on the adjusted mean vector; and until the iteration number reaches the total iteration number, obtaining the gain parameter value.
[0013] In a possible implementation, the determining the adjusted mean vector based on the mean vector generated in the current iteration round and the current optimal solution comprises: adding a mean vector weighted based on a first factor and a current optimal solution weighted based on a second factor to obtain the adjusted mean vector, the first factor being greater than the second factor.
[0014] In a possible implementation, the obtaining the gain parameter value corresponding to the preset gain parameter combination by taking the target function as an input parameter of a covariance matrix self-adaptive evolution algorithm comprises: in a case where a current iteration number exceeds a preset proportion of a total iteration number, and a difference between a mean vector obtained in a current iteration round and an expected torque is greater than a preset threshold, obtaining a task object of the robot in a current task scenario, the total iteration number being an input parameter of the covariance matrix self-adaptive evolution algorithm; obtaining a torque execution interval corresponding to the task object, the expected torque being located in the torque execution interval; performing screening on the mean vector obtained in the current iteration round according to the torque execution interval to obtain a screened mean vector; performing a next round of iteration based on the screened mean vector; and until the iteration number reaches the total iteration number, obtaining the gain parameter value.
[0015] In a possible implementation, the method further includes the steps of: adjusting the evolution parameter value of the covariance matrix adaptive evolution algorithm to obtain an adjusted evolution parameter value, in the case that the initial control parameter does not meet the expected control parameter and / or the execution result does not meet the expected result; taking the adjusted evolution parameter value and the target function as input parameters of the covariance matrix adaptive evolution algorithm to calculate an adjusted gain parameter value; taking the adjusted gain parameter value as an input parameter of the controller model to calculate an adjusted control parameter, and controlling the joint of the robot again according to the adjusted control parameter.
[0016] In a possible implementation, the adjusting of the evolution parameter value of the covariance matrix adaptive evolution algorithm to obtain an adjusted evolution parameter value includes: obtaining task time limit information corresponding to a current task scenario of the robot and a single-round iteration time length of the covariance matrix adaptive evolution algorithm; determining an adjusted total iteration number according to the task time limit information and the single-round iteration time length; and the adjusted evolution parameter value includes the adjusted total iteration number.
[0017] In a second aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0018] The memory stores computer execution instructions;
[0019] The processor executes the computer execution instructions stored in the memory, so that the processor executes the first aspect and / or various possible implementations of the first aspect.
[0020] In a third aspect, an embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions, when the processor executes the computer execution instructions, the first aspect and / or various possible implementations of the first aspect are implemented.
[0021] The robot joint control method, the electronic device and the storage medium provided by the embodiments of the present application, wherein the method first converts the controller parameter adjustment into solving the target function by using the controller model and the target function. And using the covariance adaptive evolution algorithm, the corresponding gain parameter value is calculated, and the gain parameter value is taken as the input parameter of the controller model to calculate the initial controller parameter. Finally, the joint of the robot is controlled according to the initial control parameter to execute the task to obtain the execution result. The whole robot controller parameter adjustment process improves the joint controller parameter adjustment efficiency, and reduces or even eliminates the interference of manual adjustment parameters. Especially in the complex multi-body motion and contact scene, the influence of manual intervention is reduced, so that the robot controller can obtain better control performance in a shorter time. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the application and serve to explain the principles
[0023] Figure 1 The application scenario diagram of the robot joint control method provided by an embodiment of the application is shown in the figure.
[0024] Figure 2 The flowchart of the robot joint control method provided by an embodiment of the application is shown in the figure.
[0025] Figure 3 The flowchart of the robot joint control method provided by another embodiment of the application is shown in the figure.
[0026] Figure 4 The flowchart of the robot joint control method provided by another embodiment of the application is shown in the figure.
[0027] Figure 5 The structural diagram of the electronic device provided by an embodiment of the application is shown in the figure.
[0028] The specific embodiments of the application have been shown and described in the above drawings, and will be described in more detail hereinafter. These drawings and descriptions are not intended to limit the scope of the concept of the application in any way, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0029] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The same numbers are used in different drawings to represent the same or similar elements. The following detailed description is not intended to represent all embodiments in accordance with the application. Rather, the following description is intended only to illustrate some embodiments in accordance with the application as detailed in the appended claims.
[0030] In the prior art, the solved parameter adjustment problem can also be used as a guide, and the adjustment of the PD controller parameters is proposed. The inventors have found that methods such as the Ziegler-Nichols rule, the Cohen-Coon rule, the gradient descent method, and the particle swarm optimization are used. However, the inventors have found that these methods are sensitive to initial values and are prone to fall into local optimal solutions, resulting in the failure of the final parameter adjustment and inaccurate parameter adjustment results. Especially for a complex or unique coupled controller system, the complexity of the task makes it difficult for even experienced control engineers to solve. Therefore, manual parameter adjustment usually requires a lot of trial and error and adjustment, consumes a lot of manual time, and is easily limited by experience and intuition, resulting in slow parameter adjustment and low parameter adjustment accuracy.
[0031] To solve the above technical problems, the present application proposes the following technical concept: by constructing a task objective function using the input and output of the robot controller, and using an adaptive solving algorithm based on the task objective function to solve the global optimal controller parameter solution or the controller parameter solution close to the global optimal controller parameter solution as the parameter adjustment result of the PD controller, and finally adjusting the PD controller parameters according to the parameter adjustment result, to achieve the purpose of more accurate control of the robot by the PD controller.
[0032] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0033] Figure 1 The application scenario of the robot joint control method provided by the embodiments of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the application scenario includes a robot 101 and a target to be grabbed 102. The robot 101 is installed with a server and a scanning device for collecting task scene information around the robot 102, which can be a radar sensor or a depth camera. In an embodiment, a single arm or leg of the robot 101 can have seven joints, each corresponding to a different motor, and the control parameters of each joint controller, i.e., the control parameters of the motor controller, need to be calculated and determined. The robot joint control method provided by the embodiments of the present application is used to determine the relevant parameters of each joint controller to control the robot joints to perform corresponding tasks. In this embodiment, the server can execute the relevant steps of the robot joint control method according to the task scene information, and finally make the robot controller control the robot output control quantity according to the adjusted control parameters.
[0034] It should be noted that Figure 1 The application scenario of the robot joint control method shown only represents one application scenario of the grabbing scenario, and the robot joint control method proposed in this embodiment can also be applied to other application scenarios such as the carrying scenario, the clamping scenario, and the picking scenario, and the like. This embodiment does not limit this.
[0035] Figure 2 The flowchart of the robot joint control method provided in this application, the execution subject of the method can be Figure 1 The server in the robot 101 shown, or other computer-related devices, chips, controllers, or processors that can perform rescue positioning and data processing functions. This embodiment does not limit this. As Figure 2 The robot joint control method includes
[0036] S201: Obtain the controller model and the target function respectively; the controller model is used to represent the relationship between the preset gain parameter combination and the control parameter.
[0037] In this embodiment, the controller model can be a joint PD controller model of a humanoid robot, which represents the input-output relationship of the joint PD controller. The preset gain parameter combination can be the gain parameter used by the joint PD controller to calculate the joint output. The target function can be a function F(t) to be solved, which is used to iteratively update and solve to obtain the gain parameter that makes the output of the controller model converge to the target value in the iteration process.
[0038] S202: Take the target function as an input parameter of the covariance matrix adaptive evolution algorithm, and calculate the gain parameter value corresponding to the preset gain parameter combination.
[0039] In this embodiment, the covariance matrix adaptive evolution algorithm can be a CMA-ES algorithm. According to the covariance matrix adaptive evolution algorithm, the total number of iterations and the initial solution corresponding to the preset gain parameter combination are initialized in advance to perform the iteration calculation process, and finally the gain parameter value corresponding to the preset gain parameter combination is obtained, which can be used for the controller model.
[0040] In this embodiment, the CMA-ES algorithm is used to calculate the gain parameter value corresponding to the preset gain parameter combination, which can adjust the gain parameter value through the adaptive covariance matrix. Especially for robots with multiple joints, when the parameter dimension needs to be adjusted, this embodiment can more quickly evaluate the performance of all candidate gain parameter values in parallel or in series, improve the adjustment efficiency, and also improve the accuracy of robot joint control.
[0041] In some optional embodiments, the calculation result of the covariance matrix self-adaptive evolution algorithm can be obtained by simulation experiment using a pre-built simulation environment. The pre-built simulation environment can be a physics engine applied in the fields of robots, physics inverse and reinforcement learning, which uses a numerical integration method and can handle the interaction of a large number of joints and objects. For example, the pre-built simulation environment is MuJoCo. In this embodiment, the simulation data can be data obtained when the simulation operation is performed in the pre-built simulation environment, such as the simulation end time, the simulation start time, the error of the robot joint at a certain time during the simulation process, and the like.
[0042] The pre-built simulation environment has a significant advantage in simulation speed. Compared with using a robot for experiment to calculate the gain parameter value, the iteration efficiency is higher, especially in a complex multi-body motion and contact model, which can quickly handle the interaction of a large number of joints and objects.
[0043] In an optional embodiment of the present application, the objective function is:
[0044]
[0045] In the formula, n is the total number of joints of the robot controller to be controlled in the robot controller parameters to be adjusted, such as the number of joints of the arm or the number of joints of the leg. n is a natural number greater than 0. T is the end time of each iteration in the iteration solving process. t0 is the start time of each iteration in the iteration solving process. Generally, t0 = 0. The difference between T and t0 is the iteration time of a single round. The iteration time of each round is the same, that is, the difference between T and t0 in each iteration is the same. i (τ) is the error between the current joint position and the target joint position of the ith joint at time τ, where i ∈ [0, n], and T is a positive number greater than 0.
[0046] In an optional embodiment of the present application, step S202 can be to initialize a gain parameter matrix corresponding to a preset gain parameter combination of the controller.
[0047] For example, assume that the gain parameter matrix is PD ∈ R 7×2 As follows:
[0048] PD = [[P1, D1], [K2, D2], [K3, D3], [K4, D4], [K5, D5], [K6, D6], [K7, D7]]
[0049] Wherein, Pi and Di are the proportional gain and derivative gain of the robot controller of the ith joint, respectively, and i is a natural number between 1 and 7.
[0050] It should be noted that the gain parameter matrix of the robot controller can be obtained by experience adjustment according to the requirements of actual joint control and the dynamic characteristics of the system, and a set of approximate values PD(0)∈R 7×2 As the gain parameter matrix, subsequent parameter adjustment is performed based on the gain parameter matrix to determine better PD gain values. These gain parameter matrices can be used as a reference for subsequent parameter adjustment of the robot controller, providing a reasonable initial gain parameter matrix PD(0) for the subsequent parameter adjustment process of the robot controller, for example, PD(0) can be set as follows:
[0051] PD=
[0052] [[600,10],[600,10],[600,10],[400,8],[400,8],[200,4],[200,4]].
[0053] In addition, the initial evolution parameters of the covariance matrix adaptive evolution algorithm also need to be set, including setting the initial step size, population size, parent size, iteration selection strategy and termination condition.
[0054] In this embodiment, the CMA-ES algorithm uses a global step size σ to control the variation range of the solution obtained in each iteration process, and the global step size is dynamically adjusted. In each iteration search process of the CMA-ES algorithm, the global step size is adjusted according to historical information such as the distribution of solutions and the direction of successful solutions. In this embodiment, the initial step size can be a fixed value set in advance or generated in response to a relevant parameter generation instruction. For example, the initial step size σ0=1.2.
[0055] In this embodiment, the population size refers to the number of candidate solutions generated by the CMA-ES algorithm in each generation. The parent size determines the number of optimal individuals used to generate the next generation. Specifically, the population size and the parent size can be calculated by the population calculation formula. The calculation formula of the population size is: λ=4+(3×log(d)), where d is the preset dimension d of the solution vector and is a natural number, and λ represents the population size. The calculation formula of the parent size is: μ=(λ / 2), where μ represents the parent size. For example, in this embodiment, d=14, and the population size λ=12 and the parent size μ=6 can be calculated.
[0056] In this embodiment, the iteration selection strategy can be a selection strategy that retains the best individual in each generation as a successful solution in the iteration process. In this embodiment, the iteration selection strategy can be an elite selection strategy. When using the elite selection strategy, not only the individuals of the current generation population are used, but also the best individual in the previous generation is retained when generating a new population, so as to ensure that the optimal solution is not lost in the iteration process and improve the probability of obtaining the target solution.
[0057] In this embodiment, the termination condition can include that the number of iterations reaches the total number of iterations in the target configuration data (i.e., the maximum number of iterations), and that the decreasing value of the target value of the function to be solved in the population of a preset number of values does not reach the preset lower limit value. For example, the maximum number of iterations k = 10000, the preset value can be 10, and the preset lower limit value can be 0.5.
[0058] S203: Calculate the initial control parameter by taking the gain parameter value as the input parameter of the controller model.
[0059] In this embodiment, the gain parameter value obtained by iteratively solving the target function is substituted into the controller model to obtain a target controller model that can be used to calculate the specific value of the humanoid robot control quantity. Then, the target controller is used to take the input target joint position and other parameters as the input quantity of the controller model, and the output quantity of the final controller model is the control quantity to be executed by the object controlled by the robot controller, for example: the initial control parameter can be a parameter related to the control attributes such as the torque range of the joint, the motion range of the joint, and the maximum motion speed. In this embodiment, the initial control parameter is the joint torque.
[0060] S204: Control the joints of the robot to perform a task according to the initial control parameter to obtain an execution result.
[0061] In this embodiment, the initial control parameter can be converted into a corresponding control instruction by the robot controller to control the joints of the robot to perform a corresponding task and obtain an execution result. The task is the task corresponding to the current task scenario. The execution result can be data or information reflecting the completion of the task performed by the robot, such as the final actual motion range, actual execution torque, and actual motion speed of the joint of the robot. The execution result can also be success or failure.
[0062] In summary, the robot joint control method provided by the embodiments of the present application first converts the controller parameter adjustment into solving the target function by using the controller model and the target function. Then, the covariance adaptive evolutionary algorithm is used to calculate the corresponding gain parameter value, and the gain parameter value is taken as the input parameter of the controller model to calculate the initial controller parameter. Finally, the joints of the robot are controlled to perform a task according to the initial control parameter to obtain an execution result. The entire robot controller parameter adjustment process improves the joint controller parameter adjustment efficiency, reduces or even eliminates the disturbance of manual parameter adjustment, especially in complex multi-body motion and contact scenarios, reduces the influence of manual intervention, and enables the robot controller to obtain better control performance in a shorter time.
[0063] Based on the above embodiments, in an optional embodiment of the present application, in step S201, the controller model is acquired, including: constructing the controller model according to the first relationship, the preset gain parameter combination and the control parameter; the first relationship is used to represent the relationship among the current joint position of the robot joint, the target joint position and the first input parameter.
[0064] In the embodiment, the first relationship can be a formula representing the input-output relationship of the robot controller. The current joint position of the robot joint refers to the actual joint position of the robot at present, and the target joint position refers to the position to be controlled by the joint of the robot, which represents the target joint angle. The first input parameter can be a sine-shaped target joint position and a time coefficient.
[0065] Based on the above embodiments, in an optional embodiment of the present application, the preset gain parameter combination includes a proportional gain and a derivative gain; in the first relationship, the control parameter is equal to the sum of the first product and the second product; the first product is the product between the first input parameter and the proportional gain; and the second product is the product between the result obtained by differentiating the first input parameter and the derivative gain.
[0066] In the embodiment, the first relationship can be:
[0067]
[0068] In the formula, C(t) represents the output result of the robot joint controller, e(t) represents the first input parameter of the robot joint controller, P represents the proportional gain of the robot joint controller, D represents the derivative gain of the robot joint controller, and t represents the current calculation time.
[0069] The calculation formula of the above first input parameter can be:
[0070] e(t) = |actual(t) - action(t)|
[0071] In the formula, e(t) represents the first input parameter, actual(t) represents the current joint position of the robot joint, and action(t) represents the target joint position of the robot joint.
[0072] In the embodiment, the parameter adjustment problem of the robot joint control is formulated to eliminate or significantly reduce the influence of human factors in manual adjustment, thereby improving the accuracy of the robot joint control.
[0073] Based on the above embodiments, in an optional embodiment of the present application, as shown in Figure 2 Based on the above embodiments, in an optional embodiment of the present application, as shown in Figure 3 Step S202 includes:
[0074] S202a: In a case where the current iteration number exceeds a preset proportion of the total iteration number, determine an adjusted mean vector based on the mean vector generated in the current iteration round and the current optimal solution. The total iteration number is an input parameter of the covariance matrix adaptive evolution algorithm. Exemplarily, the preset proportion can be 0.7.
[0075] In this embodiment, the total iteration number is a pre-set algorithm loop iteration number, and the total iteration number is pre-set in the server as an input parameter of the covariance matrix adaptive evolution algorithm. When the covariance matrix adaptive evolution algorithm performs iterative solving, the total iteration number is executed at most. For example, the total iteration number can be 10,000 times. The mean vector generated in the current round iteration is used to define the start and direction of the search in the covariance matrix adaptive evolution algorithm, and the adjusted mean vector can be a vector obtained by adjusting the weight proportion.
[0076] In an optional embodiment of the present application, the mean vector can be calculated according to the gain parameter matrix and the pre-set scaling coefficient in the above-mentioned embodiments.
[0077] In this embodiment, the pre-set scaling coefficient includes a proportional scaling coefficient and a derivative scaling coefficient, and the proportional scaling coefficient and the derivative scaling coefficient are used to adjust the proportional gain and the derivative gain in the gain parameter matrix to be in the same scale range. The scaled gain parameter matrix is the scaled mean vector. Similarly, the scaled initial gain parameter matrix is the initial mean vector.
[0078] For example, the scaling coefficient β = (β P , β D ), where β P is the proportional scaling coefficient, and β D is the derivative scaling coefficient. The scaled gain parameter matrix can improve the convergence and optimization efficiency of the CMA-ES algorithm in the parameter search process. According to the content of the above-mentioned embodiments, the mean vector obtained after scaling is:
[0079] m = ((β P K P1 , β D K D1 ), (β P K P2 , β D K D2 ), (β P K P3 , β D K D3 ), (β P K P4 , β D K D4 ),
[0080] (β P K P5 ,β D K D5 ),(β P K P6 ,β D K D6 ),(β P K P7 ,β D K D7 ))
[0081] Suppose the scaling coefficient β in this embodiment is β = (β P ,β D ) = (0.1, 5).
[0082] Correspondingly, the initial mean vector is:
[0083] m0 = ((60, 50), (60, 50), (60, 50), (40, 40), (40, 40), (20, 20), (20, 20))
[0084] From the above formula, it can be seen that the mean vector m0 obtained by the first iteration is obtained by scaling the gain parameter matrix K PD (0) by the scaling coefficient β = (β P ,β D ).
[0085] In this embodiment, the main role of the mean vector m0 is to define the search starting point and search direction of the CMA-ES algorithm in the next iteration process.
[0086] S202b: Based on the adjusted mean vector, the next iteration is performed.
[0087] In this embodiment, the search direction and search starting point of the next iteration are defined by the adjusted mean vector obtained after the adjustment of the current iteration. The next iteration refers to the next generation iteration process of the current iteration.
[0088] S202c: Until the number of iterations reaches the total number of iterations, the gain parameter value is obtained.
[0089] In the embodiment, when the iteration number reaches the total iteration number, the solution process of the target function is completely finished, and the gain parameter value obtained at this time can be used as the final parameter transferred to the real machine control process. If the mean vector is adjusted alone, the convergence efficiency may be low, that is, the convergence is slow. If the current optimal solution is used alone to adjust the mean vector, the local optimum may be fallen into, and the solution quality is poor. Therefore, the embodiment can take into account the convergence efficiency and the solution result accuracy, improve the convergence efficiency, avoid falling into the local optimum, and ensure the accuracy of the solution result.
[0090] Based on the above embodiment, in an optional embodiment of the present application, the adjusted mean vector is determined based on the mean vector generated in the current iteration round and the current optimal solution in step S202a, and specifically includes: adding the mean vector weighted based on the first factor and the current optimal solution weighted based on the second factor to obtain the adjusted mean vector; the first factor is greater than the second factor.
[0091] In the embodiment, the adjusted mean vector determined based on the mean vector generated in the current iteration round and the local optimal solution means that the mean vector weighted based on the first factor is added to the current optimal solution weighted based on the second factor to obtain the adjusted mean vector, and the first factor is greater than the second factor. For example, the first factor is 0.8, and the second factor is 0.2. The mean vector is multiplied by 0.8, and the optimal solution in the round is multiplied by 0.2.
[0092] In the embodiment, based on the first factor being greater than the second factor, the mean vector in the solution process can be better adjusted, the convergence efficiency and the solution result accuracy are taken into account, the convergence efficiency is improved, the local optimum is avoided, and the global optimal solution is obtained.
[0093] In the above Figure 2 Based on the corresponding embodiment, as an optional embodiment of the present application, as shown in Figure 4 S202 includes:
[0094] S202d: In the case that the current iteration number exceeds the total iteration number by a preset proportion, and the difference between the mean vector obtained in the current iteration round and the expected torque is greater than a preset threshold, the task object of the robot in the current task scene is obtained; the total iteration number is an input parameter of the covariance matrix adaptive evolution algorithm.
[0095] In the embodiment, the difference between the mean vector obtained in the current iteration and the expected torque is greater than the preset threshold, indicating that the solution corresponding to the controller parameters obtained in the iteration needs to be corrected and fine-tuned. At this time, the task object of the robot in the current task scene is obtained for subsequent operations. The preset threshold refers to a fixed value set in advance. If the difference is less than the fixed value, the controller parameters corresponding to the current iteration do not need to be adjusted.
[0096] S202e: Obtain the torque execution interval corresponding to the task object; the expected torque is located in the torque execution interval.
[0097] In the embodiment, the torque execution interval corresponding to the task object can be obtained by searching the corresponding relationship between the task object and the torque execution interval determined or set in advance through the task object in the current scene under the current scene. The expected torque execution interval as the target execution torque interval should be set to any value in the retrieved torque execution interval.
[0098] S202f: Screen the mean vector obtained in the current iteration according to the torque execution interval to obtain a screened mean vector.
[0099] In the embodiment, since the mean vector has a high correlation with the calculation result of the torque, the mean vector obtained in the current iteration can be screened according to the torque execution interval obtained through the above steps, so as to accelerate the convergence while ensuring the accuracy of the joint torque obtained by solving.
[0100] S202g: Perform the next iteration based on the screened mean vector.
[0101] S202h: Obtain the gain parameter value until the number of iterations reaches the total number of iterations.
[0102] In the embodiment, steps S202g and S202h are similar to the principles of steps S202b and S202c in the above embodiment, so this embodiment will not be described here. It should be noted that the difference between the above embodiment and the embodiment is that in step S202d, when the current number of iterations exceeds the preset proportion of the total number of iterations, and the difference between the mean vector obtained in the current iteration and the expected torque is greater than the preset threshold, the torque execution interval corresponding to the current task object can be used to guide the mean vector in the iteration process, and thus the accuracy of the joint torque output by the algorithm can be guided, the convergence efficiency and the accuracy of the solution result are considered, the convergence efficiency is improved, and the accuracy of the solution torque result is ensured.
[0103] Based on any of the above embodiments, the robot joint control method provided in an optional embodiment of the present application further includes the steps of:
[0104] Step A: adjusting the evolution parameter value of the covariance matrix adaptive evolution algorithm to obtain an adjusted evolution parameter value in a case where the initial control parameter does not satisfy the expected control parameter and / or the execution result does not satisfy the expected result.
[0105] In the embodiment, the case where the initial control parameter does not satisfy the expected control parameter may be, for example, that the solved joint torque is not located in the preset torque interval. The case where the execution result does not satisfy the expected result may be, for example, that the task execution fails, while the expected result is that the execution succeeds.
[0106] In the embodiment, the case where the initial control parameter does not satisfy the expected control parameter and the execution result does not satisfy the expected result, the case where the initial control parameter does not satisfy the expected control parameter, or the case where the execution result does not satisfy the expected result all indicate that the evolution parameter of the covariance matrix adaptive evolution algorithm needs to be fine-tuned so that the adjusted control parameter obtained by subsequently solving the objective function better satisfies the task requirement.
[0107] For example, the adjusted evolution parameter value may be the total evolution generation. The adjusted total evolution generation is less than the total evolution generation before adjustment. For example, on the one hand, if the total evolution generation is large, the algorithm will run for a long time, which cannot satisfy the timeliness requirement of the task. On the other hand, since the parameter is only fine-tuned, a large total evolution generation is not needed. The embodiment can improve the accuracy of the solving result and better consider the real-time task requirement, such as the timeliness requirement of the task, so as to better satisfy the timeliness of the task, that is, the accuracy of the solving result and the timeliness of the task are both considered.
[0108] Step B: taking the adjusted evolution parameter value and the objective function as the input parameter of the covariance matrix adaptive evolution algorithm to calculate an adjusted gain parameter value.
[0109] In the embodiment, the adjusted evolution parameter value and the objective function are taken as the input parameter of the covariance matrix adaptive algorithm, and the adjusted gain parameter value is output by iterative calculation of the pre-stored calculation tool in the server. The iterative calculation process of the covariance matrix adaptive algorithm is similar to the implementation principle of step S202 in the above embodiment, and thus will not be described here.
[0110] Step C: taking the adjusted gain parameter value as the input parameter of the controller model to calculate an adjusted control parameter, and controlling the joint of the robot again according to the adjusted control parameter.
[0111] In this embodiment, the adjusted control parameters calculated in step C and the process of controlling the key of the robot are similar to the principle of step S204 in the above embodiment, so this embodiment will not be described here.
[0112] On the basis of the above embodiment, as an optional embodiment of the present application, the evolution parameter value of the covariance matrix adaptive evolution algorithm is adjusted in step A to obtain an adjusted evolution parameter value, including:
[0113] Step A1: Obtain the task time limit information corresponding to the current task scene of the robot and the single round iteration length of the covariance matrix adaptive evolution algorithm.
[0114] In this embodiment, the task time limit information corresponding to the current task scene can be calculated based on the robot scanning the current task scene, and the path planning and the moving speed of the robot, or can be retrieved from the pre-set corresponding relationship between each task scene and the task time limit. The single round iteration length can be the length of time required for one simulation in a pre-built simulation environment, and one iteration corresponds to one simulation.
[0115] Step A2: Determine the adjusted total iteration number according to the task time limit information and the single round iteration length; the adjusted evolution parameter value includes the adjusted total iteration number.
[0116] In this embodiment, the condition needs to be met: the product operation result of the adjusted total iteration number and the single round iteration length needs to be less than or equal to the above task time limit.
[0117] Specifically, since many tasks have high time limit requirements, such as a task of grabbing a water bottle that requires completion within 5 seconds, if the first task execution fails, the task time limit information and the single round iteration length of the algorithm need to be considered during the fine-tuning of the algorithm parameters, so that the adjusted parameters can be calculated within the task time limit, and the accuracy of the joint controller parameters is also improved, achieving a balance between the accuracy of the joint control parameters and better meeting the task requirements.
[0118] In summary, the robot joint control method provided by the embodiments of the present application can quickly and accurately find the optimal solution as the target solution by fine-tuning the evolution parameters in the covariance matrix adaptive evolution algorithm, achieving a balance between the accuracy of the solution and better meeting the task requirements.
[0119] In another embodiment, for the step A2, the adjusted total iteration number can also be determined in combination with the accuracy requirement level of the joint control parameter to be solved. For example, the first total iteration number can be calculated according to the task time limit information and the single round iteration time length, and then the corresponding adjustment factor can be determined according to the accuracy requirement level of the joint control parameter to be solved. The product of the adjustment factor and the first total iteration number is taken as the adjusted total iteration number. The adjustment factor can be determined according to the preset corresponding relationship between the accuracy requirement level of the joint control parameter to be solved and the adjustment factor. The higher the accuracy requirement level of the joint control parameter to be solved, the larger the adjustment factor. Conversely, the smaller the adjustment factor. In this way, the calculation result accuracy can be further improved while the convergence efficiency is taken into account, and the solution result accuracy and the task demand are better balanced.
[0120] In another embodiment, in the above Figure 2 On the basis of the corresponding embodiment, the method can further include the step of:
[0121] In the case where it is detected that the task scene of the robot changes, the current task information of the robot is acquired.
[0122] According to the current task information of the robot, the total evolution generation number is adjusted. For example, a preset mapping relationship can be matched to obtain the adjusted total evolution generation number.
[0123] Specifically, since different tasks have different accuracy requirements for the solution result, for example, the task of grabbing a water bottle and the task of carrying heavy objects. When carrying heavy objects, the accuracy requirement for the joint force point is not required to be too high. Therefore, the total evolution generation number can be appropriately reduced.
[0124] Figure 5 The structure schematic diagram of the electronic device provided in the present application is shown in FIG. 1. As shown in the figure, the electronic device provided in the present embodiment includes at least one processor 301 and a memory 302. Optionally, the device further includes a communication component 303. The processor 301, the memory 302 and the communication component 303 are connected through a bus 304. Figure 5
[0125] In the specific implementation process, the at least one processor 301 executes the computer execution instructions stored in the memory 302, so that the at least one processor 301 executes the above-mentioned method.
[0126] The specific implementation process of the processor 301 can refer to the above-mentioned method embodiment, which has similar implementation principles and technical effects, and will not be described here in detail.
[0127] The embodiment of the present application further provides a humanoid robot, comprising a robot body, a camera arranged on the robot body, and the electronic device as described in the above embodiment arranged in the robot body.
[0128] In the embodiment, the arrangement on the robot body and the arrangement in the robot body can be achieved by a hardware connection structure such as screw connection, thread connection and the like.
[0129] The embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and when a processor executes the computer execution instructions, the above method is realized.
[0130] The embodiment of the present application further provides a computer program product, comprising a computer program, and when the computer program is executed by a processor, the above method is realized.
[0131] In the above embodiment, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution completion, or executed by a combination of hardware and software modules in the processor.
[0132] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), for example at least one disk memory.
[0133] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus or an extended industry standard architecture (EISA) bus and the like. The bus can be divided into an address bus, a data bus, a control bus and the like. For the convenience of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0134] The present application further provides a computer program product, comprising a computer program, and when the computer program is executed by a processor, the above method is realized.
[0135] The application further provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, the method described above is realized.
[0136] The readable storage medium described above can be realized by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0137] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0138] The division of units is only a logical function division, and when actually implemented, there can be another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment.
[0140] In addition, the functional units in each embodiment of the application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0141] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0142] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.
[0143] Finally, it should be noted that: those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application that follow the general principles of the present application and include common knowledge or conventional technical means in the art that are not disclosed in the present application, and is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is only limited by the appended claims.
Claims
1. A robot joint control method, characterized in that, include: Obtain the controller model and objective function respectively; The controller model is used to characterize the relationship between preset gain parameter combinations and control parameters; Using the objective function as the input parameter of the covariance matrix adaptive evolution algorithm, the gain parameter value corresponding to the preset gain parameter combination is calculated, including: when the current iteration number exceeds a preset proportion of the total iteration number, the mean vector weighted based on the first factor and the current optimal solution weighted based on the second factor are added to obtain an adjusted mean vector; the first factor is greater than the second factor; the total iteration number is the input parameter of the covariance matrix adaptive evolution algorithm; Based on the adjusted mean vector, execute the next iteration; The gain parameter value is obtained until the total number of iterations is reached. The initial control parameters are calculated by using the gain parameter value as the input parameter of the controller model. The robot's joints are controlled to perform tasks based on the initial control parameters, and the execution results are obtained.
2. The method according to claim 1, characterized in that, The acquisition of the controller model includes: A controller model is constructed based on the first relation, the preset gain parameter combination, and the control parameters; the first relation is used to characterize the relationship between the current joint position, the target joint position, and the first input parameter of the robot joint.
3. The method according to claim 2, characterized in that, The preset gain parameter combination includes proportional gain and derivative gain; In the first relational expression, the control parameter is equal to the sum of the first product and the second product; the first product is the product between the first input parameter and the proportional gain; The second product is the product between the result obtained by differentiating the first input parameter and the derivative gain.
4. The robot joint control method according to any one of claims 1 to 3, characterized in that, The step of using the objective function as input parameters for the covariance matrix adaptive evolution algorithm to calculate the gain parameter value corresponding to the preset gain parameter combination includes: If the current iteration count exceeds a preset proportion of the total iteration count, and the difference between the mean vector obtained in the current iteration round and the expected torque is greater than a preset threshold, the task object of the robot in the current task scenario is obtained; the total iteration count is the input parameter of the covariance matrix adaptive evolution algorithm. Obtain the torque execution range corresponding to the task object; the expected torque is located within the torque execution range; The mean vector obtained in the current iteration is filtered according to the torque execution interval to obtain the filtered mean vector; Based on the filtered mean vector, the next iteration is executed; The gain parameter value is obtained after the total number of iterations is reached.
5. The robot joint control method according to any one of claims 1 to 3, characterized in that, The method further includes the following steps: If the initial control parameters do not meet the expected control parameters, and / or the execution result does not meet the expected result, the evolution parameter values of the covariance matrix adaptive evolution algorithm are adjusted to obtain the adjusted evolution parameter values. The adjusted evolutionary parameter values and the objective function are used as input parameters for the covariance matrix adaptive evolution algorithm to calculate the adjusted gain parameter values. The adjusted gain parameter value is used as the input parameter of the controller model to calculate the adjusted control parameters, and the robot's joints are controlled again according to the adjusted control parameters.
6. The robot joint control method according to claim 5, characterized in that, The adjustment of the evolutionary parameter values of the adaptive evolutionary algorithm for the covariance matrix to obtain the adjusted evolutionary parameter values includes: Obtain the task time limit information of the robot in the current task scenario and the single-round iteration time of the covariance matrix adaptive evolution algorithm; Based on the task time limit information and the duration of a single iteration, the adjusted total number of iterations is determined; the adjusted evolution parameter values include the adjusted total number of iterations.
7. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the robot joint control method as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the robot joint control method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Optimized particle-based particle filter target tracking method
CN106127797A
Robot device controller, robot device arrangement and method for controlling a robot device
CN112045675A