Multi-rotor unmanned aerial vehicle control method and system

By monitoring the CPU occupancy and memory usage of the slave ESP32 of the multi-rotor drone in real time, dynamically schedule tasks and adjust the operating frequency, the processing delay problem of the multi-rotor drone in high-dynamic flight scenarios is solved, and the response speed and real-time performance are improved.

CN120353597AInactive Publication Date: 2025-07-22CHINA WEST NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510493101.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing multi-rotor UAV flight control system has serious processing delays in high dynamic flight scenarios and cannot meet the real-time requirements.

Method used

The master ESP32 is used to monitor the CPU occupancy and memory usage of multiple slave ESP32 in real time, dynamically schedule tasks and adjust the operating frequency to prevent CPU overload and realize the optimal allocation of resources for multi-core systems.

Benefits of technology

It improves the response speed and real-time performance of multi-rotor drones in high dynamic flight scenarios, ensures data consistency and communication reliability, and avoids the risk of full load of single-core CPUs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353597A_ABST
    Figure CN120353597A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-rotor unmanned aerial vehicle control method and system, and relates to the technical field of control engineering. The method comprises the steps that a master control ESP32 monitors and collects real-time CPU occupancy rates and memory usage rates of a plurality of slave control ESP32, and tasks are distributed to the slave control ESP32 with the most idle resources according to task priorities. Calculating time for completing two-way data transmission of the task, and determining a task capable of being dynamically scheduled; a threshold value is set according to the real-time CPU occupancy rate of the slave control ESP32, and the overload condition is judged; if the load is overloaded, the priority of the dynamically dispatchable task is recalculated, and the dynamically dispatchable task is migrated to other slave control ESP32; a self-adaptive factor is introduced to adjust the task operation frequency and update the task operation frequency, and a data processing result is obtained after the task is executed; and the master control ESP32 reads a result through the data pool and transmits the result to the remote control module through the wireless communication module so as to control the multi-rotor unmanned aerial vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of control engineering technology, and particularly relates to a multi-rotor UAV control method and system. Background Art

[0002] A multi-rotor aircraft is an autonomous flight platform without a pilot, and its flight control system realizes automatic flight by programming control algorithms. The development of multi-rotor aircraft can be traced back to the early 20th century. At that time, aircraft enthusiasts and researchers put forward the concept of multi-rotor aircraft when designing and constructing aircraft. Multi-rotor UAVs, with their flexibility, lightness, excellent stealth ability, excellent maneuverability, and high cost performance, have gradually replaced traditional manned aircraft that perform flight missions in complex and harsh environments, effectively reducing the risk of casualties. Compared with manned aircraft, UAVs show unique advantages in many aspects. For example, they do not need to carry pilots and life-saving equipment, and the restrictions on the airframe structure design are looser, thus reducing costs and weights. Therefore, at the technical level, the importance of achieving precise control of multi-rotor UAVs is highlighted, making the research on the control methods of multi-rotor UAVs widely concerned and supported globally.

[0003] In the prior art, a UAV flight control system based on an STM32 single-chip microcomputer is usually used to control multi-rotor UAVs. However, when the processor architecture design of this control system faces high-dynamic flight scenarios, it will cause processing delay phenomena, thus not fully meeting the flight control requirements with extremely high real-time requirements.

[0004] Therefore, it is urgent to design a multi-rotor UAV control method and system architecture to improve the response speed of flight control. Summary of the Invention

[0005] Based on this, it is necessary to provide a multi-rotor UAV control method and system for the above technical problems to improve the response speed of multi-rotor UAV flight control.

