Hydraulic mechanical arm control method and system based on optimized BP neural network
By applying ASWO optimization algorithm in BP neural network, adaptively adjusting algorithm parameters to adapt to the optimization process, the problem that BP neural network is prone to fall into local optimality in the inverse solution of hydraulic robot arm, and achieves higher control accuracy.
Patent Information
- Application Number
- CN202411738281.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, BP neural networks are prone to fall into local optimality when processing the inverse solution of hydraulic robot arms, and it is difficult to find the global optimal solution, resulting in limited control accuracy.
The initial weight and bias of the BP neural network are optimized by using the ASWO optimization algorithm, and the population size, trade-off rate and cross-rate are adaptively adjusted, and the exploration strategy is dynamically adjusted to adapt to different stages of optimization.
It effectively improves the performance of the BP neural network, allowing it to perform reverse solution and control of hydraulic robot arms more accurately, significantly improving control accuracy.
Smart Images

Figure CN119526400A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of hydraulic mechanical arm control, in particular to a hydraulic mechanical arm control method and system based on an optimized BP neural network. Background Art
[0002] The rapid growth of tunnel construction has dramatically increased the demand for large hydraulic manipulators. However, due to the deflection error caused by the huge bearing capacity of the hydraulic manipulator, the end control accuracy is difficult to guarantee. The inverse kinematics of the manipulator directly restricts the control speed and accuracy of the manipulator. Artificial neural networks are widely used in the inverse solution of complex manipulators because of their powerful mapping capabilities, avoiding complex calculation processes, and meeting real-time control requirements. The commonly used neural network is mainly the BP neural network. However, when dealing with multi-peak high-dimensional problems, the BP neural network is prone to fall into the local optimum and it is difficult to find the global optimal solution, resulting in limited accuracy when it is actually used to control the hydraulic manipulator.
[0003] Metaheuristic algorithms are more efficient in solving complex nonlinear problems, and therefore can overcome the shortcoming of BP neural networks that they are prone to fall into local optimality. Such methods in the prior art are also gradually developing. For example, (1) the literature "Bai, Yonghua et al. "An Algorithm for Solving Robot Inverse Kinematics Based on FOA Optimized BP Neural Network." Applied Sciences (2021): n. pag." uses the fruit fly optimization algorithm (FOA) to optimize the initial weight bias of the BP neural network to avoid the BP neural network from falling into local extreme values; (2) the literature "Rokbani N, Casals A, Alimi AM. IK-FA, a new heuristic inverse kinematics solver using firefly algorithm. Comput Intell Appl Model Control. 2015; 575: 369–395." proposes a new method for inverse kinematics solution of a three-joint robot arm based on the firefly algorithm (FA); (3) the literature "Jiang, Guanwu et al. "A Precise Positioning Method for a Puncture Robot Based on a PSO-Optimized BP Neural Network Algorithm." Applied Sciences 7(2017):969.” This paper provides a BP neural network algorithm based on particle swarm optimization (PSO) to solve the inverse solution problem of the robotic arm and improve the convergence accuracy and speed of the neural network.
[0004] However, existing metaheuristic algorithms are often constrained by preset fixed algorithm parameters when dealing with multi-peak high-dimensional problems, resulting in a lack of adaptability of the algorithm and an inability to effectively adjust the exploration strategy to adapt to different stages of optimization, resulting in limited optimization effects on BP neural networks. Summary of the invention
[0005] In order to address the deficiencies in the prior art, the present invention provides a hydraulic robotic arm control method and system based on an optimized BP neural network, optimizes the BP neural network based on the ASWO optimization algorithm, and uses the optimized BP neural network to inversely solve and control the hydraulic robotic arm, thereby effectively improving the control accuracy of the hydraulic robotic arm.
[0006] In order to achieve the above object, the specific scheme adopted by the present invention is: a hydraulic mechanical arm control method based on an optimized BP neural network, comprising the following steps: The acquired terminal target posture is input into the pre-trained optimized BP neural network, and the optimized BP neural network is used for inverse solution to obtain the joint motion data; generating control instructions based on the joint motion data, and controlling the joints of the hydraulic manipulator based on the control instructions; Among them, the generation method of optimizing the BP neural network includes: Construct an ASWO (Adaptive spider wasp optimizer) optimization model and determine the initial key parameters in the ASWO optimization model, including population size N, trade-off rate TR and crossover rate CR; Based on the mechanical structure of the hydraulic manipulator and the inverse solution requirements, the BP neural network topology and the number of weight parameters and bias parameters required are determined, and the position of the spider bee individuals is iterated using the ASWO optimization model; Calculate the average fitness change rate during the iteration of the ASWO optimization model, and dynamically adjust the initial key parameters based on the average fitness change rate; When the preset termination condition is reached, the iteration of the ASWO model is terminated, and the optimized weight parameters and bias parameters are output; the optimized weight parameters and bias parameters are used as the basic weight parameters and basic bias parameters of the BP neural network, and the BP neural network is trained according to the inverse solution data set to obtain the optimized BP neural network.
[0007] As a further optimization of the above hydraulic manipulator control method based on the optimized BP neural network, the specific method for iterating the position of the spider bee individual is: The spider bee individuals are sequentially made to go through the search phase, the following phase, the nest-building phase and the mating phase to complete the iteration of the position; The location update method in the search phase is: The position update method in the following phase is: The position update method in the nesting phase is: The position update method during the mating phase is:
[0008] As a further optimization of the above hydraulic manipulator control method based on the optimized BP neural network: the calculation method of the average fitness change rate is: ΔF_avg(t)=-(F_avg(t)-F_avg(t-1)) / F_avg(t-1); Among them, F_avg(t) is the average fitness of the tth generation, and F_avg(t-1) is the average fitness of the t-1th generation.
[0009] As a further optimization of the above hydraulic manipulator control method based on the optimized BP neural network: the specific method of dynamically adjusting key parameters based on the average fitness change rate includes: When the average fitness change rate ΔF_avg(t) is higher than the first threshold th in consecutive m generations u When the average fitness change rate ΔF_avg(t) is lower than the second threshold th in consecutive m generations, the population size N is reduced rapidly. l When , the deceleration reduces the population size N.
[0010] As a further optimization of the above hydraulic mechanical arm control method based on the optimized BP neural network: the specific method of adjusting the reduction speed of the population size N is: where α fast α slow α normal is the preset rate parameter.
[0011] As a further optimization of the above hydraulic manipulator control method based on the optimized BP neural network: the specific method of dynamically adjusting key parameters based on the average fitness change rate includes: When the average fitness change rate ΔF_avg(t) is higher than the first threshold th in consecutive m generations u When , reduce the trade-off rate TR and crossover rate CR; When the average fitness change rate ΔF_avg(t) is lower than the second threshold th in consecutive m generations l When , the trade-off rate TR and crossover rate CR are increased.
[0012] As a further optimization of the above hydraulic mechanical arm control method based on the optimized BP neural network: the specific method of adjusting the trade-off rate TR is: Among them, α TR To increase the weight of the trade-off rate, β TR Reduce weight for trade-off ratio.
[0013] As a further optimization of the above hydraulic manipulator control method based on the optimized BP neural network: the specific method of adjusting the crossover rate CR is: Among them, α CR To increase the weight of the crossover rate, β CR Reduce the weight for the crossover rate.
[0014] As a further optimization of the above-mentioned hydraulic manipulator control method based on optimized BP neural network: in the process of dynamically adjusting key parameters based on the average fitness change rate, the value ranges of the trade-off rate TR and the crossover rate CR are both [0,1].
[0015] As a further optimization of the above hydraulic manipulator control method based on the optimized BP neural network: in the process of dynamically adjusting the key parameters based on the average fitness change rate, the trade-off rate TR and the crossover rate CR are checked by the boundary, and the specific method is: TR(t+1)=min(max(TR(t+1),0),1); CR(t+1)=min(max(CR(t+1),0),1).
[0016] Beneficial effect: The present invention adopts the method of parameter adaptive adjustment to improve the SWO algorithm to obtain the ASWO algorithm model, and uses the ASWO algorithm model to optimize the initial weights and biases of the BP neural network to obtain the optimal solution, so that the BP neural network has better performance, and finally uses the BP neural network to inversely solve and control the hydraulic mechanical arm, effectively improving the control accuracy of the hydraulic mechanical arm. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of the present invention; Figure 2 is a rod coordinate system diagram of the robot arm in a specific implementation manner; Figure 3 It is a schematic diagram of the construction method of the positive solution error compensation model; Figure 4 It is a structural diagram of the ASWO optimization model; Figure 5 It is a flowchart of optimizing the basic BP neural network using the ASWO optimization model; Figure 6 It is a schematic diagram of the structure of the optimized BP neural network; Figure 7 It is a flow chart of simulation verification; Figure 8 It is the fitness curve diagram of four optimization models; Fig. 9 This is a comparison chart of the positioning accuracy of the end-of-arm robot obtained by inverse solution of four optimized BP neural networks; Fig.10 It is the error comparison diagram of four optimized BP neural networks after inputting two positions as data sets; Fig.11 It is an error comparison diagram between the optimization neural network of the present invention and the existing Jacobi iteration method. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0019] like Figure 1 As shown, the hydraulic manipulator control method based on the optimized BP neural network includes S1 and S2.
[0020] S1. Input the acquired terminal target posture into the pre-trained optimized BP neural network, and use the optimized BP neural network to perform inverse solution to obtain joint motion data.
[0021] S2. Generate control instructions based on the joint motion data, and control the joints of the hydraulic mechanical arm based on the control instructions.
[0022] In S1, the optimized BP neural network needs to be generated and trained in advance, and can be called and inversely solved when controlling the hydraulic manipulator. Figure 5 As shown, the generation method of optimizing the BP neural network includes T1 to T5.
[0023] T1. Construct an ASWO (Adaptive spider wasp optimizer) optimization model and determine the initial key parameters in the ASWO optimization model. The initial key parameters include the population size N, the trade-off rate TR, and the crossover rate CR. More specifically, the specific structure of the ASWO optimization model is as follows: Figure 4 As shown in the figure, in the ASWO optimization model, the parameters to be optimized are taken as individuals, and the optimization of the parameters is achieved by simulating the exploration, hunting, nesting and mating behaviors of female spider bees in nature in a certain area. Because a certain area range needs to be limited, a solution space is set in the ASWO optimization model, and the individuals seek the global optimal solution in the solution space. Among them, r1 is a random number from 0 to 1. Comparing r1 and the trade-off rate TR determines whether the current hunting and nesting behavior or mating behavior is executed. i is the index value of the individual to be optimized. k is used to determine the execution of hunting or nesting behavior, and gradually decays from 1 to 0 as the number of iterations increases. Its decay process is expressed as k=1-(t / T max ), p is a random number between 0 and 1, and the comparison result with the k value determines whether to perform search or follow behavior, and the crossover rate CR determines the mating behavior.
[0024] In the early stage of ASWO optimization model execution, individuals are required to conduct extensive exploration in the solution space to prevent them from being stuck in the local optimal position too early. In the later stage of execution, individuals need to have higher exploration efficiency so as to determine the global optimal solution in the solution space more quickly.
[0025] T2. Determine the BP neural network topology based on the mechanical structure of the hydraulic mechanical arm and the inverse solution requirements, as well as the number of weight parameters and bias parameters required, and use the ASWO optimization model to iterate the position of the spider bee individual. Because the control purpose of the hydraulic mechanical arm is mainly the end posture, and the end posture is directly related to the joint action of the hydraulic mechanical arm, the control parameters are mainly the action parameters of each joint. It is necessary to first determine the association between the end posture of the hydraulic mechanical arm and the action parameters of each joint before the BP neural network can be used to achieve automatic high-precision control of the hydraulic mechanical arm. Therefore, it is necessary to first determine the mechanical structure of the hydraulic mechanical arm. In actual implementation, it is necessary to determine its mechanical structure according to the model of the hydraulic mechanical arm to be controlled. In this embodiment, the hydraulic mechanical arm for rock drilling trolleys with the model G3Zi produced by Henan Gengli Engineering Equipment Co., Ltd. is used as the object. The hydraulic mechanical arm has five rotating joints and two translation joints, and the overall length is about 7.84m.
[0026] Use the existing standard DH method to establish the rod coordinate system of the hydraulic manipulator, such as Figure 2 As shown, the DH parameter values of each joint, including the rotation angle θ i , connecting rod distance d i , torsion angle α i , and rod length a i As shown in Table 1.
[0027] Table 1 DH parameter table of hydraulic manipulator
[0028] Among them, θ i Represents X i-1 Axis around Z i-1 Axis rotation, parallel to X i The angle of the axis, d i Represents X i-1 Axis along Z i-1 Axis translation, collinear with X i Axis distance, α i Represents Z i-1 Axis around X i Axis rotation, coincident with Z i The angle of the axis, a i Indicates along X i Axis translation, from O i-1 Move to Oi The distance between adjacent coordinate systems is: The end pose matrix of the hydraulic manipulator is: in, is the pose transformation matrix from the i-th joint to the i-1-th joint, Indicates the end position of the hydraulic manipulator, Indicates the end position. terminal pose is the direction of the X, Y, and Z axes of the end effector in the base coordinate system. The XYZ fixed angle method is used to describe the posture. The rotation matrix used in the process of inverse solving the joint action based on the end posture is:
[0029] Furthermore, the hydraulic manipulator is large in size, the solution process is complex, and the end position error is affected by many factors, including mechanical tolerance, software error, and external load changes. Therefore, in order to accurately locate the end position of the hydraulic manipulator in real time, it is necessary to build a positive solution error compensation model, such as Figure 3 As shown in the figure. Specifically, the DH parameter method is used to calculate the theoretical end position of the hydraulic manipulator joint value, and the actual end position of the corresponding joint value is recorded by the total station, and the two positions are subtracted to obtain the end position error. The joint value and the end position error are used as the input and output of the basic BP neural network model for training, and the mapping relationship between the joint value and the position error of the hydraulic manipulator can be obtained. Then, the spatial error distance between the actual position and the theoretical position of the hydraulic manipulator can be determined when the hydraulic manipulator is at different joint angles.
[0030] In the BP neural network, the weight parameters and bias parameters directly affect the structure and operation process of the BP neural network. In order to determine more optimal weight parameters and bias parameters, the present invention optimizes the basic BP neural network using the ASWO optimization model. The specific process includes T3 to T4.
[0031] The T3 and SWO algorithms first iteratively update the positions of the individuals in the population. Specifically, the spider bee individuals are sequentially made to complete the iteration of their positions through the search phase, the following phase, the nesting phase, and the mating phase, as shown in Figure 4 shown.
[0032] There are two calculation methods that can be used in the search phase. The specific formulas are:
[0033] The previous formula is used to implement a spider bee search behavior. This behavior simulates the process of a spider bee pursuing a potential food source (i.e., a better solution). The search behavior is affected by the positions of two randomly selected spider bees. It is a global search strategy used to find new, unexplored areas in the solution space.
[0034] The strategy implemented by the latter formula simulates the behavior of the spider bee in searching for food in a fixed area. In this strategy, the difference between the position of the spider bee and the upper and lower limits of the solution space plays a key role. It is a local search strategy used to find a better solution around the current solution.
[0035] The two methods can also be combined with each other, by comparing the values of the two formulas to choose one of them, thereby making a trade-off between the global and local.
[0036] There are two calculation methods in the follow-up stage, the specific formula is:
[0037] The position update in the previous formula is based on the current position, attracting the search agent (spider bee) to move closer to or away from the excellent individual.
[0038] In the latter formula, the position of the search agent in each dimension is multiplied by a randomly generated coefficient, which has the effect of speeding up or slowing down, and sometimes even changing the direction of the search.
[0039] The two methods can also be combined with each other, and one of the methods can be selected according to the value of the two formulas, thereby adding randomness and making the search process have better global search capabilities.
[0040] The nesting stage can be calculated in two ways. The specific formula is:
[0041] The previous formula is a local search strategy that depends on the current optimal solution and the value of spider bee i in dimension j. This strategy uses the cosine function to create factors that affect the search trajectory of the spider bee, making it more likely that the spider bee will be close to the optimal solution during the search process. This strategy reflects a convergence trend and is used in later iterations of the algorithm to improve the accuracy of the solution.
[0042] The latter formula is a global search strategy. First, it considers the difference between spider bee i and the other two randomly selected spider bees in the j-dimensional value. Then, a random perturbation factor is generated through random numbers and random Levy flight steps L, which helps the algorithm to jump out of the local optimum and find the global optimum.
[0043] The two methods can also be combined with each other, and one of them can be selected according to the value of the two formulas.
[0044] There are two calculation methods for the mating stage, the specific formula is: Among them, crossover means solving SW i t and A uniform crossover operator is applied between them, and its probability is called the crossover rate (CR).
[0045] The parameter adaptive adjustment strategy first needs to calculate the average fitness change rate during the iteration of the ASWO optimization model, and dynamically adjust the initial key parameters based on the average fitness change rate. The calculation method of the average fitness change rate is: ΔF_avg(t)=-(F_avg(t)-F_avg(t-1)) / F_avg(t-1); Among them, F_avg(t) is the average fitness of the tth generation, and F_avg(t) is the average fitness of the t-1th generation. It should be noted that the calculation method of the average fitness is a prior art and will not be repeated here.
[0046] If the average fitness change rate does not improve over a long period of time, it means that the current individual's exploration ability is too poor and needs to be improved. Correspondingly, if the average fitness change rate is always high over a long period of time, it is necessary to reduce the individual's exploration ability to improve the individual's success rate in developing potential good areas in the solution space.
[0047] Furthermore, the specific method for dynamically adjusting key parameters based on the average fitness change rate includes three parts, namely, a dynamic adjustment part for the population size N, a dynamic adjustment part for the trade-off rate TR, and a dynamic adjustment part for the crossover rate CR.
[0048] The method for dynamically adjusting the population size N is: When the average fitness change rate ΔF_avg(t) is higher than the first threshold th in consecutive m generations u When the average fitness change rate ΔF_avg(t) is lower than the second threshold th in consecutive m generations, the population size N is reduced rapidly. l When , the deceleration reduces the population size N.
[0049] When the average fitness change rate increases significantly, that is, ΔF_avg(t) is higher than the first threshold th in consecutive m generations uWhen , the population size N needs to be reduced faster so that the ASWO optimization model can better focus on the high potential area in the solution space; when the average fitness change rate continues to weaken, that is, ΔF_avg(t) is lower than the second threshold th in consecutive m generations, l When , it is necessary to slow down the reduction rate of the population size N to promote individuals to explore extensively in the solution space and avoid discarding possible optimal solutions too early, that is, to avoid individuals staying in the local optimal solution too early.
[0050] The specific method for adjusting the reduction rate of population size N is: where α fast , α slow , α normal is the preset rate parameter, N min is the minimum value of the preset population size N, T max is the maximum number of iterations.
[0051] In the ASWO optimization model, the trade-off rate TR and the crossover rate CR play an important role in the position change of individuals. By adjusting the trade-off rate TR and the crossover rate CR, the global exploration process and local utilization process of individuals can be balanced, thereby improving the overall efficiency. The dynamic adjustment part of the trade-off rate TR and the dynamic adjustment part of the crossover rate CR include: When the average fitness change rate ΔF_avg(t) is higher than the first threshold th in consecutive m generations u When , the trade-off rate TR and crossover rate CR are reduced, so that high potential areas can be focused and optimal solutions can be retained, thus strengthening local exploration. When the average fitness change rate ΔF_avg(t) is lower than the second threshold th in consecutive m generations l When , the trade-off rate TR and crossover rate CR are improved, which can promote the individual exploration process and improve the diversity of the population, avoiding premature focus on the local optimal solution.
[0052] The specific method for adjusting the trade-off rate TR is: Among them, α TR To increase the weight of the trade-off rate, β TR Reduce weight for trade-off ratio.
[0053] The specific method for adjusting the crossover rate CR is: Among them, α CR To increase the weight of the crossover rate, β CR Reduce the weight for the crossover rate.
[0054] In order to prevent the trade-off rate TR and the crossover rate CR from exceeding a reasonable range, in the process of dynamically adjusting key parameters based on the average fitness change rate, the value range of the trade-off rate TR and the crossover rate CR is [0,1]. Furthermore, in order to verify the trade-off rate TR and the crossover rate CR and avoid exceeding the range of [0,1], in the process of dynamically adjusting key parameters based on the average fitness change rate, the trade-off rate TR and the crossover rate CR are checked by boundaries. The specific method is as follows: TR(t+1)=min(max(TR(t+1),0),1); CR(t+1)=min(max(CR(t+1),0),1).
[0055] In summary, in the ASWO optimization model, the present invention adjusts key parameters according to the average fitness change rate of multiple generations, and adopts a smoother parameter adjustment mechanism, which can avoid over-dramatic adjustments caused by accidental fitness fluctuations. Based on this method, the model can make more robust and efficient key parameter updates according to the current search stage, thereby helping the model to move towards the global optimal solution with higher efficiency, and ultimately achieve efficient optimization of weight parameters and bias parameters in the basic BP neural network, thereby obtaining a more accurate optimized BP neural network, and improving the generalization ability and output accuracy of the optimized BP neural network.
[0056] T4. When the preset termination condition is reached, the iteration of the ASWO model is terminated, and the optimized weight parameters and bias parameters are output.
[0057] T5. The optimized weight parameters and bias parameters are used as the basic weight parameters and basic bias parameters of the BP neural network, and the BP neural network is trained according to the inverse solution data set to obtain the optimized BP neural network. The process structure of the optimized BP neural network is as follows: Figure 6 shown.
[0058] After obtaining the optimal initial weights and biases of the BP neural network, the BP neural network needs to be trained so that the optimized BP neural network can output accurate joint motion data. To construct a complete data set, the reachable range of the hydraulic manipulator end is first determined based on the joint limit, and the hydraulic manipulator is controlled to ensure that the end can fully cover all accessible positions. In addition, the actual position data of the hydraulic manipulator end is collected and stored using a total station, and a set of joint values corresponding to the hydraulic manipulator is synchronously recorded by the rock drilling robot control unit.
[0059] In this embodiment, a total of 3095 sets of data are collected, each set containing 7 joint values of the hydraulic mechanical arm and the actual posture data of its corresponding end effector. 85% of the data set is used for training, and the remaining 15% (i.e. 464 sets of data) is used for network prediction. The input layer nodes of the BP neural network are 12, including 9 sets of information on the XYZ position and posture of the end effector of the hydraulic mechanical arm, and the output layer contains 7 nodes, corresponding to the 7 sets of joint values of the hydraulic mechanical arm. In the final optimized BP neural network, the hidden layer structure is 2 layers, the number of nodes is 22 and 18 respectively, the hidden layer uses the tansig function as the activation function, the number of training iterations is 1500, and the learning rate is set to 0.001.
[0060] In order to find the global optimal solution, the mean square error MSE is used as the fitness value. MSE is the average value of the square error between the predicted value and the actual value: A smaller MSE value means a smaller gap between the predicted value and the true value, indicating a more accurate and better solution. In order to balance the impact of the telescopic joint and the rotational joint on the overall fitness value when calculating the MSE, the two telescopic joints are unified in decimeters to ensure the equal importance of each joint parameter during the optimization process.
[0061] In order to verify the effect of the present invention, simulation and actual experiments are carried out respectively.
[0062] The simulation tool selected was MATLAB and CoppeliaSim joint simulation, and the real movement of the hydraulic mechanical arm was simulated based on the forward error compensation model. Then, the BP neural network optimized based on the traditional Jacobi iteration method, the optimized neural network of the present invention with the input set to the actual position, and the optimized BP neural network of the present invention with the input set to the theoretical position were applied to the actual operation of the G3Zi hydraulic mechanical arm to calculate the inverse solution error.
[0063] The simulation verification process is as follows Figure 7 As shown, Figure 7 The optimized BP neural network in the present invention is recorded as the ASWO-BP inverse solution model, where ASWO is the SWO optimization model of the present invention. tgt Y tgt Z tgt and target posture R tgt Input into the ASWO-BP inverse solution model, and obtain a set of joint angles θ1~θ7. First, perform DH forward solution to obtain the theoretical position X theo Y theo Z theo Then, this group of joint angles is input into the positive error compensation model to obtain the position compensation value X comp Y comp Zcomp , X theo Y theo Z theo With X comp Y comp Z comp Add the two together to get the actual end position X act Y act Z act , and finally calculate X act Y act Z act With X tgt Y tgt Z tgt The difference between the two is the simulation inverse solution error X error Y error Z error .
[0064] In order to verify the performance of ASWO, the three optimization models of GA, PSO and SWO were further used as comparative examples for verification. In the BP neural network optimized by the four optimization models, the total number of weight parameters and bias parameters was set to 833, the dimension dim in ASWO was set to 833, the number of search individuals, i.e. spider bees, N was set to 100, and the initial minimum population number N was set to min is 80, the initial trade-off rate TR is 0.4, the initial crossover probability CR is 0.3, and the maximum number of iterations T max is 50000.
[0065] The results of the four optimization models are compared. Figure 8 ,Depend on Figure 8 It can be seen from the best fitness curve that GA has a strong global search ability and can obtain a better solution in a faster algebra, but its local search ability is weak, and the best fitness value is 1.946. PSO is prone to fall into local extreme values due to its strong local search ability, and its best fitness value is 0.826. SWO is sometimes in a local optimal state for a long time and is difficult to jump out due to its fixed parameters. The best fitness value is 0.641. Compared with the other three optimization models, ASWO has a faster decline in fitness value, is not easily troubled by local optimality, and obtains better solutions with fewer iterations. The best fitness value is 0.343. The BP neural networks optimized by the four optimization models are recorded as ASWO-BP, GA-BP, PAS-BP and SWO-BP respectively.
[0066] The optimal solutions obtained by the four optimization models are used as the initial weights and biases of the BP neural network for training. After the training is completed, the 464 test set data are substituted into the four models to obtain the joint error range, MSE and three-direction position error range, as shown in Table 2.
[0067] Table 2 Simulation results of four optimization models
[0068] As shown in Table 2, compared with the other three optimization models, the error range of the first three joints of ASWO-BP is smaller, which are (-0.305~0.368)°, (-0.412~0.374)°, and (-44.3~56.5) mm. The mean square error of ASWO-BP is 0.173, which is lower than 0.394 of SWO-BP, the best among the other three models. The error range of the end position of ASWO-BP is (-33~37) mm, (-42~40) mm, and (-60~54) mm, which is lower than SWO-BP, the best among the other three models.
[0069] Furthermore, ASWO-BP, GA-BP, PAS-BP and SWO-BP were used to perform inverse solutions for the same target position (7950, 1800, 1540) mm, and the four sets of joint values were substituted into the simulation model. Fig. 9 It can be seen that there are three position points in each figure: the theoretical position obtained by the DH positive solution, the actual position after the positive solution error model compensation, and the preset target position. The position error of the ASWO-BP inverse solution is (-12, 20, 4) mm, the position error of the SWO-BP inverse solution is (-18, -30, -29) mm, the position error of the PSO-BP inverse solution is (-33, -37, 35) mm, and the position error of the GA-BP inverse solution is (-51, -24, -52) mm. The simulation results show that the ASWO optimization model can more effectively optimize the initial weights and biases in the process of assisting the BP neural network in learning and training, thereby helping the network avoid the local optimal solution and find the global optimal solution or a better local optimal solution.
[0070] In order to verify the effect of using the actual position as the input of the BP neural network data set in this study, a comparison was made in Experiment 1, using the theoretical position as the data set for training. In the actual use of the hydraulic manipulator, a total of 55 sets of random target position and posture data were tested, and the target position was ensured to be within the reachable space of the hydraulic manipulator. The joint values of the hydraulic manipulator and the actual position of the end were recorded, and the spatial position errors of the two in the three directions of XYZ were compared at the same target position. The experimental results are as follows: Fig.10 shown. Fig.10The vertical axes represent the positioning errors in the XYZ directions, and the horizontal axes represent the test points. Using the theoretical position as the input of the data set cannot effectively compensate for the error of the positive solution. In addition, the inaccuracy of the inverse solution model itself further increases the positioning error, making the average positioning error in the XYZ direction (104.48, 94.07, 128.47) mm (indicated by black dots). This study uses the actual position as the data set input to remedy the above problems and significantly reduce the position error, so that the average positioning error in the XYZ direction is reduced to (18.16, 24.67, 27.21) mm (indicated by the red five-pointed star). The experimental results confirm the scientificity and effectiveness of the data set setting in this paper.
[0071] In order to avoid the influence of the neural network model error on the experiment, the Jacobi iteration method commonly used in industrial fields was used in Experiment 2 for comparison with the research method of the present invention. The experimental steps were similar to those of Experiment 1. The spatial position errors of the two methods in the three directions of XYZ were calculated under 55 sets of target positions. The test results are shown in Figure 2. Fig.11 As shown in . It can be seen that the Jacobi iteration method has high accuracy and can make the terminal theoretical position accurately reach the target position, but it cannot compensate for the error in the positive solution, resulting in a large error in the final position. Fig.11 As can be seen from the green dots in the error distribution, these points are relatively far from the zero error line. In contrast, the inverse solution error (indicated by the red five-pointed star) obtained by using the ASWO optimized BP neural network optimization model is significantly lower, and its distribution is close to the zero error line. Compared with the Jacobi iteration method, the maximum positioning error in the XYZ direction is reduced from (181.26, 284.74, 305.81) mm to (42.59, 63.71, 67.08) mm. The average positioning error is reduced from (91.3, 87.38, 117.31) mm to (18.16, 24.67, 27.21) mm, and the positioning accuracy of the hydraulic manipulator is greatly improved by 80.11%, 71.78%, and 76.81%.
[0072] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A hydraulic manipulator control method based on an optimized BP neural network, characterized in that: The steps include: The acquired terminal target posture is input into the pre-trained optimized BP neural network, and the optimized BP neural network is used for inverse solution to obtain the joint motion data; generating control instructions based on the joint motion data, and controlling the joints of the hydraulic manipulator based on the control instructions; Among them, the generation method of optimizing the BP neural network includes: Construct an ASWO (Adaptive spider wasp optimizer) optimization model and determine the initial key parameters in the ASWO optimization model, including population size N, trade-off rate TR and crossover rate CR; Based on the mechanical structure of the hydraulic manipulator and the inverse solution requirements, the BP neural network topology and the number of weight parameters and bias parameters required are determined, and the position of the spider bee individuals is iterated using the ASWO optimization model; Calculate the average fitness change rate during the iteration of the ASWO optimization model, and dynamically adjust the initial key parameters based on the average fitness change rate; When the preset termination condition is reached, the iteration of the ASWO model is terminated, and the optimized weight parameters and bias parameters are output; the optimized weight parameters and bias parameters are used as the basic weight parameters and basic bias parameters of the BP neural network, and the BP neural network is trained according to the inverse solution data set to obtain the optimized BP neural network.
2. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 1, characterized in that: The specific method for iterating the positions of individual spider bees is: The spider bee individuals are sequentially made to go through the search phase, the following phase, the nest-building phase and the mating phase to complete the iteration of the position; The location update method in the search phase is: The position update method in the following phase is: The position update method in the nesting phase is: The position update method during the mating phase is:
3. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 1, characterized in that: The calculation method of the average fitness change rate is: ΔF_avg(t)=-(F_avg(t)-F_avg(t-1)) / F_avg(t-1); Among them, F_avg(t) is the average fitness of the tth generation, and F_avg(t-1) is the average fitness of the t-1th generation.
4. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 1, characterized in that: The specific methods for dynamically adjusting the initial key parameters based on the average fitness change rate include: When the average fitness change rate ΔF_avg(t) is higher than the first threshold th in consecutive m generations u When the average fitness change rate ΔF_avg(t) is lower than the second threshold th in consecutive m generations, the population size N is reduced rapidly. l When , the deceleration reduces the population size N.
5. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 4, characterized in that: The specific method for adjusting the reduction rate of population size N is: where α fast α slow α normal is the preset rate parameter.
6. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 1, characterized in that: The specific methods for dynamically adjusting the initial key parameters based on the average fitness change rate include: When the average fitness change rate ΔF_avg(t) is higher than the first threshold th in consecutive m generations u When , reduce the trade-off rate TR and crossover rate CR; When the average fitness change rate ΔF_avg(t) is lower than the second threshold th in consecutive m generations l When , the trade-off rate TR and crossover rate CR are increased.
7. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 6, characterized in that: The specific method for adjusting the trade-off rate TR is: Among them, α TR To increase the weight of the trade-off rate, β TR Reduce weight for trade-off ratio.
8. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 6, characterized in that: The specific method for adjusting the crossover rate CR is: Among them, α CR To increase the weight of the crossover rate, β CR Reduce the weight for the crossover rate.
9. The hydraulic mechanical arm control method based on optimized BP neural network as claimed in claim 1, characterized in that: In the process of dynamically adjusting the initial key parameters based on the average fitness change rate, the value range of the trade-off rate TR and the crossover rate CR are both [0,1].
10. The hydraulic mechanical arm control method based on optimized BP neural network according to claim 9, characterized in that: In the process of dynamically adjusting the initial key parameters based on the average fitness change rate, the trade-off rate TR and the crossover rate CR are checked by the following method: TR(t+1)=min(max(TR(t+1),0),1); CR(t+1)=min(max(CR(t+1),0),1).
Citation Information
Patent Citations
Method for optimizing BP neural network redundant mechanical arm inverse solution based on genetic algorithm
CN112347409A
Marine fuel oil system diagnosis method based on composite multi-scale bidirectional diverse entropy and medium
CN117874436A
Method for transferring a pourable medium
US20220024040A1