A control method, device, electronic device and storage medium for a robotic arm

By optimizing the control signal sequence through the state prediction model, the problem of low control accuracy of the robotic arm is solved and precise motion control of the robotic arm is achieved.

CN114918912BActive Publication Date: 2024-08-30NETEASE LINGDONG (HANGZHOU) TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210225857.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-07
Publication Date
2024-08-30
Estimated Expiration
2042-03-07

AI Technical Summary

Technical Problem

Existing robotic arm control methods have low accuracy and cannot effectively constrain the control information during the movement of the robotic arm, making it difficult to achieve precise control.

Method used

Through the state prediction model, the robot arm state and control signal sequence at the current time step are combined, and the control signal sequence is optimized to predict and update the state of the robot arm, so as to realize the smooth movement of the robot arm from the current state to the target state.

Benefits of technology

It achieves precise and effective control of the robotic arm, allowing it to move stably toward the preset target state, improving control accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114918912B
    Figure CN114918912B
Patent Text Reader

Abstract

The present application discloses a control method, device, electronic device and storage medium for a robotic arm. The control method for the robotic arm comprises: obtaining a first state and a first control signal sequence corresponding to the robotic arm at a current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robotic arm at multiple time steps; based on the first state, sequentially inputting each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step, and obtaining the predicted state of the robotic arm at each time step; optimizing the first control signal sequence according to the predicted state of the robotic arm at each time step and a preset target state, and obtaining a second control signal sequence; controlling the movement of the robotic arm according to the second control signal sequence, and obtaining a second state of the robotic arm at a time step next to the current time step; updating the first state according to the second state, and updating the first control signal sequence according to the second control signal sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automatic control, and in particular to a control method, device, electronic equipment and computer storage medium for a robotic arm. Background Art

[0002] With the development of industrial technology and artificial intelligence, robotic arms have been used in more and more fields, for example: in construction, the application of excavator arms on excavators, or in the field of robotics, the application of robot limb control.

[0003] At present, there are many different control methods for robotic arms in different fields. For example, in construction, the control of excavators depends on the actual operating experience of operators and the PID control algorithm set for excavators; in the field of robotics, the control of robotic arms composed of robot limbs depends on computer control software and human control instructions. However, although the control methods in the prior art can enable the robotic arm to complete the predetermined movement, they cannot effectively constrain the control information during the movement of the robotic arm due to its low control accuracy.

[0004] Therefore, how to accurately and effectively control the robotic arm has become a problem that technical personnel in this field need to solve urgently. Summary of the invention

[0005] The embodiments of the present application provide a control method, device, electronic device and computer storage medium for a robotic arm to solve the above-mentioned problems existing in the prior art.

[0006] The control method of the robot arm provided in the embodiment of the present application includes:

[0007] Acquire a first state and a first control signal sequence corresponding to the robotic arm to be controlled at a current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robotic arm at multiple time steps;

[0008] Based on the first state, inputting each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step in sequence to obtain a predicted state of the robotic arm at each time step;

[0009] Optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and the preset target state to obtain a second control signal sequence;

[0010] Controlling the movement of the robotic arm according to the second control signal sequence to obtain a second state of the robotic arm at a next time step after the current time step;

[0011] The first state is updated according to the second state, and the first control signal sequence is updated according to the second control signal sequence.

[0012] Optionally, the method further includes:

[0013] Based on the updated first state, sequentially inputting the updated first control signal into a state prediction model for predicting the state of the robotic arm at the next time step to obtain a predicted state of the robotic arm at each time step;

[0014] Optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and the preset target state to obtain a second control signal sequence;

[0015] According to the second control signal sequence, the movement of the robotic arm is controlled to obtain a second state of the robotic arm in a next time step after the current time step.

[0016] Optionally, based on the first state, inputting each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step in sequence to obtain the predicted state of the robotic arm at each time step includes:

[0017] Inputting the first state and the first control signal in the first control signal sequence into the state prediction model, and obtaining the predicted state of the robot arm at the first time step after the current time step output by the state prediction model;

[0018] For the i-th time step after the current time step, the predicted state of the i-1-th time step after the current time step and the i-th control signal in the first control signal sequence are input into the state prediction model to obtain the predicted state of the robotic arm at the i-th time step after the current time step output by the state prediction model, where i is an integer greater than 1.

[0019] Optionally, optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and a preset target state to obtain the second control signal sequence includes:

[0020] Inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function, wherein the preset loss function is generated based on the difference between the target state and the predicted state at each time step;

[0021] The first control signal sequence is optimized based on the loss value to obtain the second control signal sequence.

[0022] Optionally, controlling the movement of the robotic arm according to the second control signal sequence includes:

[0023] Acquire a first control signal in the second control signal sequence;

[0024] The movement of the robot arm is controlled based on the first control signal in the second control signal sequence.

[0025] Optionally, updating the first control signal sequence according to the second control signal sequence includes:

[0026] Acquire the remaining control signals in the second control signal sequence except the first control signal;

[0027] generating a random control signal;

[0028] Combining the remaining control signals in the second control signal sequence except the first control signal with the random control signal to obtain a target control signal sequence;

[0029] The target control signal sequence replaces the first control signal sequence to obtain an updated first control signal sequence.

[0030] Optionally, the state of the robotic arm includes: an angle of a robotic arm joint and an angular velocity of movement of the robotic arm joint, and the angle and the angular velocity are respectively configured with corresponding weights;

[0031] The step of inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function includes:

[0032] Determining the sum of the first differences between the predicted angle of the robot arm joint in the predicted state at each time step and the target angle in the target state by using the preset loss function; and

[0033] Determine the sum of the second differences between the predicted angular velocity of the robot arm joint in the predicted state at each time step and the target angular velocity in the target state by using the preset loss function;