[0006] The present invention adopts the following technical solutions: The present invention provides a multi-rotor UAV control method, which is applied to a flight control module and includes: Obtaining the real-time CPU occupancy rate, real-time memory usage rate, and operating frequency when multiple slave ESP32s perform data processing; and obtaining the data volume of each data to be processed and the data transmission speed between each slave ESP32 and the master ESP32; each data to be processed corresponds to a task to be assigned; Determining the idle resources of each slave ESP32 according to the real-time CPU occupancy rate and real-time memory usage rate; All tasks to be assigned are allocated to the target slave ESP32 according to the preset task priority. According to the data volume of each data to be processed and the data transmission speed between the target slave ESP32 and the master ESP32, the time for each task to be assigned to complete a data bi-directional transmission, that is, the latency time, is obtained respectively; and the dynamically schedulable tasks among the tasks to be assigned are determined according to the latency time; the target slave ESP32 is the slave ESP32 with the most idle resources among all slave ESP32s; According to the real-time CPU occupancy rate of the target slave ESP32, the overloading situation of the target slave ESP32 is determined; if the target slave ESP32 is overloaded, then according to the real-time CPU occupancy rates, real-time memory usage rates of all slave ESP32s and the latency time of the data to be processed, the task priorities of the dynamically schedulable tasks are recalculated, and the dynamically schedulable tasks are migrated to other slave ESP32s according to the task priorities; otherwise, no task migration is performed; By adjusting the operating frequency of the assigned dynamically schedulable tasks through the slave ESP32, the adjusted operating frequency of each dynamically schedulable task is obtained; and according to the adjusted operating frequency, the dynamically schedulable tasks are executed to obtain the data processing results after the slave ESP32 processes the data to be processed; Control the multi-rotor UAV according to the data processing results of the slave ESP32.

[0007] Preferably, the acquisition period range of the real-time CPU occupancy rate and real-time memory usage rate when multiple slave ESP32s perform data processing is from 10 ms to 100 ms. Preferably, obtaining the time for each task to be assigned to complete a data bi-directional transmission, that is, the latency time, and determining the dynamically schedulable tasks among the tasks to be assigned specifically includes:

[0008] According to the transmission speed N of the data transmitted from the slave ESP32 to the master ESP32 once and the data volume M, the latency time of the data to be processed is determined as ; Determining the dynamically schedulable tasks among the tasks to be assigned according to the latency time includes: If , then determine that the task to be assigned is a dynamically schedulable task; If , then determine that the task to be assigned is a non-dynamically schedulable task; where time is the maximum latency time that can be accepted when the master ESP32 and each slave ESP32 perform data transmission.

[0009] Preferably, determining the overloading situation of the slave ESP32 according to the real-time CPU occupancy rate of the slave ESP32 specifically includes: If the real-time CPU occupancy rate is greater than the real-time CPU occupancy rate threshold, it is determined that the slave ESP32 is in an overloaded state; otherwise, it is determined that the slave ESP32 is not overloaded.

[0010] Preferably, the calculation formula for recalculating the task priority of dynamically schedulable tasks is: ; In the formula, B i is the task priority of the dynamically schedulable task, i is the dynamically schedulable task number, I i is the initial priority, F ei The expected running frequency of the task, F ai is the actual running frequency of the task, d i is the delay time, u i is the CPU occupancy rate of the current slave ESP32, m i is the memory usage of the current slave ESP32, are all normalization coefficients.

[0011] Preferably, the dynamically schedulable tasks are migrated to other slave ESP32s according to the task priority, which specifically includes: For the k th dynamically schedulable task, obtain the index of the slave ESP32 with the most remaining resources when no task is allocated. The formula is: ; In the formula, is the index of the slave ESP32 with the largest current remaining resources, represents the remaining resources of each slave ESP32 when the k th task is not allocated, represents the resource requirement of the dynamically schedulable task on the j th slave ESP32, m is the number of slave ESP32s, k represents the dynamically schedulable task number sorted in descending order according to the task priority. Among them, , ; Allocate the k th dynamically schedulable task to the slave ESP32 with the most current remaining resources, and update the remaining resources of this slave ESP32. The formula is: ; In the formula, The remaining resources of the slave ESP32 after the update; For the unallocated k th task, the remaining resources of the slave ESP32, For the k th resource requirement of the dynamically schedulable task.

