Method for optimizing logistics sorting encoder error based on improved grey wolf algorithm

Through the improved Gray Wolf algorithm, the logistics sorting encoder error is optimized, and the Logistic chaotic mapping and adaptive convergence factor are used to solve the problem of encoder error affecting the performance of the sorting system, and efficient and accurate logistics sorting operations are achieved.

CN120337979APending Publication Date: 2025-07-18QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +2

Patent Information

Application Number
CN202510563460.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When handling encoder errors, the existing logistics sorting system uses a fixed compensation method to adapt to complex and changeable working environments, resulting in the encoder error affecting the performance of the sorting system and making it difficult to maintain high efficiency and accuracy.

Method used

The improved gray wolf algorithm is used to optimize the error of logistics sorting encoder, and the initial population is generated through Logistic chaotic mapping. Combining adaptive convergence factors, dynamic weight allocation, differential evolution and Levi flight variation, the fitness function and hybrid boundary processing are designed to achieve accurate compensation of encoder errors.

Benefits of technology

It improves the measurement accuracy of the encoder, enhances the positioning accuracy and operating efficiency of the logistics sorting system, reduces manual intervention, reduces operating costs, adapts to different working environments and load conditions, and improves sorting quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337979A_ABST
    Figure CN120337979A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of electric digital data processing, and particularly relates to a method for optimizing errors of a logistics sorting encoder based on an improved grey wolf algorithm. According to the method, Logistic chaotic mapping and Gaussian perturbation are superposed to generate a diversity initial parameter population so as to break through the limitation of traditional random initialization, a fitness function is designed to quantify an angle compensation residual error, and parallel computing is utilized to accelerate evaluation. In the iteration process, global exploration and local development are dynamically balanced through adaptive convergence factors, a bimodal perturbation mechanism is constructed in combination with a differential evolution strategy and Levy flight variation, population effectiveness is maintained through reflection boundary processing, guiding of # imgabs0 # wolf is enhanced through dynamic weight distribution, the position of a leader wolf is updated by adopting an elitist retention strategy, and the population effectiveness is improved. And finally, outputting the optimal compensation parameter when the maximum number of iterations or the residual threshold is met, thereby improving the positioning precision and the operation efficiency of the logistics sorting system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electrical digital data processing, and more specifically, relates to a method for optimizing the encoder error of a logistics sorting system based on an improved grey wolf algorithm. Background Art

[0002] In the field of logistics sorting, accurate measurement of the motor rotation angle is crucial for ensuring the accuracy and efficiency of the sorting system. Currently, the encoder, as a key sensor for measuring the motor rotation angle, is widely used in logistics sorting equipment. However, due to factors such as manufacturing processes and installation, the encoder inevitably has engraving errors, pulse errors, and non-orthogonal errors in practical applications, which seriously affect the performance of the sorting system. However, existing logistics sorting systems often use fixed compensation methods when dealing with encoder errors. These methods are difficult to adapt to complex and changing working environments, and the compensation effect is limited. Therefore, the present invention proposes a new encoder compensation strategy that combines an advanced grey wolf algorithm, aiming to accurately compensate for the engraving errors, pulse errors, and non-orthogonal errors of the encoder to improve the overall performance of the logistics sorting system. By optimizing the grey wolf algorithm and utilizing the powerful search ability of the improved grey wolf algorithm, the errors of the encoder are optimized and compensated online, thereby improving the measurement accuracy of the encoder. This method can not only effectively overcome the limitations of traditional compensation strategies but also adapt to different working environments and load conditions, ensuring that the logistics sorting system can maintain high efficiency and accuracy in various situations. Through the implementation of the present invention, it is expected to significantly improve the sorting quality of the logistics sorting system, reduce manual intervention, and lower operating costs, bringing revolutionary progress to the logistics industry. Chinese patent document CN117574066A discloses a method for maximizing the benefits of a virtual power plant based on an improved grey wolf optimization algorithm, including the following steps: integrating distributed energy, energy storage systems, and controllable loads to construct a physical architecture; using a probability model of wind and light output and historical meteorological / electricity price data preprocessing to establish a basic model, and calculating the electricity sales revenue, subsidies, and costs based on a multi-objective optimization function; using Tent chaotic sequences to initialize the grey wolf algorithm to enhance the global search ability, and using a cosine dynamic convergence factor to balance the exploration and development efficiency, and The wolf applies Cauchy-Gaussian mixed mutation perturbation to break through the local optimum; an improved grey wolf algorithm is used to generate extreme weather scenarios by Monte Carlo simulation and reduce typical scenarios through K-means clustering. The optimization model is input into the algorithm for iterative solution, and the energy storage scheduling strategy and grid interaction plan corresponding to the maximum profit are output to verify the economic index and reliability index. However, although the Tent chaotic sequence used in this method has certain chaos, compared with the Logistic chaotic map, its ergodicity and randomness within the parameter range are relatively weak. This characteristic may lead to uneven initial population initialization, thus affecting the global search ability of the algorithm. In addition, the dynamic balance of the adaptive Cauchy-Gaussian mixed mutation mechanism is insufficient. Compared with the dynamic adjustment strategy of the adaptive scaling factor and crossover probability in differential evolution, the population diversity of the Cauchy-Gaussian mixed mutation mechanism decreases faster in the later stage of iteration, resulting in an increased risk of premature convergence.

[0003] In view of this, the present invention designs a method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm. Summary of the Invention