[0034] According to the weight corresponding to the angle, the weight corresponding to the angular velocity, the sum of the first difference and the sum of the second difference, the loss value of the predicted angle and the predicted angular velocity of the robotic arm joint output by the loss function is obtained.

[0035] Optionally, the optimizing the first control signal sequence based on the loss value to obtain the second control signal sequence includes:

[0036] When the loss value is greater than a preset loss threshold, the first control signal sequence is optimized according to the derivative gradient change of the loss function to obtain the second control signal sequence.

[0037] Optionally, also include:

[0038] Obtaining a first state and a first control signal sequence corresponding to each time step;

[0039] Using the first state and the first control signal sequence as training samples of the state prediction model;

[0040] Iteratively training the state prediction model based on the training samples to obtain a trained state prediction model;

[0041] The state prediction model is updated based on the trained state prediction model.

[0042] The present application also provides a control device for a robotic arm, comprising:

[0043] an acquisition unit, used to acquire a first state and a first control signal sequence corresponding to the robot arm to be controlled at a current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robot arm at multiple time steps;

[0044] a prediction unit, configured to input, based on the first state, each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step, so as to obtain a predicted state of the robotic arm at each time step;

[0045] an optimization unit, configured to optimize the first control signal sequence according to the predicted state of the robot arm at each time step and a preset target state to obtain a second control signal sequence;

[0046] A control unit, configured to control the movement of the robotic arm according to the second control signal sequence to obtain a second state of the robotic arm at a next time step after the current time step;

[0047] An updating unit is used to update the first state according to the second state, and to update the first control signal sequence according to the second control signal sequence.

[0048] The present application also provides an electronic device, including:

[0049] processor;

[0050] The memory is used to store the program of the method, and when the program is read and executed by the processor, the method is executed.

[0051] The present application also provides a computer storage medium, wherein the computer storage medium stores a computer program, and the program performs the above method when executed.

[0052] Compared with the prior art, this application has the following advantages:

[0053] The control method of the robot arm provided in the present application predicts the states of the robot arm at multiple time steps through the robot arm state prediction model, combined with the first state of the robot arm to be controlled at the current time step and the first control signal sequence, and obtains the predicted state of the robot arm at each time step; then, the first control signal sequence is optimized through the predicted state of each time step and the preset target state for the robot arm to obtain the optimized second control signal sequence, and the robot arm is controlled to move through the second control signal sequence to obtain the second state of the robot arm; finally, the first state of the robot arm at the current time step is updated through the second state, and the first control signal sequence is updated through the second control signal sequence, so as to repeat the above process to further control the state of the robot arm. This method enables the robot arm to move smoothly from the current state to the preset target state, and realizes accurate and effective control of the movement of the robot arm. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1a A control flow chart of an excavator mechanical arm provided in an embodiment of the present application;

[0055] Figure 1 A flow chart of a robot arm control method provided by another embodiment of the present application;

[0056] Figure 2 A schematic diagram of the mechanical structure of an excavator provided in another embodiment of the present application;

[0057] Figure 3 A schematic diagram of a PWM signal is provided for another embodiment of the present application;

[0058] Figure 4 A flow chart of a method for obtaining a robot arm sub-state corresponding to each time step provided in another embodiment of the present application;

[0059] Figure 5 A schematic diagram of the structure of a control device for a robotic arm provided in another embodiment of the present application;

[0060] Figure 6 A schematic diagram of the structure of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0061] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0062] The present application provides a control method for a robotic arm, the core of which is: through a state prediction model for predicting the state of the robotic arm in the next time step, and in combination with the first state of the robotic arm in the current time step, a first control signal sequence for driving the robotic arm to move in multiple time steps is optimized to obtain a second control signal sequence; further, through the second control signal sequence, the robotic arm is controlled to move from the current time step to the next time step to obtain the second state of the next time step; further, the first state of the current time step is updated through the second state, and the first control signal sequence is updated according to the second control signal sequence, so as to loop the above process, so that the robotic arm continues to move, thereby completing the control process.

[0063] In order to facilitate the understanding of the present application, first, the control method of the robotic arm is introduced in combination with a specific usage scenario.

[0064] The specific use scenario of the mechanical arm provided in the embodiment of the present application is the use of the mechanical arm of an excavator. Figure 1a , Figure 1a A control flow chart of an excavator mechanical arm provided in one embodiment of the present application.

[0065] like Figure 1a As shown, the control process of the excavator mechanical arm includes: an excavator mechanical arm joint control module 101a, a model prediction optimization module 102a, wherein the model prediction optimization module 102a includes: a model prediction submodule 102-1a, and a control signal optimization module 102-2a.

[0066] First, in order to achieve precise control of the excavator mechanical arm, first, a preset first control signal sequence is provided to the model prediction optimization module 102a, and each control signal in the first control signal sequence is used to drive the movement of the mechanical arm in multiple time steps.

[0067] After the model prediction optimization module 102a receives the first control signal sequence, it first inputs the simulated control sequence into the model prediction sub-unit 102-1a. The model prediction sub-module 102-1a stores a state prediction model for predicting the motion state of the robotic arm in multiple future time steps based on the first state of the robotic arm in the current time step and the first control signal sequence.

[0068] After receiving the first control signal sequence, the simulation prediction submodule 102-1a will obtain the following information: when the robotic arm is controlled according to each control signal in the first control signal sequence, the predicted state of the robotic arm at each time step. For example, assuming that the control signals of the first control signal sequence include: control signal 1, control signal 2 and control signal 3 in sequence, the predicted state of the robotic arm at each time step includes: under the control of the first control signal sequence, the predicted state 1 of the robotic arm moving from the current time step to the first time step after the current time step, the predicted state 2 of the robotic arm moving from the current time step to the second time step after the current time step, and the predicted state 3 of the robotic arm moving from the current time step to the third time step after the current time step.