[0012] Preferably, the operation frequency of each dynamically schedulable task is adjusted by the slave ESP32, specifically including: Determine the remaining resources of each slave ESP32 according to the actually used resources of each slave ESP32, the maximum resource utilization ratio of each slave ESP32, and the total CPU resources of each slave ESP32; Determine the overload ratio of each slave ESP32 according to the ratio of the remaining resources of each slave ESP32 to the total CPU resources of each slave ESP32; Determine the adaptive factor and the scaling factor of each slave ESP32 according to the overload ratio of each slave ESP32; Adjust the operation frequency of the dynamically schedulable task according to the current task operation frequency, adaptive factor, and scaling factor of each slave ESP32. The formula is: ; In the formula, Is the expected task operation frequency of each slave ESP32 at the next moment , Is the current task operation frequency of each slave ESP32 , Is the weighting coefficient, Is the scaling factor of each slave ESP32, used to control the convergence speed, Is the normalization coefficient, Is the adaptive factor of each slave ESP32; Among them, ; ; ; ; In the formula, Is the overload ratio of each slave ESP32, Is the proportionality coefficient, Is the remaining resources of each slave ESP32, Is the total CPU resources of each slave ESP32, The maximum resource ratio that can be used by each slave ESP32, is the actual resource used by each slave ESP32.

[0013] Preferably, when executing dynamically schedulable tasks, the resources used by each current task of the slave ESP32 are at the minimum value and the remaining resources are within the applicable resource range.

[0014] The present invention also provides a multi-rotor UAV control system, which is characterized by comprising: a flight control module and a remote control module; The flight control module is configured to collect the real-time CPU occupancy rate, real-time memory usage rate and operating frequency of multiple slave ESP32s during data processing; and obtain the data volume and data transmission speed of each data to be processed; each data to be processed corresponds to an assignable task; determine the idle resources of each slave ESP32 according to the real-time CPU occupancy rate and real-time memory usage rate; allocate all assignable tasks to the target slave ESP32 according to the preset task priority, and obtain the time for each assignable task to complete one data bi-directional transmission, that is, the delay time, according to the data volume and data transmission speed of each data to be processed; and determine the dynamically schedulable tasks among the assignable tasks according to the delay time; the target slave ESP32 is the slave ESP32 with the most idle resources among all slave ESP32s; determine the overload condition of the target slave ESP32 according to the real-time CPU occupancy rate of the target slave ESP32; if the target slave ESP32 is overloaded, recalculate the task priority of the dynamically schedulable tasks according to the real-time CPU occupancy rate, real-time memory usage rate of all slave ESP32s and the delay time of the data to be processed, and migrate the dynamically schedulable tasks to other slave ESP32s according to the task priority; otherwise, no task migration is performed; adjust the operating frequency of each dynamically schedulable task through the slave ESP32 to obtain the adjusted operating frequency of each dynamically schedulable task; and execute the dynamically schedulable tasks according to the adjusted operating frequency; obtain the data processing result after the slave ESP32 processes the data to be processed; The remote control module is configured to receive the data processing result sent by the master ESP32 to control the quad-rotor UAV.

[0015] The above at least one technical solution adopted by the present invention can achieve the following beneficial effects: A control method and system for a multi-rotor unmanned aerial vehicle provided by the present invention, when the unmanned aerial vehicle faces a high-dynamic flight scenario, the main control ESP32 monitors the CPU occupancy rates of multiple slave controls in real time, and based on the processor occupancy rate data and memory usage rate collected in real time, calculates the priorities of data processing tasks and performs task migration, preventing the slave control ESP32 CPU from being overloaded while making full use of CPU resources, and adjusting the operating frequency in real time, preventing system oscillations caused by frequency mutations, and ensuring that high-priority tasks are prioritized when resources are scarce, effectively realizing the dynamic allocation of computing resources when multiple slave control ESP32s perform data processing tasks, realizing dynamic resource scheduling among multiple slave control ESP32s, avoiding the risk of CPU full load when using a single core board, effectively solving the problem of real-time data synchronization in distributed thread scheduling, improving the response speed and real-time performance of the multi-rotor unmanned aerial vehicle during flight control, and ensuring data consistency and communication reliability of the multi-core system under dynamic loads. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The schematic embodiments and descriptions thereof of the present application are used to explain the present application, and do not constitute an improper limitation to the present application. In the drawings:

[0017] Figure 1 is a schematic flow chart of a control method for a multi-rotor unmanned aerial vehicle provided by the present invention; Figure 2 is a schematic structural diagram of a control system for a multi-rotor unmanned aerial vehicle provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0019] The technical solutions provided by the embodiments of the present application will be described in detail below in conjunction with the drawings.

[0020] Figure 1 is a schematic flow chart of a control method for a multi-rotor unmanned aerial vehicle provided by this real-time example, including: S101: Obtain the real-time CPU occupancy rate, real-time memory usage rate, and operating frequency of multiple slave control ESP32s during data processing; and obtain the data volume and data transmission speed of each data to be processed; each data to be processed corresponds to a task to be allocated.

[0021] Among them, the acquisition cycle range of the real-time CPU occupancy rate and real-time memory usage rate of multiple slave ESP32s during data processing is from 10 ms to 100 ms.

[0022] Specifically, monitor the CPU occupancy rate, memory usage rate, and the execution status of the current tasks (such as the expected frequency, actual frequency, delay, etc.) of each slave ESP32 on the master ESP32, and sort the tasks according to the pre-set task priority matrix.

[0023] S102: Determine the idle resources of each slave ESP32 according to the real-time CPU occupancy rate and real-time memory usage rate.

[0024] S103: Allocate all the tasks to be assigned to the target slave ESP32 according to the pre-set task priority. According to the data volume and data transmission speed of each data to be processed, obtain the time for each task to be assigned to complete a data two-way transmission, that is, the delay time; and determine the dynamically schedulable tasks among the tasks to be assigned according to the delay time; the target slave ESP32 is the slave ESP32 with the most idle resources among all slave ESP32s.

[0025] According to the transmission speed N of the data transmitted from the slave ESP32 to the master ESP32 once and the data volume M, the delay time of the data to be processed is determined as ; Determine the dynamically schedulable tasks among the tasks to be assigned according to the delay time, including: If , then determine that the task to be assigned is a dynamically schedulable task; if , then determine that the task to be assigned is a non-dynamically schedulable task; where time is the maximum delay time that can be accepted during data transmission between the master ESP32 and each slave ESP32.

[0026] Specifically, assume that the transmission speed of the data transmitted to the data pool once is N bps and the data volume is M, then the time for the task to be assigned to complete a data two-way transmission is seconds; determine whether the time for the task to be assigned to complete a data two-way transmission meets the real-time requirement; if the time for the task to be assigned to complete a data two-way transmission meets the real-time requirement, then the task to be assigned is a dynamically schedulable task; if the time for the task to be assigned to complete a data two-way transmission does not meet the real-time requirement, then the task to be assigned is a non-dynamically schedulable task.

[0027] S104: Determine the overload situation of the target slave ESP32 based on its real-time CPU occupancy rate; if the target slave ESP32 is overloaded, recalculate the task priorities of the dynamically schedulable tasks according to the real-time CPU occupancy rates, real-time memory usage rates, and latency times of the data to be processed of all slave ESP32s, and migrate the dynamically schedulable tasks to other slave ESP32s according to the task priorities; otherwise, do not perform task migration.

[0028] Optionally, if the real-time CPU occupancy rate is greater than the real-time CPU occupancy rate threshold, determine that the slave ESP32 is in an overloaded state; otherwise, determine that the slave ESP32 is not overloaded.

[0029] Specifically, set the real-time CPU occupancy rate threshold according to the real-time CPU occupancy rate of the slave ESP32 to determine the overload situation of the slave ESP32, specifically including: the real-time CPU occupancy rate threshold is set to 1; if the real-time CPU occupancy rate is greater than 1, determine that the slave ESP32 is in an overloaded state; otherwise, determine that the slave ESP32 is not overloaded.