[0004] The present invention aims to overcome at least one defect of the above-mentioned prior art and provides a method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm to solve the problems of engraving error, pulse error, and non-orthogonal error existing in the encoder in the prior art, aiming to accurately compensate the engraving error, pulse error, and non-orthogonal error of the encoder to improve the overall performance of the logistics sorting system.

[0005] The detailed technical solution of the present invention is as follows: A method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm, the method comprising: S1. Chaotic initialization stage: Generate an original chaotic sequence for the initial position vector of the grey wolf population using the Logistic chaotic map, obtain a chaotic sequence eliminating the transient effect through 100 preheating iterations for the original chaotic sequence, and superimpose a 5% Gaussian perturbation on the chaotic sequence eliminating the transient effect to obtain the final initial grey wolf population; wherein, each individual in the grey wolf population represents four compensation parameters in the logistics sorting encoder. S2. Adaptive convergence factor adjustment: Design an exponential decay-cosine oscillation model to dynamically adjust the convergence factor. This model is dominated by exponential decay in the early stage of iteration, realizes rapid decay through the exponential term, and smoothly transitions to local development through cosine oscillation in the later stage, balancing the exploration and development capabilities of the algorithm and suppressing search oscillations: (1) Wherein, represents the adaptive convergence factor; t is the current iteration number ( ) ; T is the maximum iteration number; S3. Leadership Wolf Dynamic Update Mechanism: Calculate the fitness of the population in parallel for each iteration, select the top three optimal solutions as the α-wolf, β-wolf, and δ-wolf. When the fitness of a new generation of gray wolf individuals is better than the historical optimum of the leadership wolf, update the position of the leadership wolf to ensure the stability of the algorithm's convergence direction.

[0006] S4. Dynamic Weight Allocation Strategy: Dynamically adjust the weights of the α / β / δ wolves based on fitness entropy. The more optimal the fitness of an individual, the stronger its guiding force. S5. Differential Evolution Enhancement Stage: Perform differential evolution operations on gray wolf individuals with a 30% probability, and then generate trial vectors through binomial crossover to ensure the directional inheritance characteristics of the encoder compensation parameters. If the trial vector is better than the original individual, replace it. This mechanism improves the search efficiency in the high-dimensional parameter space by 2.3 times.

[0007] S6. Adaptive Lévy Flight Mutation: Generate the mutation step size using the Lévy distribution with β = 1.5. The mutation probability linearly decays from 0.2 to 0 with the number of iterations, and the step size scaling factor is dynamically adjusted according to 0.05*(1 - t / T). This mutation enables the algorithm to have strong perturbation ability in the early stage and gradually focus on fine search in the later stage, reducing the angular compensation residual to ±0.03°.

[0008] S7. Hybrid Boundary Constraint Handling: Use the method of reflection combined with random perturbation to handle out-of-bounds parameters: (2) Among them, is the processed encoder parameter value, is the encoder parameter value to be processed; is the maximum value allowed for the parameter; is the minimum value allowed for the parameter; 、 is the absolute value of the out-of-bounds amount, used to represent the absolute distance by which the parameter exceeds the upper or lower bound; is a random number, which is a random number uniformly distributed in and is used to introduce perturbation; Unbounded, Upper-bounded, and Lower-bounded are boolean values used to mark whether the parameter is out of bounds; S8. Elite Population Management: Calculate the fitness of the population in parallel for each iteration, locate the current worst individual through fitness sorting, generate a new individual by adding a normal perturbation with an amplitude of 10% of the solution space to the position of the optimal individual to replace the worst individual, and at the same time force the historical optimum solution to be retained for the next iteration to ensure that the population quality strictly monotonically improves. This mechanism improves the algorithm's convergence speed by 40% by directionally eliminating a single individual instead of a group ratio, and avoids search oscillations caused by large-scale population replacement.

[0009] S9. Terminate when the maximum number of iterations is reached or the optimal fitness is less than the preset threshold, output the global optimal solution, and transfer the four compensation parameters in the optimal solution to the logistics sorting encoder to achieve real-time error compensation.

[0010] Preferably according to the present invention, the step S1 is specifically as follows: Generate an original chaotic sequence using the Logistic chaotic map, and obtain a chaotic sequence eliminating the transient effect through 100 preheating iterations of the original chaotic sequence. The process of generating the chaotic sequence is: (3) Where represents the value of the chaotic variable at the k-th iteration, k represents the number of iterations, represents the initial value of the chaotic variable; represents the value of the chaotic variable after 100 iterations.

[0011] To break the deterministic limitation of the chaotic sequence, a Gaussian perturbation mechanism is further introduced to lay a good foundation for subsequent optimization: (4) Where, represents an individual of the initial population of the encoder error compensation parameter; is the parameter lower bound vector, that is, the minimum value set of the encoder error compensation parameter; is the parameter upper bound vector, that is, the maximum value set of the compensation parameter; chaos is a chaotic sequence generated by the Logistic map, and the range of the chaotic sequence is ; is a standard normal distribution random number; 0.05 is the Gaussian perturbation intensity coefficient, used to control the perturbation amplitude of the initial population.

[0012] Preferably according to the present invention, in step S3, the calculation of the population fitness function is as follows: (5) Where is the compensation parameter of the i-th gray wolf individual; is the weight error; are the engraving error, subdivision error, and installation error at the k-th sampling.