[0069] Furthermore, after obtaining the above-mentioned predicted state of the robotic arm at each time step, the simulation prediction submodule 102-1a sends the above-mentioned predicted state to the control signal optimization module 102-2a, and the control signal optimization module 102-2a optimizes the first control signal sequence according to the predicted state of each time step predicted by the state prediction model and the target state preset for the robotic arm to obtain an optimized second control signal sequence, wherein the first control signal in the second control signal sequence is used to control the movement of the robotic arm for one time step.

[0070] After the movement of the robotic arm for one time step is controlled by the first control signal in the second control signal sequence, the second state of the robotic arm is obtained, and the first state corresponding to the current time step is updated by the second state, and then the updated first state is input into the simulation prediction optimization module 102a again; and a random control signal is generated again, and combined with the remaining control signals in the second control signal sequence except the first control signal to obtain a target control signal sequence, and the first control signal sequence is updated by the target control signal sequence, and the updated first control signal sequence is input into the simulation prediction optimization module 102a.

[0071] After receiving the updated first state and the updated first control signal sequence, the simulation prediction optimization module 102a optimizes the updated first control signal sequence through the model prediction submodule 102-1a and the control information optimization module 102-2a in the simulation prediction optimization module 102a, and controls the movement of the robotic arm for one time step through the first control signal in the optimized control signal sequence.

[0072] According to the above method, after controlling the movement of the robotic arm for one time step, the first state and the first control signal sequence of the robotic arm at the current time step are continuously updated and optimized until the robotic arm moves for several time steps, so that the first state of the robotic arm at the current time step is as close as possible to the predicted target state.

[0073] It is understandable that the above description of the use scenarios of the robot arm control method provided by the present application is only for the purpose of facilitating the understanding of the present application, and the robot arm control method provided by the present application can also be applied to other scenarios, for example, in the field of robotics to control the movement of a robot arm, etc. The present application does not limit this.

[0074] Another embodiment of the present application provides a control method for a robotic arm, please refer to Figure 1 , Figure 1 A flow chart of a robot arm control method provided in another embodiment of the present application.

[0075] like Figure 1 As shown, the method includes the following steps S101 to S105.

[0076] Step S101, obtaining a first state and a first control signal sequence corresponding to a robotic arm to be controlled at a current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robotic arm at multiple time steps.

[0077] In the embodiments of the present application, the mechanical arm may be a mechanical arm applied to different fields, for example, in industry, the mechanical arm may be a boom, a dipper rod and a bucket connected in sequence and installed on an excavator body; in the field of artificial intelligence, the mechanical arm may be a mechanical arm of an intelligent robot, etc. This application does not impose any limitation on this.

[0078] The first state corresponding to the robotic arm at the current time step can be understood as the current state of the robotic arm at the current time step, for example, the initial state of the robotic arm before controlling the movement of the robotic arm, or the movement state of the robotic arm from the movement process to the current moment.

[0079] In an optional implementation of the embodiment of the present application, the state of the robot arm includes the angle and angular velocity of the robot arm joint. Figure 2 The angle and angular velocity of the robotic arm are introduced.

[0080] Please refer to Figure 2 , Figure 2 A schematic diagram of the mechanical structure of an excavator provided in accordance with another embodiment of the present application.

[0081] Figure 2In the embodiment, the excavator comprises: an excavator body 201, a boom 202, a dipper arm 203 and a bucket 204 which are sequentially connected and installed on the excavator body 201. The boom 202, the dipper arm 203 and the bucket 204 together constitute the mechanical arm of the excavator.

[0082] like Figure 2 As shown, the angles of the excavator mechanical arm include: the angle α between the boom 202 and the excavator body 201, the angle β between the boom 203 and the boom 202, and the angle θ between the bucket 204 and the boom 203. The angular velocity of the excavator mechanical arm is also the angular velocity of the above-mentioned angles during the movement of the mechanical arm at each time step.

[0083] according to Figure 2 It can be seen that, when the fixed position of the robotic arm is determined, knowing the angles and angular velocities of the joints is actually knowing the position and movement direction of the robotic arm.

[0084] Furthermore, in an optional embodiment of the present application, the state of the robotic arm corresponding to a certain time step (including the first state corresponding to the current time step) can be obtained by a sensor installed on the robotic arm, for example: it can be obtained by an angular displacement sensor or a photoelectric angle sensor installed on the robotic arm.

[0085] In another optional embodiment of the present application, the state of the robotic arm can also use the posture information of the robotic arm. Further, the posture information can be obtained by detecting an IMU (Inertial Measurement Unit) installed in the robotic arm and a robotic arm image sensing device. Specifically, the speed, direction, rotation angle, acceleration, gravity and other parameters of each joint of the robotic arm can be measured by the IMU, and then the posture information of each joint of the robotic arm can be determined in combination with the image of the robotic arm captured by the image sensing device; the image sensing device can be a 2D / 3D camera or other optical image capture device.

[0086] The first control signal sequence in step S101 is used to drive the movement of the robotic arm. Specifically, the first control signal sequence includes control signals of several adjacent time steps, wherein each control signal is used to control the robotic arm to move from a state corresponding to one time step to a state corresponding to the next time step. For example, assuming that the robotic arm is the arm of a robot, and the arm is in a horizontally raised state (first state) at the current time step, then if it takes n time steps for the arm to complete the transition from the horizontally raised state to the hand-raising state, then the control signal sequence required for the arm to transition from the horizontally raised state to the hand-raising state includes n control signals. Furthermore, assuming that the control signal is u, the corresponding control signal sequence is (u0 ,u 1 ,u 2 ,u 3 …,u n-1 ).