[0030] Recalculate the task priorities of the dynamically schedulable tasks according to the real-time CPU occupancy rates, real-time memory usage rates, and latency times of the data to be processed of all slave ESP32s, specifically including: Calculate the task priorities of the dynamically schedulable tasks, and the formula is: ; In the formula, the task priority is B i , i is the dynamically schedulable task number, I i is the initial priority, F ei the expected running frequency of the task, F ai is the actual running frequency of the task, u i is the real-time CPU occupancy rate of the current slave ESP32, m i is the real-time memory usage rate of the current slave ESP32, d i is the latency, are all normalization coefficients.

[0031] Migrate the dynamically schedulable tasks to other slave ESP32s according to the task priorities, specifically including: For the k th dynamically schedulable task, obtain the index of the slave ESP32 with the most remaining resources when the task is not allocated, and the formula is: ; In the formula, is the index of the slave ESP32 with the largest current remaining resources, indicates the remaining resources of each slave ESP32 when the k th task is not allocated, indicates the resource requirement of the dynamically schedulable task on the j th slave ESP32, k indicates the number of the dynamically schedulable task sorted in descending order according to the task priority. Among them, , ; Allocate the k rd dynamically schedulable task to the slave ESP32 with the most current remaining resources, and update the remaining resources of this slave ESP32. The formula is: ; In the formula, is the remaining resources of this slave ESP32 after update; is the remaining resources of this slave ESP32 when the k th task is not allocated, is the resource requirement of the k th dynamically schedulable task.

[0032] S105: Adjust the running frequency of the allocated dynamically schedulable tasks through the slave ESP32 to obtain the adjusted running frequency of each dynamically schedulable task; and execute the dynamically schedulable tasks according to the adjusted running frequency to obtain the data processing result after the slave ESP32 processes the data to be processed.

[0033] Adjust the running frequency of each dynamically schedulable task through the slave ESP32, specifically including: Determine the remaining resources of each slave ESP32 according to the actually used resources of each slave ESP32, the maximum resource utilization ratio of each slave ESP32, and the total CPU resources of each slave ESP32; Determine the overload ratio of each slave ESP32 according to the ratio of the remaining resources of each slave ESP32 to the total CPU resources of each slave ESP32; Determine the adaptive factor and the scaling factor of each slave ESP32 according to the overload ratio of each slave ESP32; Adjust the running frequency of the dynamically schedulable task according to the current task running frequency, adaptive factor and scaling factor of each slave ESP32. The formula is: ; In the formula, is the predicted frequency of task execution for each slave ESP32 at the next moment , is the current task execution frequency of each slave ESP32 , is the weighting coefficient is the scaling factor for each slave ESP32, used to control the convergence speed is the adaptive factor for each slave ESP32; Among them, ; ; ; ; In the formula, is the overload ratio for each slave ESP32 is the proportionality coefficient, is the remaining resources of each slave ESP32 is the total CPU resources of each slave ESP32 is the maximum resource utilization ratio that each slave ESP32 can use is the actual resources used by each slave ESP32.

[0034] Specifically, when executing the dynamically schedulable task, ensure that the resources used by the current task of each slave ESP32 are the minimum and the remaining resources are within the applicable range of resources.

[0035] S106: Control the multi-rotor UAV according to the data processing results of the slave ESP32.

[0036] Figure 2 FIG. is a schematic structural diagram of a multi-rotor UAV control system provided by this real-time example, including: A flight control module and a remote control module;The flight control module is used to collect the real-time CPU occupancy rate, real-time memory usage rate, and operating frequency of multiple slave ESP32s during data processing; obtain the data volume and data transmission speed of each data to be processed; each data to be processed corresponds to an assignable task; determine the idle resources of each slave ESP32 according to the real-time CPU occupancy rate and real-time memory usage rate; allocate all assignable tasks to the target slave ESP32 according to the preset task priority, and obtain the time for each assignable task to complete a data two-way transmission, that is, the delay time, according to the data volume and data transmission speed of each data to be processed; and determine the dynamically schedulable tasks among the assignable tasks according to the delay time; the target slave ESP32 is the slave ESP32 with the most idle resources among all slave ESP32s; determine the overload situation of the target slave ESP32 according to the real-time CPU occupancy rate of the target slave ESP32; if the target slave ESP32 is overloaded, recalculate the task priority of the dynamically schedulable tasks according to the real-time CPU occupancy rate, real-time memory usage rate of all slave ESP32s, and the delay time of the data to be processed, and migrate the dynamically schedulable tasks to other slave ESP32s according to the task priority; otherwise, no task migration is performed; adjust the operating frequency of each dynamically schedulable task through the slave ESP32 to obtain the adjusted operating frequency of each dynamically schedulable task; and execute the dynamically schedulable tasks according to the adjusted operating frequency; obtain the data processing result after the slave ESP32 processes the data to be processed.

