A mechanical arm control method, device, equipment and medium

By acquiring the joint angles of the robotic arm and using a pre-trained angle-current mapping model to determine the joint motor current, the problem of obtaining robotic arm parameters is solved, and fast and accurate balance control of the robotic arm is achieved.

CN117863186BActive Publication Date: 2025-12-05HARBIN SIZHERUI INTELLIGENT MEDICAL EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410136292.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2025-12-05
Estimated Expiration
2044-01-31

AI Technical Summary

Technical Problem

Existing methods for controlling the balance state of robotic arms are hampered by difficulties in obtaining robotic arm parameters, which leads to difficulties in determining the joint motor current. As a result, existing technologies cannot effectively solve the mechanical efficiency problem.

Method used

By acquiring the angle of each joint of the robotic arm, the joint motor current is determined based on a pre-trained angle-current mapping model and assigned to the joint motor to maintain the balance of the robotic arm.

Benefits of technology

This effectively avoids the difficulty in determining the joint motor current caused by the difficulty in obtaining the robot arm parameters, and can quickly and accurately determine the joint motor current to ensure the balance of the robot arm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117863186B_ABST
    Figure CN117863186B_ABST
Patent Text Reader

Abstract

The application discloses a kind of mechanical arm control method, device, equipment and medium.It is applied to mechanical arm, and mechanical arm includes at least one joint and the joint motor corresponding to each joint.By obtaining the joint angle of each joint in mechanical arm;Determine the joint motor current corresponding to the joint angle of each joint based on pre-trained angle-current mapping model;The joint motor current of joint is assigned to the joint motor corresponding to joint, to make joint motor drive joint based on joint motor current, keep mechanical arm in balanced state.The embodiment of the application can directly map the joint angle of each joint to the joint motor current that can keep the balanced state of mechanical arm, without considering the influence brought by the internal structure of mechanical arm, effectively avoid the problem that joint motor current is difficult to determine due to the difficulty of mechanical arm parameter acquisition, accurate joint motor current can be quickly determined, which helps to keep the balanced state of mechanical arm.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of mechanical arm control, and in particular to a mechanical arm control method, device, equipment and medium. BACKGROUND

[0002] The mechanical arm is a complex system with strong coupling. The balance state control of the mechanical arm can ensure the stability of the pose of the mechanical arm, so that the mechanical arm can stably perform related tasks.

[0003] At present, the existing mechanical arm balance state control method is usually based on the rod parameters of the mechanical arm, and uses Newton-Euler method or Lagrange function method to theoretically calculate the joint load, solve the joint load, and then convert the load into the driving current of the joint motor to drive the joint motor for servo control by the driving current.

[0004] However, the internal structure of the mechanical arm is complex, and the rod parameters of the mechanical arm are difficult to obtain, resulting in deviation of the joint load obtained by theoretical calculation, so that the mechanical arm cannot maintain a balanced state. SUMMARY

[0005] The present application provides a mechanical arm control method, device, equipment and medium to solve the problem of difficult determination of joint motor current due to difficult acquisition of mechanical arm parameters.

[0006] According to one aspect of the present application, a mechanical arm control method is provided, characterized in that it is applied to a mechanical arm, the mechanical arm comprising at least one joint and a joint motor corresponding to each joint; the method comprising:

[0007] obtaining the joint angle of each joint in the mechanical arm;

[0008] determining the joint motor current corresponding to the joint angle of each joint based on a pre-trained angle-current mapping model;

[0009] assigning the joint motor current of the joint to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current to keep the mechanical arm in a balanced state.

[0010] According to another aspect of the present application, a mechanical arm control device is provided, characterized in that it comprises:

[0011] a joint angle acquisition module for obtaining the joint angle of each joint in the mechanical arm;

[0012] a joint motor current determination module for determining the joint motor current corresponding to the joint angle of each joint based on a pre-trained angle-current mapping model;

[0013] The joint motor driving module is used for assigning the joint motor current of the joint to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current, and keeps the robot arm in a balanced state.

[0014] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory in communication with the at least one processor; wherein

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the robot arm control method of any of the embodiments of the present application.

[0018] According to another aspect of the present application, a computer readable storage medium is provided, the computer readable storage medium stores computer instructions for enabling a processor to implement the robot arm control method of any of the embodiments of the present application when executed by the processor.

[0019] The technical solution of the embodiments of the present application is applied to a robot arm, the robot arm comprising at least one joint and a joint motor corresponding to each joint. The joint angle of each joint in the robot arm is obtained; the joint motor current corresponding to the joint angle of each joint is determined based on a pre-trained angle-current mapping model; the joint motor current of the joint is assigned to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current, and keeps the robot arm in a balanced state. The joint angle of each joint can be directly mapped to the joint motor current capable of keeping the robot arm in a balanced state, without considering the influence of the internal structure of the robot arm. The problem of difficult determination of the joint motor current due to the difficulty in obtaining the parameters of the robot arm is effectively avoided. The accurate joint motor current can be quickly determined, which is helpful for keeping the robot arm in a balanced state.

[0020] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0022] Figure 1is a flow chart of a mechanical arm control method provided by an embodiment of the present application;

[0023] Figure 2 is a structural schematic diagram of a BP neural network model provided by an embodiment of the present application;

[0024] Figure 3 is a flow chart of an angle-current mapping model training method provided by an embodiment of the present application;

[0025] Figure 4 is a flow chart of a PID control provided by an embodiment of the present application;

[0026] Figure 5 is a flow chart of an angle-current mapping model training method provided by an embodiment of the present application;

[0027] Figure 6 is a structural schematic diagram of a mechanical arm control device provided by an embodiment of the present application;

[0028] Figure 7 is a structural schematic diagram of an electronic device for implementing a mechanical arm control method of an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product or device.

[0031] Embodiment one