[0013] Preferably according to the present invention, in step S4, the formula for dynamically adjusting the weight of the wolf based on fitness entropy is: (6) Where, are respectively the fitness values of the wolves, that is, the error compensation effect evaluation values; is the minimum fitness value in the current population (the evaluation value of the optimal solution); is a minimum value to prevent the denominator from being zero; represents the normalized weight of the i-th leading wolf.

[0014] Preferably according to the present invention, the step S5 is specifically as follows: First, perform DE / rand / 1 mutation with a probability of 30%, randomly select three individuals for vector perturbation, and the DE / rand / 1 mutation formula is: (7) where, , , are the parameter vectors of three different randomly selected individuals respectively; F is a scaling factor used to control the intensity of the differential vector; is the parameter vector of the generated mutant individual.

[0015] Then, improve the parameter identification accuracy of the encoder nonlinear error model by ensuring the directional inheritance characteristics of the encoder compensation parameters through binomial crossover with CR = 0.8 to generate a trial vector, and replace it if the trial vector is better than the original individual; The formula for the binomial crossover operation is: (8) where, is the i-th individual and j-th dimensional parameter value of the trial vector generated by the binomial crossover operation, that is, the newly generated error compensation parameter combination; is the i-th individual and j-th dimensional parameter value of the mutant vector, that is, the perturbation parameter generated by the differential strategy; is the i-th individual and j-th dimensional parameter value of the original individual, that is, the candidate parameter combination of the current iteration; CR is the crossover probability used to control the inheritance probability of the parameter dimension; rand is a uniformly distributed random number used for dimension crossover decision.

[0016] Preferably according to the present invention, in step S6, the formula for generating the mutation step size by the Lévy distribution is as follows: (9) where, represents the generated mutation step size; is a random number obeying ; is a random number obeying ; 0.05 is the basic step size coefficient used to control the perturbation intensity; t is the current iteration number (1 ≤ t ≤ T); T is the maximum iteration number; lb is the parameter lower bound vector, that is, the minimum value set of the encoder error compensation parameters; ub is the parameter upper bound vector, that is, the maximum value set of the compensation parameters.

[0017] Preferably according to the present invention, in step S8, the positioning of the current worst individual is as follows: (10) wherein, is the fitness value of the jth individual; arg max is the index for taking the maximum value. If the optimization objective is the minimum value, then the maximum value corresponds to the worst solution; The generation of a new individual by superimposing a normal perturbation with an amplitude of 10% of the solution space on the position of the optimal individual to replace the worst individual is as follows: (11) wherein, is the parameter vector of the worst individual in the ith generation; is the parameter vector of the optimal individual; 0.1 is the perturbation intensity coefficient.

[0018] Preferably according to the present invention, in step S9, the four compensation parameters include: A: Amplitude compensation coefficient: correcting the amplitude nonlinear error of the encoder signal, B: Phase compensation coefficient: compensating for the amplitude imbalance of the orthogonal signal, φ: Phase shift: correcting the fixed phase shift caused by mechanical installation deviation or temperature drift, k: Frequency scaling factor: correcting the frequency deviation caused by transmission ratio error or electronic subdivision error.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention adopts a combined initialization strategy of Logistic chaotic mapping and Gaussian perturbation. Through 100 preheating iterations, an ergodic initial solution is generated to ensure that the encoder compensation parameters are evenly distributed within the error band of [-0.5°, +0.5°], avoiding the area coverage blind spots that may be caused by traditional random initialization. The superimposed Gaussian perturbation simulates the vibration noise of the sorting equipment, enabling the initial population to form an exploration extension within the sudden error interval of ±1.2°.

[0020] (2) The present invention designs a non-linear mixed decay convergence factor to balance the search ability. The convergence factor adopts a composite decay mode of exponential decay plus cosine oscillation. The exponential decay term rapidly shrinks the search range during the acceleration stage of the sorting line, achieving a rapid lock of the main peak of the error; the cosine decay term provides a progressive fine-tuning during the steady-state sorting period. This design realizes rapid decay through the exponential term in the early stage of iteration, with a decay rate 2.1 times that of the linear model, strengthening global exploration; in the later stage of iteration, it is dominated by the cosine term for a smooth transition, avoiding premature convergence to local extrema.

[0021] (3) The present invention constructs a dual enhancement mechanism of differential evolution and Lévy flight. Differential evolution is executed with a probability of 30%. Through binomial crossover, the directional inheritance characteristics of the encoder compensation parameters are ensured to improve the parameter identification accuracy of the encoder non-linear error model. At the same time, an adaptive step-size Lévy perturbation mechanism is introduced. High-frequency perturbation is maintained in the initial stage of iteration to effectively map the periodic error traps caused by the cogging effect of the encoder. The heavy-tailed distribution characteristic of Lévy flight breaks through the local extreme value constraints and triggers the compensation parameter reconstruction mechanism under abnormal working conditions such as package impact. Description of the Drawings

[0022] Figure 1 is a flowchart of the method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to the present invention.

[0023] Figure 2 is a test result graph of the comparison test of the method of the present invention in the CEC2017 unimodal function.

[0024] Figure 3 is a test result graph of the comparison test of the method of the present invention in the CEC2017 multimodal function.

[0025] Figure 4 is a test result graph of the comparison test of the method of the present invention in the CEC2017 hybrid function.

[0026] Figure 5 is a test result graph of the comparison test of the method of the present invention in the CEC2017 composite function.