[0037] The flight control module includes: an ESP32 core main control, an ESP32 image data processing core board, an ESP32 map data processing core board, an ESP32 attitude data processing core board, a camera, a laser data acquisition module, a 9-axis gyroscope, a first wireless communication module, and a motor control module.

[0038] The remote control module includes: an ESP32 core control board, a second wireless communication module, a throttle joystick, a direction joystick, function buttons, an unlocking button, and a touch display screen.

[0039] The ESP32 core main control is respectively connected to the first slave ESP32, the second slave ESP32, and the ESP32 attitude controller.

[0040] The ESP32 image data processing core board, the ESP32 map data processing core board, and the ESP32 attitude data processing core board all independently process data tasks, and each core board only exchanges data with the ESP32 core main control.

[0041] The camera is connected to the ESP32 image data processing core board; the laser data acquisition module is connected to the ESP32 map data processing core board; the 9-axis gyroscope is connected to the ESP32 attitude data processing core board.

[0042] The motor control module is connected to the ESP32 attitude data processing core board.

[0043] The ESP32 core control board is respectively connected to the second wireless communication module, the throttle joystick and the direction joystick.

[0044] The first wireless communication module is connected to the ESP32 attitude data processing core board.

[0045] The function button, the unlock button and the touch display screen are respectively connected to the ESP32 core control board.

[0046] Among them, the flight control part uses a 9-axis gyroscope sensor as the attitude acquisition device of the drone. Compared with the ordinary 6-axis sensor MPU6050 which does not have the function of a magnetometer and cannot provide absolute direction information during heading estimation, the 9-axis gyroscope sensor combines a three-axis gyroscope, a three-axis accelerometer and a three-axis magnetometer, and can provide more comprehensive attitude and heading information, which helps to improve the overall attitude estimation accuracy. At the same time, the flight control part is equipped with a wireless module and can perform remote wireless communication with the remote controller.

[0047] Among them, each module has a corresponding ESP32 for control. One slave ESP32 is used to read the data transmitted by the gyroscope, and after algorithm processing, automatically adjust the PID parameters of the motor, and receive the signal transmitted from the remote controller end through the wireless communication module; one slave ESP32 is used to receive the data of the laser rangefinder and the 2D lidar, perform scene mapping, and transmit the processed scene model to the master ESP32 for calling; one slave ESP32 is used to control the camera, capture and process visual pictures, and send the processed data to the master ESP32 for calling.

[0048] By parallel processing of different data streams (such as attitude data, laser ranging data and camera image data) by multiple slave ESP32s, the data processing speed can be significantly improved, the latency can be reduced, and thus the real-time response ability of the drone can be enhanced.

[0049] The slave ESP32 in the remote controller part mainly reads the data of the throttle joystick and the direction joystick and the signals of several buttons, and sends the remote control information through the wireless communication module and receives the attitude data and the like sent back by the drone, and displays them on the touch display screen on the remote controller.

[0050] In summary, for the multi-rotor UAV control system provided in this embodiment, multiple ESP32 modules can process different tasks in parallel, such as sensor data acquisition, attitude control, and image processing. This parallel processing ability significantly improves the overall response speed and real-time performance of the system, enabling the UAV to adapt to environmental changes more quickly. Modular design and flexibility: The use of multiple ESP32s enables modular design, and each module can operate independently and complete specific functions. This flexibility allows developers to freely combine and configure modules according to specific application requirements, facilitating personalized customization. Flexible communication mechanism: Each ESP32 module only needs to exchange data with the main ESP32 core, improving the flexibility and mobility of the system and avoiding problems such as complex wiring and difficult troubleshooting caused by a single host carrying multiple peripherals. Easy to expand and upgrade: The architecture using multiple ESP32s is convenient for future system expansion and upgrade. Developers can easily add new modules or replace existing modules according to technological progress or market demands without having to redesign the entire system.