[0032] Figure 1is a flowchart of a mechanical arm control method provided by Embodiment One of the present application. The present embodiment is applicable to the case where the joint motor current of a joint motor is used to control a mechanical arm. The method can be executed by a mechanical arm control device, which can be implemented in the form of hardware and / or software, and can be deployed in an electronic device such as a mechanical arm, a computer, or a server.

[0033] In the present embodiment, the method is applied to a mechanical arm, which includes at least one joint and a joint motor corresponding to each joint. The joints in the mechanical arm are rotary joints, which include but are not limited to rotary spherical joints and rotary slider joints. It can be understood that the joint angle of the rotary joint can be manually and / or automatically adjusted. For example, the joint is subjected to manual external force, resulting in a change in the joint angle; the joint motor adjusts the joint angle of the joint under the drive of the joint motor current, resulting in a change in the joint angle.

[0034] It should be noted that the joint motor is a motor in a holding servo state. The joint motor can automatically correct the motor current based on real-time feedback of the mechanical arm information, so as to maintain the balance state of the mechanical arm. For example, the mechanical arm information includes one or more of the joint angle, the position of the mechanical arm, the speed of the mechanical arm, and the force of the mechanical arm.

[0035] As shown in FIG. 1, Figure 1 the method includes the following steps.

[0036] S110, obtaining the joint angle of each joint in the mechanical arm.

[0037] In the present embodiment, one or more joints in the mechanical arm each have a corresponding joint angle. The joint angle can be measured or derived, and the present embodiment does not limit this.

[0038] Specifically, the joint angle of each joint in the mechanical arm is obtained by measuring or deriving the joint angle of one or more joints in the mechanical arm.

[0039] In some embodiments, the mechanical arm corresponds to at least one joint angle determination module. Each joint angle determination module can correspond to one or more joints. The joint angle of each joint in the mechanical arm is obtained by reading the output result of the one or more joint angle determination modules.

[0040] In the present embodiment, the joint angle determination module can be deployed in the mechanical arm or outside the mechanical arm, and the present embodiment does not limit this. The joint angle determination module can be used for at least one of measuring the angle and deriving the angle.

[0041] In the case that the joint angle determination module is only used for measuring the angle, the joint angle determination module comprises an angle sensor capable of measuring the joint angle of the corresponding joint to obtain the measured angle; in the case that the joint angle determination module is only used for deriving the angle, the joint angle determination module collects the position and posture of the end of the robot arm, and performs inverse kinematics derivation on the collected position and posture of the end of the robot arm to calculate the joint angle of the corresponding joint to obtain the derived angle; in the case that the joint angle determination module is used for measuring the angle and deriving the angle, the joint angle determination module can intermittently measure the joint angle of the corresponding joint, and perform joint angle prediction based on the joint angles at multiple time points to obtain the predicted angle, which is not limited in the embodiment. The output result of the joint angle determination module is the measured angle, the derived angle or the predicted angle, and the joint angle of each joint in the robot arm is obtained by reading the measured angle, the derived angle or the predicted angle output by one or more joint angle determination modules.

[0042] It should be noted that in the balance state control of the robot arm, the joint motor current needs to be adjusted based on the real-time joint angle of each joint. Optionally, the joint angle of the joint is the joint angle of the joint at the current time. In the embodiment, the joint angle at the current time can be obtained by real-time collection or prediction. In some embodiments, optionally, the joint angle of the joint is obtained based on an angle encoder. In the embodiment, the joint angle determination module is an angle encoder corresponding to each joint in the robot arm. The angle encoder is a device for measuring the rotation angle, which comprises a rotating part and a sensor (for example, an optical sensor and a magnetic sensor), and is exemplarily an absolute value angle encoder or an incremental encoder. The angle encoder can collect the joint angle with high precision in real time, which ensures the immediacy and accuracy of the obtained joint angle of each joint in the robot arm, and is helpful to realize the precise control of the robot arm.

[0043] In some embodiments, optionally, the joint angles of the joints are predicted based on historical angles of at least one joint in the robot arm. In the embodiments, the historical angle is a joint angle collected or derived at a historical time point before the current time point. Specifically, the joint angles of the joints at the current time point are predicted by inputting the historical angles of the at least one joint into an angle prediction model (e.g., a neural network model and a mathematical statistics model), to obtain the joint angles of the joints at the current time point. For example, based on a plurality of historical angles of one or more joints, a trend of change of the angle of each joint is determined. The trend of change of the angle represents a trend of change of the joint angle of the corresponding joint within a period of time before and after the current time point, and the trend of change of the angle includes a type and a speed of change of the joint angle. The type of change of the joint angle includes an increase of the joint angle and a decrease of the joint angle. Based on the trend of change of the angle of each joint and the historical angle at a time point before the current time point, the joint angles of the joints at the current time point are predicted to obtain the joint angles of the joints in the robot arm.

[0044] In some embodiments, optionally, prior knowledge corresponding to the robot arm is acquired, and the joint angles of the joints are predicted based on the angle prediction model, the prior knowledge, and the historical angles of the at least one joint. In the embodiments, the prior knowledge is knowledge used in the process of predicting the joint angles, and the prior knowledge includes one or more of a type of business and a business scenario performed by the robot arm. In different types of business or business scenarios, the process of adjusting the joint angles of the robot arm is different. For example, in a medical surgery scenario, the process of adjusting the joint angles of the robot arm for a laparoscopic surgery is more complex than that for an open surgery. Specifically, the prior knowledge and the historical angles of the at least one joint are input into the angle prediction model, so that the prior knowledge guides the prediction process of the angle prediction model, and the joint angles of the joints at the current time point are predicted. The technical solution of the embodiments can help the angle prediction model to better learn the historical angles of the at least one joint by combining the prior knowledge, so that the prediction speed and accuracy of the angle prediction model are improved, and the accuracy and immediacy of the predicted joint angles are improved.