[0027] Figure 6 is a time domain graph of the encoder error compensation of the improved grey wolf algorithm according to the present invention. Detailed Embodiment

[0028] The following further describes the present disclosure in conjunction with the drawings and embodiments.

[0029] It should be noted that the following detailed description is exemplary and is intended to provide further illustration of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present disclosure belongs.

[0030] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0031] In the case of no conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other.

[0032] Embodiment 1, The core idea of the Grey Wolf Algorithm is to simulate the social hierarchy and hunting behavior in a grey wolf population to achieve efficient compensation for encoder errors. However, in some cases, the convergence speed of the Grey Wolf Algorithm may not be fast enough, especially when dealing with large-scale or complex problems, which may increase the calculation time and resource consumption. In addition, due to its local search characteristics, it is prone to falling into local optimal solutions and unable to find the global optimal solution. These will greatly reduce the encoder error compensation effect, thus affecting the efficiency of the logistics sorting work. Therefore, the present invention improves the Grey Wolf Algorithm to address these problems, enhancing the search ability, avoiding local optima, and improving search diversity, thereby improving the accuracy of the sorting system. The specific implementation steps after improvement are as follows: Refer Figure 1 , this embodiment provides a method for optimizing the encoder error of logistics sorting based on an improved Grey Wolf Algorithm, and the method includes: 1. Traditional random initialization is likely to lead to uneven population distribution. The improved Grey Wolf Algorithm uses Logistic chaotic mapping to generate an ergodic initial solution, covering the parameter space through non-linear dynamic characteristics. After preheating 100 times to eliminate transient effects, a 5% Gaussian perturbation is superimposed to enhance the diversity of the initial population.

[0033] Generate the original chaotic sequence using Logistic chaotic mapping, and obtain the chaotic sequence with transient effects eliminated through 100 preheating iterations. The process of generating the chaotic sequence is as follows: (1) Where represents the chaotic variable value at the k-th iteration, k represents the number of iterations, represents the initial chaotic variable value; represents the chaotic variable value after 100 iterations.

[0034] To break the deterministic limitation of the chaotic sequence, a Gaussian perturbation mechanism is further introduced to lay a good foundation for subsequent optimization: (2) Where, represents an individual of the initial population of encoder error compensation parameters; lb is the lower bound vector of the parameters, that is, the set of minimum values of the encoder error compensation parameters; ub is the upper bound vector of the parameters, that is, the set of maximum values of the compensation parameters; chaos is the chaotic sequence generated by Logistic mapping, and the range of the chaotic sequence is ; is a standard normal distribution random number; 0.05 is the Gaussian perturbation intensity coefficient, used to control the perturbation amplitude of the initial population.

[0035] Map the chaotic value to the solution space range , construct an initial solution distribution with ergodicity and diversity. Compared with traditional random initialization, the quality of the initial solution is improved by 60%, avoiding the algorithm falling into local optimum in the early stage. This strategy makes the initial population show high dispersion in the encoder error parameter space.

[0036] 2. Adaptive convergence factor adjustment: Design an exponential decay-cosine oscillation model to dynamically adjust the convergence factor. In the early stage of iteration, that is when it is mainly dominated by exponential decay, and achieve rapid decay through the exponential term. In the later stage, that is when it smoothly transitions to local exploitation through cosine oscillation, balancing the exploration and exploitation capabilities of the algorithm and suppressing search oscillations: (3) Among them, represents the adaptive convergence factor; t is the current iteration number ( ); T is the maximum iteration number.

[0037] This design achieves rapid decay through the exponential term in the early stage of iteration, and the decay rate is 2.1 times that of the linear model, strengthening global exploration; in the later stage of iteration, it is dominated by the cosine term for smooth transition, avoiding premature falling into local extrema.

[0038] 3. Calculate the population fitness for each gray wolf individual in the population in parallel at each iteration, conduct error performance evaluation, arrange the fitness values in ascending order, and the top three optimal solutions are respectively used as wolves, and the fitness function is: (4) Among them is the compensation parameter of the i-th gray wolf individual; is the weight error, which is set according to the dynamic characteristics of the sorting motor; is the engraving error, subdivision error and installation error at the k-th sampling; When the fitness of the new generation of gray wolf individuals is better than the historical optimum of the leading wolf, update the position of the leading wolf to ensure the stability of the convergence direction of the algorithm.

[0039] 4. Dynamically adjust the weight of the wolf based on fitness entropy. The individual with better fitness has stronger guiding power, avoiding the problem of sub-optimal solution dominance caused by the fixed weight of traditional GWO. For example, when the α wolf is significantly better than other individuals (Δf>10%), its weight ratio can reach more than 70%, achieving the intelligent optimization of "the strong get stronger"; Dynamically adjust the weight of the wolf based on fitness entropy, and the formula is: (5) Among them, are respectively the fitness value of the wolf, that is, the evaluation value of the error compensation effect; is the minimum fitness value in the current population, that is, the evaluation value of the optimal solution; is a minimum value to prevent the denominator from being zero; represents the normalized weight of the $i$-th leading wolf.

[0040] 5. Perform differential evolution DE operation with a 30% probability, randomly select three individuals for vector perturbation, and ensure the directional inheritance characteristics of the encoder compensation parameters through binomial crossover with CR = 0.8 to generate a trial vector. If the trial vector is better than the original individual, it will be replaced. This mechanism improves the search efficiency in the high-dimensional parameter space by 2.3 times; The DE / rand / 1 mutation formula is: (6) Among them, , , are respectively the parameter vectors of three randomly selected different individuals; F is a scaling factor used to control the intensity of the differential vector; is the parameter vector of the generated mutant individual.