[0051] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope recorded by the present invention.

Claims

1. A control method for a multi-rotor unmanned aerial vehicle, characterized in that The method is applied to a flight control module and includes: Obtaining the real-time CPU occupancy rate, real-time memory usage rate, and operating frequency of multiple slave ESP32s during data processing; and obtaining the data volume of each data to be processed and the data transmission speed between each slave ESP32 and the master ESP32; each data to be processed corresponds to an assignable task. Determining the idle resources of each slave ESP32 according to the real-time CPU occupancy rate and real-time memory usage rate. Allocating all assignable tasks to the target slave ESP32 according to the preset task priorities, and respectively obtaining the time for each assignable task to complete one data bidirectional transmission, i.e., the latency, according to the data volume of each data to be processed and the data transmission speed between the target slave ESP32 and the master ESP32; the target slave ESP32 is the slave ESP32 with the most idle resources among all slave ESP32s. Determining the overloading situation of the target slave ESP32 according to the real-time CPU occupancy rate of the target slave ESP32; if the target slave ESP32 is overloaded, recalculating the task priorities of the assignable tasks that can be dynamically scheduled according to the real-time CPU occupancy rate, real-time memory usage rate of all slave ESP32s, and the latency of the data to be processed, and migrating the assignable tasks that can be dynamically scheduled to other slave ESP32s according to the task priorities; otherwise, no task migration is performed. Adjusting the operating frequency of the assignable tasks that can be dynamically scheduled by the slave ESP32 to obtain the adjusted operating frequency of each assignable task that can be dynamically scheduled; and executing the assignable tasks that can be dynamically scheduled according to the adjusted operating frequency to obtain the data processing result after the slave ESP32 processes the data to be processed. Controlling the multi-rotor UAV according to the data processing result of the slave ESP32.

2. The multi-rotor UAV control method according to claim 1, characterized in that, The acquisition period range of the real-time CPU occupancy rate and real-time memory usage rate of the multiple slave ESP32s during data processing is from 10 ms to 100 ms.

3. The multi-rotor UAV control method according to claim 1, wherein, The obtaining the time for each assignable task to complete one data bidirectional transmission, i.e., the latency, and determining the assignable tasks that can be dynamically scheduled according to the latency specifically includes: Determine the delay time of the data to be processed according to the transmission speed N of the slave ESP32 data transmitted to the master ESP32 once and the amount of data M transmitted ; Determining the assignable tasks that can be dynamically scheduled according to the latency, including: If , then determine that the task to be assigned is a dynamically schedulable task; If , then determine that the task to be assigned is a non-dynamically schedulable task; where time is the maximum latency that can be accepted when data is transmitted between the master ESP32 and each slave ESP32.

4. The multi-rotor UAV control method according to claim 1, wherein The determining the overloading situation of the slave ESP32 according to the real-time CPU occupancy rate of the slave ESP32 specifically includes: If the real-time CPU occupancy rate is greater than the real-time CPU occupancy rate threshold, it is determined that the slave ESP32 is in an overloaded state; otherwise, it is determined that the slave ESP32 is not overloaded.

5. A multi-rotor UAV control method according to claim 1, characterized in that The calculation formula for recalculating the task priorities of the assignable tasks that can be dynamically scheduled is: ; In the formula, B i is the task priority of the dynamically schedulable task, i is the dynamically schedulable task number, I i is the initial priority, F ei is the expected running frequency of the task, F ai is the actual running frequency of the task, d i is the delay time, u i is the CPU occupancy rate of the current slave ESP32, m i is the memory usage of the current slave ESP32, are all normalization coefficients.