[0045] In some embodiments, optionally, the actual joint angle and the predicted joint angle of each joint at the preset time point are acquired; the actual joint angle and the predicted joint angle of each joint are compared, in the case that the actual joint angle and the predicted joint angle of any joint are the same, the actual joint angle or the predicted joint angle is taken as the joint angle of each joint at the preset time point; in the case that the actual joint angle and the predicted joint angle of any joint are not the same, the actual joint angle is taken as the joint angle of each joint at the preset time point, and the angle prediction model is optimized based on the actual joint angle to ensure the prediction accuracy of the angle prediction model. In the embodiment, the preset time point is a time point at which the actual joint angle and the predicted joint angle are compared, which is set in advance. The actual joint angle is the joint angle acquired by the angle encoder at the preset time point, and the predicted joint angle is the joint angle at the preset time point predicted by the angle prediction model. For example, the preset time point is determined based on the starting time of the robot arm and a preset time interval, wherein the preset time interval is 1 second. The technical solution of the embodiment can ensure the prediction accuracy of the angle prediction model by optimizing the angle prediction model based on the actual joint angle in the case that the actual joint angle and the predicted joint angle are not the same, thereby effectively avoiding the poor control accuracy of the robot arm caused by the inaccurate predicted joint angle.

[0046] The technical solution of the embodiment can ensure the instantaneity of the joint angle by acquiring the joint angle of the joint at the current time point or predicting the joint angle based on the historical angle of at least one joint, thereby ensuring the reliability of maintaining the balance state of the robot arm based on the joint angle.

[0047] S120, determining the joint motor current corresponding to the joint angle of each joint based on the pre-trained angle-current mapping model.

[0048] In the embodiment, the angle-current mapping model is a model for mapping the joint angle of each joint to the joint motor current of each joint. For example, the angle-current mapping model can be one or a combination of a neural network model, a decision tree model, and a naive Bayes model.

[0049] Specifically, the joint motor current corresponding to the joint angle of one or more joints is obtained by inputting the joint angle of the one or more joints into the pre-trained angle-current mapping model. In some embodiments, optionally, the joints are traversed, and the joint motor current corresponding to the joint angle of any joint is obtained by inputting the joint angle of the joint into the pre-trained angle-current mapping model.

[0050] In the embodiment, the angle-current mapping model corresponding to any two joints can be the same or different, and the embodiment does not limit this. By traversing each joint in the robot arm based on the preset traversal order, the joint angle of the traversed joint is input into the pre-trained angle-current mapping model corresponding to the joint to predict the joint motor current corresponding to the joint. The preset traversal order is a pre-set order of predicting the joint motor current corresponding to the joint. For example, the preset traversal order is the order from the end joint to the base joint. When the traversal is completed, the joint motor currents corresponding to all joints in the robot arm are obtained.

[0051] The technical solution of the embodiment can quickly obtain the joint motor current of the traversed joint by traversing the joint and mapping the joint motor current of the single joint, thereby improving the instantaneity of the single joint control.

[0052] In some embodiments, optionally, a pose matrix is generated based on the joint angles of the at least one joint, the pose matrix is input into the pre-trained angle-current mapping model to obtain a current matrix, and the current matrix includes the joint motor currents corresponding to the at least one joint respectively.

[0053] In the embodiment, the pose matrix is a matrix representing the pose of the robot arm, wherein the elements in the pose matrix are the joint angles of each joint. For example, assuming that the robot arm includes n joints and n is greater than or equal to 1, the pose matrix is z=[q1…qn], wherein qj represents the joint angle of the jth joint. By storing the joint angles of one or more joints in the robot arm as a pose matrix and inputting the pose matrix into the pre-trained angle-current mapping model, the pose matrix is mapped to a current matrix y=[i1…in], wherein ij represents the joint motor current of the jth joint. The technical solution of the embodiment can simultaneously obtain the joint motor currents corresponding to the joint angles of the at least one joint based on the mapping from the pose matrix to the current matrix by the angle-current mapping model, thereby improving the integrity of the robot arm control. j …q n j n represents the joint angle of the jth joint. By storing the joint angles of one or more joints in the robot arm as a pose matrix and inputting the pose matrix into the pre-trained angle-current mapping model, the pose matrix is mapped to a current matrix y=[i1…in], wherein ij represents the joint motor current of the jth joint. The technical solution of the embodiment can simultaneously obtain the joint motor currents corresponding to the joint angles of the at least one joint based on the mapping from the pose matrix to the current matrix by the angle-current mapping model, thereby improving the integrity of the robot arm control. j …i n j n represents the joint motor current of the jth joint. The technical solution of the embodiment can simultaneously obtain the joint motor currents corresponding to the joint angles of the at least one joint based on the mapping from the pose matrix to the current matrix by the angle-current mapping model, thereby improving the integrity of the robot arm control.

[0054] The structure of the angle-current mapping model has an influence on the mapping from the joint angle to the joint motor current. Optionally, the angle-current mapping model is a neural network model, and the number of nodes of the input layer of the angle-current mapping model is the same as the number of nodes of the output layer.

[0055] ​​In the embodiment, the neural network model comprises an input layer, an output layer and at least one hidden layer, wherein the input layer, the hidden layer and the output layer each comprise at least one node, and each node represents a neuron. For example, the neural network model can be any one of a feedforward neural network, a recurrent neural network and a convolutional neural network, and the embodiment is not limited in this regard.

[0056] Specifically, the input of each node of the input layer of the angle-current mapping model is the joint angle of any joint. The robot arm comprises at least one joint, so as to divide all joints into at least one joint group, each joint group corresponds to an angle-current mapping model, and the number of joints in any two joint groups can be the same or different, and the embodiment is not limited in this regard. By inputting the joint angles of the joints in each joint group into the pre-trained angle-current mapping model corresponding to the joint group, the joint motor current of the corresponding joint in the joint group is predicted. It should be noted that the number of nodes of the input layer and the output layer of the pre-trained angle-current mapping model corresponding to the joint group is the same as the number of joints in the joint group.

