Substation mowing robot control method and device based on improved sparrow algorithm
By improving the sparrow algorithm to optimize the fuzzy PID controller, the problem of speed control of the substation lawnmower robot under load fluctuations was solved, realizing real-time adaptive adjustment of motor speed and improving lawnmower effect and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI ENERGY GRP EZHOU POWER GENERATION CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-30
AI Technical Summary
In the existing technology, the mowing effect of substation mowing robots is poor. This is mainly because traditional PID controllers have difficulty responding quickly to load fluctuations in areas with dense weeds, resulting in large deviations in motor speed, which affects control accuracy and mowing effect.
An improved sparrow algorithm is used to construct a fuzzy PID controller. By inputting the speed deviation and the rate of change of deviation, the quantization factor and the proportional factor are optimized. Combined with CircleMap chaotic mapping, adaptive dynamic step size strategy and elite back learning, the PID parameters are dynamically adjusted to achieve real-time adaptive control of motor speed.
It improves the flexibility and accuracy of motor speed control in lawnmower robots, reduces speed overshoot and oscillation, ensures mowing efficiency and motor operation stability, and ensures efficient weeding in substation environments.
Smart Images

Figure CN122308183A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of neural network optimization technology, specifically to a control method and device for a substation lawn mowing robot based on an improved sparrow algorithm. Background Technology
[0002] Substation environments have high requirements for safe operation. Weed growth can pose fire hazards, risks of small animals entering the substation, and obstacles to equipment inspection. Currently, automated lawnmower robots are being gradually introduced for routine maintenance. During the weeding process, the motor speed needs to be adjusted in real time according to the weed density and terrain changes to ensure weeding effectiveness and operational stability.
[0003] In the motor speed control of lawnmower robots, PID control is widely used due to its simple structure and ease of implementation. However, the working conditions of weeding operations in substations are highly variable, especially in areas with dense weeds. The continuous fluctuation of the weeding load leads to large deviations in motor speed, making it difficult for fixed-parameter PID controllers to respond quickly to load disturbances, affecting control accuracy and weeding effect. Fuzzy PID control can adjust PID parameters online according to the speed deviation and its rate of change, exhibiting a certain degree of self-adaptability. However, its control performance depends on the selection of quantization and proportional factors. Traditional manual trial-and-error methods are difficult to obtain the optimal parameter combination, and its ability to adapt to different working conditions is limited, resulting in poor weeding performance of the lawnmower robot. Summary of the Invention
[0004] This application provides a control method and device for a substation lawn mowing robot based on an improved sparrow algorithm, which can solve the technical problem of poor lawn mowing effect of existing lawn mowing robots.
[0005] In a first aspect, embodiments of this application provide a control method for a substation lawnmower robot based on an improved sparrow algorithm, the control method for the substation lawnmower robot based on the improved sparrow algorithm comprising: A fuzzy PID controller is constructed with speed deviation and deviation change rate as inputs and PID parameter correction as outputs. Preset initial PID parameters are set for the fuzzy PID controller. An improved sparrow algorithm is used to optimize the quantization factor and proportional factor of the fuzzy PID controller, and the optimized quantization factor and proportional factor are configured to the fuzzy PID controller. The actual rotational speed of the lawnmower robot's motor is collected, and the actual rotational speed is compared with the target rotational speed to obtain the rotational speed deviation and the rate of change of deviation. The data is then input into the configured fuzzy PID controller, which outputs the PID parameter correction amount. The preset PID initial parameters are corrected according to the PID parameter correction amount to obtain real-time PID parameters, and the rotational speed of the lawnmower robot motor is adjusted according to the real-time PID parameters. Specifically, the improved sparrow algorithm involves initializing the sparrow population using CircleMap chaotic mapping, adjusting the sparrow's anti-predation flight distance according to an adaptive dynamic step size strategy, and updating the population's optimal solution based on an elite individual reverse learning strategy combined with a perturbation strategy and a greedy mechanism.
[0006] In conjunction with the first aspect, in one implementation, before constructing a fuzzy PID controller with speed deviation and deviation change rate as inputs and PID parameter correction as outputs, and before setting preset PID initial parameters for the fuzzy PID controller, the method further includes: The camera of the lawnmower robot is activated to identify personnel, electrical equipment, and weeds in the substation working environment in real time, and to determine whether personnel or electrical equipment are detected in the substation working environment: If so, the main control module of the lawnmower will output a braking signal to stop both the walking mechanism and the mowing mechanism of the lawnmower. If not, the main control module of the lawnmower robot will control the lawnmower robot to enter the lawnmower operation state.
[0007] In conjunction with the first aspect, in one implementation, the construction of a fuzzy PID controller, with speed deviation and deviation change rate as inputs and PID parameter correction as outputs, includes: The physical domains of the rotational speed deviation, the deviation change rate, and the PID parameter correction are defined. Each physical domain is mapped to a fuzzy domain, a fuzzy subset of each fuzzy domain is defined, and the precise values after mapping are fuzzified using a triangular membership function to generate the corresponding fuzzy quantities. Using the fuzzy values of the rotational speed deviation and the rate of change of the deviation as inputs, and the fuzzy values of the PID parameter correction as outputs, a fuzzy control rule table is formulated, and a fuzzy PID controller is constructed based on the fuzzy control rule table.
[0008] In conjunction with the first aspect, in one implementation, the step of optimizing the quantization factor and scaling factor of the fuzzy PID controller using the improved sparrow algorithm, and configuring the optimized quantization factor and scaling factor to the fuzzy PID controller, includes: The parameters to be optimized are determined to be the quantization factor and proportional factor of the fuzzy PID controller. The quantization factor and proportional factor are combined as the position vector of the sparrow population. The parameter search range, population size, and maximum number of iterations are set. The sparrow population is initialized using a CircleMap chaotic mapping to generate the initial position of the population containing the initial values of the factors to be optimized; With the goal of optimizing the control effect of quantification factor and proportional factor, the fitness value of each sparrow individual is calculated, and the global optimal fitness value and global worst fitness value of the current population are determined. The positions of the discoverer, the joiner, and the scout are updated sequentially. An adaptive dynamic step size strategy is introduced during the scout position update process to adjust the sparrow's anti-predation flight distance. Select the sparrow with the best fitness value as the elite individual, generate a new solution through the elite reverse learning strategy, perturb the new solution based on the perturbation radius, and use a greedy mechanism to retain the better individual to complete the update of the population's optimal solution; Determine if the current iteration count has reached the maximum iteration count. If yes, terminate the iteration and map the current optimal sparrow position to the optimal quantization factor and the optimal scaling factor. If no, continue iterating. The optimized quantization factor and scaling factor are configured into the fuzzy PID controller.
[0009] In conjunction with the first aspect, in one implementation method, the fitness value of each individual sparrow is calculated with the optimization control effect of the quantification factor and the proportional factor as the objective. Specifically, the calculation is as follows:
[0010] in, Represents the fitness value. Indicates the speed deviation. This indicates the time length for evaluating the rotational speed error. Indicates in The speed deviation value.
[0011] In conjunction with the first aspect, in one implementation, the initialization of the sparrow population using a CircleMap chaotic mapping to generate an initial population position containing the initial values of the factors to be optimized includes: The sparrow population is initialized using the CircleMap chaotic mapping. The specific formula for the CircleMap chaotic mapping is as follows:
[0012] in, Indicates the first The initial position of each sparrow. Represents the modulo function. Indicates the first The initial position of each sparrow; Based on the value ranges of each quantification factor and each proportion factor, the initial positions of all generated sparrows are normalized to obtain the initial positions of the sparrow population that conform to the search range, thus completing the population initialization.
[0013] In conjunction with the first aspect, in one implementation, the introduction of an adaptive dynamic step size strategy to adjust the sparrow's anti-predation flight distance during the scout's location update process includes: Calculate the global optimal fitness value and the global worst fitness value of the sparrow population; Based on an adaptive dynamic step-size strategy, and combining the current iteration count, maximum iteration count, global optimal fitness value, and global worst fitness value, the discoverer search step-size and anti-predation perturbation step-size for this iteration are calculated. The adaptive dynamic step-size strategy is specifically as follows:
[0014] in, Indicates the search step size of the discoverer. Indicates the anti-predator disturbance step length. This represents the globally optimal fitness value. This represents the worst-case fitness value globally. This indicates the maximum number of iterations of the algorithm. This indicates the current iteration number of the algorithm. This represents the natural exponential function. A random number within the interval [0,1]; Based on the calculated discoverer search step size and anti-predation perturbation step size of this iteration, adjust the flight distance of the sparrow during the anti-predation process.
[0015] In conjunction with the first aspect, in one implementation, the step of selecting the current best sparrow individual as the elite individual, generating a new back-learning solution through an elite back-learning strategy, perturbing the new back-learning solution based on the perturbation radius, and using a greedy mechanism to selectively retain better individuals to complete the population optimal solution update includes: Select the sparrow individual with the best fitness value from the current sparrow population as the elite individual; A novel reverse learning solution is generated using an elite reverse learning strategy. This novel solution is then perturbed based on the perturbation radius, specifically as follows:
[0016] in, Indicates the first The first elite individual A new solution for the reverse learning perturbation of dimension. This represents the random scaling factor within the interval [0,1]. Indicates the population number The lower bound of the search for the dimensional position. Indicates the population number The upper bound of the search for dimensional positions. Indicates the first The first elite individual The original position of the dimension Indicates the first Individual The radius of the perturbation of the dimension, , Represented as the dimension of the parameter to be optimized. Indicates the current elite number The position of the dimension; Calculate the fitness value of the new solution after the perturbation, and compare it with the fitness value of the current best solution in the population through a greedy mechanism. The individual with the better fitness value is taken as the new best solution in the population.
[0017] In conjunction with the first aspect, in one implementation, setting preset PID initial parameters for the fuzzy PID controller includes: The specific values of the preset initial parameters of the PID controller are determined by trial and error and then entered into the fuzzy PID controller. The preset PID initial parameters include preset proportional parameters, preset integral parameters, and preset derivative parameters.
[0018] Secondly, embodiments of this application provide a substation lawnmower robot control device based on an improved sparrow algorithm, comprising: The module is used to build a fuzzy PID controller that takes speed deviation and deviation change rate as input and PID parameter correction as output, and sets preset PID initial parameters for the fuzzy PID controller. The optimization module is used to optimize the quantization factor and proportional factor of the fuzzy PID controller using an improved sparrow algorithm, and then configures the optimized quantization factor and proportional factor to the fuzzy PID controller. The data acquisition module is used to acquire the actual rotational speed of the lawnmower robot's motor, compare the actual rotational speed with the target rotational speed to obtain the rotational speed deviation and the rate of change of deviation, input the data into the configured fuzzy PID controller, and output the PID parameter correction amount. The correction module is used to correct the preset PID initial parameters according to the PID parameter correction amount to obtain real-time PID parameters, and adjust the speed of the lawnmower robot motor according to the real-time PID parameters. The improvements to the sparrow algorithm lie in the use of CircleMap chaotic mapping to initialize the sparrow population, adjusting the anti-predation flight distance of sparrows according to an adaptive dynamic step size strategy, and updating the optimal solution of the population based on the back learning strategy of elite individuals, combined with a perturbation strategy and a greedy mechanism.
[0019] The beneficial effects of the technical solutions provided in this application include: This application embodiment constructs a fuzzy PID controller with speed deviation and deviation change rate as inputs and PID parameter correction as outputs, and sets preset PID initial parameters. This provides a foundation for the dynamic adjustment of the motor speed of the lawnmower robot, solving the problem that traditional PID parameters with fixed values cannot adapt to changes in lawnmower conditions, and improving the flexibility of motor speed control. This application embodiment uses an improved sparrow algorithm to optimize the quantization factor and proportional factor of the fuzzy PID controller. CircleMap chaotic mapping can improve the initial diversity of the sparrow population, avoiding the algorithm getting trapped in local optima. The adaptive dynamic step size strategy can adjust the anti-predation flight distance of the sparrows, improving the algorithm's iterative convergence accuracy. Elite individual back-learning combined with a perturbation strategy and a greedy mechanism can accelerate the search speed for optimal parameters, ensuring the acquisition of the optimal quantization factor and proportional factor, and fully utilizing the control performance of the fuzzy PID controller. This application embodiment collects the actual motor speed, calculates the speed deviation and deviation change rate, and inputs them into the optimized fuzzy PID controller. It outputs the PID parameter correction and corrects the preset initial parameters, realizing dynamic adaptive adjustment of the motor speed, improving speed tracking accuracy, reducing speed overshoot, oscillation, and steady-state error, and ensuring lawnmower efficiency and motor operation stability. Attached Figure Description
[0020] Figure 1 A flowchart illustrating the control method for a substation lawnmower robot based on the improved sparrow algorithm provided in the embodiments of this application; Figure 2 An optimized flowchart of the improved sparrow algorithm provided in the embodiments of this application; Figure 3 A schematic diagram of the functional modules of a substation lawnmower control device based on an improved sparrow algorithm, provided in an embodiment of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0023] This application provides a control method and device for a substation lawn mowing robot based on an improved sparrow algorithm, which can solve the technical problem of poor lawn mowing effect of existing lawn mowing robots.
[0024] In a first aspect, embodiments of this application provide a control method for a substation lawn mowing robot based on an improved sparrow algorithm.
[0025] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating the control method for a substation lawnmower robot based on an improved sparrow algorithm, provided in an embodiment of this application. Figure 1 As shown, the control method for a substation lawnmower robot based on the improved sparrow algorithm specifically includes the following steps: Step S1: Construct a fuzzy PID controller with speed deviation and deviation change rate as inputs and PID parameter correction as output, and set preset PID initial parameters for the fuzzy PID controller.
[0026] In this embodiment of the application, the construction of a fuzzy PID controller in step S1, which takes the speed deviation and the rate of change of deviation as inputs and the PID parameter correction amount as outputs, includes: Step S11: Set the physical domain of the speed deviation, the physical domain of the deviation change rate, and the physical domain of the PID parameter correction.
[0027] Specifically, the physical domain refers to the actual range of values for the rotational speed deviation, the rate of change of deviation, and the PID parameter correction in the actual control scenario. It is the basis for signal processing by the fuzzy PID (Proportional-Integral-Derivative) controller. In this embodiment, the physical domain is determined based on the historical data of the lawnmower robot's motor operation and load characteristics, ensuring that the fuzzy PID controller covers all possible operating conditions. In a specific embodiment, the rotational speed deviation can be set. The physical domain is [-100, 100], and the rate of change of rotational speed deviation is... The physical domain is [-50, 50]. Among the PID parameter corrections, the proportional parameter correction... The physical domain is [-5, 5], and the integral parameter correction is... The physical domain is [-0.5, 0.5], and the differential parameter correction is... Its theoretical domain is [-0.08, 0.05].
[0028] Step S12: Map each physical domain to a fuzzy domain, define a fuzzy subset of each fuzzy domain, and use a triangular membership function to fuzzify the mapped precise values to generate the corresponding fuzzy quantities.
[0029] Specifically, through the quantization factor, the exact values within the physical domain of each variable are converted into values within the fuzzy domain that can be processed by the fuzzy control system, achieving unified standard processing of signals of different magnitudes and eliminating the influence of the variable value range difference on the control accuracy. In the embodiments of this application, the physical domains of each variable are mapped to a unified fuzzy domain {$ 6, 4, 2, 0, 2, 4, 6$}, and the fuzzy subsets on the fuzzy domain are defined as {Negative Large [N
[0035] , , , , , Negative Medium [N M , Negative Small [N S , Zero [Z O , Positive Small [P S , Positive Medium [P M , Positive Large [P B}, and each fuzzy subset corresponds to a linguistic value, which is used to describe the qualitative state of the variable.
[0030] The triangular membership function is used to calculate the degree to which the exact value belongs to each fuzzy subset, converting a single exact value into a fuzzy quantity with fuzzy characteristics, achieving the conversion from an exact signal to a fuzzy signal, and meeting the input requirements of fuzzy reasoning.
[0031] Step S13: Taking the fuzzy quantity of the rotational speed deviation and the fuzzy quantity of the deviation change rate as inputs and the fuzzy quantity of the PID parameter correction amount as the output, formulate a fuzzy control rule table, and construct a fuzzy PID controller based on the fuzzy control rule table.
[0032] Specifically, the fuzzy control rule table is a logical judgment rule established based on experimental data. Refer to Table 1, and Table 1 is the fuzzy control rule table.
[0033] Table 1 is the fuzzy control rule table <,
[0034] The input fuzzy quantity locates the corresponding row and column intersection cell in the table by matching the fuzzy subset with the highest membership degree, thereby determining the fuzzy subset of the output PID parameter correction amount and completing the fuzzy reasoning matching. Among them, when is relatively large, the system error is preferentially eliminated, making take a relatively large value to improve the response speed. When and are in the medium range, overshoot is mainly suppressed, making and coordinate their actions. When is relatively small, the steady-state characteristics and anti-interference ability are emphasized, making appropriately reduced to avoid oscillation.
[0035] In this embodiment of the application, step S1 of setting preset PID initial parameters for the fuzzy PID controller includes: determining the specific values of the preset PID initial parameters by trial and error and inputting them into the fuzzy PID controller; wherein, the preset PID initial parameters include preset proportional parameters, preset integral parameters, and preset derivative parameters.
[0036] Specifically, in the actual operating conditions of the lawnmower robot motor, the values of the proportional, integral, and derivative parameters are adjusted sequentially, the response characteristics of the motor speed are observed, and the parameter combination that can meet the basic speed control requirements of the motor is selected to form the preset PID initial parameters, which are used for parameter correction in subsequent real-time control.
[0037] In this embodiment of the application, before step S1, the following steps are further included: Step A1: Activate the camera of the lawnmower robot to identify personnel, electrical equipment and weeds in the substation working environment in real time. Determine whether personnel or electrical equipment are detected in the substation working environment. If yes, proceed to step A2; otherwise, proceed to step A3.
[0038] Specifically, the lawnmower robot includes a microcontroller for processing information from all sensors, and controls the movement of the motors and four servo motors to drive the entire robot to operate accurately. A camera continuously monitors the robot's surroundings, sending the location of weeds to the main controller when detected. It stops working when a person is detected nearby, resuming operation only after the person has moved away, minimizing the risk of accidental injury to people or objects. An attitude sensor acquires the robot's position and attitude in real time, adjusting the tilt angle of the mowing device based on its posture. When the main controller receives a command to remove weeds, the four servo motors lower, retracting until the camera detects that the surrounding weeds have been cleared.
[0039] To achieve the goals of real-time environmental monitoring, driving multiple motor circuits within the system, and long battery life for the lawnmower robot, the system employs a 32-bit high-performance STM32F407 microcontroller with an ARM Cortex-M4 processor, meeting the development requirements of the intelligent lawnmower robot system. This microcontroller has an I2C communication interface, enabling serial communication with a camera to read real-time surrounding conditions. The microcontroller's timer simultaneously generates four PWM outputs to drive the multiple motor circuits in this system.
[0040] The lawnmower robot uses HUSKYLENS as its vision sensor for real-time monitoring of the substation environment. It employs a Kendryte K210 processor and utilizes the classic YOLO AI algorithm. The vision sensor undergoes multiple model training iterations to accurately identify weeds around the robot. It connects to the main controller via an onboard I2C interface, displaying real-time images on a 2.0-inch IPS screen. A "Husky Image Recognition" module is used to learn the numbering of fruit trees, weeds, and people, assigning numbers to electrical equipment (1), weeds (2), and people (3). The vision sensor transmits the identified object information, represented by numbers, to the main controller via a serial port.
[0041] Step A2: The main control module of the lawnmower robot outputs a braking signal to stop both the walking mechanism and the mowing mechanism of the lawnmower robot.
[0042] Specifically, the lawnmower robot monitors its surroundings in real time for the presence of people or electrical equipment. If any people or equipment are detected, the robot stops working and resumes operation only after the person leaves. When the main control module detects a person or electrical equipment, it immediately outputs a braking signal. This braking signal is transmitted to the drive module TB6612 via a timer-generated PWM output. The TB6612 cuts off the power supply to both the walking and mowing motors. The walking mechanism, driven by four DC geared motors, stops operating upon receiving the braking signal; the mowing mechanism, composed of four servo-controlled mowing motors, also stops operating upon receiving the braking signal. With all motors stopped, the lawnmower robot remains stationary until the vision acquisition module detects that a person or electrical equipment has left the work area. At this point, the main control module releases the braking signal, and the robot resumes operation.
[0043] Step A3: The main control module of the lawnmower robot controls the lawnmower robot to enter the lawnmower operation state.
[0044] Specifically, the lawnmower robot distinguishes between people, electrical equipment, and weeds. It stops to remove weeds upon detection and continues moving forward afterward. While moving, the robot uses an MPU6050 attitude sensor to detect the slope, and the mowing device adjusts its angle accordingly. The robot then continues its work until the main controller detects that it has completed the mowing of the entire substation, at which point it automatically shuts off its power. After system initialization, the robot's vision sensors monitor its surroundings in real time and transmit information to the main controller. The main controller then sends commands to the motors and four servo motors, instructing the robot to move and mow.
[0045] When the lawnmower robot is detected to be out of parallel with the ground, the angle of the mowing motor changes with the angle of the ground. The attitude sensor MPU6050 can simultaneously detect the motion data of the three-axis acceleration and the three-axis gyroscope, and is connected to the main controller STM32F407 through the I2C bus serial clock line SCL and bidirectional data line SDA, sending the current attitude of the lawnmower robot to the main controller in real time.
[0046] The lawnmower uses a 1:12 DC geared motor to drive the robot in the substation for weeding. This motor provides greater safety and a wider operating range for the robot within the substation. The robot's raised wheels evenly distribute pressure on various terrains, such as mud, resulting in less pressure on the ground and a lower ground contact ratio, thus ensuring high stability in the substation. When the main controller receives information about weeds from the vision sensor, it transmits a weeding command to the weeding motor, which then rotates to complete the weeding task.
[0047] The main control module has a relatively low current consumption, but the motors require a large current to operate. Therefore, the TB6612 drive module is selected in this system to increase the main control current. The TB6612 can drive two DC motors to power the wheels. The TB6612 has strong driving capability, capable of driving high-power weeding robots; the TB6612 is efficient and has low power consumption, allowing the robot to operate for extended periods in substations; the TB6612 is small in size, saving space and minimizing its footprint on the intelligent weeding robot; the TB6612 also features overcurrent protection, overheat protection, and undervoltage protection, ensuring the robot's safety during long-term operation; the TB6612 offers flexible control, with the system controlling the motor speed and direction via PWM signals.
[0048] Step S2: The improved sparrow algorithm is used to optimize the quantization factor and proportional factor of the fuzzy PID controller, and the optimized quantization factor and proportional factor are configured to the fuzzy PID controller.
[0049] Figure 2 An optimized flowchart of the improved sparrow algorithm provided in the embodiments of this application. See also... Figure 2 In this embodiment of the application, the improved sparrow algorithm specifically involves initializing the sparrow population using CircleMap chaotic mapping, adjusting the sparrow anti-predation flight distance according to an adaptive dynamic step size strategy, and updating the optimal solution of the population based on an elite individual reverse learning strategy combined with a perturbation strategy and a greedy mechanism.
[0050] In this embodiment of the application, step S2 specifically includes the following steps: Step S21: Determine the parameters to be optimized as the quantization factor and proportional factor of the fuzzy PID controller, combine the quantization factor and proportional factor as the position vector of the sparrow population, and set the parameter search range, population size, and maximum number of iterations.
[0051] Specifically, the quantization factors of the fuzzy PID controller include the deviation quantization factor. Quantitative factor of deviation change rate The scaling factor includes the scaling factor for the scaling coefficient correction. , proportional factor of integral coefficient correction The scaling factor of the differential coefficient correction amount The five parameters to be optimized are combined into a five-dimensional vector, which serves as the position vector for each individual in the sparrow population. In the improved sparrow algorithm, each individual represents a set of candidate quantization and scaling factors, and the population consists of multiple such individuals. Through iterative evolution of the population, the algorithm searches for the individual position that optimizes the objective function, i.e., the optimal combination of parameters.
[0052] The parameter search range is typically determined based on the mapping relationship between the physical domain and the fuzzy domain, as well as engineering experience. The population size represents the number of sparrow individuals; a larger population size results in stronger parallel search capabilities. In this embodiment, the population size can be set to 100. The maximum number of iterations determines the total number of generations the algorithm runs, and can be set to 50.
[0053] Step S22: Initialize the sparrow population using CircleMap chaotic mapping to generate the initial position of the population containing the initial values of the factors to be optimized.
[0054] Specifically, step S22 includes the following steps: Step S221: Initialize the sparrow population using CircleMap chaotic mapping. The specific formula for CircleMap chaotic mapping is as follows:
[0055] in, Indicates the first The initial position of each sparrow. Represents the modulo function. Indicates the first The initial position of each sparrow.
[0056] Specifically, CircleMap chaotic mapping generates chaotic sequences iteratively, characterized by good traversability, strong randomness, and no repetition between adjacent points. First, an initial value is randomly generated for each dimension parameter of each individual sparrow. Then, the initial positions of the other sparrows are calculated sequentially according to the above formula until a chaotic sequence corresponding to the population size is generated. Since chaotic mapping is sensitive to initial values, the sequences generated by different initial values differ significantly, thus ensuring the diversity of the population.
[0057] Step S222: Based on the value range of each quantization factor and the value range of each proportion factor, normalize the initial positions of all generated sparrows to obtain the initial positions of the sparrow population that meet the search range, thus completing the population initialization.
[0058] Specifically, the value range of each quantization factor and the value range of each scaling factor are their respective search ranges. Therefore, it is necessary to map the normalized values to the actual search space of each parameter to obtain the initial position vector of each sparrow individual and complete the population initialization.
[0059] Using CircleMap chaotic mapping to initialize the sparrow population avoids the clustering phenomenon that may occur with random initialization, and makes the population cover a wider solution space, which is beneficial for the algorithm to find the global optimal solution.
[0060] Step S23: With the goal of optimizing the control effect of the quantification factor and the proportional factor, calculate the fitness value of each sparrow individual, and determine the global optimal fitness value and the global worst fitness value of the current population.
[0061] Specifically, with the goal of optimizing the control effect of the quantification factor and the proportional factor, the fitness value of each individual sparrow is calculated, as follows:
[0062] in, Represents the fitness value. Indicates the speed deviation. This indicates the time length for evaluating the rotational speed error. Indicates in The speed deviation value.
[0063] In a simulation model that includes modules such as a brushless DC motor, inverter circuit, and commutation logic, a target speed is set, the control system is run, and the speed deviation is recorded throughout the simulation time. The time series is discretized and sampled, and the fitness value is obtained using a numerical integration method. After calculating the fitness of all individuals, the fitness values of all individuals are compared. The value with the smallest fitness is taken as the global optimal fitness value, and the value with the largest fitness value is taken as the global worst fitness value.
[0064] Step S24: Execute the discoverer's position update, joiner's position update, and scout's position update in sequence. During the scout's position update process, introduce an adaptive dynamic step size strategy to adjust the sparrow's anti-predation flight distance.
[0065] In this embodiment of the application, the discoverer location update method in step S24 is specifically as follows:
[0066] in, Indicates the number of iterations. Indicates the maximum number of iterations; Indicates the first After the nth iteration The first sparrow The position of the dimension Represents a random number within the interval [0,1]. Let represent a random number that follows a normal distribution (0, 1). This represents a 1×d identity matrix, where d represents the search dimension. This indicates a warning value used to simulate the degree of environmental hazard. This indicates the safety threshold.
[0067] when When the environment is safe, the discoverer performs a fine search near the current optimal position, with the step size decreasing exponentially with the number of iterations, eventually tending towards local development. When a danger is detected, the discoverer randomly flies to other areas to escape the local optimum.
[0068] The specific method for updating the location of new members is as follows:
[0069] in, Indicates the first The optimal discoverer position in the next iteration. This represents a 1×d-dimensional vector with elements ±1. , Indicates the first The worst position in the next iteration This indicates the number of participants.
[0070] when At this time, less fit participants lack energy and need to fly to other areas to forage, using the exponential term to generate a random step size away from their current less fit position. At that time, participants with better fitness perform a local search around the optimal discoverer and generate new solutions near the optimal position by random directions.
[0071] The specific method for updating the scout's location is as follows:
[0072] in, Indicates the first The global optimal position in the next iteration. Indicates the search step size of the discoverer. Represents a random number within the interval [0,1]. Indicates the first The fitness value of a sparrow. This represents the globally optimal fitness value. This represents the worst-case fitness value globally. This represents the minimum value greater than 0, avoiding a denominator of 0.
[0073] when When an individual is in a relatively favorable position, random perturbations are performed near the global optimum to enhance local exploitation. When an individual is in an optimal position, it can randomly move in the direction of the global worst-case scenario in order to escape the current local optimum.
[0074] In this embodiment of the application, step S24, which introduces an adaptive dynamic step size strategy to adjust the sparrow's anti-predation flight distance during the scout's position update process, specifically includes the following steps: Step S241: Calculate the global optimal fitness value and the global worst fitness value of the sparrow population.
[0075] Specifically, based on the population fitness value calculated in step S23, the global optimal fitness value and the global worst fitness value are determined.
[0076] Step S242: Based on the adaptive dynamic step size strategy, and combining the current iteration number, maximum iteration number, global best fitness value, and global worst fitness value, calculate the discoverer search step size and anti-predator perturbation step size for this iteration. The adaptive dynamic step size strategy is as follows:
[0077] in, Indicates the search step size of the discoverer. Indicates the anti-predator disturbance step length. This represents the globally optimal fitness value. This represents the worst-case fitness value globally. This indicates the maximum number of iterations of the algorithm. This indicates the current iteration number of the algorithm. This represents the natural exponential function. It is a random number within the interval [0,1].
[0078] Specifically, the discoverer's search step size is determined by the difference between the best and worst fitness and the iteration progress factor. It is smaller in the early stages of iteration, with the progress factor close to 1, resulting in a larger discoverer search step size, which is beneficial for global search. In the later stages of iteration, as the maximum number of iterations approaches, the progress factor approaches 0, and the discoverer search step size decreases, which is beneficial for finer-grained local search. The anti-predation perturbation step size is larger in the early stages of iteration and approaches 0 in the later stages, causing the perturbation amplitude to gradually decrease as the search progresses. Simultaneously, multiplying by a random factor allows the anti-predation perturbation step size to take positive or negative values, achieving bidirectional random perturbation and helping the algorithm escape local optima.
[0079] Step S243: Adjust the flight distance of the sparrow during the anti-predation process based on the founder search step length and anti-predation perturbation step length calculated for this iteration.
[0080] Specifically, when the scout moves towards the global optimum, the search step size of the discoverer is used to control the movement step size, so that the movement distance adaptively decreases with the iteration process. When the scout makes random perturbations, the anti-predator perturbation step size is used to control the perturbation amplitude, so that the perturbation range gradually shrinks with the iteration process, avoiding excessive oscillation in the later stages.
[0081] Step S25: Select the sparrow individual with the best current fitness value as the elite individual, generate a new solution through the elite reverse learning strategy, perturb the new solution based on the perturbation radius, and use a greedy mechanism to retain the better individual to complete the population optimal solution update.
[0082] In this embodiment of the application, step S25 specifically includes the following steps: Step S251: Select the sparrow individual with the best current fitness value from the current sparrow population as the elite individual.
[0083] Specifically, based on the fitness value calculated in step S23, the individual with the smallest fitness value is selected as the elite individual, which represents the optimal solution found in the current search process.
[0084] Step S252: Generate a new back-learning solution using an elite back-learning strategy, and perturb the new back-learning solution based on the perturbation radius, specifically as follows:
[0085] in, Indicates the first The first elite individual A new solution for the reverse learning perturbation of dimension. This represents the random scaling factor within the interval [0,1]. Indicates the population number The lower bound of the search for the dimensional position. Indicates the population number The upper bound of the search for dimensional positions. Indicates the first The first elite individual The original position of the dimension. Indicates the first Individual The radius of the perturbation of the dimension, , Represented as the dimension of the parameter to be optimized. Indicates the current elite number The position of the dimension.
[0086] Before performing elite reverse learning, a random number is generated for each individual discoverer. P ,judge P If the probability of >50% holds true, then elite back-learning is performed on the discoverer to generate a reverse solution and introduce a perturbation. If the probability does not hold true, the discoverer is skipped, back-learning is not performed, and the original individual is retained. This reduces the computational burden while maintaining search capability.
[0087] The perturbation radius is the absolute deviation between the population average position and the elite individual's position. A larger deviation indicates that the elite individual is farther from the population center; in this case, a larger perturbation helps explore a wider area around the elite individual. If the elite individual is close to the population center, a smaller perturbation allows for a more refined search. By introducing a random scaling factor, the center of symmetry in the back-learning process changes randomly within a certain range, preventing the back-learning solution from being fixed at a strictly symmetric point and increasing the diversity of solutions. After superimposing the perturbation radius, the new solution further gains local perturbation based on the back-learning, expanding the search range.
[0088] Step S253: Calculate the fitness value of the new solution after the perturbation, compare it with the fitness value of the current best solution in the population through a greedy mechanism, and take the individual with the better fitness value as the new best solution in the population.
[0089] Specifically, if the fitness value of the new solution obtained through reverse learning is better than that of the original elite individual, then the original elite individual is replaced with the new solution, thus updating the optimal solution for the population. Otherwise, the original elite individual remains unchanged. This mechanism ensures that the population always evolves towards a smaller fitness value, while allowing for the acceptance of better new solutions but not inferior ones, thereby guaranteeing the monotonicity of convergence.
[0090] Step S26: Determine whether the current iteration count has reached the maximum iteration count. If yes, terminate the iteration and map the current optimal sparrow position to the optimal quantization factor and the optimal scaling factor. If no, continue the iteration.
[0091] Specifically, if the current iteration count has not yet reached the maximum iteration count, it indicates that the algorithm has not completed the entire search process. In this case, the algorithm returns to step S23 to continue the next iteration, including fitness calculation, position update, and backpropagation. If the current iteration count reaches the maximum iteration count, it indicates that the algorithm has completed all preset iterations, the search process terminates, and the algorithm enters the parameter decoding stage. When the iteration terminates, the individual with the smallest fitness value in the current population is the global optimum. The components of this vector are then mapped sequentially to the parameters to be optimized by the fuzzy PID controller.
[0092] Step S27: Configure the optimized quantization factor and scaling factor into the fuzzy PID controller.
[0093] Specifically, the five decoded parameters are written into the corresponding modules of the fuzzy PID controller. After configuration, the fuzzy PID controller has an optimized input-output mapping relationship, and its quantization factor and scaling factor are the optimal values obtained by the algorithm.
[0094] Step S3: Collect the actual rotation speed of the lawnmower robot motor, compare the actual rotation speed with the target rotation speed to obtain the rotation speed deviation and the rate of change of deviation, and input them into the configured fuzzy PID controller to output the PID parameter correction amount.
[0095] Specifically, during operation, the main control module of the lawnmower robot collects the actual rotational speed of the DC geared motor at a fixed sampling period through feedback components such as motor encoders or Hall sensors. The main control module internally stores a preset target rotational speed, which can be the desired rotational speed set according to the characteristics of the weeding load. The rate of change of rotational speed deviation is approximately calculated using the differential method to reflect the trend of rotational speed deviation over time. This data is input to the fuzzy PID controller configured in step S27, and the controller outputs the PID parameter correction amount.
[0096] Step S4: Correct the preset PID initial parameters according to the PID parameter correction amount to obtain the real-time PID parameters, and adjust the speed of the lawnmower robot motor according to the real-time PID parameters.
[0097] Specifically, the calculation of real-time PID parameters is as follows:
[0098]
[0099]
[0100] in, This represents the proportional parameter in the preset PID initial parameters obtained through trial and error. The scaling factor represents the amount of scaling factor correction. This indicates the adjustment amount for the proportional parameter. This represents the integral parameter in the preset PID initial parameters obtained through trial and error. The scaling factor represents the amount of correction to the integral coefficient. This represents the correction amount for the integral parameter. This represents the differential parameter in the preset PID initial parameters obtained through trial and error. The scaling factor that represents the correction amount of the differential coefficient. This represents the correction amount for the differential parameter.
[0101] Based on real-time PID parameters, a positional or incremental PID control algorithm is used to calculate the control quantity. This control quantity is converted into a corresponding PWM duty cycle signal, which is then output to the drive module TB6612 via the main control module's timer. The drive module adjusts the voltage applied across the DC geared motor according to the PWM signal, thereby changing the motor speed and bringing the actual speed closer to the target speed.
[0102] This application embodiment constructs a fuzzy PID controller with speed deviation and deviation change rate as inputs and PID parameter correction as outputs, and sets preset PID initial parameters. This provides a foundation for the dynamic adjustment of the motor speed of the lawnmower robot, solving the problem that traditional PID parameters with fixed values cannot adapt to changes in lawnmower conditions, and improving the flexibility of motor speed control. This application embodiment uses an improved sparrow algorithm to optimize the quantization factor and proportional factor of the fuzzy PID controller. CircleMap chaotic mapping can improve the initial diversity of the sparrow population, avoiding the algorithm getting trapped in local optima. The adaptive dynamic step size strategy can adjust the anti-predation flight distance of the sparrows, improving the algorithm's iterative convergence accuracy. Elite individual back-learning combined with a perturbation strategy and a greedy mechanism can accelerate the search speed for optimal parameters, ensuring the acquisition of the optimal quantization factor and proportional factor, and fully utilizing the control performance of the fuzzy PID controller. This application embodiment collects the actual motor speed, calculates the speed deviation and deviation change rate, and inputs them into the optimized fuzzy PID controller. It outputs the PID parameter correction and corrects the preset initial parameters, realizing dynamic adaptive adjustment of the motor speed, improving speed tracking accuracy, reducing speed overshoot, oscillation, and steady-state error, and ensuring lawnmower efficiency and motor operation stability.
[0103] Secondly, embodiments of this application also provide a control device for a substation lawn mowing robot based on an improved sparrow algorithm.
[0104] In one embodiment, reference is made to Figure 3 , Figure 3 This is a functional module diagram of a substation lawnmower control device based on an improved sparrow algorithm, provided as an embodiment of this application. Figure 3 As shown, the control device for the substation lawnmower robot based on the improved sparrow algorithm includes: The module is used to build a fuzzy PID controller that takes speed deviation and deviation change rate as input and PID parameter correction as output, and sets preset PID initial parameters for the fuzzy PID controller. The optimization module is used to optimize the quantization factor and proportional factor of the fuzzy PID controller using an improved sparrow algorithm, and then configures the optimized quantization factor and proportional factor to the fuzzy PID controller. The data acquisition module is used to acquire the actual rotational speed of the lawnmower robot's motor, compare the actual rotational speed with the target rotational speed to obtain the rotational speed deviation and the rate of change of deviation, input the data into the configured fuzzy PID controller, and output the PID parameter correction amount. The correction module is used to correct the preset PID initial parameters according to the PID parameter correction amount to obtain real-time PID parameters, and adjust the speed of the lawnmower robot motor according to the real-time PID parameters. The improvements to the sparrow algorithm lie in the use of CircleMap chaotic mapping to initialize the sparrow population, adjusting the anti-predation flight distance of sparrows according to an adaptive dynamic step size strategy, and updating the optimal solution of the population based on the back learning strategy of elite individuals, combined with a perturbation strategy and a greedy mechanism.
[0105] The functions of each module in the substation lawn mowing robot control device based on the improved sparrow algorithm correspond to the steps in the substation lawn mowing robot control method embodiment based on the improved sparrow algorithm. Their functions and implementation processes will not be described in detail here.
[0106] Thirdly, this application provides a substation lawn mowing robot control device based on an improved sparrow algorithm. The substation lawn mowing robot control device based on the improved sparrow algorithm can be a personal computer (PC), laptop computer, server, or other device with data processing capabilities.
[0107] In this embodiment of the application, the substation lawn mowing robot control device based on the improved sparrow algorithm may include a processor, a memory, a communication interface, and a communication bus.
[0108] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.
[0109] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces enable interconnection of internal components within the substation lawnmower control device based on the improved sparrow algorithm, and also enable interconnection between the substation lawnmower control device and other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.
[0110] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0111] The processor can be a general-purpose processor, which can call the substation lawnmower control program based on the improved sparrow algorithm stored in the memory and execute the substation lawnmower control method based on the improved sparrow algorithm provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the substation lawnmower control program based on the improved sparrow algorithm is called can refer to the various embodiments of the substation lawnmower control method based on the improved sparrow algorithm of this application, and will not be repeated here.
[0112] Those skilled in the art will understand that the hardware structure shown in Figure m does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0113] Fourthly, embodiments of this application also provide a computer-readable storage medium.
[0114] This application stores a substation lawn mowing robot control program based on an improved sparrow algorithm on a computer-readable storage medium. When the substation lawn mowing robot control program based on the improved sparrow algorithm is executed by a processor, it implements the steps of the substation lawn mowing robot control method based on the improved sparrow algorithm as described above.
[0115] The method implemented when the substation lawn mowing robot control program based on the improved sparrow algorithm is executed can be referred to in the various embodiments of the substation lawn mowing robot control method based on the improved sparrow algorithm of this application, and will not be repeated here.
[0116] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0117] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0118] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0119] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0120] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0122] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A control method for a substation lawnmower robot based on an improved sparrow algorithm, characterized in that, The substation lawnmower control method based on the improved sparrow algorithm includes: A fuzzy PID controller is constructed with speed deviation and deviation change rate as inputs and PID parameter correction as outputs. Preset initial PID parameters are set for the fuzzy PID controller. An improved sparrow algorithm is used to optimize the quantization factor and proportional factor of the fuzzy PID controller, and the optimized quantization factor and proportional factor are configured into the fuzzy PID controller. The actual rotational speed of the lawnmower robot's motor is collected, and the actual rotational speed is compared with the target rotational speed to obtain the rotational speed deviation and the rate of change of deviation. The data is then input into the configured fuzzy PID controller, which outputs the PID parameter correction amount. The preset PID initial parameters are corrected according to the PID parameter correction amount to obtain real-time PID parameters, and the rotational speed of the lawnmower robot motor is adjusted according to the real-time PID parameters. Specifically, the improved sparrow algorithm involves initializing the sparrow population using CircleMap chaotic mapping, adjusting the sparrow's anti-predation flight distance according to an adaptive dynamic step size strategy, and updating the population's optimal solution based on an elite individual reverse learning strategy combined with a perturbation strategy and a greedy mechanism.
2. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 1, characterized in that, Before constructing a fuzzy PID controller that takes speed deviation and deviation change rate as inputs and PID parameter correction as outputs, and before setting preset PID initial parameters for the fuzzy PID controller, the following steps are also included: The camera of the lawnmower robot is activated to identify personnel, electrical equipment, and weeds in the substation working environment in real time, and to determine whether personnel or electrical equipment are detected in the substation working environment: If so, the main control module of the lawnmower will output a braking signal to stop both the walking mechanism and the mowing mechanism of the lawnmower. If not, the main control module of the lawnmower robot will control the lawnmower robot to enter the lawnmower operation state.
3. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 1, characterized in that, The construction of the fuzzy PID controller, which takes speed deviation and deviation change rate as inputs and PID parameter correction as outputs, includes: Define the physical domain of the speed deviation, the physical domain of the deviation change rate, and the physical domain of the PID parameter correction. Each physical domain is mapped to a fuzzy domain, a fuzzy subset of each fuzzy domain is defined, and the precise values after mapping are fuzzified using a triangular membership function to generate the corresponding fuzzy quantities. Using the fuzzy values of the rotational speed deviation and the rate of change of the deviation as inputs, and the fuzzy values of the PID parameter correction as outputs, a fuzzy control rule table is formulated, and a fuzzy PID controller is constructed based on the fuzzy control rule table.
4. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 1, characterized in that, The step of optimizing the quantization factor and scaling factor of the fuzzy PID controller using an improved sparrow algorithm, and configuring the optimized quantization factor and scaling factor to the fuzzy PID controller, includes: The parameters to be optimized are determined to be the quantization factor and proportional factor of the fuzzy PID controller. The quantization factor and proportional factor are combined as the position vector of the sparrow population. The parameter search range, population size, and maximum number of iterations are set. The sparrow population is initialized using a CircleMap chaotic mapping to generate the initial position of the population containing the initial values of the factors to be optimized; With the goal of optimizing the control effect of quantification factor and proportional factor, the fitness value of each sparrow individual is calculated, and the global optimal fitness value and global worst fitness value of the current population are determined. The positions of the discoverer, the joiner, and the scout are updated sequentially. An adaptive dynamic step size strategy is introduced during the scout position update process to adjust the sparrow's anti-predation flight distance. Select the sparrow with the best fitness value as the elite individual, generate a new solution through the elite reverse learning strategy, perturb the new solution based on the perturbation radius, and retain the better individual using a greedy mechanism to complete the update of the population's optimal solution; Determine if the current iteration count has reached the maximum iteration count. If yes, terminate the iteration and map the current optimal sparrow position to the optimal quantization factor and the optimal scaling factor. If no, continue iterating. The optimized quantization factor and scaling factor are configured into the fuzzy PID controller.
5. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 4, characterized in that, The fitness value of each individual sparrow is calculated with the optimization control effect of quantification factor and proportional factor as the objective. The specific calculation is as follows: in, Represents the fitness value. Indicates the speed deviation. This indicates the time length for evaluating the rotational speed error. Indicates in The speed deviation value.
6. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 4, characterized in that, The initialization of the sparrow population using CircleMap chaotic mapping to generate the initial population position containing the initial values of the factors to be optimized includes: The sparrow population is initialized using the CircleMap chaotic mapping. The specific formula for the CircleMap chaotic mapping is as follows: in, Indicates the first The initial position of each sparrow. Represents the modulo function. Indicates the first The initial position of each sparrow; Based on the value ranges of each quantification factor and each proportion factor, the initial positions of all generated sparrows are normalized to obtain the initial positions of the sparrow population that conform to the search range, thus completing the population initialization.
7. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 4, characterized in that, The introduction of an adaptive dynamic step size strategy to adjust the sparrow's anti-predation flight distance during the scout's location update process includes: Calculate the global optimal fitness value and the global worst fitness value of the sparrow population; Based on an adaptive dynamic step-size strategy, and combining the current iteration count, maximum iteration count, global optimal fitness value, and global worst fitness value, the discoverer search step-size and anti-predation perturbation step-size for this iteration are calculated. The adaptive dynamic step-size strategy is specifically as follows: in, Indicates the search step size of the discoverer. Indicates the anti-predator disturbance step length. This represents the globally optimal fitness value. This represents the worst global fitness value. This indicates the maximum number of iterations of the algorithm. This indicates the current iteration number of the algorithm. This represents the natural exponential function. A random number within the interval [0,1]; Based on the calculated discoverer search step size and anti-predation perturbation step size of this iteration, adjust the flight distance of the sparrow during the anti-predation process.
8. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 4, characterized in that, The process involves selecting the current best sparrow individual as the elite individual, generating a new solution through an elite reverse learning strategy, perturbing the new solution based on the perturbation radius, and using a greedy mechanism to select and retain the best individuals to complete the update of the population's optimal solution, including: Select the sparrow individual with the best fitness value from the current sparrow population as the elite individual; A novel reverse learning solution is generated using an elite reverse learning strategy. This novel solution is then perturbed based on the perturbation radius, specifically as follows: in, Indicates the first The first elite individual A new solution for the reverse learning perturbation of dimension. This represents the random scaling factor within the interval [0,1]. Indicates the population number The lower bound of the search for the dimensional position. Indicates the population number The upper bound of the search for dimensional positions. Indicates the first The first elite individual The original position of the dimension Indicates the first Individual The radius of the perturbation of the dimension, , Represented as the dimension of the parameter to be optimized. Indicates the current elite number The position of the dimension; Calculate the fitness value of the new solution after the perturbation, and compare it with the fitness value of the current best solution in the population through a greedy mechanism. The individual with the better fitness value is taken as the new best solution in the population.
9. The substation lawnmower robot control method based on the improved sparrow algorithm according to claim 1, characterized in that, The step of setting preset PID initial parameters for the fuzzy PID controller includes: The specific values of the preset initial parameters of the PID controller are determined by trial and error and then entered into the fuzzy PID controller. The preset PID initial parameters include preset proportional parameters, preset integral parameters, and preset derivative parameters.
10. A control device for a substation lawnmower robot based on an improved sparrow algorithm, characterized in that, The substation lawnmower control device based on the improved sparrow algorithm includes: The module is used to build a fuzzy PID controller that takes speed deviation and deviation change rate as input and PID parameter correction as output, and sets preset PID initial parameters for the fuzzy PID controller. The optimization module is used to optimize the quantization factor and proportional factor of the fuzzy PID controller using an improved sparrow algorithm, and then configures the optimized quantization factor and proportional factor to the fuzzy PID controller. The data acquisition module is used to acquire the actual rotational speed of the lawnmower robot's motor, compare the actual rotational speed with the target rotational speed to obtain the rotational speed deviation and the rate of change of deviation, input the data into the configured fuzzy PID controller, and output the PID parameter correction amount. The correction module is used to correct the preset PID initial parameters according to the PID parameter correction amount to obtain real-time PID parameters, and adjust the speed of the lawnmower robot motor according to the real-time PID parameters. The improvements to the sparrow algorithm lie in the use of CircleMap chaotic mapping to initialize the sparrow population, adjusting the anti-predation flight distance of sparrows according to an adaptive dynamic step size strategy, and updating the optimal solution of the population based on the back learning strategy of elite individuals, combined with a perturbation strategy and a greedy mechanism.