UAV vertical launch method and system based on PID control
By introducing adaptive mechanisms and genetic algorithms into the drone vertical launch system to optimize PID parameters, and combining wind speed, temperature compensation and fuzzy logic control, the problem of slow response and steady-state error of traditional PID control under environmental changes is solved, and the problem of slow response and steady-state error of traditional PID control under environmental changes is realized. More efficient control effect.
Patent Information
- Application Number
- CN202411281078.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-13
AI Technical Summary
Traditional PID control is difficult to dynamically adjust when facing environmental changes, resulting in problems such as slow response, excessive overshoot, steady-state error during vertical launch of the drone.
Adaptive mechanism and genetic algorithm are introduced to optimize PID parameters, adjust the basic PID parameters in real time through environmental monitoring, and use wind speed and temperature compensation methods to optimize proportion, integral, and differential terms, and combine with a fuzzy logic controller to perform temperature compensation, and dynamically adjust the control output.
It improves the response speed and stability of the vertical launch control of the drone, reduces steady-state error and overshoot, and enhances the adaptability and robustness of the control system.
Smart Images

Figure CN118778426B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to control technology, and in particular to a method and system for vertically launching an unmanned aerial vehicle based on PID control. Background Art
[0002] In the field of modern UAV technology, the autonomous control and stable flight capabilities of UAVs are one of the key indicators to measure their performance. Especially when performing complex tasks such as vertical launch, precise positioning, and obstacle avoidance flight, UAV control systems face many challenges, especially the uncertainty of external environmental factors, such as wind speed changes, temperature fluctuations, etc., which have a significant impact on the flight performance and safety of UAVs. Although traditional PID (proportional-integral-differential) control has shown good performance in many control systems, its fixed parameter settings are often difficult to meet the needs of dynamic adjustment when facing environmental changes, resulting in limited control effects and problems such as slow response, excessive overshoot, and steady-state error. Summary of the invention
[0003] The embodiments of the present invention provide a method and system for vertically launching an unmanned aerial vehicle based on PID control, which can solve the problems in the prior art.
[0004] According to a first aspect of the embodiments of the present invention,
[0005] Provides a UAV vertical launch method based on PID control, including:
[0006] Initialize the PID basic parameters corresponding to the UAV, start the environmental monitoring system, introduce the adaptive mechanism framework, and prepare to adjust the PID basic parameters in real time; collect at least one environmental information of height error, wind speed, and temperature in real time, and apply the wind speed and temperature compensation method to adjust the PID basic parameters, where the height error is the difference between the target height and the current real-time height, the wind speed compensation is to calculate the wind force component, and the temperature compensation is to determine the motor efficiency coefficient according to the temperature;
[0007] Optimize PID basic parameters by optimizing genetic algorithm, set the population size, each individual represents a set of PID target parameters, PID target parameters include historical PID parameters and PID basic parameters, randomly generate the initial population, the fitness function aims to minimize the control error, rise time, overshoot and steady-state error, adopt the probability selection mechanism to select individuals to enter the next generation, and perform single-point or multi-point crossover according to the probability selection mechanism, iteratively perform the evaluation, selection, crossover and mutation process until the preset number of iterations is reached or the stop condition is met, select the individual with the highest fitness, and its corresponding PID target parameter is the optimization result;
[0008] Based on the optimization results, the proportional term, integral term and differential term of the PID controller are calculated. Among them, the proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers integral saturation processing, the differential term introduces the filter coefficient and the differential pre-value, and finally the total control output is obtained by considering temperature compensation; the total control output is applied to the UAV to adjust the output of the counter-rotating motor for vertical ascent control.
[0009] In an optional embodiment,
[0010] PID basic parameters are optimized by optimizing genetic algorithm, and the population size is set. Each individual represents a set of PID target parameters. The PID target parameters include historical PID parameters and PID basic parameters. The initial population is randomly generated. The fitness function aims to minimize the control error, rise time, overshoot and steady-state error. The probability selection mechanism is used to select individuals to enter the next generation, and single-point or multi-point crossover is performed according to the probability selection mechanism. The evaluation, selection, crossover and mutation process are iteratively executed until the preset number of iterations is reached or the stop condition is met. The individual with the highest fitness is selected, and its corresponding PID target parameters are the optimization results including:
[0011] The initial crossover probability and mutation probability are set, and the cycle of the crossover and mutation probabilities is adjusted. In each iteration process, the population convergence of the current population is calculated, and the population convergence is measured by the population fitness standard deviation. The population fitness standard deviation is obtained by calculating the square root of the sum of the squares of the differences between the individual fitness values in the population and the average fitness value of the population and dividing it by the population size; the individual fitness value is calculated by constructing a weighted fitness function by comprehensively considering multiple performance indicators such as control error, response time, overshoot and steady-state error;
[0012] According to the population convergence, the crossover and mutation probabilities are adjusted adaptively. If the current generation can be divided by the adjustment period, the crossover and mutation probabilities are adjusted, and the upper and lower thresholds of the population convergence are set. When the population fitness standard deviation is greater than the preset upper threshold, the crossover and mutation probabilities are increased proportionally. When the population fitness standard deviation is less than the preset lower threshold, the crossover and mutation probabilities are reduced proportionally. The preset upper and lower thresholds are adaptively set according to the initial convergence and expected convergence of the population.
[0013] The difference between the standard deviation of population fitness and the average value of population convergence is divided by the difference between the preset upper and lower thresholds, multiplied by the crossover and mutation probability adjustment coefficient, and added to the initial crossover and mutation probabilities to obtain the adjusted crossover and mutation probabilities;
[0014] Perform selection operations based on the elite retention strategy on the current population, select individuals whose fitness value ranking exceeds the preset ranking threshold from the current population to directly enter the next generation, retain excellent individuals while maintaining population diversity; use the adjusted crossover probability to perform arithmetic crossover or heuristic crossover on the selected individuals to generate new offspring individuals; use the adjusted mutation probability to perform uniform mutation or non-uniform mutation on the offspring individuals after crossover to introduce new genes;
[0015] Repeat the above steps of calculating population convergence, adaptively adjusting crossover probability and mutation probability, selection, crossover and mutation to generate a new generation of population until the preset maximum number of evolutionary generations is reached or the population converges to the global optimal solution; select the PID target parameters corresponding to the individual with the highest fitness value from the final population as the optimal control parameters.
[0016] In an optional embodiment,
[0017] The fitness function aims to minimize the control error, rise time, overshoot and steady-state error including:
[0018] ;
[0019] in, F represents the individual fitness value, w 1 , w 2 , w 3 , w 4 They represent the weight factors corresponding to the height error, system response time, overshoot and steady-state error respectively, e Indicates the height error, Tr It indicates the first time that the system response reaches and remains within a certain threshold range near the set value. Indicates the overshoot, that is, the maximum deviation of the output beyond the set value. ess Represents the steady-state error, that is, the absolute value of the difference between the output and the set value after the system stabilizes.
[0020] In an optional embodiment,
[0021] Based on the optimization results, the proportional term, integral term and differential term of the PID controller are calculated. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers the integral saturation processing, and the differential term introduces the filter coefficient and the differential pre-value. Finally, the total control output considering the temperature compensation includes:
[0022] The wind speed compensation factor is introduced, and the compensation factor value related to the real-time measured wind speed is obtained by table lookup method, which is used to correct the optimized proportional coefficient, and the proportional coefficient after wind speed compensation is used as the final proportional term of the PID controller;
[0023] In each control cycle, the control error at the current moment is obtained, and it is added to the integral value at the previous moment and divided by the optimized integral time constant to obtain the integral value at the current moment. The integral value at the current moment is saturated and limited to the preset saturation limit range. The integral value after the integral saturation processing is used as the final integral term of the PID controller.
[0024] The filter coefficient is introduced to smooth the differential output. In each control cycle, the control errors of the current moment and the previous moment are obtained, and the differential value of the current moment is calculated by combining the differential time constant and the filter coefficient. Then the differential feedforward is introduced, and the differential value of the previous moment and the differential value of the current moment are weighted and synthesized according to the preset feedforward coefficient as the final differential term of the PID controller.
[0025] The temperature compensation factor is introduced, and the value of the compensation factor related to the real-time measured temperature is obtained by table lookup method. The final proportional term, final integral term and final differential term are corrected by the temperature compensation factor respectively to obtain the total control output of the PID controller.
[0026] According to the total control output of the PID controller, the control parameters of the actuator of the controlled object are calculated, and the control parameters are applied to the controlled object to achieve regulation and control of the state of the controlled object.
[0027] In an optional embodiment,
[0028] The final proportional term is calculated as follows:
[0029] ;
[0030] in, P(t) express t The final proportional term at time, Represents the proportional coefficient after wind speed compensation, K p,t Indicates the proportional coefficient before wind speed compensation, e(t) Indicates the height error, represents the compensation coefficient of wind speed, represents the wind force component, is the wind speed, is the wind direction angle;
[0031] The final integral term is calculated as follows:
[0032] ;
[0033] in, I(t) express t The final integral term at time , represents the integral gain at time t, and △t represents the time difference;
[0034] The final differential term is calculated as follows:
[0035] ;
[0036] in, D(t) express t The final differential term at time, represents the value before differentiation, α represents the filter coefficient, represents the differential coefficient, For tiny increments of time.
[0037] In an optional embodiment,
[0038] The method further comprises:
[0039] Select temperature and PID controller output as the input and output variables of the fuzzy logic controller, and determine the value range of temperature and control output;
[0040] Define the fuzzy subsets and membership functions of temperature and control output. The fuzzy subsets of temperature include low temperature, normal temperature and high temperature. The fuzzy subsets of control output include negative compensation, zero compensation and positive compensation. The membership of each fuzzy subset is represented by a triangular membership function or a Gaussian membership function.
[0041] A fuzzy rule base of temperature and control output is established, which consists of multiple IF-THEN language rules to describe the compensation strategy of control output under different temperature conditions;
[0042] Obtain the real-time measured temperature of the controlled object and calculate the membership degree of each temperature fuzzy subset of the temperature value;
[0043] Based on the fuzzy reasoning method, combining temperature membership and fuzzy rules, the triggering strength of each rule is calculated;
[0044] The temperature compensation output by the fuzzy logic controller is calculated by using the centroid method according to the rule triggering strength and the membership function of the control output.
[0045] The temperature compensation amount is superimposed on the control amount calculated by the PID controller according to the control error to obtain the final output of the PID controller after temperature compensation, which is used for the actuator of the controlled object to realize adaptive temperature compensation control.
[0046] According to a second aspect of the embodiments of the present invention,
[0047] UAV vertical launch system based on PID control, including:
[0048] The first unit is used to initialize the PID basic parameters corresponding to the drone, start the environmental monitoring system, introduce the adaptive mechanism framework, and prepare to adjust the PID basic parameters in real time; collect at least one environmental information of height error, wind speed, and temperature in real time, and apply the wind speed and temperature compensation method to adjust the PID basic parameters, where the height error is the difference between the target height and the real-time height at the current moment, the wind speed compensation is to calculate the wind force component, and the temperature compensation is to determine the motor efficiency coefficient according to the temperature;
[0049] The second unit is used to optimize the PID basic parameters by optimizing the genetic algorithm, setting the population size, each individual represents a set of PID target parameters, the PID target parameters include historical PID parameters and PID basic parameters, randomly generating the initial population, the fitness function is to minimize the control error, rise time, overshoot and steady-state error, using the probability selection mechanism to select individuals to enter the next generation, and perform single-point or multi-point crossover according to the probability selection mechanism, iteratively executing the evaluation, selection, crossover and mutation process until the preset number of iterations is reached or the stop condition is met, and the individual with the highest fitness is selected, and its corresponding PID target parameter is the optimization result;
[0050] The third unit is used to calculate the proportional term, integral term and differential term of the PID controller based on the optimization results. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers integral saturation processing, the differential term introduces the filter coefficient and the differential pre-value, and finally the total control output is obtained by considering temperature compensation; the total control output is applied to the UAV to adjust the output of the counter-rotating motor for vertical ascent control.
[0051] According to a third aspect of the embodiments of the present invention,
[0052] An electronic device is provided, comprising:
[0053] processor;
[0054] a memory for storing processor-executable instructions;
[0055] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0056] According to a fourth aspect of the embodiments of the present invention,
[0057] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0058] By introducing the adaptive crossover and mutation probability adjustment strategy, the probability of crossover and mutation can be dynamically adjusted according to the convergence state of the population, so that the algorithm can adaptively balance the global exploration and local development capabilities at different stages of evolution. In the early stage of evolution, the population convergence is low. By increasing the crossover and mutation probability, the diversity of the population is enhanced to prevent premature convergence; in the late stage of evolution, the population convergence is high. By reducing the crossover and mutation probability, the damage to the formed excellent individuals is reduced and the convergence speed is accelerated. At the same time, by setting the adjustment period T, the frequent fluctuations of the crossover and mutation probability are avoided, and the stability of the algorithm is improved. In the PID parameter tuning problem, the adaptive crossover and mutation probability adjustment strategy can effectively balance the global search ability and local optimization ability of the algorithm, and improve the efficiency and accuracy of parameter tuning.
[0059] Compared with traditional temperature compensation methods, the temperature compensation technology based on fuzzy logic has stronger nonlinear processing ability and adaptability, and can effectively deal with the complex nonlinear relationship between temperature and control output. The application of this technology can significantly improve the control accuracy and stability of PID controller under temperature changes and expand its scope of application. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 The figure is a flow chart of a method for vertically launching an unmanned aerial vehicle based on PID control according to an embodiment of the present invention;
[0061] Figure 2 It is a schematic diagram of the mechanism of the counter-rotating motor according to an embodiment of the present invention;
[0062] Figure 3 The figure is a schematic diagram of the structure of the UAV vertical launch system based on PID control according to an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0065] Figure 1 FIG. 1 is a flow chart of a method for vertically launching an unmanned aerial vehicle based on PID control according to an embodiment of the present invention. Figure 1As shown, the method includes:
[0066] S101. Initialize the PID basic parameters corresponding to the UAV, start the environmental monitoring system, introduce the adaptive mechanism framework, and prepare to adjust the PID basic parameters in real time; collect at least one environmental information of height error, wind speed, and temperature in real time, and apply the wind speed and temperature compensation method to adjust the PID basic parameters, wherein the height error is the difference between the target height and the real-time height at the current moment, the wind speed compensation is to calculate the wind force component, and the temperature compensation is to determine the motor efficiency coefficient according to the temperature;
[0067] S102. Optimize the PID basic parameters by optimizing the genetic algorithm, set the population size, each individual represents a set of PID target parameters, the PID target parameters include historical PID parameters and PID basic parameters, randomly generate the initial population, the fitness function aims to minimize the control error, rise time, overshoot and steady-state error, adopt the probability selection mechanism to select individuals to enter the next generation, and perform single-point or multi-point crossover according to the probability selection mechanism, iteratively perform the evaluation, selection, crossover and mutation process until the preset number of iterations is reached or the stop condition is met, select the individual with the highest fitness, and its corresponding PID target parameter is the optimization result;
[0068] S103. Based on the optimization results, the proportional term, integral term and differential term of the PID controller are calculated, wherein the proportional term is the proportional coefficient after taking into account wind speed compensation, the integral term continuously accumulates the error and takes into account integral saturation processing, the differential term introduces the filter coefficient and the differential pre-value, and finally the total control output is obtained by taking into account temperature compensation; the total control output is applied to the UAV, the output of the counter-rotating motor is adjusted, and vertical ascent control is performed.
[0069] In an optional embodiment,
[0070] PID basic parameters are optimized by optimizing genetic algorithm, and the population size is set. Each individual represents a set of PID target parameters. The PID target parameters include historical PID parameters and PID basic parameters. The initial population is randomly generated. The fitness function aims to minimize the control error, rise time, overshoot and steady-state error. The probability selection mechanism is used to select individuals to enter the next generation, and single-point or multi-point crossover is performed according to the probability selection mechanism. The evaluation, selection, crossover and mutation process are iteratively executed until the preset number of iterations is reached or the stop condition is met. The individual with the highest fitness is selected, and its corresponding PID target parameters are the optimization results including:
[0071] The initial crossover probability and mutation probability are set, and the cycle of the crossover and mutation probabilities is adjusted. In each iteration process, the population convergence of the current population is calculated, and the population convergence is measured by the population fitness standard deviation. The population fitness standard deviation is obtained by calculating the square root of the sum of the squares of the differences between the individual fitness values in the population and the average fitness value of the population and dividing it by the population size; the individual fitness value is calculated by constructing a weighted fitness function by comprehensively considering multiple performance indicators such as control error, response time, overshoot and steady-state error;
[0072] According to the population convergence, the crossover and mutation probabilities are adjusted adaptively. If the current generation can be divided by the adjustment period, the crossover and mutation probabilities are adjusted, and the upper and lower thresholds of the population convergence are set. When the population fitness standard deviation is greater than the preset upper threshold, the crossover and mutation probabilities are increased proportionally. When the population fitness standard deviation is less than the preset lower threshold, the crossover and mutation probabilities are reduced proportionally. The preset upper and lower thresholds are adaptively set according to the initial convergence and expected convergence of the population.
[0073] The difference between the standard deviation of population fitness and the average value of population convergence is divided by the difference between the preset upper and lower thresholds, multiplied by the crossover and mutation probability adjustment coefficient, and added to the initial crossover and mutation probabilities to obtain the adjusted crossover and mutation probabilities;
[0074] Perform selection operations based on the elite retention strategy on the current population, select individuals whose fitness value ranking exceeds the preset ranking threshold from the current population to directly enter the next generation, retain excellent individuals while maintaining population diversity; use the adjusted crossover probability to perform arithmetic crossover or heuristic crossover on the selected individuals to generate new offspring individuals; use the adjusted mutation probability to perform uniform mutation or non-uniform mutation on the offspring individuals after crossover to introduce new genes;
[0075] Repeat the above steps of calculating population convergence, adaptively adjusting crossover probability and mutation probability, selection, crossover and mutation to generate a new generation of population until the preset maximum number of evolutionary generations is reached or the population converges to the global optimal solution; select the PID target parameters corresponding to the individual with the highest fitness value from the final population as the optimal control parameters.
[0076] For example, in a standard genetic algorithm, the crossover probability Pc and the mutation probability Pm are usually set to fixed values and remain unchanged throughout the evolution process. However, a fixed crossover and mutation probability may not be able to adapt to the needs of the population at different stages of evolution. In the early stages of evolution, the diversity of the population is high, and a larger crossover and mutation probability is required to maintain the diversity of the population and enhance the global exploration ability of the algorithm; in the later stages of evolution, the population tends to converge, and a smaller crossover and mutation probability is required to reduce the damage to the excellent individuals that have been formed and enhance the local development ability of the algorithm. Therefore, this paper introduces an adaptive crossover and mutation probability adjustment strategy, which dynamically adjusts the probabilities of crossover and mutation according to the convergence state of the population, and balances the global exploration and local development capabilities at different stages of the algorithm.
[0077] Set the initial crossover probability Pc_0 and mutation probability Pm_0, as well as the period T for adjusting the crossover and mutation probabilities. The values of Pc_0 and Pm_0 need to be selected according to the specific problem and encoding method. Generally, Pc_0 is 0.6~0.9 and Pm_0 is 0.001~0.1. The period T means that the crossover and mutation probability is adjusted every T generations. The value of T needs to be selected according to the complexity of the problem and the size of the population, and is generally 10~50.
[0078] In each iteration, the convergence of the current population needs to be evaluated to determine whether the crossover probability needs to be adjusted. The convergence of the population can be measured by a variety of indicators, such as the standard deviation of the individual fitness values in the population, the difference between the optimal individual and the average fitness of the population, etc. This paper uses the standard deviation of population fitness to measure the convergence of the population, and the calculation formula is as follows:
[0079] σ = sqrt(sum((Fi - Fmean)^2) / N);
[0080] Among them, σ is the population fitness standard deviation, Fi is the fitness value of the i-th individual, Fmean is the average fitness value of the population, and N is the population size. The population fitness standard deviation σ reflects the degree of dispersion of individual fitness values in the population. The larger σ is, the higher the diversity of the population and the lower the convergence; the smaller σ is, the lower the diversity of the population and the higher the convergence.
[0081] According to the population convergence σ, determine whether the crossover mutation probability needs to be adjusted. The specific steps are as follows:
[0082] a) If the current generation t is divisible by the period T, the crossover probability is adjusted, otherwise the original probability remains unchanged;
[0083] b) Set the upper and lower thresholds σmax and σmin of population convergence. If σ>σmax, it means that the population is too divergent and the probability of crossover mutation needs to be increased to enhance the global exploration capability. If σ<σmin, it means that the population is too convergent and the probability of crossover mutation needs to be reduced to enhance the local development capability.
[0084] c) The adjustment formula of crossover probability Pc and mutation probability Pm is as follows:
[0085] Pc = Pc_0 + kc * (σ - σmean) / (σmax - σmin);
[0086] Pm = Pm_0 + km * (σ - σmean) / (σmax - σmin);
[0087] Among them, Pc_0 and Pm_0 are the initial crossover mutation probabilities, σmean is the average value of the population convergence σ, kc and km are adjustment coefficients that control the adjustment range of the crossover mutation probability.
[0088] d) Perform a rationality check on the adjusted crossover probability to ensure that it is within the valid range, such as the value range of Pc is [0.5, 1.0], and the value range of Pm is [0.001, 0.1]. If it is out of range, take the endpoint value.
[0089] Using the adjusted crossover probability Pc and mutation probability Pm, genetic operations such as selection, crossover, and mutation are performed on the current population to generate a new generation of population.
[0090] Repeat the iteration until the preset termination conditions are reached, such as the maximum number of evolutionary generations, fitness threshold, etc.
[0091] By introducing the adaptive crossover and mutation probability adjustment strategy, the probability of crossover and mutation can be dynamically adjusted according to the convergence state of the population, so that the algorithm can adaptively balance the global exploration and local development capabilities at different stages of evolution. In the early stage of evolution, the population convergence is low. By increasing the crossover and mutation probability, the diversity of the population is enhanced to prevent premature convergence; in the late stage of evolution, the population convergence is high. By reducing the crossover and mutation probability, the damage to the formed excellent individuals is reduced and the convergence speed is accelerated. At the same time, by setting the adjustment period T, the frequent fluctuations of the crossover and mutation probability are avoided, and the stability of the algorithm is improved. In the PID parameter tuning problem, the adaptive crossover and mutation probability adjustment strategy can effectively balance the global search ability and local optimization ability of the algorithm, and improve the efficiency and accuracy of parameter tuning.
[0092] In an optional embodiment,
[0093] The fitness function aims to minimize the control error, rise time, overshoot and steady-state error including:
[0094] ;
[0095] in, F represents the individual fitness value, w 1 , w 2 , w 3 , w 4 They represent the weight factors corresponding to the height error, system response time, overshoot and steady-state error respectively, e Indicates the height error, Tr It indicates the first time that the system response reaches and remains within a certain threshold range near the set value. Indicates the overshoot, that is, the maximum deviation of the output beyond the set value. ess Represents the steady-state error, that is, the absolute value of the difference between the output and the set value after the system stabilizes.
[0096] In an optional embodiment,
[0097] Based on the optimization results, the proportional term, integral term and differential term of the PID controller are calculated. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers the integral saturation processing, and the differential term introduces the filter coefficient and the differential pre-value. Finally, the total control output considering the temperature compensation includes:
[0098] The wind speed compensation factor is introduced, and the compensation factor value related to the real-time measured wind speed is obtained by table lookup method, which is used to correct the optimized proportional coefficient, and the proportional coefficient after wind speed compensation is used as the final proportional term of the PID controller;
[0099] In each control cycle, the control error at the current moment is obtained, and it is added to the integral value at the previous moment and divided by the optimized integral time constant to obtain the integral value at the current moment. The integral value at the current moment is saturated and limited to the preset saturation limit range. The integral value after the integral saturation processing is used as the final integral term of the PID controller.
[0100] The filter coefficient is introduced to smooth the differential output. In each control cycle, the control errors of the current moment and the previous moment are obtained, and the differential value of the current moment is calculated by combining the differential time constant and the filter coefficient. Then the differential feedforward is introduced, and the differential value of the previous moment and the differential value of the current moment are weighted and synthesized according to the preset feedforward coefficient as the final differential term of the PID controller.
[0101] The temperature compensation factor is introduced, and the value of the compensation factor related to the real-time measured temperature is obtained by table lookup method. The final proportional term, final integral term and final differential term are corrected by the temperature compensation factor respectively to obtain the total control output of the PID controller.
[0102] According to the total control output of the PID controller, the control parameters of the actuator of the controlled object are calculated, and the control parameters are applied to the controlled object to achieve regulation and control of the state of the controlled object.
[0103] In an optional embodiment,
[0104] The final proportional term is calculated as follows:
[0105] ;
[0106] in, P(t) express t The final proportional term at time, Represents the proportional coefficient after wind speed compensation, K p,t Indicates the proportional coefficient before wind speed compensation, e(t) Indicates the height error, represents the compensation coefficient of wind speed, represents the wind force component, is the wind speed, is the wind direction angle;
[0107] The final integral term is calculated as follows:
[0108] ;
[0109] in, I(t) express t The final integral term at time , represents the integral gain at time t, and △t represents the time difference;
[0110] The final differential term is calculated as follows:
[0111] ;
[0112] in, D(t) express t The final differential term at time, represents the value before differentiation, α represents the filter coefficient, represents the differential coefficient, For tiny increments of time.
[0113] For example, after obtaining the optimization results of the PID controller parameters, it is necessary to further calculate the proportional term, integral term and differential term of the controller, and introduce technologies such as wind speed compensation, integral saturation processing, differential filtering and temperature compensation to improve the robustness and adaptability of the controller. This application will introduce in detail the method of calculating the PID controller parameters based on the optimization results, as well as the implementation steps of various compensation technologies.
[0114] The proportional term is the core component of the PID controller, which determines the sensitivity of the controller to errors. When calculating the proportional term, in addition to considering the optimized proportional coefficient, it is also necessary to introduce a wind speed compensation factor to adapt to the impact of wind speed changes on the control system.
[0115] First, the compensation factor value related to the real-time measured wind speed is obtained by table lookup. The table lookup process can be based on the pre-established wind speed-compensation factor comparison table, and the corresponding compensation factor value is found in the table according to the current measured wind speed value. The wind speed-compensation factor comparison table can be constructed through experiments and data fitting methods to reflect the influence of wind speed changes on the control system.
[0116] After obtaining the wind speed compensation factor, use it to correct the optimized proportional coefficient. Specifically, multiply the wind speed compensation factor by the optimized proportional coefficient to obtain the proportional coefficient after wind speed compensation. This process can dynamically adjust the proportional term under different wind speed conditions to adapt to the impact of wind speed changes on the control system.
[0117] Finally, the proportional coefficient after wind speed compensation is used as the final proportional term of the PID controller to calculate the controller output.
[0118] The integral term is used to eliminate the steady-state error of the control system. It adjusts the controller output by continuously accumulating the error. When calculating the integral term, the integral saturation problem needs to be considered to avoid the integral term being too large and causing the controller output to saturate.
[0119] In each control cycle, the control error at the current moment is first obtained. The control error can be obtained by measuring the difference between the actual state and the expected state of the controlled object.
[0120] Then, the control error at the current moment is added to the integral value at the previous moment and divided by the optimized integral time constant. The integral time constant determines the sensitivity of the integral term to error accumulation, and its value can be obtained through the optimization algorithm. This process realizes the continuous accumulation of errors, so that the integral term can gradually adjust the controller output to eliminate steady-state errors.
[0121] In order to avoid integral saturation, the integral value at the current moment needs to be saturated. Specifically, the integral value at the current moment is limited to the preset saturation limit range. The saturation limit can be set according to the physical limitations of the controller output and the system performance requirements. When the integral value exceeds the saturation limit, it is truncated to the saturation limit to prevent the integral term from being too large and causing the controller output to saturate.
[0122] Finally, the integral value after integral saturation processing is used as the final integral term of the PID controller to calculate the controller output.
[0123] The differential term is used to predict the changing trend of the error and adjust the controller output in advance to improve the dynamic response performance of the system. When calculating the differential term, it is necessary to introduce filter coefficients and differential feedforward to smooth the differential term output and improve the robustness of the controller.
[0124] First, the filter coefficient is introduced to smooth the differential output. The introduction of the filter coefficient can reduce the amplification effect of the differential on high-frequency noise and improve the anti-interference ability of the control system.
[0125] In each control cycle, the control error at the current moment and the previous moment is obtained. The rate of change of the control error can be obtained by dividing the difference between the error at the current moment and the previous moment by the sampling time interval.
[0126] Then, the differential value at the current moment is calculated by combining the differential time constant and the filter coefficient. The differential time constant determines the sensitivity of the differential term to the error change rate, and its value can be obtained through the optimization algorithm. The filter coefficient is multiplied by the differential value to smooth the differential term output and reduce the impact of high-frequency noise.
[0127] In order to further improve the robustness of the differential term, the differential feedforward technology is introduced. The differential value of the previous moment and the differential value of the current moment are weighted and synthesized according to the preset feedforward coefficient to obtain the final differential term. The feedforward coefficient can be set according to the dynamic characteristics and control requirements of the system to adjust the intensity of the differential feedforward. The introduction of differential feedforward can improve the control system's ability to respond quickly to disturbances and improve the system's dynamic performance.
[0128] Finally, the differential value after filtering and differential feedforward is used as the final differential term of the PID controller to calculate the controller output.
[0129] In order to further improve the adaptability of PID controller, it is necessary to introduce temperature compensation technology to deal with the impact of temperature changes on the control system. Temperature compensation corrects the controller parameters to maintain stable control performance under different temperature conditions.
[0130] First, the temperature compensation factor is introduced, and the compensation factor value related to the real-time measured temperature is obtained by table lookup. Similar to wind speed compensation, temperature compensation also requires the establishment of a temperature-compensation factor comparison table in advance. According to the current measured temperature value, the corresponding compensation factor value is found in the table. The temperature-compensation factor comparison table can be constructed through experiments and data fitting methods to reflect the influence of temperature changes on the control system.
[0131] After obtaining the temperature compensation factor, the final proportional term, the final integral term, and the final differential term are corrected using the temperature compensation factor. Specifically, the temperature compensation factor is multiplied by each controller parameter to obtain the controller parameters after temperature compensation. This process allows the controller parameters to be dynamically adjusted under different temperature conditions to adapt to the impact of temperature changes on the control system.
[0132] Finally, the proportional term, integral term and differential term after temperature compensation are added to obtain the total control output of the PID controller. The total control output combines the effects of various controller parameters and takes into account technologies such as wind speed compensation, integral saturation, differential filtering and temperature compensation to achieve precise control of the controlled object.
[0133] According to the total control output of the PID controller, it is necessary to further calculate the control parameters of the actuator of the controlled object, and apply the control parameters to the controlled object to achieve regulation and control of the state of the controlled object.
[0134] First, the control parameters of the actuator of the control object are calculated according to the total control output and the characteristics of the actuator. The control parameters can be physical quantities such as voltage, current, position, speed, etc. of the actuator, and the calculation method depends on the type of actuator and the control requirements. Usually, the corresponding control parameter value can be calculated according to the value of the total control output by establishing a mapping relationship between the total control output and the control parameter.
[0135] Then, the calculated control parameters are applied to the actuator of the controlled object. The actuator adjusts the physical quantity of the controlled object according to the instructions of the control parameters, such as changing the speed of the motor, adjusting the opening of the valve, etc. The action of the actuator directly affects the state of the controlled object, causing it to change in the desired direction.
[0136] Finally, the actual state of the controlled object is measured through feedback, and compared with the expected state, the control error is calculated, and a closed-loop control is formed. According to the control error, the PID controller continuously adjusts the controller parameters and control output, so that the state of the controlled object gradually approaches the expected value, and the controlled object is precisely controlled.
[0137] This application details the method of calculating PID controller parameters based on optimization results, as well as the implementation steps of wind speed compensation, integral saturation processing, differential filtering and temperature compensation. By introducing these compensation technologies, the robustness and adaptability of the PID controller can be improved, enabling it to maintain stable control performance under complex working conditions.
[0138] When calculating the proportional term, the wind speed compensation factor is introduced, and the compensation factor value related to the real-time measured wind speed is obtained by the table lookup method, which is used to correct the optimized proportional coefficient. This process can dynamically adjust the proportional term under different wind speed conditions to adapt to the impact of wind speed changes on the control system.
[0139] When calculating the integral term, the integral saturation problem is taken into consideration. The integral value is saturated and limited to the preset saturation limit range to avoid the integral term being too large and causing the controller output to be saturated.
[0140] When calculating the differential term, the filter coefficient and differential feedforward technology are introduced to smooth the differential term output and improve the robustness of the controller. The introduction of the filter coefficient can reduce the amplification effect of the differential term on high-frequency noise, while the introduction of the differential feedforward can improve the control system's ability to respond quickly to disturbances.
[0141] In terms of temperature compensation, the compensation factor value related to the real-time measured temperature is obtained by looking up the table method, and the temperature compensation factor is used to correct the final proportional term, the final integral term, and the final differential term to adapt to the impact of temperature changes on the control system.
[0142] Finally, according to the total control output of the PID controller, the control parameters of the actuator of the controlled object are calculated, and the control parameters are applied to the controlled object. Through feedback measurement and closed-loop control, precise adjustment and control of the state of the controlled object can be achieved.
[0143] In summary, the PID controller parameter calculation and compensation technology based on the optimization results comprehensively considers various influencing factors. By introducing a number of compensation technologies, the robustness and adaptability of the controller are improved, laying the foundation for realizing high-performance control systems.
[0144] In an optional embodiment,
[0145] The method further comprises:
[0146] Select temperature and PID controller output as the input and output variables of the fuzzy logic controller, and determine the value range of temperature and control output;
[0147] Define the fuzzy subsets and membership functions of temperature and control output. The fuzzy subsets of temperature include low temperature, normal temperature and high temperature. The fuzzy subsets of control output include negative compensation, zero compensation and positive compensation. The membership of each fuzzy subset is represented by a triangular membership function or a Gaussian membership function.
[0148] A fuzzy rule base of temperature and control output is established, which consists of multiple IF-THEN language rules to describe the compensation strategy of control output under different temperature conditions;
[0149] Obtain the real-time measured temperature of the controlled object and calculate the membership degree of each temperature fuzzy subset of the temperature value;
[0150] Based on the fuzzy reasoning method, combining temperature membership and fuzzy rules, the triggering strength of each rule is calculated;
[0151] The temperature compensation output by the fuzzy logic controller is calculated by using the centroid method according to the rule triggering strength and the membership function of the control output.
[0152] The temperature compensation amount is superimposed on the control amount calculated by the PID controller according to the control error to obtain the final output of the PID controller after temperature compensation, which is used for the actuator of the controlled object to realize adaptive temperature compensation control.
[0153] For example, in the design of PID controller, temperature change has a significant impact on control performance. Traditional temperature compensation methods, such as linear compensation or piecewise linear compensation, are difficult to adapt to the complex nonlinear relationship between temperature and control output, resulting in unsatisfactory compensation effect. In order to solve this problem, this application proposes a temperature compensation technology based on fuzzy logic, which realizes intelligent and adaptive temperature compensation by establishing a fuzzy rule base of temperature and control output, and further improves the robustness and adaptability of PID controller.
[0154] First, select temperature T and control output U as the input and output variables of the fuzzy logic controller. Temperature T reflects the temperature environment of the controlled object and is an important factor affecting the control performance. Control output U represents the output of the PID controller and is the target variable that needs temperature compensation.
[0155] The value range of the input variable temperature T is [Tmin, Tmax], where Tmin and Tmax are the lowest and highest temperatures that the controlled object may encounter. The value range of the output variable control output U is [Umin, Umax], where Umin and Umax are the minimum and maximum values of the PID controller output.
[0156] In order to establish the fuzzy relationship between temperature T and control output U, it is necessary to define their fuzzy subsets and membership functions.
[0157] For the input variable temperature T, three fuzzy subsets are defined: low temperature (Low), normal temperature (Normal) and high temperature (High). These three fuzzy subsets represent different states of temperature. Each fuzzy subset corresponds to a membership function, which is used to calculate the degree to which the temperature value belongs to the subset. Common function forms such as triangular membership function or Gaussian membership function can be used.
[0158] For example, using the triangular membership function, the fuzzy subsets and membership functions of temperature T are defined as follows:
[0159] Low temperature (Low):μLow(T)=max(0,(TL2-T) / (TL2-TL1));
[0160] Normal temperature: μNormal(T)=max(0,min((T-TN1) / (TN2-TN1),(TN3-T) / (TN3-TN2)));
[0161] High temperature (High): μHigh(T)=max(0,(T-TH1) / (TH2-TH1));
[0162] Among them, TL1, TL2, TN1, TN2, TN3, TH1 and TH2 are the eigenvalues of temperature T, which are used to determine the shape of the triangular membership function. These eigenvalues can be set according to the temperature characteristics of the controlled object and expert experience.
[0163] For the output variable control output U, three fuzzy subsets are also defined: negative compensation (Negative), zero compensation (Zero) and positive compensation (Positive). These three fuzzy subsets represent the impact of temperature compensation on the control output. Similarly, each fuzzy subset corresponds to a membership function.
[0164] Using the triangular membership function, the fuzzy subsets and membership functions of the control output U are defined as follows:
[0165] Negative compensation (Negative): μNegative(U)=max(0,(UN2-U) / (UN2-UN1));
[0166] Zero compensation (Zero): μZero(U)=max(0,min((U-UZ1) / (UZ2-UZ1),(UZ3-U) / (UZ3-UZ2)));
[0167] Positive compensation (Positive): μPositive(U)=max(0,(U-UP1) / (UP2-UP1));
[0168] Among them, UN1, UN2, UZ1, UZ2, UZ3, UP1 and UP2 are the characteristic values of the control output U, which are used to determine the shape of the membership function. These characteristic values can be set according to the output characteristics and compensation requirements of the PID controller.
[0169] After defining the fuzzy subsets and membership functions of the input variable temperature T and the output variable control output U, it is necessary to establish a fuzzy rule base between temperature T and control output U. The fuzzy rule base consists of a series of IF-THEN language rules, which are used to describe the impact of temperature on control output.
[0170] The general form of the fuzzy rule is: "If the temperature T is A, then the control output U is B", where A and B are the fuzzy subsets of the temperature T and the control output U, respectively. According to the three fuzzy subsets of the temperature T (low temperature, normal temperature, high temperature) and the three fuzzy subsets of the control output U (negative compensation, zero compensation, positive compensation), 9 fuzzy rules can be constructed to form a complete fuzzy rule base.
[0171] For example, a fuzzy rule base may contain the following rules:
[0172] R1: If the temperature T is low, the control output U is positive compensation;
[0173] R2: If the temperature T is low, the control output U is zero compensation;
[0174] R3: If the temperature T is low, the control output U is negative compensation;
[0175] R4: If the temperature T is normal temperature, the control output U is positive compensation;
[0176] R5: If the temperature T is normal temperature, the control output U is zero compensation;
[0177] R6: If the temperature T is normal temperature, the control output U is negative compensation;
[0178] R7: If the temperature T is high, the control output U is positive compensation;
[0179] R8: If the temperature T is high, the control output U is zero compensation;
[0180] R9: If the temperature T is high, the control output U is negative compensation.
[0181] These fuzzy rules give compensation strategies for the control output U according to the different states of temperature T. The specific content of the rules can be designed according to the characteristics of the controlled object, control requirements and expert knowledge.
[0182] After the fuzzy rule base is established, the temperature compensation ΔU can be calculated based on the measured temperature T through fuzzy reasoning and defuzzification.
[0183] First, the membership of each fuzzy subset is calculated based on the measured temperature T. Taking the fuzzy subset and membership function of the temperature T as an example, the membership of the temperature T belonging to low temperature (Low), normal temperature (Normal) and high temperature (High) is calculated, namely μLow(T), μNormal(T) and μHigh(T).
[0184] Then, the fuzzy reasoning method is applied to calculate the trigger strength of each fuzzy rule. Commonly used fuzzy reasoning methods include Mamdani reasoning and Larsen reasoning. Taking Mamdani reasoning as an example, the trigger strength αi of rule Ri is calculated as follows:
[0185] αi=min(μA(T),μB(U));
[0186] Among them, μA(T) is the membership degree of temperature T to fuzzy subset A in the rule antecedent, and μB(U) is the membership degree of control output U to fuzzy subset B in the rule consequent.
[0187] Next, using the commonly used defuzzification methods such as the centroid method, the clear output ΔU of the fuzzy logic controller is calculated according to the membership function of the rule trigger intensity αi and the output variable control output U. The centroid method calculation formula is as follows:
[0188] ΔU=(∑αi×Ui) / (∑αi);
[0189] Among them, Ui is the clear value of the control output U in the consequent of rule Ri, and the peak point or center of gravity of the membership function μB(U) can be selected.
[0190] Finally, the temperature compensation ΔU is added to the total control output U(t) of the PID controller to obtain the final control output U'(t) after temperature compensation:
[0191] U'(t)=U(t)+ΔU;
[0192] In this way, the temperature compensation process based on fuzzy logic is completed, and the adaptively adjusted PID controller output is obtained.
[0193] Temperature compensation technology based on fuzzy logic can be implemented through the following steps:
[0194] Step 1: Select temperature T and control output U as the input and output variables of the fuzzy logic controller and determine their value ranges.
[0195] Step 2: Define the fuzzy subsets and membership functions of temperature T and control output U, such as low temperature (Low), normal temperature (Normal), high temperature (High) and negative compensation (Negative), zero compensation (Zero), and positive compensation (Positive).
[0196] Step 3: Establish a fuzzy rule base of temperature T and control output U, such as the IF-THEN language rule of "if temperature T is A, then control output U is B".
[0197] Step 4: According to the measured temperature T, calculate its membership degree to each fuzzy subset.
[0198] Step 5: Apply fuzzy reasoning methods, such as Mamdani reasoning, to calculate the triggering strength αi of each fuzzy rule.
[0199] Step 6: Use anti-fuzzification methods such as the centroid method to calculate the temperature compensation ΔU based on the rule trigger intensity αi and the membership function of the output variable control output U.
[0200] Step 7: Add the temperature compensation ΔU to the total control output U(t) of the PID controller to obtain the final control output U'(t) after temperature compensation.
[0201] Through the above steps, the temperature compensation technology based on fuzzy logic is realized, which enables the PID controller to adaptively adjust the control output according to temperature changes and improve the robustness and adaptability of the control system. This technology overcomes the limitations of traditional temperature compensation methods and provides a new solution for precise control under complex working conditions.
[0202] This application proposes a temperature compensation technology based on fuzzy logic, which is used to improve the control performance of PID controller under temperature change conditions. This technology realizes intelligent and adaptive temperature compensation by establishing a fuzzy rule base of temperature and control output.
[0203] First, temperature T and control output U are selected as the input and output variables of the fuzzy logic controller, and their fuzzy subsets and membership functions are defined. Then, according to expert knowledge and control requirements, a fuzzy rule base between temperature T and control output U is constructed. In the actual control process, according to the measured temperature T, the temperature compensation ΔU is calculated through fuzzy reasoning and defuzzification, and added to the total control output of the PID controller to obtain the final control output after adaptive adjustment.
[0204] Compared with traditional temperature compensation methods, the temperature compensation technology based on fuzzy logic has stronger nonlinear processing ability and adaptability, and can effectively deal with the complex nonlinear relationship between temperature and control output. The application of this technology can significantly improve the control accuracy and stability of PID controller under temperature changes and expand its scope of application.
[0205] Another embodiment of the present application is as follows: Figure 2 FIG. 1 is a schematic diagram of the mechanism of the counter-rotating motor according to an embodiment of the present invention. Figure 2 As shown:
[0206] 1. Mechanical structure:
[0207] 1. The counter-rotating motor is composed of two LD4530 motors. During assembly, one is inside the fuselage and the other is outside the fuselage separated by the motor mounting seat. The motor shaft inside the fuselage passes 68.6mm from the middle of the motor outside the fuselage to achieve the purpose of installing the propeller
[0208] 2. The counter-rotating propeller is fixed to the motor outside the fuselage with four M3×12 cylindrical head hexagonal screws;
[0209] 3. The forward propeller is fixed to the motor shaft extending from the motor in the fuselage by four M5×12 flat round head hexagon socket screws with the help of propeller clamps;
[0210] 4. The counter-rotating motor is fixed to the motor mounting base with four M5×12 cylindrical head hexagon socket screws;
[0211] 5. The motor mounting base is fixed to the body with eight M3×8 flat round head hexagon socket screws;
[0212] 2. Component Description:
[0213] 1. Wings: generate lift for the aircraft;
[0214] 2. ESC: After receiving the signal, the motor speed is precisely controlled by the current;
[0215] 3. Counter-rotating motor: converts the electricity provided by the battery into mechanical energy to drive the rotation of the propeller, thereby generating thrust;
[0216] 3. Working process and function of counter-rotating motor
[0217] The counter-rotating motor is composed of two LD4530 motors. Two 110A electric regulators need to be installed in the fuselage for control. When in use, a forward propeller and a reverse propeller need to be installed. When the two propellers run at the same time, the anti-torque torque when the aircraft is launched will be eliminated, allowing the aircraft to have a more stable flight.
[0218] Figure 3FIG. 1 is a schematic diagram of the structure of a UAV vertical launch system based on PID control according to an embodiment of the present invention. Figure 3 As shown, the system comprises:
[0219] The first unit is used to initialize the PID basic parameters corresponding to the drone, start the environmental monitoring system, introduce the adaptive mechanism framework, and prepare to adjust the PID basic parameters in real time; collect at least one environmental information of height error, wind speed, and temperature in real time, and apply the wind speed and temperature compensation method to adjust the PID basic parameters, where the height error is the difference between the target height and the real-time height at the current moment, the wind speed compensation is to calculate the wind force component, and the temperature compensation is to determine the motor efficiency coefficient according to the temperature;
[0220] The second unit is used to optimize the PID basic parameters by optimizing the genetic algorithm, setting the population size, each individual represents a set of PID target parameters, the PID target parameters include historical PID parameters and PID basic parameters, randomly generating the initial population, the fitness function is to minimize the control error, rise time, overshoot and steady-state error, using the probability selection mechanism to select individuals to enter the next generation, and perform single-point or multi-point crossover according to the probability selection mechanism, iteratively executing the evaluation, selection, crossover and mutation process until the preset number of iterations is reached or the stop condition is met, and the individual with the highest fitness is selected, and its corresponding PID target parameter is the optimization result;
[0221] The third unit is used to calculate the proportional term, integral term and differential term of the PID controller based on the optimization results. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers integral saturation processing, the differential term introduces the filter coefficient and the differential pre-value, and finally the total control output is obtained by considering temperature compensation; the total control output is applied to the UAV to adjust the output of the counter-rotating motor for vertical ascent control.
[0222] According to a third aspect of the embodiments of the present invention,
[0223] An electronic device is provided, comprising:
[0224] processor;
[0225] a memory for storing processor-executable instructions;
[0226] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0227] According to a fourth aspect of the embodiments of the present invention,
[0228] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0229] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0230] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. UAV vertical launch method based on PID control, It is characterized in that include: Initialize the PID basic parameters corresponding to the drone, start the environmental monitoring system, introduce the adaptive mechanism framework, and prepare to adjust the PID basic parameters in real time; Collect at least one of the following environmental information in real time: height error, wind speed, and temperature; apply wind speed and temperature compensation methods to adjust PID basic parameters; wherein the height error is the difference between the target height and the current real-time height; the wind speed compensation is to calculate the wind force component; and the temperature compensation is to determine the motor efficiency coefficient according to the temperature; Optimize PID basic parameters by optimizing genetic algorithm, set the population size, each individual represents a set of PID target parameters, PID target parameters include historical PID parameters and PID basic parameters, randomly generate the initial population, the fitness function aims to minimize the control error, rise time, overshoot and steady-state error, adopt the probability selection mechanism to select individuals to enter the next generation, and perform single-point or multi-point crossover according to the probability selection mechanism, iteratively perform the evaluation, selection, crossover and mutation process until the preset number of iterations is reached or the stop condition is met, select the individual with the highest fitness, and its corresponding PID target parameter is the optimization result; Based on the optimization results, the proportional term, integral term and differential term of the PID controller are calculated. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers integral saturation processing, the differential term introduces the filter coefficient and the differential pre-value, and finally the total control output is obtained by considering temperature compensation; the total control output is applied to the UAV to adjust the output of the counter-rotating motor for vertical ascent control; PID basic parameters are optimized by optimizing genetic algorithm, and the population size is set. Each individual represents a set of PID target parameters. The PID target parameters include historical PID parameters and PID basic parameters. The initial population is randomly generated. The fitness function aims to minimize the control error, rise time, overshoot and steady-state error. The probability selection mechanism is used to select individuals to enter the next generation, and single-point or multi-point crossover is performed according to the probability selection mechanism. The evaluation, selection, crossover and mutation process are iteratively executed until the preset number of iterations is reached or the stop condition is met. The individual with the highest fitness is selected, and its corresponding PID target parameters are the optimization results including: The initial crossover probability and mutation probability are set, and the cycle of the crossover and mutation probabilities is adjusted. In each iteration process, the population convergence of the current population is calculated, and the population convergence is measured by the population fitness standard deviation. The population fitness standard deviation is obtained by calculating the square root of the sum of the squares of the differences between the individual fitness values in the population and the average fitness value of the population and dividing it by the population size; the individual fitness value is calculated by constructing a weighted fitness function by comprehensively considering multiple performance indicators such as control error, response time, overshoot and steady-state error; According to the population convergence, the crossover and mutation probabilities are adjusted adaptively. If the current generation can be divided by the adjustment period, the crossover and mutation probabilities are adjusted, and the upper and lower thresholds of the population convergence are set. When the population fitness standard deviation is greater than the preset upper threshold, the crossover and mutation probabilities are increased proportionally. When the population fitness standard deviation is less than the preset lower threshold, the crossover and mutation probabilities are reduced proportionally. The preset upper and lower thresholds are adaptively set according to the initial convergence and expected convergence of the population. The difference between the standard deviation of population fitness and the average value of population convergence is divided by the difference between the preset upper and lower thresholds, multiplied by the crossover and mutation probability adjustment coefficient, and added to the initial crossover and mutation probabilities to obtain the adjusted crossover and mutation probabilities; Perform selection operations based on the elite retention strategy on the current population, select individuals whose fitness value ranking exceeds the preset ranking threshold from the current population to directly enter the next generation, retain excellent individuals while maintaining population diversity; use the adjusted crossover probability to perform arithmetic crossover or heuristic crossover on the selected individuals to generate new offspring individuals; use the adjusted mutation probability to perform uniform mutation or non-uniform mutation on the offspring individuals after crossover to introduce new genes; Repeat the above steps of calculating population convergence, adaptively adjusting crossover probability and mutation probability, selection, crossover, and mutation to generate a new generation of population until the preset maximum number of evolutionary generations is reached or the population converges to the global optimal solution; select the PID target parameters corresponding to the individual with the highest fitness value from the final population as the optimal control parameters; The fitness function aims to minimize the control error, rise time, overshoot and steady-state error including: ; in, F represents the individual fitness value, w 1 , w 2 , w 3 , w 4 They represent the weight factors corresponding to the height error, system response time, overshoot and steady-state error respectively, e Indicates the height error, Tr It indicates the first time that the system response reaches and remains within a certain threshold range near the set value. Indicates the overshoot, that is, the maximum deviation of the output beyond the set value. ess Represents the steady-state error, that is, the absolute value of the difference between the output and the set value after the system stabilizes.
2. The method according to claim 1, It is characterized in that Based on the optimization results, the proportional term, integral term and differential term of the PID controller are calculated. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers the integral saturation processing, and the differential term introduces the filter coefficient and the differential pre-value. Finally, the total control output considering the temperature compensation includes: The wind speed compensation factor is introduced, and the compensation factor value related to the real-time measured wind speed is obtained by table lookup method, which is used to correct the optimized proportional coefficient, and the proportional coefficient after wind speed compensation is used as the final proportional term of the PID controller; In each control cycle, the control error at the current moment is obtained, and it is added to the integral value at the previous moment and divided by the optimized integral time constant to obtain the integral value at the current moment. The integral value at the current moment is saturated and limited to the preset saturation limit range. The integral value after the integral saturation processing is used as the final integral term of the PID controller. The filter coefficient is introduced to smooth the differential output. In each control cycle, the control errors of the current moment and the previous moment are obtained, and the differential value of the current moment is calculated by combining the differential time constant and the filter coefficient. Then the differential feedforward is introduced, and the differential value of the previous moment and the differential value of the current moment are weighted and synthesized according to the preset feedforward coefficient as the final differential term of the PID controller. The temperature compensation factor is introduced, and the value of the compensation factor related to the real-time measured temperature is obtained by table lookup method. The final proportional term, final integral term and final differential term are corrected by the temperature compensation factor respectively to obtain the total control output of the PID controller. According to the total control output of the PID controller, the control parameters of the actuator of the controlled object are calculated, and the control parameters are applied to the controlled object to achieve regulation and control of the state of the controlled object.
3. The method according to claim 2, It is characterized in that The final proportional term is calculated as follows: ; in, P(t) express t The final proportional term at time, Represents the proportional coefficient after wind speed compensation, K p,t Indicates the proportional coefficient before wind speed compensation, e(t) Indicates the height error, represents the compensation coefficient of wind speed, represents the wind force component, is the wind speed, is the wind direction angle; The final integral term is calculated as follows: ; in, I(t) express t The final integral term at time , represents the integral gain at time t, and △t represents the time difference; The final differential term is calculated as follows: ; in, D(t) express t The final differential term at time, represents the value before differentiation, α represents the filter coefficient, represents the differential coefficient, For tiny increments of time.
4. The method according to claim 3, It is characterized in that The method further comprises: Select temperature and PID controller output as the input and output variables of the fuzzy logic controller, and determine the value range of temperature and control output; Define the fuzzy subsets and membership functions of temperature and control output. The fuzzy subsets of temperature include low temperature, normal temperature and high temperature. The fuzzy subsets of control output include negative compensation, zero compensation and positive compensation. The membership of each fuzzy subset is represented by a triangular membership function or a Gaussian membership function. A fuzzy rule base of temperature and control output is established, which consists of multiple IF-THEN language rules to describe the compensation strategy of control output under different temperature conditions; Obtain the real-time measured temperature of the controlled object, and calculate the membership degree of the real-time measured temperature to each temperature fuzzy subset; Based on the fuzzy reasoning method, combining temperature membership and fuzzy rules, the triggering strength of each rule is calculated; The temperature compensation output by the fuzzy logic controller is calculated by using the centroid method according to the rule triggering strength and the membership function of the control output. The temperature compensation amount is superimposed on the control amount calculated by the PID controller according to the control error to obtain the final output of the PID controller after temperature compensation, which is used for the actuator of the controlled object to realize adaptive temperature compensation control.
5. A UAV vertical launch system based on PID control, used to implement the method described in any one of claims 1 to 4. It is characterized in that include: The first unit is used to initialize the PID basic parameters corresponding to the drone, start the environmental monitoring system, introduce the adaptive mechanism framework, and prepare to adjust the PID basic parameters in real time; Collect at least one of the following environmental information in real time: height error, wind speed, and temperature; apply wind speed and temperature compensation methods to adjust PID basic parameters; wherein the height error is the difference between the target height and the current real-time height; the wind speed compensation is to calculate the wind force component; and the temperature compensation is to determine the motor efficiency coefficient according to the temperature; The second unit is used to optimize the PID basic parameters by optimizing the genetic algorithm, setting the population size, each individual represents a set of PID target parameters, the PID target parameters include historical PID parameters and PID basic parameters, randomly generating the initial population, the fitness function is to minimize the control error, rise time, overshoot and steady-state error, using the probability selection mechanism to select individuals to enter the next generation, and perform single-point or multi-point crossover according to the probability selection mechanism, iteratively executing the evaluation, selection, crossover and mutation process until the preset number of iterations is reached or the stop condition is met, and the individual with the highest fitness is selected, and its corresponding PID target parameter is the optimization result; The third unit is used to calculate the proportional term, integral term and differential term of the PID controller based on the optimization results. The proportional term is the proportional coefficient after considering wind speed compensation, the integral term continuously accumulates the error and considers integral saturation processing, the differential term introduces the filter coefficient and the differential pre-value, and finally the total control output is obtained by considering temperature compensation; the total control output is applied to the UAV to adjust the output of the counter-rotating motor for vertical ascent control.
6. An electronic device, It is characterized in that include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 4.
7. A computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