[0057] Taking the angle-current mapping model as a BP neural network model, Figure 2 is a structural diagram of a BP neural network model provided by the first embodiment of the application. As shown in Figure 2 , the BP neural network model comprises an input layer, an output layer and two hidden layers, assuming that the robot arm comprises n joints and the n joints are divided into 1 joint group, the number of nodes of the input layer and the output layer of the BP neural network model is n, and the number of nodes of the hidden layer is The input of the jth node of the input layer is the joint angle of the jth joint, and the output of the jth node of the output layer is the joint motor current of the jth joint. The pose matrix z is constructed based on the joint angles of the n joints, and the pose matrix z is [q1 q2…q n ], by inputting the pose matrix into the BP neural network model, the element representing the joint angle of the jth joint in the pose matrix is transmitted to the jth node of the input layer, and the jth node of the output layer outputs q j , which is the corresponding joint motor current i j of the jth joint. Based on the joint motor currents of the n joints, the current matrix y is composed, and the current matrix y is [i1 i2…i n ].

[0058] The technical scheme of the embodiment, the angle-current mapping model is a neural network model, which can efficiently process the nonlinear mapping from the joint angle to the joint motor current, the predicted joint motor current has high accuracy, the neural network model can better adapt to different data distribution and mode, and the generalization of the angle-current mapping model is ensured; and the number of nodes of the input layer of the angle-current mapping model is the same as the number of nodes of the output layer, the complexity of the angle-current mapping model is reduced, unnecessary information loss or redundancy can be avoided, the mapping between the joint angle and the joint motor current is more direct and transparent, and the explainability of the angle-current mapping model is improved.

[0059] S130, the joint motor current of the joint is assigned to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current, and the mechanical arm is kept in a balanced state.

[0060] Specifically, by using the joint motor current of each joint output by the pre-trained angle-current mapping model, the joint motor corresponding to each joint generates a joint torque corresponding to the joint motor current, so that each joint moves under the action of the joint torque, and the effect of keeping the mechanical arm in a balanced state is achieved. For example, based on the joint motor current corresponding to the joint angle of each joint in the mechanical arm at the current time, the joint motor generates a corresponding joint torque, so that the corresponding joint adjusts the joint angle under the action of the joint torque at the current time, and the movement of the mechanical arm in a stable state at the current time is realized.

[0061] The technical scheme of the embodiment is applied to a mechanical arm, and the mechanical arm includes at least one joint and a joint motor corresponding to each joint. By obtaining the joint angle of each joint in the mechanical arm, the joint motor current corresponding to the joint angle of each joint is determined based on a pre-trained angle-current mapping model, and the joint motor current of the joint is assigned to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current, and the mechanical arm is kept in a balanced state. The joint angle of each joint can be directly mapped to the joint motor current that can keep the mechanical arm in a balanced state, without considering the influence of the internal structure of the mechanical arm, effectively avoiding the problem that the determination of the joint motor current is difficult due to the difficulty in obtaining the parameters of the mechanical arm, and the accurate joint motor current can be quickly determined, which is helpful for keeping the mechanical arm in a balanced state.

[0062] Embodiment two

[0063] Figure 3 is a flowchart of an angle-current mapping model training method provided by the second embodiment of the application. The embodiment can be applied to the training of the angle-current mapping model, and the trained angle-current mapping model can be applied to the above-mentioned embodiments. As shown in Figure 3 , the method comprises:

[0064] S210. Obtain the sample dataset, which includes the joint angles of the joints in the sample robotic arm and the joint motor currents corresponding to the joint angles.

[0065] In this embodiment, the sample robotic arm is the robotic arm described in the above embodiments, or a robotic arm of the same model as the robotic arm described in the above embodiments. The sample dataset is a dataset pre-stored locally or on a server. The sample dataset includes multiple sample data, and each sample data includes the joint angle and joint motor current of at least one joint. The joint motor current is the joint motor current corresponding to the joint angle at the same moment when the sample robotic arm is in a balanced state.

[0066] Specifically, in response to the training start operation of the angle-current mapping model, a sample dataset pre-stored locally or on a server is invoked based on a preset path. The preset path is a pre-defined storage path for the sample dataset locally or on a server; this embodiment does not impose any limitations on this. In some embodiments, a sample dataset can be pre-constructed based on a sample robotic arm. Optionally, a sample pose matrix of at least one joint in the sample robotic arm is obtained, the sample pose matrix including pose data of at least one joint; pose control of the sample robotic arm is performed based on the sample pose matrix; when each joint of the sample robotic arm satisfies the sample pose matrix, the joint angles and joint motor currents of each joint are collected, and a sample dataset is formed based on the joint angles and joint motor currents of each joint.