6. The multi-rotor UAV control method according to claim 1, characterized in that, The migrating the assignable tasks that can be dynamically scheduled to other slave ESP32s according to the task priorities specifically includes: For the k th dynamically schedulable task, obtain the slave ESP32 index with the most remaining resources when obtaining unassigned tasks. The formula is: ; In the formula, is the index of the slave ESP32 with the largest current remaining resources, represents the remaining resources of each slave ESP32 when the k th task is not allocated, represents the resource requirement of the dynamically schedulable task on the j th slave ESP32, m is the number of slave ESP32s, k represents the number of the dynamically schedulable task sorted in descending order of task priority. Among them, , ; Assign the k th dynamically schedulable task to the slave ESP32 with the most remaining resources currently, and update the remaining resources of this slave ESP32. The formula is: ; In the formula, is the remaining resources of the slave ESP32 after update; is the remaining resources of the slave ESP32 when the k th task is not allocated, is the resource requirement of the k th dynamically schedulable task.

7. The multi-rotor UAV control method according to claim 1, characterized in that, The adjusting the operating frequency of each assignable task that can be dynamically scheduled by the slave ESP32 specifically includes: Determine the remaining resources of each slave ESP32 according to the actually used resources of each slave ESP32, the maximum resource utilization ratio of each slave ESP32, and the total CPU resources of each slave ESP32; Determine the overload ratio of each slave ESP32 according to the ratio of the remaining resources of each slave ESP32 to the total CPU resources of each slave ESP32; Determine the adaptive factor and the proportionality factor of each slave ESP32 according to the overload ratio of each slave ESP32; Adjust the running frequency of the dynamically schedulable tasks according to the running frequency, adaptive factor, and proportionality factor of each slave ESP32 at the current moment. The formula is: ; In the formula, is the expected frequency of task execution at the next moment for each slave ESP32 ; is the frequency of task execution at the current moment for each slave ESP32 ; is the weighting coefficient is the proportionality factor for each slave ESP32, used to control the convergence speed is the normalization coefficient is the adaptive factor for each slave ESP32; Wherein, ; ; ; ; Wherein, is the overload ratio of each slave ESP32, is the proportionality coefficient, is the remaining resources of each slave ESP32, is the total CPU resources of each slave ESP32, is the maximum resource ratio that each slave ESP32 can use, is the actual resources used by each slave ESP32.

8. A multi-rotor UAV control method according to claim 1, characterized in that, When executing the dynamically schedulable tasks, the resources used by the current tasks of each slave ESP32 are the minimum and the remaining resources are within the applicable resource range.

9. A multi-rotor UAV control system, characterized in that, Including: A flight control module and a remote control module; The flight control module is used to collect the real-time CPU occupancy rate, real-time memory usage rate, and running frequency of multiple slave ESP32s during data processing; and obtain the data volume and data transmission speed of each data to be processed; each data to be processed corresponds to a task to be assigned; Determine the idle resources of each slave ESP32 according to the real-time CPU occupancy rate and real-time memory usage rate; Allocate all tasks to be assigned to the target slave ESP32 according to the preset task priorities. According to the data volume and data transmission speed of each data to be processed, obtain the time for each task to be assigned to complete a data two-way transmission, that is, the delay time; and determine the dynamically schedulable tasks among the tasks to be assigned according to the delay time; the target slave ESP32 is the slave ESP32 with the most idle resources among all slave ESP32s; determine the overload situation of the target slave ESP32 according to the real-time CPU occupancy rate of the target slave ESP32; if the target slave ESP32 is overloaded, recalculate the task priorities of the dynamically schedulable tasks according to the real-time CPU occupancy rate, real-time memory usage rate, and delay time of all slave ESP32s, and migrate the dynamically schedulable tasks to other slave ESP32s according to the task priorities; otherwise, no task migration is performed; Adjust the running frequency of each dynamically schedulable task through the slave ESP32 to obtain the adjusted running frequency of each dynamically schedulable task; and execute the dynamically schedulable tasks according to the adjusted running frequency; Obtain the data processing result after the slave ESP32 processes the data to be processed; The remote control module is used to receive the data processing result sent by the master ESP32 to control the quadcopter drone.