An Optimization Method for the Controller of a Fruit Picking Mechanical System
The improved Growth Optimizer algorithm optimizes PID control parameters for apple harvesting robots, addressing precision and speed issues in complex agricultural environments, enhancing control accuracy and adaptability.
Patent Information
- Application Number
- CN202510487101.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Traditional PID controllers are difficult to achieve efficient and accurate control of fruit picking robots in complex farmland environments, especially under dynamic interference factors, the positioning deviation of the robot arm is severe, and the parameter adjustment is time-consuming and it is difficult to achieve the optimal solution.
The improved growth optimization algorithm is used to optimize the parameter of the PID control algorithm of the fruit picking mechanical system controller. Through the enhanced incremental PID algorithm combined with visual sensor positioning, the three-dimensional position of the robot arm is adjusted in real time to reduce errors, and the improved learning and reflection stage strategies are used to find the global optimal solution.
It improves the control accuracy and sensitivity of the fruit picking robot, reduces positioning deviations, enhances the adaptability and robustness of the system, reduces the cost and difficulty of manual parameter adjustment, and achieves efficient picking under different fruit types and picking conditions.
Smart Images

Figure CN120010232B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic control, and particularly to an optimization method for a controller of a fruit picking mechanical system. Background Art
[0002] An apple picking robot is an intelligent device widely used in the agricultural field, aiming to replace manual labor to complete the precise apple picking task; such a robot usually needs to have fast and accurate positioning capabilities, as well as the ability to adapt to complex farmland environments. During the fruit picking process, the robot must coordinate the movement of the robotic arm and the visual recognition function to achieve efficient picking; however, in practical applications, due to the complex and changeable farmland environment, the picking process often faces many technical challenges.
[0003] The PID controller (Proportional-Integral-Derivative controller), as a classic control algorithm, is widely used in apple picking robots for the motion control of the robotic arm due to its simple and efficient structure; however, the traditional PID controller is difficult to achieve the optimal control effect in a complex non-linear environment, and the motion control accuracy of the robotic arm is low, and the motion speed is slow, which is mainly reflected in the following aspects: 1. The performance of the PID controller highly depends on the setting of the proportional, integral, and derivative parameters (Kp, Ki, Kd). In the complex and changeable farmland environment, these parameters often need to be frequently adjusted to adapt to different fruit varieties and picking conditions, and manual parameter tuning is both time-consuming and difficult to obtain the optimal solution; 2. The apple picking task has high requirements for the response speed and stability of the control system. However, the traditional PID controller is difficult to achieve an ideal balance between fast response and oscillation suppression, and is prone to overshoot, lag, or system oscillation, affecting the picking efficiency and accuracy; 3. There are various dynamic interference factors in the farmland environment, such as wind force, shaking of branches and leaves, and light changes. These factors may cause positioning deviation of the robotic arm, and the traditional PID controller is difficult to adapt to this dynamic change in real time.
[0004] The Growth Optimizer (GO) is a new meta-heuristic algorithm aiming to solve continuous global optimization problems. The design inspiration of the GO algorithm comes from the learning and reflection mechanisms of individuals during the social growth process. By simulating the growth behavior of individuals, the GO algorithm aims to find the global optimal solution. The GO algorithm is divided into a learning stage and a reflection stage to establish a mathematical model for updating the individual position. Optimizing the control parameters of the PID algorithm of the fruit picking mechanical system controller using the GO algorithm can improve the sensitivity and accuracy of the controller, but the GO algorithm needs to be improved to solve the problem of being easily trapped in local optimal solutions to ensure absolute superiority during the optimization process of the control parameters of the PID algorithm of the fruit picking mechanical system controller by the growth optimization algorithm. Summary of the Invention
[0005] The object of the present invention is to provide an optimization method for the controller of a fruit picking mechanical system. By using an improved growth optimization algorithm to tune the control parameters of the control algorithm of the fruit picking mechanical system controller, the control accuracy and sensitivity of the fruit picking mechanical system controller are enhanced, and the problems of low motion control accuracy and slow motion speed of the robotic arm of the apple picking robot in the above-mentioned background technology are solved, so as to achieve the optimal robust control of the picking accuracy of the fruit picking robot.
[0006] To achieve the above object, the present invention provides the following technical solution: an optimization method for the controller of a fruit picking mechanical system, which is improved by the growth optimization algorithm, and the control parameters of the PID control algorithm of the fruit picking mechanical system controller are optimized by using the improved growth optimization algorithm. The specific steps are as follows.
[0007] S1. The positions of the fruit and the robotic claw are established in the same three-dimensional space, and the three-dimensional position of the fruit is located by a vision sensor , and at the same time, the three-dimensional position of the robotic arm claw in real time is calculated .
[0008] S2. The error coordinates (Δx, Δy, Δz) of the fruit position and the robotic claw position are calculated through the three-dimensional positions of the fruit and the robotic claw in real time, and the error value of the three-dimensional position data of the fruit and the robotic claw is established.
[0009] S3. The error value is input to the enhanced incremental PID algorithm module for processing, and the output of the enhanced incremental PID algorithm at the current moment, Δu(t), is output; the enhanced incremental PID algorithm module is a fusion of an improved growth optimization algorithm module and an incremental PID algorithm module. The specific method is: using the improved growth optimization algorithm to tune the control parameters of the incremental PID algorithm to obtain the enhanced incremental PID algorithm, and the enhanced incremental PID algorithm is used for the fruit picking mechanical system controller.
[0010] S4. The fruit picking mechanical system controller superimposes the Δu(t) on the robotic arm control signal u(t - 1) at the previous moment to output the robotic arm control signal u(t) at the current moment; the robotic arm control signal at the current moment controls the movement of the robotic arm; at the same time, the three-dimensional position of the robotic arm claw in real time is fed back to S2, and S2 to S4 are cyclically executed until Δu(t) is zero, completing the optimization of the fruit picking mechanical system controller.
[0011] Preferably, the fruit picking mechanical system includes two parts: the robotic arm and the robotic claw of the fruit picking robot. The robotic claw is connected to the end of the robotic arm, and the angle and distance of the robotic claw are adjusted by the fruit picking robotic arm. The controller of the fruit picking mechanical system includes a fruit and robotic claw position data input module, an incremental PID algorithm module, a three-dimensional position data difference calculation module for the fruit and the robotic claw, a real-time position data feedback module for the robotic claw, and a robotic arm regulation output module. Among them, the robotic arm regulation output module outputs the robotic arm regulation signal u(t) at the current moment, and the regulation signal u(t) is input into the three-degree-of-freedom electronic speed control module of the robotic arm. The electronic speed control module processes the regulation signal u(t) and controls the movement of the three-degree-of-freedom motors of the robotic arm respectively.
[0012] Preferably, the angles and distances that the robotic claw needs to be adjusted are determined by calculating the errors (Δx, Δy, Δz) between the fruit position and the real-time position of the robotic claw. Among them, the mathematical model of the straight-line distance between the robotic claw and the target fruit is:
[0013] (1);
[0014] In formula (1), is the horizontal axis position error, is the vertical axis position error, is the Z-axis position error; is the straight-line distance between the robotic claw and the target fruit, and this straight-line distance is the distance that the robotic claw needs to be adjusted along the straight-line trajectory;
[0015] More specifically, the angles and distances that the robotic claw needs to be adjusted during the experiment are the angles that the fruit picking robotic arm needs to be adjusted. The robotic arm is a three-degree-of-freedom robotic arm, and the angles of the robotic arm are adjusted by driving three servo motors through the electronic speed control of the robotic arm. Among them, the angles required for the robotic claw adjustment are represented in polar coordinates after being converted in the Cartesian coordinate system, and the direction angles of the target fruit point are defined, including the pitch angle and the yaw angle. Among them, the pitch angle is the adjustment angle in the vertical direction The distribution in the four quadrants, the mathematical model is:
[0016] (2);
[0017] The yaw angle is the included angle between the fruit and the robotic claw on the horizontal plane , the mathematical model is:
[0018] (3).
[0019] Preferably, the control algorithm of the fruit picking mechanical system controller adopts the incremental PID algorithm to adjust the increment of the manipulator control signal. Compared with the positional PID, it only calculates the control signal increment at the current moment, adjusts based on the change of the current error, has less cumulative influence on the calculation error, and has better robustness. The mathematical model is as follows:
[0020] (4);
[0021] In formula (4), is the proportional coefficient of the incremental PID algorithm, is the integral coefficient of the incremental PID algorithm, is the differential coefficient of the incremental PID algorithm, , , are the error values of the three-dimensional position data of the fruit and the mechanical claw at times t, t - 1, and t - 2 respectively;
[0022] More specifically, for the error coordinates (Δx, Δy, Δz) of the fruit position and the mechanical claw position, the error values of the three-dimensional position data of the fruit and the mechanical claw are established. The mathematical model is as follows:
[0023] (5);
[0024] More specifically, the output Δu(t) of the enhanced incremental PID algorithm is used to change the output manipulator control signal of the fruit picking mechanical system controller until the error value of the three-dimensional position data of the fruit and the mechanical claw tends to zero, that is, the output Δu(t) of the enhanced incremental PID algorithm tends to zero, and the feedback of the fruit picking mechanical system controller ends. The mathematical model is as follows:
[0025] (6);
[0026] In the formula, u(t - 1) is the manipulator control signal at the previous moment, and u(t) is the manipulator control signal at the current moment.
[0027] Preferably, the three-degree-of-freedom electronic speed control module of the robotic arm is an existing control module that can convert a single control signal into multiple groups of control signals, convert the manipulator control signal into a three-dimensional array. The first-dimensional data of the array is the increment of the control signal of the first degree of freedom of the robotic arm, which regulates the yaw angle; the second-dimensional data is the increment of the control signal of the second degree of freedom of the robotic arm, which regulates the telescopic length; the third-dimensional data is the increment of the control signal of the third degree of freedom of the robotic arm, which regulates the pitch angle.
[0028] Preferably, the proportional coefficient, integral coefficient, and differential coefficient of the incremental PID algorithm are tuned using an improved growth optimization algorithm, and the obtained optimal control parameters are input into formula (4) to obtain the enhanced incremental PID algorithm, including: proportional coefficient, integral coefficient, and differential coefficient; the enhanced incremental PID algorithm is used in the incremental PID algorithm module of the fruit picking mechanical system controller to improve the control accuracy and sensitivity of the fruit picking mechanical system controller to the robotic arm.
[0029] Preferably, the growth optimization algorithm includes a mathematical model with two stages: a learning stage and a reflection stage. Among them, the learning stage simulates the learning process of an individual in society, and improves its own knowledge level by learning from the gaps between other individuals, which is the global search stage of the growth optimization algorithm; the reflection stage simulates the behavior of an individual in the process of self-reflection, and improves its own knowledge level by checking and making up for its own deficiencies, which is the local development stage of the growth optimization algorithm; the growth optimization algorithm finds the optimal individual position by iteratively updating the individual position, and its iterative process is the optimization process of the optimal control parameters of the incremental PID algorithm, and the optimal individual position is the value of the optimal control parameter.
[0030] Preferably, the position vector of the i-th individual of the growth optimization algorithm includes D dimensions, where D is the dimension of the algorithm problem. During the optimization process of the growth optimization algorithm for the incremental PID algorithm, for the tuning of the control parameters of the incremental PID algorithm, the optimal control parameters in the current environment are obtained. Among them, the number of control parameters is denoted as the dimension D of the algorithm problem. The control parameters of the incremental PID algorithm include proportional parameters, differential parameters, and integral parameters; the position vector of the i-th individual is , the value of the first dimension of the position vector of the i-th individual maps the proportional parameter value of the incremental PID algorithm, the value of the second dimension of the position vector of the i-th individual maps the integral parameter value of the incremental PID algorithm, and the value of the third dimension of the position vector of the i-th individual maps the differential parameter value of the incremental PID algorithm.
[0031] Preferably, in the learning stage of the growth optimization algorithm, the cooperation learning between individuals is simulated by constructing the differences between four different standard individuals. Among them, the four different standard individuals include: the optimal individual in the current population, the elite individual in the current population, the inferior individual in the current population, and the random individual in the current population. Among them, the mathematical model of the differences between the four different standard individuals is:
[0032] (7);
[0033] In formula (7), is the value of the j-th dimension of the optimal individual position vector of the global population, is the fitness value ranked among the top denote the j-th dimension value of the position vector of the elite individual in the current population for an individual, is the maximum population size, after fitness value ranking denote the j-th dimension value of the position vector of the inferior individual in the current population for an individual, and denote the j-th dimension value of the position vectors of two random individuals in the population, is the distance between the optimal individual and the elite individual in the current population, is the distance between the elite individual and the inferior individual in the current population, is the distance between the optimal individual and the inferior individual in the current population, is the distance between two random individuals in the population.
[0034] Preferably, in the learning stage of the growth optimization algorithm, update the position of the i-th individual according to the knowledge acquisition amount, and the mathematical model:
[0035] (8);
[0036] In formula (8), is the position vector of the i-th individual at the (t + 1)-th iteration, is the position vector of the i-th individual at the t-th iteration, is the k-th knowledge acquisition amount, which is obtained through the Euclidean distance between four different standard individuals.
[0037] Preferably, the current standard growth optimization algorithm mainly relies on the Euclidean distance, with a single target direction, which affects the control accuracy of the fruit picking mechanical system; improve the individual position update strategy in the learning stage of the standard growth optimization algorithm. In the learning stage, introduce a multi-direction exploration strategy that imitates high fitness value individuals to obtain an improved individual position update strategy in the learning stage. The specific steps are as follows:
[0038] Step 1: Calculate the Euclidean distance between the current individual and the other N - 1 individuals. Among them, those with a distance less than R are used as the neighborhood individuals of the current individual, and update the position of the current individual according to the positions of the neighborhood individuals. The mathematical model is:
[0039] (9);
[0040] In formula (9), is the number of individuals within the neighborhood R of the current individual; is the position vector generated by the i-th individual according to the y-th neighborhood individual, where y = 1, 2,..., n; is the neighborhood solution set at the t-th iteration is the position vector of the y-th neighborhood individual within it; is the position vector of the i-th individual in the t-th iteration;
[0041] Step 2: Imitate the individuals with small fitness values in the population. The mathematical model is:
[0042] (10);
[0043] In formula (10), is the position vector of the i-th individual in the (t + 1)-th iteration, is the position vector generated by the i-th individual according to the y-th neighborhood individual, where y = 1, 2,..., n, and are dynamic weight factors to ensure that information from different sources is reasonably integrated, is the optimal individual position vector of the global population, Select from the individual position vectors whose fitness values are closest to ;
[0044] Step 3: Select the optimal from the search results in multiple directions and improve the way of single-direction guidance. The specific method is:
[0045] The fitness values of the n candidate solutions generated by the i-th individual are respectively , and select the optimal candidate solution to update the position vector of the i-th individual. The mathematical model is:
[0046] ; where is the first candidate solution of the i-th individual in the (t + 1)-th iteration, is the second candidate solution of the i-th individual in the (t + 1)-th iteration, is the n-th candidate solution of the i-th individual in the (t + 1)-th iteration, is the fitness value of the individual position, is the minimum value selection function.
[0047] Preferably, the decay factor (AF) in the growth optimization algorithm (GO) is designed based on the current iteration number and the maximum iteration number, gradually reducing the exploration intensity and focusing on local development; based on the design of the decay factor (AF) in the standard growth optimization algorithm (GO), the method proposed by the present invention dynamically adjusts the decay factor using the average amplitude of the position change of the current iteration individuals in the population and the individuals in the previous generation. In the local development stage, by reducing the exploration intensity and focusing on local search, it can find the optimal solution more precisely, and at the same time adaptively adjust the strategy at different stages to avoid falling into local optimum or premature convergence problems, improving the tuning optimization efficiency and accuracy of the growth optimization algorithm for the control parameters of the incremental PID algorithm in the local development stage; the improved mathematical model of the decay factor is:
[0048] (11);
[0049] Wherein, is the improved attenuation factor value at the t-th iteration, is the maximum number of iterations, is the population activity at the t-th iteration, and the mathematical model is:
[0050] (12);
[0051] Wherein, is the maximum activity at population initialization, is the maximum population size, is the position value of the i-th individual in the j-th dimension at the t-th iteration, is the position value of the i-th individual in the j-th dimension at the (t - 1)-th iteration.
[0052] Preferably, using the improved attenuation factor, and introducing the optimal individual position of the current population to guide the individual position update to improve the individual position update strategy mathematical model in the reflection stage of the growth optimization algorithm, the mathematical model is:
[0053] (13);
[0054] Wherein, is the position vector of the i-th individual at the (t + 1)-th iteration, is the position vector of the i-th individual at the t-th iteration, UB and LB are the upper and lower limits of the individual position vector, r is a random number between 0 and 1, is the optimal individual position vector of the population at the t-th iteration, and p is a control parameter.
[0055] Preferably, using the improved individual position update strategies in the learning stage and reflection stage, the improvement of the standard growth optimization algorithm is completed; using the improved growth optimization algorithm to optimize the proportional coefficient, integral coefficient, and differential coefficient of the incremental PID algorithm, the specific steps are:
[0056] S31. Encode the control parameters of the incremental PID algorithm of the fruit picking mechanical system controller as a space vector U with a dimension of 3, and establish a mapping between the space vector and the position vector of the i-th individual of the improved growth optimization algorithm;
[0057] S32. Set the maximum number of iterations T, problem dimension D, maximum population size N, upper limit UB and lower limit LB of the individual position vector of the improved growth optimization algorithm, and randomly initialize the position vector values of each individual;
[0058] S33. Calculate the fitness value of the position of each individual currently using the objective function, and retain the current minimum fitness value The corresponding individual position, and use it as the optimal individual position vector of the population at the t-th iteration ; Update the optimal individual position vector of the global population according to formula (14);
[0059] (14);
[0060] In the formula, is the optimal individual position vector of the global population, is the fitness value of the optimal individual position vector of the global population;
[0061] S34. If the current iteration number t satisfies t > T, then output and parse the current optimal individual position vector of the global population and assign it to the control parameters of the incremental PID algorithm of the fruit picking machine system controller; otherwise, execute the individual position update mathematical model of the improved growth optimization algorithm;
[0062] S35. Update the positions of N individuals using the improved individual position update strategy in the learning stage, calculate the value of the improved attenuation factor at the t-th iteration, and establish an individual position update strategy in the reflection stage according to the attenuation factor value to update the positions of N individuals;
[0063] S36. Limit the updated individual position vector within the upper limit UB and lower limit LB of the individual position vector; increment the iteration number by one, and return to execute S33.
[0064] Preferably, the role of the fitness value is to evaluate the superiority of the solution. The size of the fitness value reflects the control accuracy of the current fruit picking machine system controller, that is, the accuracy of the proportional coefficient, integral coefficient, and differential coefficient of the incremental PID algorithm of the fruit picking machine system controller. By parsing the individual position of the improved growth optimization algorithm into the proportional coefficient, integral coefficient, and differential coefficient of the incremental PID algorithm for the fruit picking machine system controller, and calculating the control error size of the fruit picking machine system controller under the current proportional coefficient, integral coefficient, and differential coefficient through the objective function to obtain the fitness value. The smaller the fitness value, the smaller the current control error of the fruit picking machine system controller, and vice versa, the larger the control error; the mathematical model of the objective function is:
[0065] (15);
[0066] In the formula, is the objective function, and e(t) is the three-dimensional position data error value of the fruit and the mechanical claw at the t-th moment.
[0067] Compared with the prior art, the technical solution of the present invention has the following advantages and beneficial effects: The present invention optimizes the control parameters of the PID control algorithm of the fruit picking mechanical system controller by using an improved growth optimization algorithm, significantly improving the control accuracy and sensitivity of the controller; By precisely adjusting the movement of the robotic arm, precise picking of fruits is achieved, reducing the positioning deviation and errors during the picking process. The improved growth optimization algorithm can find the optimal solution more precisely through two stages of global search and local development, avoiding the problems of falling into local optima or premature convergence. Therefore, the method of the present invention can maintain good control performance under different fruit types and picking conditions, enhancing the adaptability and robustness of the system; Traditional PID controllers need to frequently adjust the proportional, integral, and derivative parameters to adapt to different picking conditions, which is not only time-consuming but also difficult to obtain the optimal solution. The method of the present invention reduces the cost and difficulty of manual parameter tuning by automatically optimizing the control parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is an overall technical framework diagram optimized for the fruit picking mechanical system controller;
[0069] Figure 2 It is a flowchart for the improved growth optimization algorithm to optimize the proportional coefficient, integral coefficient, and derivative coefficient of the incremental PID algorithm;
[0070] Figure 3 It is a comparison diagram of the minimum fitness value of each iteration during the optimization process of the improved growth optimization algorithm and the standard growth optimization algorithm;
[0071] Figure 4 It is a change diagram of the optimization process of the control parameters of the incremental PID control algorithm of the fruit picking mechanical system controller;
[0072] Figure 5 It is a comparison diagram of the optimization effects of the method of the present invention and the existing method on the fruit picking mechanical system controller. DETAILED DESCRIPTION OF THE INVENTION
[0073] The following embodiments further illustrate the content of the present invention, but should not be construed as limiting the present invention. Without departing from the spirit and essence of the present invention, any modification or replacement of the methods, steps, or conditions of the present invention belongs to the scope of the present invention.
[0074] Such as Figure 1As shown in the figure, the present invention provides an optimization method for the controller of a fruit picking mechanical system. By improving the growth optimization algorithm, the improved growth optimization algorithm is used to optimize the control parameters of the incremental PID control algorithm of the fruit picking mechanical system controller. The improved incremental PID control algorithm is applied to the fruit picking mechanical system controller. The implementation process includes Matlab code and Simulink system simulation models, including steps S1 to S4.
[0075] S1. Establish the positions of the fruit and the mechanical claw in the same three-dimensional space, and locate the three-dimensional position of the fruit through a vision sensor , and at the same time calculate the three-dimensional position of the real-time robotic arm claw .
[0076] Specifically, in this implementation step, the coordinate system of the entire three-dimensional space is used as the global coordinate system, and the local coordinate system is determined according to the initial position of the mechanical claw and the position of the fruit. The position of the fruit is real-time located through a vision sensor, and the image data is converted into points in the three-dimensional coordinate system , and the three-dimensional position of the real-time robotic arm claw is calculated through the encoders of the three-degree-of-freedom motors of the robotic arm .
[0077] S2. Calculate the error coordinates (Δx, Δy, Δz) of the fruit position and the mechanical claw position through the three-dimensional positions of the fruit and the real-time mechanical claw, and establish the error value of the three-dimensional position data of the fruit and the mechanical claw.
[0078] Specifically, in this implementation step, calculate the error (Δx, Δy, Δz) between the fruit position and the real-time position of the mechanical claw to determine the angle and distance that the mechanical claw needs to be adjusted. Among them, the mathematical model of the straight-line distance between the mechanical claw and the target fruit is:
[0079] (1);
[0080] In formula (1), is the horizontal axis position error, is the vertical axis position error, is the Z-axis position error; is the straight-line distance between the mechanical claw and the target fruit, and this straight-line distance is the distance that the mechanical claw needs to be adjusted along the straight-line trajectory.
[0081] Furthermore, the angle and distance that the mechanical claw needs to be adjusted during the experiment are the angles that the fruit picking robotic arm needs to be adjusted. The robotic arm is a three-degree-of-freedom robotic arm, and the angles of the robotic arm are adjusted by driving three servo motors through the electronic speed controller of the robotic arm; among them, the angle required for the mechanical claw adjustment is converted into polar coordinate representation in the Cartesian coordinate system, and the direction angle of the target fruit point is defined, including the pitch angle and the yaw angle; among them, the pitch angle is the vertical direction adjustment angle The distribution within the four quadrants has a mathematical model as follows:
[0082] (2);
[0083] The yaw angle is the angle between the fruit and the mechanical claw on the horizontal plane , and the mathematical model is:
[0084] (3).
[0085] S3. Input the error value into the enhanced incremental PID algorithm module for processing, and output the output Δu(t) of the enhanced incremental PID algorithm at the current moment; the enhanced incremental PID algorithm module is a fusion of an improved growth optimization algorithm module and an incremental PID algorithm module. The specific method is as follows: Use the improved growth optimization algorithm to tune the control parameters of the incremental PID algorithm to obtain the enhanced incremental PID algorithm, and the enhanced incremental PID algorithm is used for the fruit picking mechanical system controller.
[0086] Specifically, in this implementation step, define the control algorithm of the fruit picking mechanical system controller. The incremental PID algorithm is used for the incremental PID algorithm module in the Simulink simulation model of the fruit picking mechanical system controller. The mathematical model is:
[0087] (4);
[0088] In formula (4), is the proportional coefficient of the incremental PID algorithm, is the integral coefficient of the incremental PID algorithm, is the differential coefficient of the incremental PID algorithm, , , are the error values of the three-dimensional position data of the fruit and the mechanical claw at times t, t - 1, and t - 2 respectively; among them, for the error coordinates (Δx, Δy, Δz) of the fruit position and the mechanical claw position, establish the error value of the three-dimensional position data of the fruit and the mechanical claw, and input it into the difference calculation module of the three-dimensional position data of the fruit and the mechanical claw in the Simulink fruit picking mechanical system controller simulation model. The mathematical model is:
[0089] (5).
[0090] Specifically, in this implementation step, improve the individual position update strategy in the learning stage of the standard growth optimization algorithm. In the learning stage, introduce a multi-direction exploration strategy that imitates high-fitness individuals to obtain an improved individual position update strategy in the learning stage. The specific steps are as follows:
[0091] Step 1: Calculate the Euclidean distance between the current individual and the other N - 1 individuals. Those with a distance less than R are considered as the neighborhood individuals of the current individual, and update the position of the current individual according to the positions of the neighborhood individuals. The mathematical model is as follows:
[0092] (9);
[0093] In Equation (9), is the number of individuals within the neighborhood R of the current individual; is the position vector generated by the i-th individual according to the y-th neighborhood individual, where y = 1, 2,..., n; is the neighborhood solution set at the t-th iteration the position vector of the y-th neighborhood individual within it; is the position vector of the i-th individual at the t-th iteration;
[0094] Step 2: Imitate the individuals with small fitness values in the population. The mathematical model is as follows:
[0095] (10);
[0096] In Equation (10), is the position vector of the i-th individual at the (t + 1)-th iteration, is the position vector generated by the i-th individual according to the y-th neighborhood individual, where y = 1, 2,..., n, and are dynamic weight factors to ensure the reasonable integration of information from different sources, is the position vector of the optimal individual in the global population, selected from the individual position vectors whose fitness values are closest to ;
[0097] Step 3: Select the optimal from the search results in multiple directions and improve the single-direction guidance method. The specific method is as follows:
[0098] The fitness values of the n candidate solutions generated by the i-th individual are respectively , and select the optimal candidate solution to update the position vector of the i-th individual. The mathematical model is as follows:
[0099] ; where, is the first candidate solution of the i-th individual at the (t + 1)-th iteration, is the second candidate solution of the i-th individual at the (t + 1)-th iteration, is the n-th candidate solution of the i-th individual at the (t + 1)-th iteration, is the fitness value of the individual position, is the minimum value taking function.
[0100] Furthermore, based on the design of the attenuation factor (AF) in the standard growth optimization algorithm (GO), the attenuation factor is dynamically adjusted using the average amplitude of the position change of the current iteration individuals and the individuals of the previous generation in the population. The improved mathematical model of the attenuation factor is as follows:
[0101] (11);
[0102] In the formula, is the value of the improved attenuation factor for the t-th iteration, is the maximum number of iterations, is the population activity for the t-th iteration, and the mathematical model is:
[0103] (12);
[0104] In the formula, is the maximum activity at population initialization, is the maximum population size, is the position value of the i-th individual in the j-th dimension at the t-th iteration, is the position value of the i-th individual in the j-th dimension at the (t - 1)-th iteration.
[0105] Furthermore, using the improved attenuation factor and introducing the optimal individual position of the current population to guide the individual position update, the mathematical model of the individual position update strategy in the reflection stage of the growth optimization algorithm is improved. The mathematical model is:
[0106] (13);
[0107] In the formula, is the position vector of the i-th individual at the (t + 1)-th iteration, is the position vector of the i-th individual at the t-th iteration, UB and LB are the upper and lower limits of the individual position vector, r is a random number between 0 and 1, is the optimal individual position vector of the population at the t-th iteration, and p is a control parameter.
[0108] Furthermore, as Figure 2 shown, using the improved individual position update strategy in the learning stage, the improvement of the standard growth optimization algorithm is completed; using the improved growth optimization algorithm to optimize the proportional coefficient, integral coefficient, and differential coefficient of the incremental PID algorithm. The specific steps are as follows:
[0109] S31. Encode the control parameters of the incremental PID algorithm of the fruit picking mechanical system controller as a space vector U with a dimension of 3, and establish a mapping between the space vector and the position vector of the i-th individual of the improved growth optimization algorithm;
[0110] S32. Set the maximum number of iterations T, problem dimension D, maximum population size N, upper bound UB and lower bound LB of the individual position vector of the improved growth optimization algorithm, and randomly initialize the position vector values of each individual.
[0111] S33. Calculate the fitness value of the position of each current individual using the objective function, and retain the current minimum fitness value corresponding individual position, and take it as the optimal individual position vector of the population at the t-th iteration. ; Update the optimal individual position vector of the global population according to formula (14);
[0112] (14);
[0113] In the formula, is the optimal individual position vector of the global population, is the fitness value of the optimal individual position vector of the global population;
[0114] Among them, the mathematical model of the objective function is:
[0115] (15);
[0116] In the formula, is the objective function, and e(t) is the error value of the three-dimensional position data of the fruit and the robotic gripper at the t-th moment;
[0117] S34. If the current iteration number t satisfies t > T, then output and parse the optimal individual position vector of the current global population and assign it to the control parameters of the incremental PID algorithm of the fruit picking mechanical system controller; otherwise, execute the individual position update mathematical model of the improved growth optimization algorithm.
[0118] S35. Update the positions of N individuals using the improved individual position update strategy in the learning stage, calculate the improved attenuation factor value at the t-th iteration, and establish an individual position update strategy in the reflection stage according to the attenuation factor value to update the positions of N individuals.
[0119] S36. Limit the updated individual position vector within the range of the upper bound UB and lower bound LB of the individual position vector; increment the iteration number by one, and return to execute S33.
[0120] S4. The fruit picking mechanical system controller adds the Δu(t) to the robotic arm control signal u(t - 1) at the previous moment to output the robotic arm control signal u(t) at the current moment; the robotic arm control signal at the current moment controls the movement of the robotic arm; at the same time, the three-dimensional position of the real-time robotic arm gripper is fed back to S2, and S2 to S4 are looped until Δu(t) is zero, completing the optimization of the fruit picking mechanical system controller.
[0121] Specifically, in this implementation step, the output Δu(t) of the enhanced incremental PID algorithm is used to change the output robotic arm control signal of the fruit picking mechanical system controller until the three-dimensional position data error value between the fruit and the robotic claw approaches zero, that is, the output Δu(t) of the enhanced incremental PID algorithm approaches zero, and the feedback of the fruit picking mechanical system controller ends. The mathematical model is as follows:
[0122] (6);
[0123] In the formula, u(t - 1) is the robotic arm control signal at the previous moment, and u(t) is the robotic arm control signal at the current moment.
[0124] Furthermore, in Matlab, a three-degree-of-freedom electronic speed control model of the robotic arm is established to convert a single control signal into multiple groups of control signals, and the robotic arm control signal is converted into a three-dimensional array. The first-dimensional data of the array is the increment of the control signal for the first degree of freedom of the robotic arm, which controls the yaw angle; the second-dimensional data is the increment of the control signal for the second degree of freedom of the robotic arm, which controls the telescopic length; and the third-dimensional data is the increment of the control signal for the third degree of freedom of the robotic arm, which controls the pitch angle.
[0125] Furthermore, in Matlab, the code design for the mathematical model of the method of the present invention is completed. The maximum number of iterations T = 100 is initialized, the problem dimension D = 3, the maximum population size N = 20, the upper limit UB = 110 and the lower limit LB = 0.001 of the individual position vector are set, and the fitness value calls the objective function. The code is as follows:
[0126] Dim = 3;
[0127] Pop = 20;
[0128] f = @(x) AGO_PID(x);
[0129] Max_iter = 100;
[0130] ub = 110;
[0131] lb = 0.001;
[0132] Then, a mapping is established between the improved growth optimization algorithm and the incremental PID control algorithm of the fruit picking mechanical system controller. The code is as follows:
[0133] [Best_f, Best_X, val, curve_f] = AGO(Max_iter, lb, ub, Dim, f); where Best_f represents the minimum fitness value, curve_f represents the fitness value, val represents the control parameters of the three-dimensional incremental PID control algorithm, and Best_X represents the individual best position.
[0134] Furthermore, a simulation model of the fruit picking mechanical system controller is established in Simulink, including a fruit and robotic gripper position data input module, an incremental PID algorithm module, a three-dimensional position data difference calculation module for the fruit and the robotic gripper, a real-time position data feedback module for the robotic gripper, a robotic arm regulation output module, and an objective function model; the control parameters of the incremental PID control algorithm at the minimum fitness value are input into the incremental PID algorithm module, and the code sim('AGO_Model') is run to complete the closed-loop control of the fruit picking mechanical system controller.
[0135] As Figure 3 shown, from the comparison chart of the minimum fitness value of each iteration in the optimization process of the standard growth optimization algorithm (GO) and the improved growth optimization algorithm (AGO), it can be found that in the initial stage of iteration, both algorithms show a rapid decrease in fitness value, but the decreasing speed of GO-PID is slightly lower than that of AGO-PID, and in the initial stage of iteration, the minimum fitness value of the improved growth optimization algorithm is lower than the fitness value of the standard growth optimization algorithm (GO), indicating that the improved growth optimization algorithm (AGO) shows a faster speed and higher accuracy in the early stage of optimization; at the 48th iteration, the fitness value of the standard growth optimization algorithm (GO) remains stable and does not continue to decrease, reaching the minimum fitness value that it can optimize; at the 52nd iteration, the improved growth optimization algorithm (AGO) reaches the minimum fitness value that it can optimize. By comparison, it can be found that the fitness value optimized by the improved growth optimization algorithm (AGO) is smaller than that of the standard growth optimization algorithm (GO), indicating that the improved growth optimization algorithm (AGO) proposed in the present invention has a better optimization effect on the control parameters of the PID control algorithm of the fruit picking mechanical system controller.
[0136] As Figure 4As shown in the figure, from the change diagram of the control parameter optimization process of the incremental PID control algorithm of the fruit picking mechanical system controller, it can be found that during the optimization process of the improved growth optimization algorithm (AGO), the changes of the Kp, Ki, and Kd parameters of the incremental PID control algorithm reach stability at about 52 iterations. The optimal Kp, Ki, and Kd parameters are: 4.3058, 0.530887, and 1.23167 respectively. Input the optimal control parameters into the incremental PID algorithm module of the Simulink simulation model of the fruit picking mechanical system controller, set the target value to 5 times the unit step signal, and run for 20 seconds to output the control effect of the fruit picking mechanical system controller, as Figure 5 shown. During the experiment, the standard PID control algorithm was added for comparison. From the control effects of the three control algorithms used in the fruit picking mechanical system controller, it can be found that when the method of improving the growth optimization algorithm to optimize the incremental PID control algorithm (AGO-PID) proposed in the present invention is used in the fruit picking mechanical system controller, it is better than the other two methods in terms of control speed and control accuracy. In terms of the control overshoot in the early stage, there is no overshoot in the method of the present invention, while the overshoot of the other methods reaches about 6 to 7. In terms of control speed, the control method of the present invention reaches the target value of 5 units in about 7 seconds and there is almost no fluctuation, indicating that the optimization method of the fruit picking mechanical system controller proposed in the present invention is better.
Claims
1. An optimization method for the controller of a fruit picking mechanical system, characterized in that, Specifically, it includes: S1. Establish the fruit and the robotic gripper in the same three-dimensional space, and locate the three-dimensional position of the fruit through a vision sensor , and simultaneously calculate the three-dimensional position of the robotic arm gripper in real time ; S2. Calculate the error coordinates (Δx, Δy, Δz) between the fruit position and the robotic gripper position through the three-dimensional positions of the fruit and the real-time robotic gripper, and establish the error value of the three-dimensional position data between the fruit and the robotic gripper; S3. Input the error value into the enhanced incremental PID algorithm module for processing, and output the output Δu(t) of the enhanced incremental PID algorithm at the current moment; the enhanced incremental PID algorithm module is a fusion of an improved growth optimization algorithm module and an incremental PID algorithm module. The specific method is: use the improved growth optimization algorithm to tune the control parameters of the incremental PID algorithm to obtain the enhanced incremental PID algorithm, and the enhanced incremental PID algorithm is used for the controller of the fruit picking mechanical system; the specific method of the improved growth optimization algorithm is: in the learning stage, introduce a multi-direction exploration strategy that imitates high-fitness individuals to obtain an improved individual position update strategy in the learning stage. The specific steps are: Step 1. Calculate the Euclidean distance between the current individual and the other N - 1 individuals. Those with a distance less than R are used as the neighborhood individuals of the current individual. Update the position vector of the current individual according to the positions of the n neighborhood individuals. There are n position vectors in total, corresponding to the n neighborhood individuals. The mathematical model is: (9); In formula (9), is the number of individuals within the neighborhood R of the current individual; is the position vector generated by the i-th individual according to the y-th neighboring individual, where y = 1, 2,..., n; is the neighborhood solution set at the t-th iteration and is the position vector of the y-th neighboring individual within it; is the position vector of the i-th individual at the t-th iteration; Step 2. Imitate the update of the n values of the position vector of the i-th individual by the individuals with low fitness values in the population. The mathematical model is: (10); In formula (10), is the y-th position vector of the i-th individual in the (t + 1)-th iteration, where y = 1, 2, ..., n, and are dynamic weight factors to ensure that information from different sources is reasonably integrated, is the optimal individual position vector of the global population, is the individual position vector closest to the fitness value , is the y-th position vector of the i-th individual in the t-th iteration; Step 3. Take the optimal value based on the search results in multiple directions, improve the single-direction guidance method, and update the position vector of the i-th individual. The specific method is: The n position vectors generated by the i-th individual have fitness values of respectively. Select the optimal candidate solution to update the position vector of the i-th individual. The mathematical model is as follows: ; where, is the first candidate solution of the i-th individual in the (t + 1)-th iteration, is the second candidate solution of the i-th individual in the (t + 1)-th iteration, is the n-th candidate solution of the i-th individual in the (t + 1)-th iteration, is the fitness function, is the minimum value taking function; The improved growth optimization algorithm includes dynamically adjusting the attenuation factor using the average amplitude of the position change between the current iterative individuals and the previous generation individuals in the population. The mathematical model of the improved attenuation factor is: (11); In the formula, is the improved attenuation factor value at the t-th iteration, is the maximum number of iterations, is the population activity at the t-th iteration, and the mathematical model is: (12); In the formula, is the maximum activity level at the time of population initialization, is the maximum population size, is the position value of the j-th dimension of the i-th individual at the t-th iteration, is the position value of the j-th dimension of the i-th individual at the (t - 1)-th iteration; Then, use the improved attenuation factor, and at the same time introduce the optimal individual position of the current population to guide the individual position update to improve the mathematical model of the individual position update strategy in the reflection stage of the growth optimization algorithm; S4. The controller of the fruit picking mechanical system superimposes the Δu(t) on the manipulator control signal u(t-1) at the previous moment to output the manipulator control signal u(t) at the current moment; the manipulator control signal at the current moment controls the movement of the manipulator; meanwhile, the three-dimensional position of the real-time manipulator claw is fed back to the S2, and S2 to S4 are executed cyclically until Δu(t) becomes zero, completing the optimization of the controller of the fruit picking mechanical system.
2. The optimization method of the controller of a fruit picking mechanical system according to claim 1, wherein The fruit picking mechanical system includes two parts: the robotic arm and the robotic gripper of the fruit picking robot. The robotic gripper is connected to the end of the robotic arm, and the angle and distance of the robotic gripper are adjusted through the fruit picking robotic arm; the fruit picking mechanical system controller includes a fruit and robotic gripper position data input module, an incremental PID algorithm module, a three-dimensional position data difference calculation module between the fruit and the robotic gripper, a real-time position data feedback module of the robotic gripper, and a robotic arm control output module. Among them, the robotic arm control output module outputs the robotic arm control signal u(t) at the current moment, and the control signal u(t) controls the movement of the robotic arm. The mathematical model is: (6); In the formula, u(t - 1) is the robotic arm control signal at the previous moment, and u(t) is the robotic arm control signal at the current moment.
3. The optimization method of a fruit picking mechanical system controller according to claim 1, characterized in that, The improved mathematical model of the individual position update strategy in the reflection stage is: (13); In the formula, is the position vector of the i-th individual at the (t + 1)-th iteration, is the position vector of the i-th individual at the t-th iteration, UB and LB are the upper and lower limits of the individual position vector, r is a random number within 0 to 1, is the optimal individual position vector of the population at the t-th iteration, and p is a control parameter.
4. An optimization method for the controller of a fruit picking mechanical system according to claim 3, characterized in that, The obtained enhanced incremental PID algorithm includes: using the improved individual position update strategy in the learning stage and the individual position update strategy in the reflection stage to complete the improvement of the standard growth optimization algorithm, and using the improved growth optimization algorithm to optimize the proportional coefficient, integral coefficient, and differential coefficient of the incremental PID algorithm. The specific steps are: S31. Encode the control parameters of the incremental PID algorithm of the fruit picking mechanical system controller as a spatial vector U with a dimension of 3, and establish a mapping between the spatial vector and the position vector of the i-th individual of the improved growth optimization algorithm. Establish a mapping; S32. Set the maximum number of iterations \(T\), problem dimension \(D\), maximum population size \(N\), upper bound \(UB\) and lower bound \(LB\) of the individual position vector of the improved growth optimization algorithm, and randomly initialize the position vector values of each individual; S33. Calculate the fitness value of the position of each individual currently using the objective function, and retain the current minimum fitness value The corresponding individual position, and use it as the optimal individual position vector of the population in the t-th iteration ; Update the optimal individual position vector of the global population according to formula (14); (14); Wherein, is the optimal individual position vector of the global population, is the fitness value of the optimal individual position vector of the global population; Among them, the mathematical model of the objective function is: (15); In the formula, is the objective function, and e(t) is the error value of the three-dimensional position data of the fruit and the mechanical claw at the t-th moment; S34. If the current iteration number \(t\) satisfies \(t > T\), then output and parse the optimal individual position vector of the current global population and assign it to the control parameters of the incremental PID algorithm of the fruit picking mechanical system controller; otherwise, execute the individual position update mathematical model of the improved growth optimization algorithm; S35. Update the positions of \(N\) individuals using the improved individual position update strategy in the learning stage, calculate the improved attenuation factor value at the \(t\)-th iteration, and update the positions of \(N\) individuals according to the individual position update strategy in the reflection stage established based on the attenuation factor value; S36. Limit the updated individual position vector within the range of the upper bound \(UB\) and lower bound \(LB\) of the individual position vector; increment the iteration number by one, and return to execute S33.
Citation Information
Patent Citations
Automatic identification method and system for closed harvesting of corridor
CN119339249A
Agricultural machinery automatic driving operation method applied to automatic driving harvester
CN119645021A