[0067] In this embodiment, the sample pose matrix X Q =[Q1…Q j …Q n The workspace of the sample robotic arm is represented by n, where n is greater than or equal to 1, and each column of the sample pose matrix represents the pose data of a joint. Let j be the pose data of the j-th joint. The joint angle of the j-th joint in the m-th sample data is represented; each row of the sample pose matrix represents a pose state of the sample robotic arm.

[0068] Specifically, based on the maximum and minimum angles of each joint in the sample robotic arm, multiple candidate angles are determined for that joint, where each candidate angle represents an angle that the joint can reach. For example, multiple candidate angles are obtained by uniformly selecting values ​​between the maximum and minimum angles. The u-th candidate angle of the j-th joint is... Where, u∈[0 w j ], w j +1 represents the number of candidate angles for the j-th joint.

[0069] The plurality of candidate angle combinations are obtained by permutation and combination of the plurality of candidate angles of the at least one joint, each candidate angle combination represents a pose state of the sample robot arm, candidate angle combinations corresponding to unattainable pose states of the sample robot arm are removed, and the at least one remaining candidate angle combination is spliced to obtain a sample pose matrix.

[0070] The sample pose matrix is input into a pose control script of the sample robot arm, each candidate angle combination is traversed, a candidate angle combination traversed is taken as a current candidate angle combination, and the sample robot arm is automatically adjusted from a pose state corresponding to a previous candidate angle combination to a pose state corresponding to the current candidate angle combination in a balanced state. Exemplarily, the pose control script is a proportional-integral-derivative control (PID) script, and a control variable is wherein e(t) represents a difference between a current candidate angle and a previous candidate angle of each joint, k p , k i , and k d are control parameters. Figure 4 is a flowchart of the PID control provided in the second embodiment of the present application. As shown in Figure 4 , the pose control script is configured in the PID controller.

[0071] In a case where the pose state of the sample robot arm is a pose state corresponding to the current candidate angle combination, i.e., joint angles of joints of the sample robot arm are all candidate angles corresponding to the current candidate angle combination, it is determined that the joints of the sample robot arm satisfy the sample pose matrix, and joint angles and joint motor currents of each joint of the sample robot arm are collected. By saving joint angles and joint motor currents of the at least one joint corresponding to the plurality of candidate angle combinations in the sample pose matrix, a sample data set is constructed.

[0072] Exemplarily, the sample data set is X = [Q1 … Q j … Q n I1 … I j … I n ], wherein I j is a vector representing a joint motor current of the jth joint represents a joint motor current of the jth joint in the mth sample data.

[0073] The technical solution of the present embodiment constructs a sample data set based on a sample pose matrix of a sample robot arm, can guarantee specificity of the sample data set, and is helpful to improve mapping accuracy of an angle-current mapping model.

[0074] S220, first-stage training of the angle-current mapping model based on the sample data set, to obtain a first-stage angle-current mapping model, and model parameters of the angle-current mapping model are first-stage model parameters.

[0075] Specifically, in the first-stage training process, the angle-current mapping model is supervised trained by taking the joint angle of at least one joint in the sample data set as input, to obtain the predicted joint motor current of each joint, and the loss value of the predicted joint motor current corresponding to the input joint angle of each joint and the corresponding joint motor current in the sample data set is calculated based on a preset loss function. For example, the preset loss function can be one or more combinations of a Focal loss function, a cross-entropy loss function, and a Dice loss function, and the present embodiment does not limit this. In the case where the loss value does not meet the first-stage training end condition, the parameters of the angle-current mapping model are adjusted, such as adjusting the learning rate, the optimizer, the regularization, and the batch size, to gradually reduce the loss value until the first-stage training end condition is met, the first-stage training of the angle-current mapping model is stopped, and the first-stage angle-current mapping model is obtained. The first-stage training end condition can be one or more of loss value convergence, predicted joint motor current average detection precision convergence, and reaching a fixed first-stage training number, and the present embodiment does not limit this. The first-stage model parameters include the parameters of each node in the first-stage angle-current mapping model, for example, the node parameters include the connection weight of the input layer node and the hidden layer node, the threshold value of the hidden layer node, the connection weight of the hidden layer node and the output layer node, and the threshold value of the output layer node.

[0076] S230, iterative updating of the first-stage model parameters of the angle-current mapping model based on the genetic algorithm, to obtain updated model parameters, and updating the angle-current mapping model based on the updated model parameters.

[0077] Specifically, the genetic parameters of the genetic algorithm are determined based on the topology structure of the angle-current mapping model, wherein the genetic parameters include but are not limited to the population size, the population individual number, the initial crossover rate, the initial mutation rate, and the total number of iterations. For example, the number of input layer nodes of the angle-current mapping model is equal to the number of output layer nodes, the population individual number is l num = k 2 + 2nk+k+n, wherein n represents the number of input layer (or output layer) nodes, and k represents the number of hidden layer nodes; the population size is 20; and the total number of iterations is 1000. Based on the first-stage model parameters of the angle-current mapping model, the fitness is calculated to obtain the initial fitness. For example, the fitness calculation formula of the angle-current mapping model as a BP neural network model is N is the number of sample data in the sample data set, y i With are the expected value and the actual value of the BP neural network model. By performing initial value encoding processing on the model parameters of the first stage of the angle-current mapping model, initial population individuals are obtained. Based on the genetic parameters, the initial fitness, and the initial population individuals, multiple genetic iterations are performed, and the fitness corresponding to the new model parameters is obtained based on the new model parameters in each genetic iteration. Optionally, the following steps are iteratively performed: in the case where the fitness of the model parameters meets the end condition, the updated model parameters are obtained: based on the current iteration number and the fitness of the model parameters, the crossover rate and the mutation rate are determined; the population genes of the genetic algorithm are selected, crossed, and mutated based on the crossover rate and the mutation rate to generate new model parameters; and the fitness of the new model parameters is determined based on the new model parameters.

[0078] In the case where the fitness of the model parameters is greater than the average fitness, the crossover rate is the first preset crossover rate, and the mutation rate is the first preset mutation rate; in the case where the fitness of the model parameters is less than or equal to the average fitness, the crossover rate is determined based on the first preset crossover rate, the second preset crossover rate, the total number of iterations, and the current iteration number, and the mutation rate is determined based on the first preset mutation rate, the second preset mutation rate, the total number of iterations, and the current iteration number.

[0079] In this embodiment, the end condition can be one or more of the fitness of the model parameters being less than a preset fitness threshold, the fitness of the model parameters converging, and the total number of iterations being reached, and the present embodiment does not limit this.

[0080] It should be noted that for the initial stage of genetic iteration, a larger crossover rate and a smaller mutation rate are helpful to improve the genes of individuals with poor fitness; in the middle stage of genetic iteration, a larger mutation rate is helpful to improve the local search ability of the algorithm; and when the genetic iteration is in the later stage, a smaller crossover rate and mutation rate are helpful to the preservation of the genes of individuals with strong fitness. For example, assuming that the crossover rate p c ∈ [0.3, 0.8] and the mutation rate p m ∈ [0.001, 0.1], the first preset crossover rate is 0.8, the second preset crossover rate is 0.3, the first preset mutation rate is 0.001, and the second preset mutation rate is 0.1.

[0081] Specifically, in the case where the current iteration number is less than the total number of iterations, the fitness of the model parameters is compared with the end condition, and in the case where the fitness of the model parameters does not meet the end condition, it is considered that the next genetic iteration needs to be performed, and the crossover rate and the mutation rate are updated.

[0082] The average fitness is the average value of the fitness of the model parameters of all population individuals. By comparing the fitness of the model parameters corresponding to the current iteration number with the average fitness, in the case that the fitness of the model parameters corresponding to the current iteration number is greater than the average fitness, it can be considered that the current iteration number is in the early stage of genetic iteration, the crossover rate and the mutation rate do not need to be changed, the first preset crossover rate is set as the crossover rate of the next genetic iteration, and the first preset mutation rate is set as the mutation rate of the next genetic iteration.

[0083] In the case that the fitness of the model parameters corresponding to the current iteration number is less than or equal to the average fitness, it can be considered that the current iteration number is in the middle and late stage of genetic iteration, the crossover rate and the mutation rate need to be changed, the first preset crossover rate, the second preset crossover rate, the total number of iterations and the current iteration number are calculated and processed based on the crossover rate calculation formula, the crossover rate of the next genetic iteration is calculated, and the first preset mutation rate, the second preset mutation rate, the total number of iterations and the current iteration number are calculated and processed based on the mutation rate calculation formula, and the mutation rate of the next genetic iteration is calculated. Exemplarily, the crossover rate calculation formula is p c =p c,I -(p c,I -p c,II )×b / b max , wherein p c,I represents the first preset crossover rate, p c,II represents the second preset crossover rate, b represents the current iteration number, and b max represents the total number of iterations; the mutation rate calculation formula is p m =p m,II -(p m,II -p m,I )×b / b max , wherein p m,I represents the first preset mutation rate, and p m,II represents the second preset mutation rate.

[0084] Based on the crossover rate and the mutation rate of the next genetic iteration, genetic iteration of the next iteration number is performed. The population genes are selected, crossed and mutated based on the crossover rate and the mutation rate, the population genes are updated, new population individuals are obtained, and new model parameters are generated based on the new population individuals. Based on the new model parameters, fitness calculation is performed to obtain the fitness of the new model parameters. In the case that the fitness of the new model parameters meets the end condition, the new model parameters are determined as the updated model parameters, and by configuring the updated model parameters to the angle-current mapping model, the update of the angle-current mapping model is realized.

[0085] Exemplarily, Figure 5 is a flowchart of an angle-current mapping model training method provided by Embodiment Two of the present application. As shown in FIG. 1, the angle-current mapping model training method provided by Embodiment Two of the present application comprises the following steps.Figure 5 In a case where the fitness of the model parameter corresponding to the current iteration number satisfies the end condition, the updated model parameter of the BP neural network model is obtained.

[0086] The technical scheme of the embodiment updates the crossover rate and the mutation rate based on the current iteration number and the fitness of the model parameter, improves the local search capability of the genetic algorithm in the middle stage of the genetic iteration, and helps to retain the individual genes with strong adaptability in the late stage of the genetic iteration, so that the updated model parameter is more reasonable.

[0087] S240, training the updated angle-current mapping model based on the sample data set to obtain a trained angle-current mapping model.

[0088] Specifically, in the second stage training process, the updated angle-current mapping model is trained based on the preset training algorithm by taking the joint angle of at least one joint in the sample data set as input, to obtain the predicted joint motor current of each joint. For example, the preset training algorithm is a Bayesian regularization algorithm. Based on the predicted joint motor current corresponding to the input joint angle of each joint and the corresponding joint motor current in the sample data set, the joint motor current error is calculated. By comparing the joint motor current error and the preset joint motor current error threshold, in a case where the joint motor current error is greater than the preset joint motor current error threshold, it is determined that the second stage training end condition is met, and then the second stage training of the angle-current mapping model is stopped to obtain the trained angle-current mapping model; in a case where the joint motor current error is greater than the preset joint motor current error threshold, it is determined that the second stage training end condition is not met, and then the parameters of the angle-current mapping model are adjusted based on the learning rate and the joint motor current error until the second stage training end condition is met. For example, the iteration number of the second stage training is 1000, the learning rate is 0.01, and the preset joint motor current error threshold is 0.0001.

[0089] The technical scheme of the embodiment is characterized in that sample data sets are acquired, the sample data sets include joint angles of joints in a sample mechanical arm and joint motor currents corresponding to the joint angles; a first-stage training is performed on an angle-current mapping model based on the sample data sets, a first-stage angle-current mapping model is obtained, model parameters of the angle-current mapping model are first-stage model parameters; the first-stage model parameters of the angle-current mapping model are iteratively updated based on a genetic algorithm, updated model parameters are obtained, and the angle-current mapping model is updated based on the updated model parameters; a second-stage training is performed on the updated angle-current mapping model based on the sample data sets, and a trained angle-current mapping model is obtained. The embodiment can optimize angle-current mapping model parameters based on the genetic algorithm, avoid the angle-current mapping model parameters from falling into local optimization, ensure the prediction accuracy of the angle-current mapping model, enable the trained angle-current mapping model to quickly determine accurate joint motor currents, and help maintain the balance state of the mechanical arm.

[0090] Embodiment three

[0091] Figure 6 is a structural schematic diagram of a mechanical arm control device provided by the embodiment three of the application. As shown in the figure, Figure 6 the device comprises:

[0092] a joint angle acquisition module 310, configured to acquire joint angles of each joint in a mechanical arm;

[0093] a joint motor current determination module 320, configured to determine joint motor currents corresponding to the joint angles of each joint based on a pre-trained angle-current mapping model;

[0094] a joint motor driving module 330, configured to assign the joint motor currents of the joints to joint motors corresponding to the joints, so that the joint motors drive the joints based on the joint motor currents to maintain the mechanical arm in a balance state.

[0095] The technical scheme of the embodiment is applied to a mechanical arm, and the mechanical arm comprises at least one joint and a joint motor corresponding to each joint. The joint angles of each joint in the mechanical arm are acquired; the joint motor currents corresponding to the joint angles of each joint are determined based on a pre-trained angle-current mapping model; the joint motor currents of the joints are assigned to joint motors corresponding to the joints, so that the joint motors drive the joints based on the joint motor currents to maintain the mechanical arm in a balance state. The joint angles of each joint can be directly mapped to joint motor currents capable of maintaining the balance state of the mechanical arm, without considering the influence of the internal structure of the mechanical arm, effectively avoiding the problem that it is difficult to determine the joint motor currents due to the difficulty in acquiring the parameters of the mechanical arm, and quickly determining accurate joint motor currents, which helps to maintain the balance state of the mechanical arm.

[0096] In the above embodiment, optionally, the joint angle of the joint is a joint angle of the joint at a current time; the joint angle of the joint is acquired based on an angle encoder; or the joint angle of each joint is predicted based on a historical angle of at least one joint in the robot arm.

[0097] In the above embodiment, optionally, the joint motor current determination module 320 is specifically configured to: traverse the joints, input the joint angle of any joint into a pre-trained angle-current mapping model to obtain the joint motor current corresponding to the joint; or generate a pose matrix based on the joint angles of at least one joint, input the pose matrix into the pre-trained angle-current mapping model to obtain a current matrix, the current matrix including the joint motor currents corresponding to the at least one joint respectively.

[0098] In the above embodiment, optionally, the angle-current mapping model is a neural network model; the number of nodes of the input layer of the angle-current mapping model is the same as the number of nodes of the output layer.

[0099] In the above embodiment, optionally, the robot arm control device further comprises: an angle-current mapping model training module configured to: acquire a sample data set, the sample data set including the joint angles of the joints in a sample robot arm and the joint motor currents corresponding to the joint angles; perform first-stage training on the angle-current mapping model based on the sample data set to obtain a first-stage angle-current mapping model, the model parameters of the angle-current mapping model being first-stage model parameters; iteratively update the first-stage model parameters of the angle-current mapping model based on a genetic algorithm to obtain updated model parameters, and update the angle-current mapping model based on the updated model parameters; perform second-stage training on the updated angle-current mapping model based on the sample data set to obtain a trained angle-current mapping model.

[0100] In the above embodiment, optionally, the angle-current mapping model training module is specifically configured to: acquire a sample pose matrix of at least one joint in a sample robot arm, the sample pose matrix including pose data of the at least one joint; perform pose control on the sample robot arm based on the sample pose matrix, acquire the joint angles and the joint motor currents of the joints of the sample robot arm under the condition that the joints of the sample robot arm meet the sample pose matrix, and form a sample data set based on the joint angles and the joint motor currents of the joints.

[0101] On the basis of the above-mentioned embodiments, optionally, the angle-current mapping model training module is specifically configured to: iteratively perform the following steps, and obtain updated model parameters in the case that the fitness of the model parameters meets an ending condition: determine a crossover rate and a mutation rate based on the current iteration number and the fitness of the model parameters; perform selection, crossover and mutation on the population genes of the genetic algorithm based on the crossover rate and the mutation rate to generate new model parameters; determine the fitness of the new model parameters based on the new model parameters; wherein, in the case that the fitness of the model parameters is greater than the average fitness, the crossover rate is a first preset crossover rate, and the mutation rate is a first preset mutation rate; in the case that the fitness of the model parameters is less than or equal to the average fitness, the crossover rate is determined based on the first preset crossover rate, a second preset crossover rate, the total number of iterations and the current iteration number, and the mutation rate is determined based on the first preset mutation rate, the second preset mutation rate, the total number of iterations and the current iteration number.

[0102] The mechanical arm control device provided in the embodiments of the present application can execute the mechanical arm control method provided in any of the embodiments of the present application, and has the function modules and beneficial effects corresponding to the execution method.

[0103] Embodiment Four

[0104] Figure 7 is a structural schematic diagram of an electronic device for implementing the mechanical arm control method of the embodiments of the present application. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0105] As shown in Figure 7 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is in communication connection with the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0106] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0107] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the robotic arm control method.