[0041] The formula for the crossover operation is: (7) Among them, is the $i$-th individual and $j$-th dimensional parameter value of the trial vector generated through binomial crossover operation, that is, the newly generated error compensation parameter combination; is the $i$-th individual and $j$-th dimensional parameter value of the mutant vector, that is, the perturbation parameter generated through the differential strategy; is the $i$-th individual and $j$-th dimensional parameter value of the original individual, that is, the candidate parameter combination of the current generation; CR is the crossover probability used to control the inheritance probability of the parameter dimension; rand is a uniformly distributed random number used for dimension crossover decision.

[0042] 6. At the same time, introduce a Levy perturbation mechanism with an adaptive step size, maintain high-frequency perturbation in the initial stage of iteration. The effective figure is the periodic error trap caused by the cogging effect of the encoder. The heavy-tailed distribution characteristic of Levy flight breaks through the local extreme value constraint and triggers the compensation parameter reconstruction mechanism under abnormal working conditions such as package impact. The Levy step size generation formula is: (8) Among them, represents the generated mutant step size; is a random number obeying ; is a random number obeying a random number; 0.05 is the basic step size coefficient used to control the perturbation intensity; t is the current iteration number ( ); T is the maximum iteration number; lb is the lower bound vector of parameters, that is, the set of minimum values of the encoder error compensation parameters; ub is the upper bound vector of parameters, that is, the set of maximum values of the compensation parameters.

[0043] 7. For out-of-bounds parameters, a hybrid strategy of reflection combined with random perturbation is adopted, which not only maintains the population distribution characteristics but also avoids repeated ineffective searches. The boundary handling rules are as follows: (9) Among them, is the processed encoder parameter value, is the encoder parameter value to be processed; ub is the maximum value allowed for the parameter; lb is the minimum value allowed for the parameter; , is the absolute value of the out-of-bounds amount, used to represent the absolute distance by which the parameter exceeds the upper or lower bound; rand is a random number, which is a random number uniformly distributed in , used to introduce perturbation; not out-of-bounds, out-of-upper-bound, out-of-lower-bound are boolean values used to mark whether the parameter is out-of-bounds; This strategy introduces randomness while maintaining the population distribution characteristics, increasing the search efficiency in the boundary region by 58%.

[0044] 8. In each iteration, the population fitness is calculated in parallel. The current worst individual is located by fitness sorting. A new individual is generated by adding a normal perturbation with an amplitude of 10% of the solution space to the position of the best individual to replace the worst individual. At the same time, the historical best solution is forced to be retained in the next iteration to ensure that the population quality strictly monotonically improves.

[0045] Locate the current worst individual: (10) Among them, is the fitness value of the j-th individual; arg max is the index for taking the maximum value. If the optimization goal is the minimum value, the maximum value corresponds to the worst solution.

[0046] Generate a new individual by adding a normal perturbation with an amplitude of 10% of the solution space to the position of the best individual to replace the worst individual: (11) Among them, is the parameter vector of the worst individual in the i-th generation; is the parameter vector of the best individual; 0.1 is the perturbation intensity coefficient.

[0047] 9. Terminate when the maximum iteration number is reached or the optimal fitness is less than the threshold, and output the global optimal solution.

[0048] (12) Among them, is the fitness value; is the precision threshold, preset by the user.

[0049] 10. The optimal solution output is the following four compensation parameters: A represents the amplitude compensation coefficient: correcting the amplitude nonlinear error of the encoder signal, B represents the phase compensation coefficient: compensating for the amplitude imbalance of the quadrature signal, represents the phase shift: correcting the fixed phase shift caused by mechanical installation deviation or temperature drift, k represents the frequency scaling factor: correcting the frequency deviation caused by transmission ratio error or electronic subdivision error. Finally, the four compensation parameters are transmitted to the control system of the encoder to achieve real-time error compensation.

[0050] The improved grey wolf algorithm is placed on the CEC2017 test function for comparative testing, which proves that the improved grey wolf algorithm is significantly superior to the comparative algorithm in terms of convergence accuracy, stability and robustness. The comparison graphs of the four types of functions in CEC2017 are as Figures 2-5 shown, where the red line is the test result of the present invention. Through the optimization of the improved grey wolf algorithm, the encoder error in the logistics sorting system is effectively adjusted, improving the accuracy and reliability of the sorting system. This optimization method can adaptively optimize the encoder parameters, thus realizing more efficient and accurate logistics sorting operations.

[0051] Example 2, This embodiment provides an application of the method for optimizing the encoder error of the logistics sorting by the improved grey wolf algorithm in the logistics sorting system: The encoder error compensation design optimized by the improved grey wolf algorithm combines the search ability of the grey wolf algorithm and the accuracy of the encoder error model, realizing real-time adjustment of the encoder error in the logistics sorting system. This design utilizes the global search ability and local search accuracy of the grey wolf algorithm to optimize the compensation parameters of the encoder error model, thereby improving the accuracy and efficiency of logistics sorting.

[0052] First, design an encoder error model, which can calculate the error according to the actual rotation angle of the motor and the angle difference measured by the encoder. And define the parameter set of the error model, as well as determine the initial values of these parameters.