[0087] In an optional implementation manner of the present application, PWM (Pulse width modulation, pulse width modulation signal) may be used as each control signal in the first control signal sequence.

[0088] Specifically, PWM is a method of digitally encoding the level of an analog signal, which encodes the level of a specific analog signal through a high-resolution counter and the duty cycle of a square wave. In practical applications, PWM signals are still digital because at any given moment, the full-amplitude DC power supply is either fully present (ON) or completely absent (OFF). The voltage or current source is applied to the analog load in a repetitive sequence of pulses that are either on (ON) or off (OFF). When it is on, the DC power supply is applied to the load, and when it is off, the power supply is disconnected. As long as the bandwidth is sufficient, any analog value can be encoded using PWM.

[0089] Please refer to Figure 3 , which provides a PWM signal schematic diagram for another embodiment of the present application.

[0090] Figure 3 Three different PWM signals are shown. Figure 3 (a) is a PWM output with a duty cycle of 10%, that is, in the signal cycle, 10% of the time is on and the remaining 90% of the time is off; Figure 3 (b) and (c) show PWM outputs with duty cycles of 50% and 90%, respectively. The three PWM outputs encode three different analog signal values ​​with intensities of 10%, 50%, and 90% of the full scale value. For example, assuming the power supply is 9V and the duty cycle is 10%, the corresponding analog signal is 0.9V.

[0091] In actual application, in order to control the movement of the robot arm, a PWM signal representing a certain amplitude is usually input into the motor used to control the movement of the robot arm, and then the motor is started to control the movement of the robot arm to a certain extent. It should be noted that in order to achieve safe control of the robot arm, that is, to control the angular velocity of the robot arm movement within a certain safety range, each control signal in the first control signal sequence needs to be within a stable PWM signal range. Optionally, in an embodiment of the present application, the PWM signal range of each control signal in the first control signal sequence is between -100 and +100.

[0092] In the embodiment of the present application, the purpose of the control method of the robotic arm is to predict the state of the robotic arm at different time steps based on the first control signal sequence and the first state, and then optimize and update the first control signal sequence based on the predicted state of the robotic arm and the preset target state for the robotic arm, so that the robotic arm can smoothly move from the first state of the current time step to the preset target state as much as possible during the actual movement. Therefore, based on the first state of the current time step of the known robotic arm and the first control signal sequence, it is necessary to further predict the predicted state of the robotic arm at each time step under the control of the first control signal sequence.

[0093] Step S102: based on the first state, input each control signal in the first control signal sequence into a state prediction model for predicting the state of the robot arm at the next time step in sequence to obtain the predicted state of the robot arm at each time step.

[0094] In the embodiment of the present application, the state prediction model is a neural network obtained by machine learning (ML) training. Machine learning (a multi-disciplinary cross-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines) is specifically used to study how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own new abilities. Machine learning generally includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies. Machine learning is a branch of artificial intelligence (AI) technology.

[0095] In an embodiment of the present application, the state prediction model is used to predict the state of the robotic arm at the next time step after the one time step based on the state of the robotic arm at the one time step and the control signal, that is, the input data of the robotic arm state prediction model are the angles and angular velocities of each joint of the robotic arm, and the PWM control signal, and the output data is the predicted values ​​of the angles and angular velocities of each joint of the robotic arm in the future.

[0096] Specifically, the state prediction model obtained in the above manner can be expressed by the formula x'=f(ζ, x, u), wherein ζ represents the model parameters, which determine the accuracy of the model prediction; x represents the first state of the robotic arm, that is, the angle and angular velocity of each joint of the robotic arm in the current time step; x' is the predicted state of the robotic arm in the next time step after the current time step, that is, the angle and angular velocity of each joint of the robotic arm in the next time step after the current time step.

[0097] Furthermore, after obtaining the state prediction model, based on the current state of the robotic arm and the first control signal sequence, the predicted state of the robotic arm at each time step can be predicted.

[0098] In a specific application process, the above step S102 includes the following steps S102-1 and S102-2:

[0099] Step S102-1, inputting the first state and the first control signal in the first control signal sequence into the state prediction model, and obtaining the predicted state of the robot arm at the first time step after the current time step output by the state prediction model;

[0100] Step S102-2, for the i-th time step after the current time step, input the predicted state of the i-1th time step after the current time step and the i-th control signal in the first control signal sequence into the state prediction model, and obtain the predicted state of the robotic arm at the i-th time step after the current time step output by the state prediction model, where i is an integer greater than 1.

[0101] Please refer to Figure 4 , which is a flow chart of a method for obtaining the robot arm sub-state corresponding to each time step provided by another embodiment of the present application.

[0102] That is, if the first state of the robot arm at the current time step is x 0 , the first control signal sequence is (u 0 ,u 1 ,u 2 ,u 3 …,u n-1 ), the state prediction model can be based on the first state x 0 and the control information u 0 , predict the predicted state x of the manipulator at the first time step after the current time step 1 ;

[0103] Furthermore, the state prediction model can be based on the predicted state x corresponding to the first time step after the current time step. 1 and the second control information u in the first control signal sequence 1 , predict the predicted state x of the robot at the second time step after the current time step 2 ;

[0104] And so on, until the state prediction model traverses all control information in the first control signal sequence, and obtains the prediction results of the state prediction model on the state of the robot arm in multiple time steps.

[0105] Step S103: optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and the preset target state to obtain a second control signal sequence.

[0106] The purpose of step S103 is to find a control signal for controlling the movement of the robot arm for one time step by optimizing the first control signal sequence.

[0107] Specifically, the process of optimizing the initialization control sequence of the robot arm includes the following steps S103-1 to S103-2:

[0108] Step S103-1, inputting the target state and the predicted state of each time step into a preset loss function to obtain a loss value output by the loss function, wherein the preset loss function is generated based on the difference between the target state and the predicted state of each time step;

[0109] The loss function is used to measure the degree of difference between the predicted state of the state prediction model and the target state. In an embodiment of the present application, the loss function is represented by f=f(u), where f is the loss value and u represents the first control signal sequence.

[0110] In order to facilitate understanding of the preset loss function provided in the embodiment of the present application, the preset loss function and the process of calculating the loss value by the loss function are introduced as follows:

[0111] Here, the state of the robot arm includes: an angle of the robot arm joint and an angular velocity of the robot arm joint movement, and the angle and the angular velocity are respectively configured with corresponding weights.

[0112] Furthermore, the above step S103-1 includes steps 1 to 3.

[0113] Step 1, determining the sum of the first difference between the predicted angle of the robot arm joint in the predicted state at each time step and the target angle in the target state through the preset loss function; and

[0114] Step 2, determining the sum of the second difference between the predicted angular velocity of the robot arm joint in the predicted state at each time step and the target angular velocity in the target state by using the preset loss function;

[0115] Step 3, according to the weight corresponding to the angle, the weight corresponding to the angular velocity, the sum of the first difference and the sum of the second difference, obtain the loss value of the predicted angle and predicted angular velocity of the robotic arm joint output by the loss function.

[0116] For example: Assume that the predicted states of the robot arm at each time step are (x 1 ,y 1 )、(x 2 ,y 2 )、(x 3 ,y 3 ),……,(x n ,y n ), wherein n is an integer greater than 1; the preset target state is (X, Y).

[0117] Then the sum of the first differences is equal to:

[0118] The sum of the second differences is equal to:

[0119] Furthermore, suppose the weight assigned to the angle is q 1 , the weight assigned to the angular velocity is q 2 , then the preset loss function can be written as the following formula (1):

[0120]

[0121] In formula (1), n ​​represents the number of control signals in the first control signal sequence.

[0122] Furthermore, since the state of the robot arm at a time step is determined by the control signal input to the robot arm together with the time step before the time step, the above formula (1) is essentially a loss function with the robot arm control information as the independent variable and the loss value as the dependent variable, that is, f=f(u).

[0123] Step S103 - 2 , optimizing the first control signal sequence based on the loss value to obtain the second control signal sequence.

[0124] The purpose of step S103-2 is to adjust and optimize the state of the robot arm at each time step so that the loss value generated in the process of the robot arm moving from the current state to the target state becomes smaller. Since the state of the robot arm at each time step is determined by the first control signal sequence, its essence is to optimize the first control signal sequence.

[0125] Specifically, the step S103-2 includes: when the loss value is greater than a preset loss threshold, optimizing the first control signal sequence according to the derivative gradient change of the loss function to obtain the second control signal sequence.

[0126] Step S104: Control the movement of the robotic arm according to the second control signal sequence to obtain a second state of the robotic arm at a next time step after the current time step.

[0127] In the embodiment of the present application, it is considered that the first control signal in the second control signal sequence can be used to control the movement of the robotic arm to the next time step.

[0128] Based on this, the above step S104 includes the following steps S5 and S6:

[0129] Step 5, obtaining the first control signal in the second control signal sequence;

[0130] Step 6: Control the movement of the robotic arm based on the first control signal in the second control signal sequence.

[0131] Specifically, after the robot arm is controlled to move for one time step by the first control signal in the second control signal sequence, the second state of the robot arm in the next time step of the current time step can be obtained through a sensor or sensing device installed on the robot arm.

[0132] Step S105: updating the first state according to the second state, and updating the first control signal sequence according to the second control signal sequence.

[0133] Furthermore, after the robotic arm moves from the current time step to the next time step, in order for the robotic arm to completely execute the expected motion process and be able to smoothly approach the preset target state after moving from the first state for multiple time steps, it is also necessary to update the first state of the current time step (i.e., use the second state as the new first state), and at the same time, it is also necessary to update the first control signal sequence based on the optimized second control signal sequence.

[0134] In an optional implementation manner of the present application, updating the first control signal sequence according to the second control sequence includes the following steps S7 to S10:

[0135] Step 7, obtaining the remaining control signals in the second control signal sequence except the first control signal;

[0136] Step 8, generating a random control signal;

[0137] Step 9, combining the remaining control signals in the second control signal sequence except the first control signal with the random control signal to obtain a target control signal sequence;

[0138] Step 10: Replace the first control signal sequence with the target control signal sequence to obtain an updated first control signal sequence.