[0108] In some embodiments, the robotic arm control method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the robotic arm control method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the robotic arm control method by any other appropriate means, such as by means of firmware.

[0109] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0110] A computer program for implementing the robot control method of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor, implements the functions / operations specified in the flow charts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine, or entirely on a remote machine or server.

[0111] Embodiment five

[0112] Embodiment five of the present application also provides a computer readable storage medium, the computer readable storage medium storing computer instructions, the computer instructions being used for causing a processor to execute a robot control method, the method comprising:

[0113] obtaining a joint angle of each joint in the robot arm; determining a joint motor current corresponding to the joint angle of each joint based on a pre-trained angle-current mapping model; and assigning the joint motor current of the joint to a joint motor corresponding to the joint, so as to drive the joint by the joint motor based on the joint motor current, and keep the robot arm in a balanced state.

[0114] In the context of the present application, the computer readable storage medium can be a tangible medium, which can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the above. Alternatively, the computer readable storage medium can be a machine readable signal medium. More specific examples of the machine readable storage medium will include one or more wires, portable computer disks, hard disk drives, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disc read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0115] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0116] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0117] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0118] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.

[0119] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above, but only by the scope of the appended claims.

Claims

1. A robot arm control method characterized by, The application is applied to a mechanical arm, the mechanical arm comprising at least one joint and a joint motor corresponding to each joint; the method comprising: acquiring a joint angle of each joint in the mechanical arm; determining a joint motor current corresponding to the joint angle of each joint based on a pre-trained angle-current mapping model; assigning the joint motor current of the joint to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current, and keeps the mechanical arm in a balanced state; wherein the angle-current mapping model training method comprises: acquiring a sample data set, the sample data set comprising a joint angle of a joint in a sample mechanical arm and a joint motor current corresponding to the joint angle; training the angle-current mapping model based on the sample data set to obtain a first-stage angle-current mapping model, the model parameters of the angle-current mapping model being first-stage model parameters; iteratively updating the first-stage model parameters of the angle-current mapping model based on a genetic algorithm to obtain updated model parameters, and updating the angle-current mapping model based on the updated model parameters; training the updated angle-current mapping model based on the sample data set to obtain a trained angle-current mapping model; wherein the iteratively updating the first-stage model parameters of the angle-current mapping model based on the genetic algorithm to obtain the updated model parameters comprises: iteratively performing the following steps to obtain the updated model parameters when the fitness of the model parameters meets an end condition: determining a crossover rate and a mutation rate based on the current iteration number and the fitness of the model parameters; selecting, crossing, and mutating the population genes of the genetic algorithm based on the crossover rate and the mutation rate to generate new model parameters; and determining a new fitness of the new model parameters based on the new model parameters; wherein, when the fitness of the model parameters is greater than the average fitness, the crossover rate is a first preset crossover rate, and the mutation rate is a first preset mutation rate; when the fitness of the model parameters is less than or equal to the average fitness, determining the crossover rate based on the first preset crossover rate, a second preset crossover rate, the total number of iterations, and the current iteration number; and determining the mutation rate based on the first preset mutation rate, a second preset mutation rate, the total number of iterations, and the current iteration number.

