Processing method of UAV power system data based on MCU external Flash memory
By reasonably partitioning and data management of the external Flash memory of MCU, the problems of low space utilization and limited fault analysis capabilities in data processing of UAV power system are solved, and more efficient data storage and analysis capabilities are achieved.
Patent Information
- Application Number
- CN202510034561.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2045-01-09
AI Technical Summary
The existing UAV power system has problems with low space utilization and limited fault recording and analysis capabilities in data processing, especially under the physical characteristics of slow random write speed, limited number of erases and fixed storage space.
By reasonably partitioning the external Flash memory of the MCU, it is divided into system data area, historical data area, fault data area and reserved area, and the first storage queue and second storage queue are opened in the on-chip RAM of the MCU as buffers for the historical data area and fault data area, and various types of data are managed using different sampling frequencies and storage strategies.
It improves the utilization rate of Flash memory space, enhances the ability to record and analyze historical data and fault data of the drone power system, and facilitates developers to view and analyze data.
Smart Images

Figure CN119479108B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of UAV power system data processing, and in particular to a method for processing UAV power system data based on MCU external Flash memory. Background Art
[0002] During the flight, the drone is powered by a power system consisting of propellers, motors, and electronic speed regulators. When the power system fails, the drone will be out of control or even explode. Therefore, it is very important to detect the power system data before takeoff.
[0003] Drones are usually equipped with embedded devices, which use microcontrollers (MCUs) as core control units and undertake important tasks such as data collection, processing, and storage. Due to the need to process multiple types and formats of data, in order to manage data storage more efficiently, external Flash is usually used as an extended storage device for MCU. However, Flash storage has physical characteristics such as slow random write speed, limited erase and write times, and fixed storage space. Therefore, how to partition and manage it reasonably is an important issue.
[0004] In the prior art, most embedded storage solutions use a simple partitioning mechanism, usually divided into fixed addresses or linear storage areas, for storing a single type of data. This approach is difficult to dynamically adjust when the amount of data increases or storage requirements change, resulting in low utilization of Flash memory space, and limited ability to record and analyze power system faults, making it inconvenient to view and analyze historical data and fault data. Summary of the invention
[0005] In order to solve the above technical problems, this application proposes a method for processing UAV power system data based on MCU external Flash memory. By reasonably partitioning and managing the Flash memory, the Flash memory space utilization rate is improved, and it is convenient to view and analyze the historical data and fault data of the UAV power system.
[0006] According to a first aspect of the present application, a method for processing data of a UAV power system based on an MCU external Flash memory is proposed, wherein the on-chip RAM of the MCU is provided with a first storage queue and at least one second storage queue, and the Flash memory is configured to include at least a system data area, a history data area, and a fault data area, and the method comprises:
[0007] After the electronic speed regulator of the UAV power system is powered on, obtaining system data and real-time operation data of the electronic speed regulator;
[0008] Saving the system data to the system data area;
[0009] Sampling the real-time operation data at a first frequency and statically storing the data in the first storage queue, extracting data from the first storage queue at a second frequency and writing the data into the historical data area, wherein the first frequency is greater than the second frequency;
[0010] The real-time operation data is sampled at a third frequency and dynamically overwritten and saved in the second storage queue. In response to detecting a fault in the electronic speed regulator, data is extracted from the second storage queue and continuously written into the fault data area. The third frequency is greater than the first frequency.
[0011] Preferably, the system data includes at least any one or more parameters of the self-test parameters, control variables and onboard IC chip configuration of the electronic speed regulator;
[0012] The real-time operation data includes at least any one or more of the throttle value, target speed, actual speed, bus voltage, maximum phase current, MOS temperature and capacitor temperature. The real-time operation data is dynamically overwritten and saved in the form of a file to the historical data area and the fault data area.
[0013] Preferably, a plurality of the second storage queues are opened, and each type of the real-time operation data is saved in a corresponding second storage queue.
[0014] Preferably, the faults include at least any one or more fault types of throttle loss, throttle not returning to zero, stall, undervoltage, overvoltage, overcurrent, motor phase loss and MOS overtemperature, each of the fault types corresponds to one or more of the real-time operation data, and the fault data area is configured to include multiple sub-areas, each of the sub-areas is used to write data from the corresponding second storage queue according to the fault type.
[0015] Preferably, the fault types are divided into at least high priority faults and low priority faults, and the method further comprises:
[0016] In response to detecting that the electronic speed regulator has the high priority fault, increasing the third frequency by a first increment, sampling the real-time operation data at the updated third frequency and dynamically overwriting and saving the data to the corresponding second storage queue;
[0017] In response to detecting that the electronic speed regulator has the low priority fault, increasing the third frequency by a second increment, sampling the real-time operation data at the updated third frequency and dynamically overwriting and saving the data to the corresponding second storage queue;
[0018] Wherein, the first increase is greater than the second increase.
[0019] Preferably, the Flash memory is further configured to include a reserved area, the reserved area being used as a reserved memory space, and the method further includes:
[0020] In response to the memory space of the sub-area corresponding to the high priority fault being lower than a preset capacity threshold, at least a portion of emergency memory space is opened up in the reserved area for continuing to write data from the corresponding second storage queue.
[0021] Preferably, the historical data area is divided into multiple independent historical files, and the historical files describe the attributes of the historical data through a fixed historical file format. The historical file format includes power-on times, file sequence number, file size, amount of data in a sampled frame, timestamp and operation data for the time period.
[0022] Preferably, the fault data area is divided into multiple independent fault files according to the sub-areas, and the emergency memory space is divided into at least one fault file. The fault file describes the attributes of the fault data through a fixed fault file format, and the fault file format includes the fault type, number of faults, the last power-on number of faults, a timestamp, and the operating data for the time period.
[0023] Preferably, the MCU has a host computer interaction interface, and the method further includes:
[0024] The MCU communicates with a host computer;
[0025] In response to receiving the data request signal from the host computer, the MCU sends the corresponding real-time operation data / the historical data / the fault data to the host computer;
[0026] The host computer queries the historical data based on the power-on times and the file sequence number of the historical file, and the host computer queries the fault data based on the fault type of the fault file.
[0027] Preferably, the method further comprises:
[0028] In response to the host computer exporting the fault file in the emergency memory space to the local memory space, the reserved area releases the corresponding emergency memory space.
[0029] According to a second aspect of the present application, a device for processing UAV power system data based on an MCU external Flash memory is proposed, wherein the on-chip RAM of the MCU is provided with a first storage queue and at least one second storage queue, and the Flash memory is configured to include at least a system data area, a history data area, and a fault data area, and the device comprises:
[0030] A data acquisition module, configured to acquire system data and real-time operation data of the electronic speed regulator after the electronic speed regulator of the UAV power system is powered on;
[0031] A system data storage module, configured to save the system data to the system data area;
[0032] A historical data storage module, configured to sample the real-time operation data at a first frequency and statically save the data to the first storage queue, extract data from the first storage queue at a second frequency and write the data to the historical data area, wherein the first frequency is greater than the second frequency;
[0033] A fault data storage module is configured to sample the real-time operating data at a third frequency and dynamically overwrite and save it to the second storage queue. In response to detecting a fault in the electronic speed regulator, data is extracted from the second storage queue and continuously written into the fault data area. The third frequency is greater than the first frequency.
[0034] According to the third aspect of the present application, an electronic device is proposed, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements a method for processing UAV power system data based on MCU external Flash memory as provided in any embodiment of the first aspect above.
[0035] According to the fourth aspect of the present application, a computer-readable storage medium is proposed, on which a computer program is stored. When the program is executed by a processor, a method for processing UAV power system data based on MCU external Flash memory as provided in any embodiment of the first aspect above is implemented.
[0036] The present application proposes a method for processing data of a UAV power system based on an MCU external Flash memory. The method divides the Flash memory into a system data area, a historical data area, a fault data area and a reserved area, and opens a first storage queue and a second storage queue in the on-chip RAM of the MCU as buffers for the historical data area and the fault data area, respectively. Different management and optimization strategies are performed on each partition of the Flash memory, and each partition adopts a different storage strategy according to the different characteristics of the data, thereby ensuring that the storage space is fully utilized. At the same time, the recording and analysis capabilities of the historical data and fault data are enhanced, which facilitates developers to view and analyze the historical data and fault data of the UAV power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the accompanying drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0038] Figure 1 It is a processing framework diagram of UAV power system data based on MCU external Flash memory according to a specific embodiment of the present application;
[0039] Figure 2 It is a flow chart of a method for processing UAV power system data based on MCU external Flash memory according to a specific embodiment of the present application;
[0040] Figure 3 It is a schematic diagram of a device for processing UAV power system data based on MCU external Flash memory according to an embodiment of the present application;
[0041] Figure 4 is a schematic diagram of an electronic device according to a specific embodiment of the present application. DETAILED DESCRIPTION
[0042] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0043] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0044] The present application proposes a method for processing UAV power system data based on MCU external Flash memory, which will be described below in conjunction with the accompanying drawings.
[0045] Figure 1 FIG. 1 shows a processing framework diagram of a UAV power system data based on an MCU external Flash memory according to a specific embodiment of the present application, as shown in FIG. Figure 1 As shown, the UAV power system includes an electronic speed regulator, which is equipped with an MCU (microcontroller) as a core control unit, and the MCU uses an external Flash memory as an extended storage device. Among them, the on-chip RAM of the MCU has a first storage queue and at least one second storage queue, and the Flash memory is configured to include a system data area, a historical data area, a fault data area, and a reserved area.
[0046] Figure 2 A flowchart of a method for processing drone power system data based on MCU external Flash memory according to a specific embodiment of the present application is shown. Figure 2 As shown, the method comprises the following steps:
[0047] Step S101: After the electronic speed regulator of the UAV power system is powered on, the system data and real-time operation data of the electronic speed regulator are obtained.
[0048] In a specific embodiment, the system data includes at least any one or more parameters of the self-test parameters, control variables and onboard IC chip configuration of the electronic speed regulator. The self-test parameters of the electronic speed regulator may include the throttle value (whether the throttle value is zero), the temperature threshold (MOS temperature threshold, capacitor temperature threshold) and the bus voltage threshold; the control variables may include some filter parameters inside the electronic speed regulator; the onboard IC chip configuration may include the Bluetooth chip configuration, the magnetic encoder chip configuration, etc.
[0049] It is understandable that, in other implementations, the system data of the electronic speed regulator may also include default parameters such as initialization parameters of the MCU and configuration parameters of some peripherals, which are not limited here.
[0050] In a specific embodiment, the real-time operation data includes at least one or more of the throttle value, target speed, actual speed, bus voltage, maximum phase current, MOS temperature, capacitor temperature, and the like.
[0051] It should be noted that after the electronic speed regulator is powered on, it is usually necessary to perform a power-on self-test first. The solution of this embodiment does not involve data processing of the power-on self-test, so it will not be described in detail.
[0052] Step S102: Save the system data to the system data area.
[0053] In a specific embodiment, since system data is usually relatively stable and changes less frequently, the storage structure of the system data area is relatively simple, and the system data does not involve complex data management, and the system data is directly saved in the system data area in a standardized format.
[0054] Step S103: sampling the real-time operation data at a first frequency and statically saving it to a first storage queue, extracting data from the first storage queue at a second frequency and writing it into a historical data area, wherein the first frequency is greater than the second frequency.
[0055] Specifically, the historical data area is mainly used to store the work logs generated during the power-on period of the electronic speed regulator. These work logs record the working status of the electronic speed regulator and related real-time operating data, which is convenient for later data analysis and fault tracing.
[0056] Historical data generally does not involve detailed key data analysis, so it is sampled at a lower second frequency. In this embodiment, the first frequency is 5HZ. In order to further avoid frequent writing of data into the historical data area of the Flash memory and reduce the life of the Flash memory, this embodiment opens a first storage queue in the on-chip RAM of the MCU. The sampled historical data can be first statically cached in the first storage queue, and then sampled and written into the historical data area at the second frequency. In this embodiment, the second frequency is 1HZ, and the memory space of the first storage queue can cache real-time operation data sampled 5 times.
[0057] It is understandable that in other implementations, the first frequency, the second frequency and the memory space of the first storage queue can be dynamically adjusted according to their respective values, which will not be described in detail here.
[0058] In a specific embodiment, the sampled real-time operation data is dynamically overwritten and saved in the historical data area in the form of a file. On the one hand, the use of file management for historical data facilitates the management and subsequent analysis of historical data; on the other hand, the file writing operation adopts a circular overwriting method, so that the historical data area will not be insufficient in memory space due to excessive data volume.
[0059] Specifically, the historical data area is divided into multiple independent historical files, and the historical files describe the attributes of the historical data through a fixed historical file format. The file format of each historical file in the historical data area includes the following fields, as shown in Table 1 below:
[0060] ①Power-on times: Indicates the number of times the electronic speed controller is started.
[0061] ②File serial number: used to distinguish the order of files.
[0062] ③File size: the amount of storage space occupied by the file.
[0063] ④ Amount of data sampled per frame: the amount of real-time data recorded each time.
[0064] ⑤Timestamp: the running time when the file was created.
[0065] ⑥ Operation data for this time period: including various working data of the electronic speed regulator sampled during this time period.
[0066]
[0067] As shown in Table 1, illustratively, during the first power-on of the electronic speed controller, a total of two history files are generated, wherein after the first history file is filled with 4096 bytes of memory, the data continues to be saved in the second history file; during the second power-on, the first history file is regenerated, and data is saved starting from the first history file.
[0068] In a specific embodiment, the historical data area is divided into a first number of historical files. During each power-on, when the number of historical files storing data reaches a second number, the earliest historical file is automatically overwritten to ensure that the number of historical files during each power-on does not exceed the limit, thereby ensuring that there are redundant blank historical files to continue storing data during the next power-on.
[0069] In this embodiment, the first number is 100 and the second number is 30. In other implementations, the first number and the second number can be set according to actual needs and are not limited here.
[0070] Step S104: sampling the real-time operation data at a third frequency and dynamically overwriting and saving it to the second storage queue, in response to detecting a fault in the electronic speed regulator, extracting data from the second storage queue and continuously writing it to the fault data area, the third frequency being greater than the first frequency.
[0071] Specifically, the fault data area is mainly used to store fault data that occurs during the operation of the electronic speed regulator. These fault data can help developers quickly locate faults and optimize products.
[0072] For fault analysis, it is necessary not only to analyze the fault data after the fault point occurs, but also to analyze the normal data before the fault point occurs, and the data generally needs to be as detailed as possible. In order to avoid losing some key data before and after the fault point occurs, the real-time operation data is sampled at a relatively high third frequency. In this embodiment, the third frequency is 40HZ. Further, a second storage queue is opened in the on-chip RAM of the MCU, and the real-time operation data obtained by sampling is dynamically overwritten and cached in the second storage queue. In this embodiment, a plurality of second storage queues are opened, and each type of real-time operation data is cached in the corresponding second storage queue.
[0073] Further, it is detected whether the electronic speed regulator has a fault. If not, the real-time operation data in the second storage queue is dynamically overwritten; if so, the real-time operation data in the second storage queue is dynamically overwritten and written into the fault data area.
[0074] In a specific embodiment, by comparing various data in the real-time operation data with corresponding thresholds, it is possible to determine what type of fault has occurred. Specifically, the fault includes at least one or more types of faults including throttle loss, throttle not returning to zero, stall, undervoltage, overvoltage, overcurrent, motor phase loss, and MOS overtemperature. Each type of fault may correspond to one or more real-time operation data, and each real-time operation data may also correspond to one or more types of faults.
[0075] In a specific embodiment, the fault data area is configured into a plurality of sub-areas according to the fault type, wherein each sub-area is used to determine corresponding real-time operation data according to the fault type, and then write the data from the corresponding second storage queue.
[0076] In a specific embodiment, the sampled real-time operation data is dynamically overwritten and saved in the sub-area corresponding to the fault data area in the form of a file. On the one hand, the fault data is managed in a file-based manner to facilitate the management and subsequent analysis of the fault data; on the other hand, the file writing operation adopts a circular overwriting method, so that the fault data area will not be insufficient in memory space due to excessive data volume.
[0077] Specifically, the fault data area is divided into multiple independent fault files according to the sub-areas, and the fault files describe the attributes of the fault data through a fixed fault file format. The file format of each fault file in the fault data area includes the following fields, as shown in Table 2 below:
[0078] ① Fault type: such as throttle loss, throttle not returning to zero, stall, undervoltage, overvoltage, overcurrent, motor phase loss and MOS overtemperature, etc.
[0079] ②Number of faults: record the number of times the fault occurs.
[0080] ③ Last power-on times of fault: record the last power-on times of fault.
[0081] ④Timestamp: The running time when the fault is sent.
[0082] ④ Operation data for this time period: record the real-time operation data related to the occurrence of the fault during this time period.
[0083]
[0084] As shown in Table 2, illustratively, different fault types are correspondingly stored in the fault files of the sub-areas.
[0085] In this embodiment, each sub-region is divided into one fault file. In other implementations, each sub-region may also be divided into two or more fault files, which is not limited here.
[0086] In a specific embodiment, different fault types are divided into at least two priorities including high priority faults and low priority faults. Exemplarily, undervoltage, overvoltage, overcurrent, and MOS overtemperature are classified as high priority faults, and stall, throttle loss, motor phase loss, and throttle non-return to zero are classified as low priority faults. Step S104 also includes:
[0087] In response to detecting a high priority fault in the electronic speed regulator, the third frequency is increased by a first increase, and the real-time operation data is sampled at the updated third frequency and dynamically overwritten and saved in the corresponding second storage queue.
[0088] In response to detecting that a low priority fault exists in the electronic speed regulator, the third frequency is increased by a second increase, and the real-time operation data is sampled at the updated third frequency and dynamically overwritten and saved in the corresponding second storage queue.
[0089] In this embodiment, the first increase is greater than the second increase. Specifically, the first increase is 60HZ, and when a high-priority fault is detected in the electronic speed regulator, the real-time operation data is sampled at a sampling frequency of 100HZ and dynamically overwritten and saved to the corresponding second storage queue; the second increase is 40HZ, and when a low-priority fault is detected in the electronic speed regulator, the real-time operation data is sampled at a sampling frequency of 80HZ and dynamically overwritten and saved to the corresponding second storage queue.
[0090] Therefore, when a high-priority fault occurs, the data written to the fault file of the sub-area has a sampling frequency of 40 Hz before the fault point and a sampling frequency of 100 Hz after the fault point; when a low-priority fault occurs, the data written to the fault file of the sub-area has a sampling frequency of 40 Hz before the fault point and a sampling frequency of 80 Hz after the fault point.
[0091] Through the above sampling strategy, for a medium frequency sampling frequency of 40HZ, it can be ensured that the second storage queue can cache real-time operation data for a long period of time, and the data is relatively detailed, and it is not easy to lose the key data before the fault point occurs. When a low-priority fault occurs, sampling is performed at a medium-high frequency sampling frequency of 80HZ, so that the fault data after the fault point occurs is more detailed. When a high-priority fault occurs, sampling is performed at a high-frequency sampling frequency of 100HZ, so that the fault data after the fault point occurs is further detailed, ensuring that important fault data will not be lost.
[0092] In this embodiment, the memory space of the sub-region corresponding to the high-priority fault is larger than the memory space of the sub-region corresponding to the low-priority fault.
[0093] It should be noted that in other implementations, the fault types may also be divided into three priorities, four priorities or even more priorities. When faults of different levels of priority occur, the third frequency may be increased by different increments, which will not be described in detail here.
[0094] In a specific embodiment, the reserved area is used as a reserved memory space to store future product maintenance, upgrades or other functional development needs. The reserved area can be dynamically adjusted according to actual needs to support different versions of firmware updates and functional expansions. The reserved area supports flexible space division without affecting other functional areas to meet the needs of future functional expansion of the system. Step S104 also includes:
[0095] In response to the memory space of the sub-area corresponding to the high priority fault being lower than a preset capacity threshold, at least a portion of the emergency memory space is opened in the reserved area for continuing to write data from the corresponding second storage queue.
[0096] Specifically, as a high-priority fault is an important fault, it is necessary to ensure that as much fault data as possible is stored, so that developers can analyze the fault data and maintain and update the product. Therefore, when a high-priority fault occurs, the reserved area can be divided into part of the emergency memory space to continue writing fault data, ensuring that important fault data can be stored in a timely manner.
[0097] In this embodiment, each emergency memory space is divided into one fault file. In other implementations, each emergency memory space may also be divided into two or more fault files, which is not limited here.
[0098] It should be noted that the preset capacity threshold may be 5%, 2% or 1%, which may be set according to actual needs and is not limited here.
[0099] In a specific embodiment, the MCU also has a host computer interface. Figure 2 , the method further comprises:
[0100] Step S105: The MCU communicates with the host computer. In response to receiving a data request signal from the host computer, the MCU sends corresponding real-time operation data / historical data / fault data to the host computer.
[0101] Specifically, in order to facilitate developers to perform data management and fault analysis, the host computer communicates with the MCU through a specified protocol to receive real-time operation data / historical data / fault data sent by the MCU.
[0102] For real-time operation data, the MCU sends data to the host computer at a fourth frequency. In this embodiment, the fourth frequency is 100 Hz.
[0103] For historical data, the host computer can send a data request signal to query historical data based on the power-on times and file sequence number of the historical file. The host computer supports switching displays of different historical files and can export and save data according to the needs of developers.
[0104] For fault data, the host computer can send a data request signal to query the fault data based on the fault type of the fault file. The host computer supports switching displays of different fault files and can export and save data according to the needs of developers.
[0105] For real-time operation data / historical data / fault data, the host computer can send a request signal to the MCU according to the data type selected by the developer, and the MCU transmits the corresponding data to the host computer according to the request. After receiving the data, the host computer will display the data in the form of a waveform, where the vertical axis represents the value change and the horizontal axis represents the operation timestamp, which is convenient for developers to analyze.
[0106] In a specific embodiment, step S105 further includes:
[0107] In response to exporting the fault file in the emergency memory space to the local memory space through the host computer, the reserved area releases the corresponding emergency memory space.
[0108] When the developer exports the fault file saved in the fault data area and the emergency memory space of a high-priority fault to the local client through the host computer, it can be determined that the fault data has been saved. At this time, the reserved area releases the corresponding emergency memory space, thereby realizing dynamic adjustment of the reserved area memory space, so as to continue to reserve emergency memory space for high-priority faults in the future.
[0109] The present application provides a method for processing data of a UAV power system based on an MCU external Flash memory. By dividing the Flash memory into a system data area, a historical data area, a fault data area and a reserved area, a first storage queue and a second storage queue are opened in the on-chip RAM of the MCU as buffers for the historical data area and the fault data area, respectively. Different management and optimization strategies are performed on each partition of the Flash memory, and each partition adopts a different storage strategy according to the different characteristics of the data, thereby ensuring that the storage space is fully utilized. At the same time, the recording and analysis capabilities of the historical data and fault data are stronger, so that users can view and analyze the historical data and fault data of the UAV power system conveniently.
[0110] Based on the above-mentioned method for processing UAV power system data based on MCU external Flash memory, based on the same inventive concept, the present application also proposes a device for processing UAV power system data based on MCU external Flash memory.
[0111] Among them, the UAV power system includes an electronic speed regulator, which is equipped with an MCU (microcontroller) as the core control unit. The MCU uses an external Flash memory as an extended storage device. The on-chip RAM of the MCU has a first storage queue and at least one second storage queue. The Flash memory is configured to include a system data area, a historical data area, a fault data area, and a reserved area.
[0112] Figure 3 A schematic diagram of a device for processing UAV power system data based on an MCU external Flash memory according to an embodiment of the present application is shown, Figure 3 As shown, the device comprises:
[0113] The data acquisition module 201 is configured to acquire system data and real-time operation data of the electronic speed regulator after the electronic speed regulator of the UAV power system is powered on.
[0114] The system data storage module 202 is configured to store system data in the system data area.
[0115] The historical data storage module 203 is configured to sample the real-time operation data at a first frequency and statically save it to a first storage queue, extract data from the first storage queue at a second frequency and write it into the historical data area, and the first frequency is greater than the second frequency.
[0116] The fault data storage module 204 is configured to sample the real-time operation data at a third frequency and dynamically overwrite and save it to the second storage queue. In response to detecting a fault in the electronic speed regulator, data is extracted from the second storage queue and continuously written into the fault data area. The third frequency is greater than the first frequency.
[0117] The analysis module 205 is configured to enable the MCU to communicate with the host computer. In response to receiving a data request signal from the host computer, the MCU sends the corresponding real-time operation data / historical data / fault data to the host computer.
[0118] Based on the above-mentioned method for processing UAV power system data based on MCU external Flash memory, based on the same inventive concept, the present application also proposes an electronic device.
[0119] Figure 4 A schematic diagram of an electronic device according to a specific embodiment of the present application is shown. Figure 4 As shown, the electronic device includes: one or more processors 301, a memory 302, a bus 303 and a communication interface 304. Among them, the one or more processors 301, the memory 302 and the communication interface 304 are connected via the bus 303. The memory 302 is used to store one or more programs. When the one or more programs are executed by one or more processors 301, the electronic device implements the method for processing the drone power system data based on the MCU external Flash memory provided in any of the above embodiments.
[0120] Based on the above-mentioned method for processing UAV power system data based on MCU external Flash memory, based on the same inventive concept, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor, it implements the method for processing UAV power system data based on MCU external Flash memory provided in any of the above-mentioned embodiments.
[0121] In the embodiments of the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device / system / method embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0123] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0124] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0125] Obviously, those skilled in the art can make various modifications and changes to the embodiments of the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and changes are within the scope of the claims of the present invention and their equivalents, the present invention is also intended to cover these modifications and changes. The word "comprising" does not exclude the presence of other elements or steps not listed in the claims. The simple fact that certain measures are recorded in mutually different dependent claims does not indicate that the combination of these measures cannot be used to profit. Any reference numerals in the claims should not be considered to limit the scope.
Claims
1. A method for processing UAV power system data based on MCU external Flash memory, characterized in that: The on-chip RAM of the MCU is provided with a first storage queue and at least one second storage queue, the Flash memory is configured to include at least a system data area, a history data area and a fault data area, and the method comprises: After the electronic speed regulator of the UAV power system is powered on, obtaining system data and real-time operation data of the electronic speed regulator; Saving the system data to the system data area; Sampling the real-time operation data at a first frequency and statically storing the data in the first storage queue, extracting data from the first storage queue at a second frequency and writing the data into the historical data area, wherein the first frequency is greater than the second frequency; Sampling the real-time operation data at a third frequency and dynamically overwriting and saving the data in the second storage queue, extracting data from the second storage queue and continuously writing the data in the fault data area in response to detecting that the electronic speed regulator has a fault, wherein the third frequency is greater than the first frequency; Wherein, the fault includes at least any one or more fault types of throttle loss, throttle non-zero return, stall, undervoltage, overvoltage, overcurrent, motor phase loss and MOS overtemperature, each of the fault types corresponds to one or more of the real-time operation data, and the fault data area is configured to include a plurality of sub-areas, each of the sub-areas is used to write data from the corresponding second storage queue according to the fault type; The fault types are divided into at least high priority faults and low priority faults, and the method further includes: In response to detecting that the electronic speed regulator has the high priority fault, increasing the third frequency by a first increment, sampling the real-time operation data at the updated third frequency and dynamically overwriting and saving the data to the corresponding second storage queue; In response to detecting that the electronic speed regulator has the low priority fault, increasing the third frequency by a second increment, sampling the real-time operation data at the updated third frequency and dynamically overwriting and saving the data to the corresponding second storage queue; Wherein, the first increase is greater than the second increase.
2. The method according to claim 1, characterized in that The system data at least includes any one or more parameters of the self-test parameters, control variables and onboard IC chip configuration of the electronic speed regulator; The real-time operation data includes at least any one or more of the throttle value, target speed, actual speed, bus voltage, maximum phase current, MOS temperature and capacitor temperature. The real-time operation data is dynamically overwritten and saved in the form of a file to the historical data area and the fault data area.
3. The method according to claim 2, characterized in that There are multiple second storage queues opened, and each type of real-time operation data is saved in the corresponding second storage queue.
4. The method according to claim 1, characterized in that: The Flash memory is further configured to include a reserved area, the reserved area being used as a reserved memory space, and the method further includes: In response to the memory space of the sub-area corresponding to the high priority fault being lower than a preset capacity threshold, at least a portion of emergency memory space is opened up in the reserved area for continuing to write data from the corresponding second storage queue.
5. The method according to claim 4, characterized in that The historical data area is divided into a plurality of independent historical files, and the historical files describe the attributes of the historical data in a fixed historical file format, and the historical file format includes the number of power-on times, file sequence number, file size, data volume of a sampled frame, timestamp and operation data of the time period; The operation data in this time period is the real-time operation data of the electronic speed regulator sampled during power-on.
6. The method according to claim 5, characterized in that The fault data area is divided into a plurality of independent fault files according to the sub-areas, the emergency memory space is divided into at least one fault file, the fault file describes the attributes of the fault data in a fixed fault file format, and the fault file format includes the fault type, the number of faults, the last fault power-on number, the timestamp and the operation data of the time period; The operation data in this time period is real-time operation data related to the occurrence of the fault during the power-on period.
7. The method according to claim 6, characterized in that The MCU has a host computer interaction interface, and the method further includes: The MCU communicates with a host computer; In response to receiving the data request signal from the host computer, the MCU sends the corresponding real-time operation data / the historical data / the fault data to the host computer; The host computer queries the historical data based on the power-on times and the file sequence number of the historical file, and the host computer queries the fault data based on the fault type of the fault file.
8. The method according to claim 7, characterized in that The method further comprises: In response to the host computer exporting the fault file in the emergency memory space to the local memory space, the reserved area releases the corresponding emergency memory space.
9. A processing device for drone power system data based on MCU external Flash memory, characterized in that: The on-chip RAM of the MCU is provided with a first storage queue and at least one second storage queue, the Flash memory is configured to include at least a system data area, a history data area and a fault data area, and the device comprises: A data acquisition module, configured to acquire system data and real-time operation data of the electronic speed regulator after the electronic speed regulator of the UAV power system is powered on; A system data storage module, configured to save the system data to the system data area; A historical data storage module, configured to sample the real-time operation data at a first frequency and statically save the data to the first storage queue, extract data from the first storage queue at a second frequency and write the data to the historical data area, wherein the first frequency is greater than the second frequency; a fault data storage module, configured to sample the real-time operation data at a third frequency and dynamically overwrite and save the data to the second storage queue, and in response to detecting a fault in the electronic speed regulator, extract data from the second storage queue and continuously write the data to the fault data area, wherein the third frequency is greater than the first frequency; Wherein, the fault includes at least any one or more fault types of throttle loss, throttle non-zero return, stall, undervoltage, overvoltage, overcurrent, motor phase loss and MOS overtemperature, each of the fault types corresponds to one or more of the real-time operation data, and the fault data area is configured to include a plurality of sub-areas, each of the sub-areas is used to write data from the corresponding second storage queue according to the fault type; The fault types are divided into at least high priority faults and low priority faults, and the fault data storage module is further configured to: In response to detecting that the electronic speed regulator has the high priority fault, increasing the third frequency by a first increment, sampling the real-time operation data at the updated third frequency and dynamically overwriting and saving the data to the corresponding second storage queue; In response to detecting that the electronic speed regulator has the low priority fault, increasing the third frequency by a second increment, sampling the real-time operation data at the updated third frequency and dynamically overwriting and saving the data to the corresponding second storage queue; Wherein, the first increase is greater than the second increase.
10. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Systems and methods for evaluation of vehicle parameters of a remotely controllable material handling vehicle
CN113433844A
Method and device for storing faults of power system of unmanned aerial vehicle
CN116107793A