[0053] Then, the improved grey wolf algorithm is used to optimize the error compensation. The optimization process involves integrating chaotic initialization, dynamic weight allocation, and hybrid mutation strategies to achieve high-precision parameter optimization. Logistic chaotic mapping is used to superimpose Gaussian perturbations to generate a diverse initial parameter population to break through the limitations of traditional random initialization. A fitness function is designed to quantify the angular compensation residuals, and parallel computing is used to accelerate the evaluation. During the iteration process, the global exploration and local exploitation are dynamically balanced through a hybrid convergence factor, combined with the differential evolution strategy: DE / rand / 1 mutation, and Levy flight mutation: , with a step size of 0.05 linearly decaying to construct a bimodal perturbation mechanism. An 85% reflection boundary treatment is used to maintain the population effectiveness. The guidance of the alpha wolf is strengthened through dynamic weight allocation, and the leader wolf position is updated using the elite retention strategy. Finally, the optimal compensation parameters are output when the maximum iteration number or the preset threshold is met, thereby improving the positioning accuracy and operating efficiency of the logistics sorting system.

[0054] The optimized error compensation design enhances the robustness of the system, can adjust the compensation parameters in real time online, reduces the workload of manual intervention, and effectively addresses the nonlinear, time-varying, and uncertain problems that may occur in the logistics sorting system. It is applicable to various logistics sorting scenarios, thereby improving the sorting accuracy and operation efficiency. Through this error compensation design, the logistics sorting system can maintain high-precision positioning during high-speed operation, reduce sorting errors, and improve the overall performance of logistics sorting.

[0055] The encoder error compensation design optimized by the improved grey wolf algorithm can achieve precise control of the motors in the logistics sorting system. This design improves the adaptability and stability of the logistics sorting system under different working scenarios and load conditions by automatically adjusting the error compensation parameters and intelligently optimizing the compensation strategy. The optimized compensation design reduces the positioning error during the sorting process, ensures the accuracy and efficiency of item sorting, thereby improving the overall performance of logistics sorting. At the same time, the enhanced robustness enables the logistics sorting system to still operate efficiently in the face of complex and changeable operating environments, reducing sorting errors caused by external interference. The adaptive adjustment ability not only reduces manual intervention but also lowers the complexity of system maintenance and improves the operation efficiency. Through this error compensation design, the logistics sorting system can maintain high-precision positioning during high-speed operation, increase the sorting speed, reduce sorting errors, and thus improve the operation quality and customer satisfaction of logistics sorting.

[0056] Example 3, This example provides a method for constructing an encoder error model: The three main error types that may occur in the output of an incremental optical encoder are engraving error, subdivision error, and installation error.

[0057] The engraving error is divided into position error and width error: the former refers to the deviation between the theoretical angle and the actual angle, which is caused by environmental interference or measurement and control error; the latter is caused by the inconsistency between the actual width of the grating engraving and the theoretical value.

[0058] (13) Among them, is due to the harmonic characteristics of the lithography process defects, K is jointly determined by the Nuquist frequency and process noise, then reflects the ability of the process to suppress high-frequency errors, is the amplitude of the equivalent angle error, is the phase correction term, is the equivalent angle noise, satisfying , .

[0059] The subdivision error includes electronic subdivision error and non-orthogonal error. The former stems from the phase / amplitude judgment process of generating sine optical signals by grating rotation, and the latter is caused by the non-orthogonality of the grating rulings.

[0060] (14) Among them, is the DC bias term, is the amplitude / phase error term, is the third harmonic term, is the phase deviation angle, then is the actual mechanical rotation angle of the encoder rotor, is the equivalent noise term.

[0061] The installation error includes three categories: eccentricity error: the code disk deviates from the rotation center, tilt error: the grating disk is tilted during installation, resulting in the installation plane not being perpendicular to the rotation axis, and aiming error: the zero points of the encoder and the measured object are not aligned.

[0062] (15) Among them, e is the eccentricity between the geometric center of the code disk and the rotation axis, R is the radius of the code disk, is the eccentricity direction angle, is the tilt angle of the code disk plane, that is, the angle between the normal line and the rotation axis, is the tilt direction angle, that is, the normal direction of the tilt plane.

[0063] Construct an encoder hybrid error model, including third harmonic distortion, fifth harmonic interference and thermal drift terms. Dynamically optimize the phase compensation parameters in the 6D parameter space through an improved grey wolf algorithm, with the comprehensive error index: the main term of the mean square error + the residual fluctuation penalty term as the objective function. Configure hybrid operation condition tests: steady state / dynamic / anti-noise scenarios, with a sampling rate of 1 kHz, to verify the effectiveness of the algorithm. The time domain diagram of the improved grey wolf algorithm is asFigure 6 As shown Figure 6 It is shown that the display compensation signal effectively suppresses waveform distortion: the peak error at 0.06 s is reduced from 0.25 to 0.05, the dynamic response delay is 0.02 ms; the baseline offset in the steady state section is optimized to 0.02, and the envelope fluctuation converges to [-0.5, 1.0], verifying that the algorithm effectively suppresses nonlinear distortion.

[0064] Example 4 The present invention mainly optimizes the error compensation of the logistics sorting encoder to accurately position the public office motor, so a mathematical model of the motor needs to be established. For a DC servo drive motor, its mathematical model usually consists of two parts, specifically the mechanical part and the electrical part.