[0139] For example, assuming that the second control signal sequence is (k 1 , k 2 ,……,k n-1 ), then select the control signal sequence consisting of other control signals except k1 (k 2 , k 3 ..., k n-1 ), then, a random control signal k' is randomly generated and k' is placed in the control signal sequence (k 2 , k 3 ..., k n-1 ) at the end of the target control signal sequence (k 2 , k 3 ..., k n-1 , k'), taking the target control signal as a new first control signal sequence.

[0140] In another optional implementation of the present application, the implementation method of updating the first control signal sequence according to the second control sequence may not be limited to the method provided in the above steps 7 to 10. For example, the above step of generating a random control signal may be omitted, and the remaining control signals in the second control signal sequence except the first control signal may be selected as the target control signal sequence; or, a random control signal sequence may be generated again, and the random control signal sequence may be used as the target control signal sequence, etc. The present application does not impose any restrictions on this.

[0141] Furthermore, after executing the above steps S101 to S105, the movement of the robot arm in one time step is completed. In order to make the robot arm move toward the preset target state, the method further includes the following steps S11 to S13:

[0142] Step S11, based on the updated first state, sequentially inputting the updated first control signal into a state prediction model for predicting the state of the robotic arm at the next time step to obtain the predicted state of the robotic arm at each time step;

[0143] Step S12, optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and the preset target state to obtain a second control signal sequence;

[0144] Step S13: Control the movement of the robotic arm according to the second control signal sequence to obtain a second state of the robotic arm at a time step next to the current time step.

[0145] That is to say, after updating the first state and the first control signal sequence, the method described in steps S101 to S105 is returned to be executed based on the updated first state and the updated first control signal sequence, so that the robot arm continues to move relative to the current time step based on the updated first state and the updated first control signal sequence until the robot arm completes the movement process from the current time step to the next time step of the current time step according to the second control signal sequence, and so on, until the robot arm moves a preset number of time steps.

[0146] Furthermore, in order to facilitate understanding of the control method of the robotic arm provided in the present application, a specific application of the method is described in detail below.

[0147] First, assume that the first control signal sequence is u s =(u 0 ,u 1 ,…,u 9 ), the first state x of the current time step 0 , the preset target state is x n ;

[0148] Then the first control signal sequence u s and the first state x 0 After inputting the state prediction model for predicting the state of the robotic arm in the next step, the state prediction model obtains the predicted state of the robotic arm at each time step in the following manner:

[0149] x 0 +u 0 →x 1 , that is, the state prediction model is based on the first state x 0 and the first control signal u in the first control signal sequence 0 , predict the predicted state x of the first time step after the current time step 1 ;

[0150] x 1 +u 1 →x 2 , that is, the state prediction model is based on the state x 1 and the second control signal u in the first control signal sequence 1 , predict the predicted state x of the second time step after the current time step 2 ;

[0151] And so on, until the predicted state x10 of the tenth time step after the current time step is obtained, that is, x 9 +u 9 →x 10 .

[0152] Through the above method, the predicted state sequence x output by the state prediction model for identifying the predicted state of the robot arm at each time step can be obtained. s =(x 1 , x 2 , …, x 10 ).

[0153] Furthermore, the above predicted state sequence x s and the preset target state x n A preset loss function is input. If the loss value output by the preset loss function is greater than a preset loss threshold, it indicates that the first control signal sequence needs to be optimized. Specifically, the optimization process is to optimize the first control signal sequence according to the derivative gradient change of the loss function to obtain a second control signal sequence;

[0154] Here, it is assumed that after the first control signal sequence is optimized, the second control signal sequence is u' s =(u' 0 ,u' 1 ,…,u' 9 ).

[0155] Here, select u' 0 As the control signal of the first time step after the current time step of the robot arm, the robot arm is controlled to move from the current time step to the next time step after the current time step. Here, it is further assumed that the state of the robot arm when the robot arm moves from the current time step to the next time step after the current time step is the second state x' 1 .

[0156] Since the state of the robot arm has changed, here, through the second state x' 1 The first state of the robot arm is updated, and the second state of the current time step is used as the first state. At this time, the first state is updated to x 0 =x' 1 ;

[0157] Furthermore, it is also necessary to control the first control signal sequence u s Make updates;

[0158] In an optional implementation manner of the present application, the first control signal u s The second control signal sequence u' needs to be used in the updating process s u' 1 tou' 9 , and a random control signal u 10The first control signal is updated by the above control signal, and the updated first control signal sequence u s =(u' 1 ,u' 2 ,…,u' 9 ,u 10 ).

[0159] Further, the updated first state x 0 and the updated first control signal u s Input the state prediction model, use the state prediction model to predict the state of each of the robot arms in the next 10 time steps, and obtain the predicted state of each time step, and repeat the above process of optimizing the first control signal sequence through the loss function to obtain the second control signal sequence u' s .

[0160] By the second control signal sequence u' s The first control signal in controls the robot arm to move to the next time step of the current time step.

[0161] By analogy with the above method, until the robot arm moves for 10 time steps, according to the control method of the robot arm provided in the present application, after the robot arm moves for the above time steps, the final state of the robot arm is based on the preset target state x n The same, and the movement process of the robotic arm is also smooth.

[0162] In an optional embodiment of the present application, in order to ensure the accuracy of the state prediction model in predicting the state of the robotic arm, the control method of the robotic arm provided in the present application also includes a training process for the state prediction model. Specifically, the control method of the robotic arm also includes the following steps S14 to S17.

[0163] Step S14, obtaining the first state and the first control signal sequence corresponding to each time step;

[0164] Step S15, using the first state and the first control signal sequence as training samples of the state prediction model;

[0165] Step S16, iteratively training the state prediction model based on the training samples to obtain a trained state prediction model;

[0166] Step S17: updating the state prediction model based on the trained state prediction model.

[0167] In a specific application process, the sample data can be obtained by modifying the robotic arm. For example, the first state of each time step can be obtained by an angle sensor installed on the robotic arm, and the corresponding first control signal sequence of each time step can be obtained by a pulse width modulation signal sensor installed on the robotic arm.

[0168] In summary, the control method of the robotic arm provided in the present application predicts the states of the robotic arm at multiple time steps through the robotic arm state prediction model, combined with the first state of the robotic arm to be controlled at the current time step and the first control signal sequence, to obtain the predicted state of the robotic arm at each time step; then, the first control signal sequence is optimized through the predicted state of each time step and the target state preset for the robotic arm to obtain the optimized second control signal sequence, and the robotic arm is controlled to move through the second control signal sequence to obtain the second state of the robotic arm; finally, the first state of the robotic arm at the current time step is updated through the second state, and the first control signal sequence is updated through the second control signal sequence, so as to repeat the above process and further control the movement of the robotic arm. This method enables the robotic arm to move smoothly from the current state to the preset target state, and realizes accurate and effective control of the movement of the robotic arm.

