Control method and device of mechanical arm and electronic equipment
Through the target detection model and back-propagation network, the robotic arm is accurately controlled, which solves the problem of low control accuracy of the robotic arm during live operations on high-voltage transmission lines, and improves the safety and efficiency of operations.
Patent Information
- Application Number
- CN202410862607.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-06
AI Technical Summary
The control accuracy of the robotic arm during live operations on high-voltage transmission lines is low, resulting in large operating errors and affecting the normal operation of the power grid. Manual live maintenance is dangerous and inconvenient for complex line operations.
The target detection model and back-propagation network are used to obtain the original image of the robotic arm's working area, perform target detection to determine the positioning information of the working target, generate joint control variables, accurately control the robotic arm, reduce errors, and improve control accuracy.
It effectively improves the control accuracy of the robotic arm, reduces operating errors, improves operating safety and efficiency in high-voltage environments, and is suitable for live operations on complex power grid lines.
Smart Images

Figure CN118596152A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotic arms, and in particular to a control method, device and electronic equipment for a robotic arm. Background Art
[0002] During the long-term operation of high-voltage transmission lines, they will be subjected to a variety of harsh working environments such as high altitude, high voltage, and strong electromagnetic interference, which will lead to multiple hidden dangers such as pollution and damage of transmission line insulator strings, displacement and damage of anti-vibration keys, broken and scattered wire strands, loose bolts of tension clamps and drain plates, etc. In particular, the heating of the insulator porcelain bottle may even cause the explosion of the insulator steel cap and the breaking of the insulator string. The temperature rise caused by the loosening of the drain plate bolts will not only cause the waste of electric energy, but also cause accidents such as deformation and damage of the tension clamps in severe cases, which will directly affect the normal operation of the power grid. When a transmission line fails, live working is an important technical means to eliminate the fault in time. However, live maintenance is a difficult and dangerous task. At present, these tasks must be completed by multiple operators on and off the tower. There are disadvantages of high labor intensity and high degree of danger. Moreover, with the complexity and diversification of the power grid, a considerable number of lines cannot be manually carried out for live maintenance due to the tight safety distance. Faced with the complex and dangerous line corridor environment, the limitations of manual live working have become increasingly prominent. Therefore, related technologies use robotic arms to perform live working instead of manual labor. However, the error in robotic arm control in related technologies is large, so that repeated operations are required to complete some high-precision operations, resulting in low accuracy in robotic arm control.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] Embodiments of the present invention provide a method, device and electronic device for controlling a robotic arm, so as to at least solve the technical problem of low accuracy of robotic arm control caused by large errors in robotic arm control.
[0005] According to one aspect of an embodiment of the present invention, a control method for a robotic arm is provided, comprising: acquiring an original image of a working area of the robotic arm; performing target detection on the original image using a target detection model to determine positioning information of a working target in the working area, wherein the positioning information is used to characterize spatial position information of the working target relative to the robotic arm; determining a target posture of the robotic arm based on the positioning information of the working target, wherein the robotic arm is used to operate the working target when in the target posture; generating joint control variables of the robotic arm based on the target posture using a back propagation network; and controlling the robotic arm to operate the working target based on the joint control variables.
[0006] Furthermore, the method also includes: obtaining a training posture of the robotic arm; inputting the training posture into the network to be trained to obtain a predicted control variable output by the network to be trained; controlling the movement of the robotic arm based on the predicted control variable to obtain an actual posture of the robotic arm; determining an error of the network to be trained based on the training posture and the actual posture; and adjusting network parameters of the network to be trained based on the error to obtain a feedback propagation network.
[0007] Furthermore, obtaining the training posture of the robotic arm includes: obtaining preset variable ranges of multiple joints of the robotic arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; based on the preset variable ranges of multiple joints, using the kinematics of the robotic arm, determining the training posture.
[0008] Furthermore, the network parameters of the network to be trained are adjusted based on the error to obtain the feedback propagation network, including: processing the error using a gradient descent method to obtain an error gradient; and adjusting the network parameters of the network to be trained based on the error gradient to obtain the feedback propagation network.
[0009] Furthermore, the network parameters of the to-be-trained network are adjusted based on the error gradient to obtain a feedback propagation network, including: determining the current adjustment amount of the network parameters based on the error gradient; obtaining the historical adjustment amount of the network parameters; weighting the current adjustment amount and the historical adjustment amount to obtain a target adjustment amount; and adjusting the network parameters of the to-be-trained network based on the target adjustment amount to obtain a feedback propagation network.
[0010] Furthermore, the target detection model is used to perform target detection on the original image to determine the positioning information of the working target in the working area, including: scaling the original image to obtain the target image; performing target detection on the target image using the target detection model to obtain the recognition result of the working target; and positioning the working target based on the recognition result of the working target to obtain the positioning information of the working target.
[0011] Furthermore, the original image is scaled to obtain a target image, including: determining a scaling factor of the original image based on size information and preset size information of the original image; scaling the original image based on the scaling factor to obtain a scaled image; determining a filling area in the original image based on the original image and the scaled image; and filling the original image based on the filling area to obtain the target image.
[0012] Furthermore, based on the original image and the scaled image, a filling area in the original image is determined, including: obtaining a difference between size information of the scaled image and size information of the original image to obtain a size difference; obtaining a remainder of a ratio of the size difference to a first preset value to obtain a filling area.
[0013] Further, filling the original image based on the filling area to obtain the target image includes: filling the filling area of the original image with a second preset value to obtain the target image.
[0014] Furthermore, based on the positioning information of the work target, the target posture of the robot arm is determined, including: obtaining preset variable ranges of multiple joints of the robot arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; based on the positioning information of the work target and the preset variable ranges of multiple joints, the target posture is determined using the kinematic method of the robot arm.
[0015] According to another aspect of an embodiment of the present invention, a control device for a robotic arm is also provided, including: an acquisition module, used to acquire an original image of a working area of the robotic arm; a detection module, used to perform target detection on the original image using a target detection model, and determine the positioning information of the working target in the working area, wherein the positioning information is used to characterize the spatial position information of the working target relative to the robotic arm; a determination module, used to determine the target posture of the robotic arm based on the positioning information of the working target, wherein the robotic arm is used to operate the working target when it is in the target posture; a generation module, used to generate joint control variables of the robotic arm based on the target posture using a back propagation network; and a control module, used to control the robotic arm to operate the working target based on the joint control variables.
[0016] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.
[0017] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0018] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0019] In an embodiment of the present invention, an original image of the working area of the robot arm is obtained; a target detection model is used to perform target detection on the original image to determine the positioning information of the working target in the working area; based on the positioning information of the working target, the target posture of the robot arm is determined; based on the target posture, a back propagation network is used to generate joint control variables of the robot arm; based on the joint control variables, the robot arm is controlled to operate the working target. The present application establishes a target monitoring model to perform target detection on the original image of the working area of the robot arm to accurately determine the positioning information of the working target in the working area, so that a more accurate target posture of the robot arm can be obtained, and the control variables of the robot arm can be accurately obtained through the target posture of the robot arm to accurately control the robot arm, thereby achieving the purpose of reducing the control error of the robot arm, thereby achieving the technical effect of effectively improving the control accuracy of the robot arm, and then solving the technical problem of low control accuracy of the robot arm caused by large control errors of the robot arm. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 is a flow chart of an optional method for controlling a robotic arm according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of an optional three-layer back propagation network topology structure according to an embodiment of the present invention;
[0023] Figure 3 is a flow chart of an optional feedback propagation network determination method according to an embodiment of the present invention;
[0024] Figure 4 It is a schematic structural diagram of an optional control device for a robotic arm according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to an embodiment of the present invention, an embodiment of a method for controlling a robotic arm is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0029] Step S102, obtaining an original image of the working area of the robot arm.
[0030] The above-mentioned robot arm refers to an automated device widely used in the fields of industry, medical treatment, scientific research, etc. It performs various tasks such as handling, assembly, welding, spraying, etc. by simulating the movement of human arms. The robot arm in this application refers to a robot arm used for fixed-point operations, especially a robot arm used for live operations on high-voltage transmission lines.
[0031] The above-mentioned operation area refers to the area where the robot arm performs operations. In the present application, the operation area refers to the area in the high-voltage transmission line where live operations need to be performed.
[0032] The above-mentioned original image refers to the original image of the robot arm working area directly obtained by shooting or other means, including but not limited to the point cloud map of the robot arm working area obtained through point cloud, or the image of the robot arm working area taken by a camera device.
[0033] In an optional embodiment, a point cloud image of the working area of the robot arm can be obtained by using a laser radar, and the obtained point cloud image can be used as the original image of the working area of the robot arm.
[0034] In another optional embodiment, the image of the working area of the robot arm can also be acquired through a camera, and the acquired image can be used as the original image of the working area of the robot arm.
[0035] Step S104, using the target detection model to perform target detection on the original image, and determine the positioning information of the working target in the working area, wherein the positioning information is used to characterize the spatial position information of the working target relative to the robot arm.
[0036] The above-mentioned target detection model refers to a pre-set algorithm model for identifying and locating specific targets in an image, including but not limited to: Convolutional Neural Network (CNN), You Only Look Once (YOLO), Feature Pyramid Network (FPN), etc. In the present application, the above-mentioned target detection model is a target detection model for determining the positioning information of the operating target in the operating area. Among them, the original image is input to the target monitoring model, and the output result is the positioning information of the operating target in the operating area. Among them, the above-mentioned target detection model can be set according to the parameters and state of the robotic arm, the above-mentioned target monitoring model can also be manually set according to experience and needs, and the above-mentioned target monitoring model can also be set according to the actual application scenario.
[0037] The above-mentioned operation target refers to the operation target of the robot arm. In the present application, the operation target refers to the target that requires live operation in the high-voltage transmission line.
[0038] The above positioning information refers to the spatial position information of the work target relative to the robotic arm. The above positioning information is used to characterize the positional relationship between the work target and the robotic arm, and is used to determine the position of the robotic arm when the robotic arm is performing work.
[0039] In an optional embodiment, a convolutional neural network can be selected as a target detection model, and after obtaining the original image of the working area of the robot arm, the original image is scaled and processed to obtain the target image, and the target image is detected by the convolutional neural network to obtain the recognition result of the working target, and the working target is located by a binocular ranging method based on the recognition result of the working target to determine the spatial position information of the working target relative to the robot arm. For example, the original image is scaled and processed to obtain the target image, and the target image is detected by the convolutional neural network to obtain the recognition result of the working target, and the coordinate information of the working target of the high-voltage transmission line is obtained based on the recognition result of the working target.
[0040] In another optional embodiment, a single detection model can also be selected as the target detection model, and after obtaining the original image of the working area of the robot arm, the original image is scaled and processed to obtain the target image, and the original image is subjected to target detection through the single detection model to obtain the recognition result of the working target, and the working target is located by the binocular ranging method based on the recognition result of the working target to determine the spatial position information of the working target relative to the robot arm. For example, the original image is scaled and processed to obtain the target image, and the original image is subjected to target detection through the single detection model to obtain the recognition result of the working target, and the coordinate information of the working target of the high-voltage transmission line is obtained based on the recognition result of the working target.
[0041] In the present application, target detection is performed on the original image of the robot arm's working area through a pre-set target detection model to accurately obtain the spatial position information of the working target relative to the robot arm, thereby effectively improving the accuracy of the robot arm's control.
[0042] Step S106, determining a target posture of the robot arm based on the positioning information of the work target, wherein the robot arm is used to operate the work target when it is in the target posture.
[0043] The above-mentioned target posture refers to the position and posture of the robot arm when performing live operations on high-voltage transmission lines. When the robot arm is in the target posture, it operates the operation target of the high-voltage transmission line.
[0044] In an optional embodiment, after obtaining the positioning information of the work target, the kinematic equation is used to calculate the target posture of the robotic arm for operating the work target based on the positioning information of the work target and the variable range of each joint of the robotic arm, and the robotic arm operates the work target when it is in the target posture.
[0045] In the present application, the target posture of the manipulator operating the operating target of the high-voltage transmission line is accurately determined based on the positioning information of the operating target, which effectively improves the accuracy of the target posture of the manipulator operating the operating target of the high-voltage transmission line.
[0046] Step S108, using a back propagation network to generate joint control variables of the robotic arm based on the target posture.
[0047] The back propagation (BP) network is a deep learning artificial neural network. In the present application, the target posture is input into the back propagation network to obtain the robot arm joint control variables.
[0048] The above-mentioned joint control variables refer to control quantities used to control the robot arm to operate the work target. In response to the robot arm being in the target posture, the robot arm is controlled to operate the work target through the joint control variables of the robot arm.
[0049] In an optional embodiment, after obtaining the target posture of the robot arm, a back propagation network is used to generate joint control variables of the robot arm based on the target posture. Figure 2 is a schematic diagram of an optional three-layer back propagation network topology structure according to an embodiment of the present invention, such as Figure 2 As shown in the figure, the target posture of the robot arm enters the back propagation network through the input layer, and after calculation through the hidden layer, the joint control variables of the robot arm are output through the output layer.
[0050] In this application, the robot arm joint control variables are accurately obtained through the back propagation network, making the control of the robot arm more accurate, effectively improving the accuracy of the robot arm control, and improving the user experience.
[0051] Step S110, controlling the robot arm to operate the work target based on the joint control variables.
[0052] In an optional embodiment, after obtaining the robot arm joint control variables, the robot arm is controlled to operate the working target based on the robot arm joint control variables.
[0053] Through the above steps, the original image of the working area of the robot arm is obtained; the target detection model is used to perform target detection on the original image to determine the positioning information of the working target in the working area; based on the positioning information of the working target, the target posture of the robot arm is determined; based on the target posture, the joint control variables of the robot arm are generated by the back propagation network; based on the joint control variables, the robot arm is controlled to operate the working target. The present application establishes a target monitoring model to perform target detection on the original image of the working area of the robot arm to accurately determine the positioning information of the working target in the working area, so that a more accurate target posture of the robot arm can be obtained, and the control variables of the robot arm can be accurately obtained through the target posture of the robot arm to accurately control the robot arm, thereby achieving the purpose of reducing the control error of the robot arm, thereby achieving the technical effect of effectively improving the control accuracy of the robot arm, and then solving the technical problem of low control accuracy of the robot arm caused by large control errors of the robot arm.
[0054] Optionally, the method also includes: obtaining a training posture of the robotic arm; inputting the training posture into the network to be trained to obtain a predicted control variable output by the network to be trained; controlling the movement of the robotic arm based on the predicted control variable to obtain an actual posture of the robotic arm; determining an error of the network to be trained based on the training posture and the actual posture; and adjusting network parameters of the network to be trained based on the error to obtain a feedback propagation network.
[0055] The training network is an untrained feedback propagation network, wherein the training network is trained to perform learning optimization to obtain a feedback propagation network, wherein the training network has lower accuracy than the feedback propagation network.
[0056] The training posture refers to the posture for training the training network, and the training posture can be any posture of the robot. The training posture can be set according to the parameters and state of the robot, the training posture can also be set manually according to experience and needs, and the training posture can also be set according to the actual application scenario.
[0057] The above-mentioned predictive control variable refers to the control amount for controlling the robot arm obtained by inputting the training posture into the training network. Among them, the above-mentioned predictive control variable is used to control the robot arm to reach the training posture.
[0058] The above-mentioned actual posture refers to the actual position and posture that the robot arm reaches based on the predicted control variables. There is usually an error between the actual posture and the training posture. Therefore, it is necessary to train the training network based on the error to obtain a feedback propagation network.
[0059] In an optional embodiment, preset variable ranges of multiple joints of the robotic arm are obtained, and the motion ranges of corresponding nodes of the joints are determined. Based on the preset variable ranges of the multiple joints, the training posture is manually determined according to actual conditions, and the determined training posture is input into the network to be trained. The network to be trained outputs predicted control variables, and the movement of the robotic arm is controlled based on the predicted control variables. After the movement of the robotic arm stops, the actual posture of the robotic arm at this time is determined, and the actual posture is compared with the coordinates and other values of the training posture to obtain the error of the training network, and the error gradient is determined based on the error. After the error gradient is obtained, the network parameters of the network to be trained are adjusted based on the error gradient to obtain a feedback propagation network.
[0060] In the present application, the training posture is set to obtain the predicted control variables, and the actual posture of the robotic arm is obtained through the predicted control variables. The training posture is compared with the actual posture to obtain the error of the network to be trained, and the network parameters of the training network are adjusted according to the error of the network to be trained to obtain a more accurate feedback propagation network, which effectively improves the accuracy of the feedback propagation network, makes the acquisition of the joint control variables of the robotic arm more accurate, effectively improves the accuracy of the robotic arm control, and improves the user experience.
[0061] Optionally, obtaining the training posture of the robotic arm includes: obtaining preset variable ranges of multiple joints of the robotic arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; based on the preset variable ranges of multiple joints, using the kinematics of the robotic arm, determining the training posture.
[0062] The above-mentioned preset variable range refers to the movement range of the nodes corresponding to the multiple joints of the robot arm. The nodes of the robot arm can only move within the movement range of the nodes. If the preset variable exceeds the preset variable range, it may cause the corresponding joint of the robot arm to move to the limit, or even damage the robot arm. The above-mentioned preset variable range is set according to the parameters and status of the robot arm.
[0063] The kinematic mode of the above-mentioned robot arm refers to the mode of movement of the robot arm, including the route and speed of the movement of the robot arm. The kinematic mode of the above-mentioned robot arm is determined by the parameters and state of the robot arm.
[0064] In an optional embodiment, the preset variable ranges of the multiple joints of the robotic arm are obtained, wherein the preset variable ranges are used to characterize the motion ranges of the multiple nodes corresponding to the multiple joints of the robotic arm. The nodes of the robotic arm can only move within the motion ranges of the nodes. If the preset variables exceed the preset variable ranges, it may cause the corresponding joints of the robotic arm to move to the limit, or even damage the robotic arm. After obtaining the preset variable ranges of the multiple joints of the robotic arm, the motion mode of the robotic arm is determined based on information such as the route and speed of the robotic arm's motion, and the training posture is determined based on the motion mode of the robotic arm.
[0065] In the present application, a preset variable range is used to prevent the node movement corresponding to the joint of the robot arm from exceeding the movement range of the node, so as to ensure the safety of the movement of the robot arm.
[0066] Optionally, adjusting the network parameters of the network to be trained based on the error to obtain the feedback propagation network includes: processing the error using a gradient descent method to obtain an error gradient; adjusting the network parameters of the network to be trained based on the error gradient to obtain the feedback propagation network.
[0067] The above-mentioned gradient descent method refers to using the first-order derivative information of the error, weight and threshold to guide the adjustment direction of the next weight, so as to minimize the error in the end.
[0068] In an optional embodiment, after obtaining the error between the training posture and the actual posture, the error is processed using the gradient descent method to obtain the error gradient. The current adjustment amount of the network parameter is determined based on the error gradient, and the historical adjustment amount of the network parameter is obtained. The current adjustment amount and the historical adjustment amount are weighted to obtain the target adjustment amount, and the network parameters of the to-be-trained network are adjusted based on the target adjustment amount to obtain the feedback propagation network.
[0069] In this application, the error is processed by the gradient descent method to obtain the error gradient, and the current adjustment amount of the network parameters is obtained by the error gradient. Combined with the historical adjustment amount, a more accurate target adjustment amount is obtained compared to the current adjustment amount. The network parameters are adjusted by the target adjustment amount to quickly obtain the feedback propagation network, which effectively improves the efficiency of the robot arm control and enhances the user experience.
[0070] Optionally, the network parameters of the network to be trained are adjusted based on the error gradient to obtain a feedback propagation network, including: determining the current adjustment amount of the network parameters based on the error gradient; obtaining the historical adjustment amount of the network parameters; weighting the current adjustment amount and the historical adjustment amount to obtain a target adjustment amount; adjusting the network parameters of the network to be trained based on the target adjustment amount to obtain a feedback propagation network.
[0071] The above-mentioned current adjustment amount refers to the adjustment amount of the network parameters in the training network currently calculated by the error gradient, wherein the current adjustment amount includes the current hidden layer adjustment amount and the current output layer adjustment amount.
[0072] The above-mentioned historical adjustment amount refers to the adjustment amount of the network parameters in the training network calculated by the error gradient before adjusting the network parameters this time, wherein the historical adjustment amount includes the historical hidden layer adjustment amount and the historical output layer adjustment amount.
[0073] The target adjustment amount refers to the adjustment amount of the network parameter obtained by weighting the current adjustment amount and the historical adjustment amount, wherein the target adjustment amount is more accurate than the current adjustment amount.
[0074] In an optional embodiment, to ensure the convergence of the training network algorithm, the learning rate of the training network must be less than the preset error limit. This determines that the convergence speed of the training network algorithm cannot be very fast. When approaching the minimum value, the algorithm converges more and more slowly because the gradient change value gradually tends to zero. A part of the historical adjustment amount is superimposed on the current adjustment amount obtained by the current error calculation, and the network parameters are adjusted as the target adjustment amount this time. Among them, the training posture X p The p-th training pose (p=1,2,3,…,n) is input into the training network to obtain the predicted control variable Y p (p=1,2,3,…,m). The square error function is used to obtain the error between the pth training pose and the actual pose. The calculation formula for the error between the pth training pose and the actual pose is as follows:
[0075]
[0076] Among them, t j is the expected prediction control variable, E pis the error between the pth training pose and the actual pose. For n training poses, the global error is:
[0077]
[0078] Among them, E is the global error, E p is the error between the pth training pose and the actual pose, t j is the expected prediction control variable. When the global error E becomes smaller, the cumulative error can be used to adjust the weight change of the output layer of the training network, that is:
[0079]
[0080] Among them, W jk is the weight of the output layer, ΔW jk is the adjustment amount of the output layer of the training network, η is the learning rate, E p is the error between the pth training pose and the actual pose, and E is the global error, so the error formula is:
[0081]
[0082] in, is the error caused by the jth predicted control variable, E p is the error between the pth training pose and the actual pose, Y j is the jth prediction control variable. Among them:
[0083]
[0084] Among them, t j is the expected prediction control variable, E p is the error between the pth training pose and the actual pose, Y j is the jth predictor control variable.
[0085] Therefore, the error caused by the jth predictor control variable is It can also be expressed as:
[0086]
[0087] According to the chain theorem:
[0088]
[0089] Among them, E p is the error between the pth training pose and the actual pose, t j is the expected predictor control variable, Y j is the jth predictor control variable, W jk is the weight of the output layer.
[0090] Therefore, the adjustment formula for the output layer of the training network is:
[0091]
[0092] Where, ΔW jk is the adjustment amount of the output layer of the training network, t j is the expected predictor control variable, Y j is the jth predictor control variable.
[0093] The adjustment formula of the hidden layer is as follows:
[0094]
[0095] V ki is the weight of the hidden layer, ΔV ki is the adjustment amount of the hidden layer, η is the learning rate, E p is the error between the pth training pose and the actual pose, and E is the global error.
[0096] Therefore the error can also be defined as:
[0097]
[0098] Among them, E p is the error between the pth training pose and the actual pose, and E is the global error.
[0099]
[0100] According to the chain theorem:
[0101]
[0102] because:
[0103]
[0104] You can get:
[0105]
[0106] in, is the error, E p is the error between the pth training pose and the actual pose, E is the global error, is the error caused by the kth predictor control variable.
[0107] Among them, the adjustment amount of the hidden layer of the training network can be expressed as:
[0108]
[0109] Where, ΔV kiis the adjustment amount of the hidden layer of the training network, η is the learning rate, t j is the expected predictor control variable, Y j is the jth predictor control variable, W jk is the weight of the output layer.
[0110] The current hidden layer adjustment amount, the current output layer adjustment amount, the historical hidden layer adjustment amount and the historical output layer adjustment amount are obtained respectively, the target adjustment amount is obtained in a weighted manner, and the network parameters of the network to be trained are adjusted based on the target adjustment amount to obtain a feedback propagation network.
[0111] In this application, by obtaining the current hidden layer adjustment amount, the current output layer adjustment amount, the historical hidden layer adjustment amount and the historical output layer adjustment amount, the target adjustment amount is obtained in a weighted manner, and the network parameters of the training network are adjusted based on the target adjustment amount to obtain a feedback propagation network. This makes the accuracy of the feedback propagation network higher, effectively improving the accuracy of the robot arm control.
[0112] Optionally, a target detection model is used to perform target detection on the original image to determine the positioning information of the working target in the working area, including: scaling the original image to obtain a target image; performing target detection on the target image using the target detection model to obtain a recognition result of the working target; and positioning the working target based on the recognition result of the working target to obtain the positioning information of the working target.
[0113] In an optional embodiment, after obtaining the original image, since the sizes of different original images are different, it is necessary to scale all original images to a standard size before detection. Therefore, the original image is scaled to obtain the target image, and the target detection model is used to perform target detection on the target image to obtain the recognition result of the working target, and the working target is located based on the recognition result of the working target to obtain the positioning information of the working target.
[0114] In the present application, by scaling the original image, original images of different sizes can be adjusted to the same size, thereby effectively improving the applicability of detecting the original image.
[0115] Optionally, the original image is scaled to obtain a target image, including: determining a scaling factor of the original image based on size information and preset size information of the original image; scaling the original image based on the scaling factor to obtain a scaled image; determining a filling area in the original image based on the original image and the scaled image; and filling the original image based on the filling area to obtain the target image.
[0116] The above-mentioned preset size information refers to a pre-set size standard for unifying the original image size, wherein the above-mentioned preset size information can be set according to the parameters and status of the target detection model, the above-mentioned preset size information can also be set manually according to experience and needs, and the above-mentioned preset size information can also be set according to the actual application scenario.
[0117] The padding area is to prevent the original image from being compressed or stretched and changing its aspect ratio after being scaled. Therefore, the padding area is determined so that the original image can be scaled without changing its aspect ratio.
[0118] In an optional embodiment, a scaling factor of the original image is determined based on size information of the original image and pre-set preset size information, the original image is scaled based on the scaling factor to obtain a scaled image, and in order to prevent the original image from being compressed or stretched and the aspect ratio of the original image from being changed, a filling area in the original image is determined based on the original image and the scaled image, and the original image is filled based on the filling area to obtain a target image.
[0119] In the present application, a filling area in the original image is determined based on the original image and the scaled image, and the original image is filled based on the filling area to obtain a target image, so as to prevent the original image from being compressed or stretched and changing the aspect ratio of the original image, thereby effectively improving the accuracy of the target image.
[0120] Optionally, based on the original image and the scaled image, determining the filling area in the original image includes: obtaining the difference between size information of the scaled image and size information of the original image to obtain the size difference; obtaining the remainder of the ratio of the size difference to a first preset value to obtain the filling area.
[0121] The first preset value refers to a preset value used to determine the size of the filling area, wherein the above-mentioned first preset value can be set according to preset size information, the above-mentioned first preset value can also be set manually according to experience and needs, and the above-mentioned first preset value can also be set according to actual application scenarios.
[0122] In an optional embodiment, the difference between the size information of the scaled image and the size information of the original image is obtained to obtain the size difference, and the remainder of the ratio of the size difference to the first preset value is used to obtain the value to be filled and determine the filling area.
[0123] In the present application, the difference between the size information of the scaled image and the size information of the original image is obtained to obtain the size difference, so as to quickly obtain the value that needs to be filled and determine the filling area, thereby effectively improving the efficiency of the robot arm control.
[0124] Optionally, filling the original image based on the filling area to obtain the target image includes: filling the filling area of the original image with a second preset value to obtain the target image.
[0125] The above-mentioned second preset value refers to a preset value used to fill the filling area of the original image, wherein the above-mentioned second preset value can be set according to the preset size information, the above-mentioned second preset value can also be set manually according to experience and needs, and the above-mentioned second preset value can also be set according to the actual application scenario.
[0126] In an optional embodiment, after the filling area of the original image is determined, the second preset value is filled in the filling area of the original image to obtain the target image.
[0127] In the present application, the filling area of the original image is filled by setting a second preset value, so that the original image can be filled in a standardized manner to prevent errors in obtaining positioning information of the work target due to uneven filling.
[0128] Optionally, based on the positioning information of the work target, the target posture of the robot arm is determined, including: obtaining preset variable ranges of multiple joints of the robot arm, wherein the preset variable ranges are used to characterize the motion range of corresponding nodes; based on the positioning information of the work target and the preset variable ranges of multiple joints, the target posture is determined using the kinematic method of the robot arm.
[0129] In an optional embodiment, preset variable ranges of multiple joints of the robotic arm are obtained, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; based on the positioning information of the work target and the preset variable ranges of multiple joints, the target posture is determined using the kinematics of the robotic arm.
[0130] In the present application, the target posture is accurately determined by the kinematic method of the robot arm, which effectively improves the accuracy of the target posture determination.
[0131] Combine the following Figure 3 An optional feedback propagation network determination method of the present invention is described in detail, wherein: Figure 3 is a flow chart of an optional feedback propagation network determination method according to an embodiment of the present invention, such as Figure 3 As shown, the feedback propagation network determination method includes the following steps:
[0132] Step S301, initializing the training network.
[0133] In an optional embodiment, the training network is initialized.
[0134] Step S302, determine the training posture and predict the control variables, and input the training posture into the network to be trained.
[0135] In an optional embodiment, the preset variable ranges of multiple joints of the robotic arm are obtained to determine the motion ranges of the corresponding nodes of the joints. Based on the preset variable ranges of the multiple joints, the training posture is manually determined according to actual conditions. After the training posture is determined, the training posture is input into the training network.
[0136] Step S303, obtaining the predicted control variables output by the network to be trained.
[0137] In an optional embodiment, the determined training posture is input into the network to be trained, and the network to be trained outputs the predicted control variable.
[0138] Step S304, obtaining the error of the network to be trained based on the training pose and the actual pose.
[0139] In an optional embodiment, after the network to be trained outputs the predicted control variables, the movement of the robotic arm is controlled based on the predicted control variables. After the movement of the robotic arm stops, the actual posture of the robotic arm at this time is determined, and the actual posture is compared with the coordinates and other values of the training posture to obtain the error of the network to be trained.
[0140] Step S305: whether the error is less than the upper limit of the error.
[0141] In an optional embodiment, in response to the error being less than a preset upper limit of the error, step S306 is performed, and in response to the error being greater than or equal to the preset upper limit of the error, step S307 is performed.
[0142] Step S306: Check whether all errors are less than the upper error limit.
[0143] In an optional embodiment, in response to all errors being less than a preset upper error limit, step S310 is performed, and in response to at least one of all errors being greater than or equal to a preset upper error limit, step S307 is performed.
[0144] Step S307, calculating the hidden layer error.
[0145] In an optional embodiment, in response to at least one of all errors being greater than or equal to a preset upper error limit, or the error being greater than or equal to a preset upper error limit, the error of the hidden layer in the training network is calculated.
[0146] Step S308, calculating the error gradient.
[0147] In an optional embodiment, the error is processed using a gradient descent method to obtain an error gradient.
[0148] Step S309, obtaining the target adjustment amount.
[0149] In an optional embodiment, to ensure the convergence of the training network algorithm, the learning rate of the training network must be less than a preset error upper limit. This determines that the convergence speed of the training network algorithm cannot be very fast. When approaching the minimum value, the convergence of the algorithm becomes slower and slower because the gradient change value gradually approaches zero. A part of the historical adjustment amount is superimposed on the current adjustment amount obtained by calculating the current error, the target adjustment amount is obtained, the network parameters are adjusted, and then step S303 is performed.
[0150] Step S310, determining a feedback propagation network.
[0151] According to an embodiment of the present invention, an embodiment of a control device for a robotic arm is provided. It should be noted that the device can be used to execute the control method for the robotic arm mentioned above. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.
[0152] Figure 4 is a schematic diagram of the structure of an optional control device for a robotic arm according to an embodiment of the present invention, such as Figure 4 As shown, the control device of the robot arm includes: an acquisition module 30, which is used to acquire an original image of the working area of the robot arm; a detection module 32, which is used to perform target detection on the original image using a target detection model, and determine the positioning information of the working target in the working area, wherein the positioning information is used to characterize the spatial position information of the working target relative to the robot arm; a determination module 34, which is used to determine the target posture of the robot arm based on the positioning information of the working target, wherein the robot arm is used to operate the working target when it is in the target posture; a generation module 36, which is used to generate joint control variables of the robot arm based on the target posture using a back propagation network; and a control module 38, which is used to control the robot arm to operate the working target based on the joint control variables.
[0153] Optionally, the device also includes: a first posture module, used to obtain the training posture of the robotic arm; a prediction module, used to input the training posture into the network to be trained to obtain the predicted control variables output by the network to be trained; a second posture module, used to control the movement of the robotic arm based on the predicted control variables to obtain the actual posture of the robotic arm; an error module, used to determine the error of the network to be trained based on the training posture and the actual posture; and an adjustment module, used to adjust the network parameters of the network to be trained based on the error to obtain a feedback propagation network.
[0154] Optionally, the first posture module includes: a range unit, used to obtain preset variable ranges of multiple joints of the robotic arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; a posture unit, used to determine the training posture based on the preset variable ranges of multiple joints and using the kinematics of the robotic arm.
[0155] Optionally, the adjustment module includes: a gradient unit, which is used to process the error using a gradient descent method to obtain an error gradient; and an adjustment unit, which is used to adjust the network parameters of the network to be trained based on the error gradient to obtain a feedback propagation network.
[0156] Optionally, the adjustment unit includes: an acquisition subunit, used to determine the current adjustment amount of the network parameter based on the error gradient; a history subunit, used to obtain the historical adjustment amount of the network parameter; an adjustment quantum unit, used to weight the current adjustment amount and the historical adjustment amount to obtain the target adjustment amount; an adjustment subunit, used to adjust the network parameters of the network to be trained based on the target adjustment amount to obtain a feedback propagation network.
[0157] Optionally, the detection module includes: a scaling unit, used to scale the original image to obtain a target image; a recognition unit, used to perform target detection on the target image using a target detection model to obtain a recognition result of the working target; and a positioning unit, used to locate the working target based on the recognition result of the working target to obtain positioning information of the working target.
[0158] Optionally, the scaling unit includes: a scaling factor subunit, used to determine the scaling factor of the original image based on the size information of the original image and preset size information; a scaling subunit, used to scale the original image based on the scaling factor to obtain a scaled image; a determination subunit, used to determine a filling area in the original image based on the original image and the scaled image; and a filling subunit, used to fill the original image based on the filling area to obtain a target image.
[0159] Optionally, the determination subunit is further configured to obtain a difference between size information of the scaled image and size information of the original image to obtain a size difference; and obtain a remainder of a ratio of the size difference to a first preset value to obtain a filling area.
[0160] Optionally, the filling subunit is further configured to fill a second preset value in a filling area of the original image to obtain a target image.
[0161] Optionally, the determination module includes: a motion unit, used to obtain preset variable ranges of multiple joints of the robotic arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; a range unit, used to determine the target posture based on the positioning information of the work target and the preset variable ranges of multiple joints, using the kinematics of the robotic arm.
[0162] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0163] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0164] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0165] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0166] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0167] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0168] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0169] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-On lyMemory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0171] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for controlling a robotic arm, characterized in that: include: Acquire the original image of the working area of the robot arm; Performing target detection on the original image using a target detection model to determine positioning information of the working target in the working area, wherein the positioning information is used to characterize spatial position information of the working target relative to the robotic arm; Determining a target posture of the robotic arm based on the positioning information of the work target, wherein the robotic arm is used to operate the work target when in the target posture; Generate joint control variables of the robotic arm based on the target posture using a back propagation network; The robot arm is controlled to operate the work target based on the joint control variable.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining a training posture of the robotic arm; Inputting the training posture into the network to be trained to obtain the predicted control variable output by the network to be trained; Control the movement of the robotic arm based on the predicted control variable to obtain the actual position and posture of the robotic arm; Determining an error of the network to be trained based on the training pose and the actual pose; The network parameters of the network to be trained are adjusted based on the error to obtain the feedback propagation network.
3. The method according to claim 2, characterized in that Obtaining the training posture of the robotic arm, including: Acquire preset variable ranges of multiple joints of the robotic arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; Based on the preset variable ranges of the multiple joints, the training posture is determined using the kinematics of the robotic arm.
4. The method according to claim 2, characterized in that: Adjusting the network parameters of the network to be trained based on the error to obtain the feedback propagation network includes: Processing the error using a gradient descent method to obtain an error gradient; The network parameters of the network to be trained are adjusted based on the error gradient to obtain the feedback propagation network.
5. The method according to claim 4, characterized in that Adjusting the network parameters of the network to be trained based on the error gradient to obtain the feedback propagation network includes: Based on the error gradient, determining a current adjustment amount of the network parameter; Obtaining historical adjustment values of the network parameters; Performing weighted processing on the current adjustment amount and the historical adjustment amount to obtain a target adjustment amount; The network parameters of the network to be trained are adjusted based on the target adjustment amount to obtain the feedback propagation network.
6. The method according to claim 1, characterized in that Performing target detection on the original image using a target detection model to determine the positioning information of the operating target in the operating area includes: Scaling the original image to obtain a target image; Performing target detection on the target image using the target detection model to obtain a recognition result of the operation target; The operation target is positioned based on the recognition result of the operation target to obtain the positioning information of the operation target.
7. The method according to claim 6, characterized in that Scaling the original image to obtain a target image includes: Determining a scaling factor of the original image based on the size information of the original image and the preset size information; Scaling the original image based on the scaling factor to obtain a scaled image; Determining a fill area in the original image based on the original image and the zoomed image; The original image is filled based on the filling area to obtain the target image.
8. The method according to claim 7, characterized in that Determining a fill area in the original image based on the original image and the scaled image includes: Obtaining a difference between the size information of the scaled image and the size information of the original image to obtain a size difference; The remainder of the ratio of the size difference to the first preset value is obtained to obtain the filling area.
9. The method according to claim 7, characterized in that: Filling the original image based on the filling area to obtain the target image includes: The target image is obtained by filling the filling area of the original image with a second preset value.
10. The method according to claim 1, characterized in that Determining a target position of the robot arm based on the positioning information of the operation target includes: Acquire preset variable ranges of multiple joints of the robotic arm, wherein the preset variable ranges are used to characterize the motion ranges of corresponding nodes; Based on the positioning information of the work target and the preset variable ranges of the multiple joints, the target posture is determined using the kinematics of the robotic arm.
11. A control device for a robotic arm, characterized in that: include: An acquisition module, used to acquire an original image of the working area of the robot arm; A detection module, used to perform target detection on the original image using a target detection model, and determine the positioning information of the working target in the working area, wherein the positioning information is used to represent the spatial position information of the working target relative to the robotic arm; A determination module, configured to determine a target posture of the robotic arm based on the positioning information of the operating target, wherein the robotic arm is configured to operate the operating target when in the target posture; A generation module, used for generating joint control variables of the robotic arm based on the target posture by using a back propagation network; A control module is used to control the robot arm to operate the working target based on the joint control variable.
12. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 10 when running.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 10.
14. A computer program product, characterized in that It comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 10.