2. The method of claim 1, wherein, The joint angle of the joint is the joint angle of the joint at the current time; The joint angle of the joint is acquired based on an angle encoder; Alternatively, the joint angles of the joints are predicted based on historical angles of at least one joint in the mechanical arm.

3. The method of claim 1, wherein, The determining of the joint motor current corresponding to the joint angle of each joint based on the pre-trained angle-current mapping model comprises: traversing the joints, inputting the joint angle of any joint into the pre-trained angle-current mapping model to obtain the joint motor current corresponding to the joint. Or, a pose matrix is generated based on the joint angle of at least one joint, the pose matrix is input into the pre-trained angle-current mapping model, and a current matrix is obtained, wherein the current matrix includes the joint motor current corresponding to each of the at least one joint.

4. The method of claim 1, wherein, The angle-current mapping model is a neural network model; the number of nodes of the input layer of the angle-current mapping model is the same as the number of nodes of the output layer.

5. The method of claim 1, wherein, The sample data set is obtained, including: The sample pose matrix of at least one joint of the sample mechanical arm is obtained, and the sample pose matrix includes the pose data of the at least one joint; The sample mechanical arm is controlled based on the sample pose matrix, and the joint angle and the joint motor current of each joint are collected under the condition that each joint of the sample mechanical arm meets the sample pose matrix, and a sample data set is formed based on the joint angle and the joint motor current of each joint.