[0169] Another embodiment of the present application provides a control device for a robotic arm, referring to Figure 5 , Figure 5 This is a schematic diagram of the structure of a control device for a robotic arm provided in another embodiment of the present application. Since the device embodiment is basically similar to the above method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the above method embodiment.

[0170] like Figure 5 As shown, the control device of the robot arm provided in the embodiment of the present application includes:

[0171] An acquisition unit 501 is used to acquire a first state and a first control signal sequence corresponding to a robot arm to be controlled at a current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robot arm at multiple time steps;

[0172] A prediction unit 502 is used to input each control signal in the first control signal sequence into a state prediction model for predicting the state of the manipulator at the next time step in sequence based on the first state, so as to obtain a predicted state of the manipulator at each time step;

[0173] An optimization unit 503, configured to optimize the first control signal sequence according to the predicted state of the robot arm at each time step and a preset target state to obtain a second control signal sequence;

[0174] A control unit 504 is used to control the movement of the robotic arm according to the second control signal sequence to obtain a second state of the robotic arm at a next time step after the current time step;

[0175] The updating unit 505 is configured to update the first state according to the second state, and update the first control signal sequence according to the second control signal sequence.

[0176] Optionally, the device is also used for:

[0177] Based on the updated first state, sequentially inputting the updated first control signal into a state prediction model for predicting the state of the robotic arm at the next time step to obtain a predicted state of the robotic arm at each time step;

[0178] Optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and the preset target state to obtain a second control signal sequence;

[0179] According to the second control signal sequence, the movement of the robotic arm is controlled to obtain a second state of the robotic arm in a next time step after the current time step.

[0180] Optionally, based on the first state, inputting each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step in sequence to obtain the predicted state of the robotic arm at each time step includes:

[0181] Inputting the first state and the first control signal in the first control signal sequence into the state prediction model, and obtaining the predicted state of the robot arm at the first time step after the current time step output by the state prediction model;

[0182] For the i-th time step after the current time step, the predicted state of the i-1-th time step after the current time step and the i-th control signal in the first control signal sequence are input into the state prediction model to obtain the predicted state of the robotic arm at the i-th time step after the current time step output by the state prediction model, where i is an integer greater than 1.

[0183] Optionally, optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and a preset target state to obtain the second control signal sequence includes:

[0184] Inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function, wherein the preset loss function is generated based on the difference between the target state and the predicted state at each time step;

[0185] The first control signal sequence is optimized based on the loss value to obtain the second control signal sequence.

[0186] Optionally, controlling the movement of the robotic arm according to the second control signal sequence includes:

[0187] Acquire a first control signal in the second control signal sequence;

[0188] The movement of the robot arm is controlled based on the first control signal in the second control signal sequence.

[0189] Optionally, updating the first control signal sequence according to the second control signal sequence includes:

[0190] Acquire the remaining control signals in the second control signal sequence except the first control signal;

[0191] generating a random control signal;

[0192] Combining the remaining control signals in the second control signal sequence except the first control signal with the random control signal to obtain a target control signal sequence;

[0193] The target control signal sequence replaces the first control signal sequence to obtain an updated first control signal sequence.

[0194] Optionally, the state of the robotic arm includes: an angle of a robotic arm joint and an angular velocity of movement of the robotic arm joint, and the angle and the angular velocity are respectively configured with corresponding weights;

[0195] The step of inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function includes:

[0196] Determining the sum of the first differences between the predicted angle of the robot arm joint in the predicted state at each time step and the target angle in the target state by using the preset loss function; and

[0197] Determine the sum of the second differences between the predicted angular velocity of the robot arm joint in the predicted state at each time step and the target angular velocity in the target state by using the preset loss function;

[0198] According to the weight corresponding to the angle, the weight corresponding to the angular velocity, the sum of the first difference and the sum of the second difference, the loss value of the predicted angle and the predicted angular velocity of the robotic arm joint output by the loss function is obtained.

[0199] Optionally, the optimizing the first control signal sequence based on the loss value to obtain the second control signal sequence includes:

[0200] When the loss value is greater than a preset loss threshold, the first control signal sequence is optimized according to the derivative gradient change of the loss function to obtain the second control signal sequence.

[0201] Optionally, the device is also used for:

[0202] Obtaining a first state and a first control signal sequence corresponding to each time step;

[0203] Using the first state and the first control signal sequence as training samples of the state prediction model;

[0204] Iteratively training the state prediction model based on the training samples to obtain a trained state prediction model;

[0205] The state prediction model is updated based on the trained state prediction model.

[0206] The present application also provides an electronic device. Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided for another embodiment of the present application. Since the electronic device embodiment is basically similar to the above-mentioned method embodiment and device embodiment, the description is relatively simple. For relevant matters, please refer to the partial description of the above-mentioned method embodiment and device embodiment.

[0207] The electronic device comprises: a processor 601;

[0208] The memory 602 is used to store a method program, and when the program is read and executed by the processor 601, any of the above methods is executed.

[0209] The embodiment of the present application also provides a computer storage medium, wherein the computer stores a computer program, and when the program is executed, any one of the methods of the embodiment is executed.

[0210] It should be noted that the detailed description of the computer storage medium provided by this invention can also refer to the relevant description of the above method embodiment, which will not be repeated here.

[0211] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

[0212] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0213] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0214] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include non-transitory computer-readable media (transitor7media), such as modulated data signals and carrier waves.

[0215] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as a system or electronic device. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

Claims