[0065] The electrical equation of the servo motor is: (16) where V is the motor input voltage; L is the motor inductance; R is the motor resistance; I is the motor current; is the back electromotive force constant. The mechanical equation of the servo motor is: (17) where J is the inertia of the motor rotor; B is the damping coefficient of the motor; T is the output torque of the motor; w is the angular velocity of the motor.

[0066] The relationship between the torque T and the current I can be expressed by the following formula: (18) where is the torque constant of the motor.

[0067] The servo system adopts closed-loop control. The PID controller adjusts the motor input voltage V(t) through the feedback signal to make the motor reach the desired angle or position. However, due to the encoder error, the feedback signal cannot accurately reflect the actual state of the motor, resulting in a control error.

[0068] Introduce the error into the servo system model, specifically: The closed-loop control of the servo motor usually adopts a PID controller. The controller adjusts the motor input based on the feedback signal to reach the desired angle or position. Due to the encoder error, the feedback signal is inaccurate, and the controller must compensate according to the wrong feedback. The set value is , and the feedback signal is , then the error is: (19) Then, the PID controller generates the control input V(t) based on the error: (20) Among them, is the proportional gain; is the integral gain; is the derivative gain.

[0069] The servo motor parameters are shown in Table 1: Table 1 Servo Motor Parameters

[0070] The constructed grey wolf algorithm is combined with the encoder error model to generate an adaptive error compensation mechanism, which acts on the servo motor of the logistics sorting system.

[0071] Specifically: In this system, the encoder error is compensated by the grey wolf optimization algorithm to ensure the precise control of the servo motor. The specific process is as follows: After the system starts, first set the working parameters of the machine, including the target speed, transmission ratio, working cycle, etc.; after the system enters the running state, use the encoder to collect the actual rotation angle of the stepping motor in real time, and calculate the error e and the error change rate ec; feedback the error information to the control system, use the grey wolf optimization algorithm to compensate the encoder error, and adjust the control strategy of the stepping motor to achieve higher-precision control. This process not only improves the accuracy of motor control, but also effectively avoids the system instability caused by error accumulation, thus ensuring the smooth and efficient operation of the mechanical system.

[0072] Obviously, the above-mentioned embodiments of the present invention are only examples for clearly explaining the technical solutions of the present invention, rather than limitations on the specific implementation manners of the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the claims of the present invention shall be included within the protection scope of the claims of the present invention.

Claims

1. Method for optimizing encoder error of logistics sorting based on improved grey wolf algorithm, characterized in that The method includes: S1. Chaotic initialization stage: The initial position vector of the grey wolf population is used to generate an original chaotic sequence by Logistic chaotic mapping. The original chaotic sequence is subjected to 100 warm-up iterations to obtain a chaotic sequence with transient effects eliminated, and Gaussian perturbation is superimposed on the chaotic sequence with transient effects eliminated to obtain the final initial grey wolf population; where each individual in the grey wolf population represents four compensation parameters in the logistics sorting encoder. S2. Adaptive convergence factor adjustment: Design an exponential decay-cosine oscillation model to dynamically adjust the convergence factor. This model is dominated by exponential decay in the early stage of iteration, achieving rapid decay through the exponential term, and smoothly transitioning to local development through cosine oscillation in the later stage, balancing the exploration and development capabilities of the algorithm and suppressing search oscillations. (1) Among them, represents the adaptive convergence factor; t is the current iteration number, ; T is the maximum number of iterations; S3. Dynamic update mechanism of the leading wolf: Calculate the population fitness in parallel at each iteration, select the top three optimal solutions as the α wolf, β wolf, and δ wolf, and update the position of the leading wolf when the fitness of the new generation of grey wolf individuals is better than the historical optimum of the leading wolf. S4. Dynamic weight allocation strategy: dynamically adjust based on fitness entropy the weight of the wolf, and the more excellent the fitness, the stronger the guiding force of the individual; S5. Differential evolution enhancement stage: Perform differential evolution operations on grey wolf individuals with a probability of 30%, and then generate a trial vector through binomial crossover. If the trial vector is better than the original individual, it is replaced. S6. Adaptive Levy flight mutation: Generate a mutation step size using a Levy distribution with β = 1.

5. The mutation probability linearly decays from 0.2 to 0 with iteration, and the step size scaling factor is dynamically adjusted according to 0.05*(1 - t / T). S7. Hybrid boundary constraint processing: Use the method of reflection combined with random perturbation to process out-of-bounds parameters. (2) Among them, is the processed encoder parameter value, is the encoder parameter value to be processed; is the maximum value allowed for the parameter; is the minimum value allowed for the parameter; 、 is the absolute value of the out-of-bounds quantity, used to represent the absolute distance by which the parameter exceeds the upper or lower bound; is a random number, which is a random number uniformly distributed in and is used to introduce perturbations; out-of-bounds, upper-bound violation, and lower-bound violation are boolean values used to mark whether the parameter is out of bounds. S8. Elite population management: Calculate the population fitness in parallel at each iteration, locate the current worst individual through fitness sorting, generate a new individual by superimposing a normal perturbation with an amplitude of 10% of the solution space on the position of the optimal individual to replace the worst individual, and at the same time force the historical optimum solution to be retained for the next iteration. S9. Terminate when the maximum number of iterations is reached or the optimal fitness is less than the preset threshold, output the global optimal solution, and transfer the four compensation parameters in the optimal solution to the logistics sorting encoder to achieve real-time error compensation.