6. A robot control device characterized by comprising: Including: The joint angle acquisition module is configured to acquire the joint angle of each joint of the mechanical arm; The joint motor current determination module is configured to determine the joint motor current corresponding to the joint angle of each joint based on the pre-trained angle-current mapping model; The joint motor driving module is configured to assign the joint motor current of the joint to the joint motor corresponding to the joint, so that the joint motor drives the joint based on the joint motor current, and keeps the mechanical arm in a balanced state. The device further includes: The angle-current mapping model training module is configured to obtain a sample data set, wherein the sample data set includes the joint angle and the joint motor current corresponding to the joint angle of a joint of a sample mechanical arm; the angle-current mapping model is trained based on the sample data set in a first stage to obtain a first-stage angle-current mapping model, the model parameters of the angle-current mapping model are first-stage model parameters; the first-stage model parameters of the angle-current mapping model are iteratively updated based on a genetic algorithm to obtain updated model parameters, and the angle-current mapping model is updated based on the updated model parameters; the updated angle-current mapping model is trained based on the sample data set in a second stage to obtain a trained angle-current mapping model. The angle-current mapping model training module is specifically configured to iteratively perform the following steps: determining a crossover rate and a mutation rate based on a current iteration number and the fitness of the model parameters, performing selection, crossover and mutation on the population genes of the genetic algorithm based on the crossover rate and the mutation rate to generate new model parameters, determining a new fitness of the new model parameters based on the new model parameters, and obtaining the updated model parameters when the fitness of the model parameters meets an ending condition. In a case where the fitness of the model parameters is greater than an average fitness, the crossover rate is a first preset crossover rate, and the mutation rate is a first preset mutation rate. In a case where the fitness of the model parameters is less than or equal to the average fitness, the crossover rate is determined based on the first preset crossover rate, a second preset crossover rate, a total number of iterations and the current iteration number, and the mutation rate is determined based on the first preset mutation rate, a second preset mutation rate, the total number of iterations and the current iteration number.

7. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the mechanical arm control method of any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to execute the mechanical arm control method of any one of claims 1-5 when executed.

Citation Information

Patent Citations

  • Robot joint control method and device, robot and storage medium

    CN113752250A

  • Rehabilitation training method and device and rehabilitation robot

    CN114028156A