1. A method for controlling a robotic arm, characterized in that: include: Acquire a first state and a first control signal sequence corresponding to the robotic arm to be controlled at the current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robotic arm at multiple time steps; the first state is the initial state of the robotic arm before controlling the movement of the robotic arm, or the movement state of the robotic arm during the movement process to the current time step; Based on the first state, inputting each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step in sequence to obtain a predicted state of the robotic arm at each time step; According to the predicted state of the robot arm at each time step and the preset target state, the first control signal sequence is optimized to obtain the second control signal sequence, including: inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function, wherein the preset loss function is generated based on the difference between the target state and the predicted state at each time step; optimizing the first control signal sequence based on the principle of reducing the loss value to obtain the second control signal sequence; according to the second control signal sequence, controlling the movement of the robot arm to obtain the second state of the robot arm at the next time step of the current time step; The first state is updated according to the second state, and the first control signal sequence is updated according to the second control signal sequence.

2. The control method according to claim 1, characterized in that: The method further comprises: Based on the updated first state, sequentially inputting the updated first control signal into a state prediction model for predicting the state of the robotic arm at the next time step to obtain a predicted state of the robotic arm at each time step; Optimizing the first control signal sequence according to the predicted state of the robot arm at each time step and the preset target state to obtain a second control signal sequence; According to the second control signal sequence, the movement of the robotic arm is controlled to obtain a second state of the robotic arm in a next time step after the current time step.

3. The control method according to claim 1, characterized in that: Based on the first state, inputting each control signal in the first control signal sequence into a state prediction model for predicting the state of the robot arm at the next time step in sequence to obtain the predicted state of the robot arm at each time step includes: Inputting the first state and the first control signal in the first control signal sequence into the state prediction model, and obtaining the predicted state of the robot arm at the first time step after the current time step output by the state prediction model; For the i-th time step after the current time step, the predicted state of the i-1-th time step after the current time step and the i-th control signal in the first control signal sequence are input into the state prediction model to obtain the predicted state of the robotic arm at the i-th time step after the current time step output by the state prediction model, wherein i is an integer greater than 1.

4. The control method according to claim 1, characterized in that: The step of controlling the movement of the robot arm according to the second control signal sequence comprises: Acquire a first control signal in the second control signal sequence; The movement of the robot arm is controlled based on the first control signal in the second control signal sequence.

5. The control method according to claim 4, characterized in that: The updating of the first control signal sequence according to the second control signal sequence comprises: Acquire the remaining control signals in the second control signal sequence except the first control signal; generating a random control signal; Combining the remaining control signals in the second control signal sequence except the first control signal with the random control signal to obtain a target control signal sequence; The target control signal sequence replaces the first control signal sequence to obtain an updated first control signal sequence.

6. The control method according to claim 1, characterized in that: The state of the robot arm includes: the angle of the robot arm joint and the angular velocity of the robot arm joint movement, and the angle and the angular velocity are respectively configured with corresponding weights; The step of inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function includes: Determining the sum of the first differences between the predicted angle of the robot arm joint in the predicted state at each time step and the target angle in the target state by using the preset loss function; and Determine the sum of the second differences between the predicted angular velocity of the robot arm joint in the predicted state at each time step and the target angular velocity in the target state by using the preset loss function; According to the weight corresponding to the angle, the weight corresponding to the angular velocity, the sum of the first difference and the sum of the second difference, the loss value of the predicted angle and the predicted angular velocity of the robotic arm joint output by the loss function is obtained.

7. The control method according to claim 1, characterized in that: The optimizing the first control signal sequence based on the loss value to obtain the second control signal sequence includes: When the loss value is greater than a preset loss threshold, the first control signal sequence is optimized according to the derivative gradient change of the loss function to obtain the second control signal sequence.

8. The control method according to claim 1, characterized in that: Also includes: Obtaining a first state and a first control signal sequence corresponding to each time step; Using the first state and the first control signal sequence as training samples of the state prediction model; Iteratively training the state prediction model based on the training samples to obtain a trained state prediction model; The state prediction model is updated based on the trained state prediction model.

9. A control device for a robotic arm, characterized in that: include: an acquisition unit, used for acquiring a first state and a first control signal sequence corresponding to the robotic arm to be controlled at a current time step, wherein each control signal in the first control signal sequence is used to drive the movement of the robotic arm at multiple time steps; the first state is an initial state of the robotic arm before controlling the movement of the robotic arm, or a motion state of the robotic arm during the motion process to the current time step; a prediction unit, configured to input, based on the first state, each control signal in the first control signal sequence into a state prediction model for predicting the state of the robotic arm at the next time step, so as to obtain a predicted state of the robotic arm at each time step; an optimization unit, configured to optimize the first control signal sequence according to the predicted state of the robot arm at each time step and a preset target state to obtain a second control signal sequence, comprising: inputting the target state and the predicted state at each time step into a preset loss function to obtain a loss value output by the loss function, wherein the preset loss function is generated based on the difference between the target state and the predicted state at each time step; optimizing the first control signal sequence based on the principle of reducing the loss value to obtain the second control signal sequence; A control unit, configured to control the movement of the robotic arm according to the second control signal sequence to obtain a second state of the robotic arm at a next time step after the current time step; An updating unit is used to update the first state according to the second state, and to update the first control signal sequence according to the second control signal sequence.

10. An electronic device, characterized in that: include: processor; A memory for storing a method program, wherein when the program is read and executed by a processor, the method according to any one of claims 1 to 8 is executed.

11. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the program is executed, the method according to any one of claims 1 to 8 is performed.

Citation Information

Patent Citations

  • Motion control method, device and system and storage medium

    CN109551485A

  • System and methods for pixel based model predictive control

    CN112135717A

  • Apparatus and methods for object manipulation via action sequence optimization

    US20190321974A1

  • Inferring device, training device, inferring method, and training method

    US20210302926A1

  • Control device, control method, and storage medium

    WO2021171357A1