2. The method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to claim 1, characterized in that The specific steps of S1 are as follows: Generate an original chaotic sequence using Logistic chaotic mapping, and obtain a chaotic sequence with transient effects eliminated through 100 warm-up iterations of the original chaotic sequence. The process of generating the chaotic sequence is as follows: (3) Among them represents the chaotic variable value at the k-th iteration, where k represents the number of iterations, represents the initial chaotic variable value; represents the chaotic variable value after 100 iterations; Further introduce a Gaussian perturbation mechanism to lay a good foundation for subsequent optimization. (4) Among them, represents an individual of the initial population of encoder error compensation parameters; is the parameter lower bound vector, that is, the minimum value set of encoder error compensation parameters; is the parameter upper bound vector, that is, the maximum value set of compensation parameters; chaos is a chaotic sequence generated by the Logistic map, and the range of the chaotic sequence is ; is a standard normal distribution random number; 0.05 is the Gaussian perturbation intensity coefficient, which is used to control the perturbation amplitude of the initial population.

3. The method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to claim 1, characterized in that, In step S3, the population fitness function is calculated as follows: (5) wherein is the compensation parameter of the i-th grey wolf individual; is the weight error; is the engraving error, subdivision error and installation error of the k-th sampling.

4. The method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to claim 1, wherein In step S4, the dynamic adjustment based on fitness entropy The formula for the weight of the wolf is as follows: (6) Among them, are respectively the fitness value of the wolf, that is, the error compensation effect evaluation value; is the minimum fitness value in the current population; is the minimum value to prevent the denominator from being zero; represents the normalized weight of the i-th leading wolf.

5. The method for optimizing the error of a logistics sorting encoder based on an improved gray wolf algorithm according to claim 1, wherein The specific steps of S5 are as follows: First, perform DE / rand / 1 mutation with a probability of 30%, randomly select three individuals for vector perturbation. The DE / rand / 1 mutation formula is: (7) Among them, , , are three different individual parameter vectors randomly selected respectively; F is a scaling factor used to control the intensity of the difference vector; is the generated mutant individual parameter vector; Then, ensure the directional inheritance characteristics of the encoder compensation parameters through CR = 0.8 binomial crossover to improve the parameter identification accuracy of the encoder nonlinear error model, generate a trial vector, and replace it if the trial vector is better than the original individual. The formula for the binomial crossover operation is: (8) Among them, is the value of the j-th dimension parameter of the i-th individual of the trial vector generated by the binomial crossover operation, that is, the newly generated error compensation parameter combination; is the value of the j-th dimension parameter of the i-th individual of the mutation vector, that is, the perturbation parameter generated by the differential strategy; is the value of the j-th dimension parameter of the i-th individual of the original individual, that is, the candidate parameter combination of the current iteration; CR is the crossover probability, which is used to control the inheritance probability of the parameter dimension; rand is a uniformly distributed random number, which is used for the dimension crossover decision.

6. The method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to claim 1, wherein In step S6, the formula for generating the mutation step size using the Levy distribution is as follows: (9) Among them, represents the generated mutation step size; is a random number that obeys ; is a random number that obeys ; 0.05 is the basic step size coefficient, used to control the perturbation intensity; t is the current iteration number ( ); T is the maximum iteration number; lb is the lower bound vector of the parameters, that is, the minimum value set of the encoder error compensation parameters; ub is the upper bound vector of the parameters, that is, the maximum value set of the compensation parameters.

7. The method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to claim 1, characterized in that In step S8, the method of locating the current worst individual is as follows: (10) Among them, is the fitness value of the j-th individual; arg max is the index for taking the maximum value. If the optimization goal is the minimum value, then the maximum value corresponds to the worst solution; The new individual is generated by superimposing a normal perturbation with an amplitude of 10% of the solution space on the position of the optimal individual to replace the worst individual as follows: (11) Among them, is the parameter vector of the worst individual in the i-th generation; is the parameter vector of the optimal individual; 0.1 is the perturbation intensity coefficient.

8. The method for optimizing the error of a logistics sorting encoder based on an improved grey wolf algorithm according to claim 1, wherein In step S9, the four compensation parameters include: A: Amplitude compensation coefficient: correct the amplitude nonlinear error of the encoder signal; B: Phase compensation coefficient: compensate for the amplitude imbalance of the orthogonal signal; φ: Phase shift: correct the fixed phase shift caused by mechanical installation deviation or temperature drift; k: Frequency scaling factor: correct the frequency deviation caused by transmission ratio error or electronic subdivision error.

Citation Information

Patent Citations

  • Virtual power plant maximum benefit method based on improved grey wolf optimization algorithm

    CN117574066A

  • Implementation method for improved GWO (Gray Wolf Optimization) algorithm

    CN108510074A

  • Grey wolf algorithm hybrid optimization method based on reverse learning strategy

    CN116341605A

  • IGWO-SVR-based AC contactor control parameter optimization method

    CN117170244A

  • Unmanned aerial vehicle path planning method and system based on multi-strategy improved grey wolf algorithm

    CN119902554A

Cited By

  • Tension control optimization method for cable performance detection

    CN121115644A

  • A tension control optimization method for cable performance detection

    CN121115644B

  • High-permeability photovoltaic power distribution network multi-target voltage optimization method based on genetic algorithm

    CN122137034A