A multi-mode automatic switching control system and method for electric tricycle

By designing detection, data processing and logic control modules in electric tricycles, using FPGA and MCU chips to process real-time data and dynamically adjust the FIFO depth, the problem of low efficiency of multi-mode automatic switching control of electric tricycles is solved, and efficient and flexible control is achieved system.

CN118769927BActive Publication Date: 2024-12-20SICHUAN HONGZUN MOTORCYCLE MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411216695.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-20
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

The existing electric tricycle control system cannot achieve flexible multi-mode automatic switching, and the lack of dynamic adjustment of sensor data usage methods and FIFO cache optimization, resulting in low data processing efficiency.

Method used

An electric tricycle multi-mode automatic switching control system including detection module, data processing module and logic control module was designed. The FPGA chip was used to process real-time data and connect the sensor and MCU chip through the SPI bus to realize data classification, normalization processing and Logical control, dynamically adjusting FIFO depth to optimize data storage and processing.

Benefits of technology

It improves the automatic switching reaction speed and data processing efficiency of electric tricycles, realizes efficient, flexible and low-cost multi-mode control, and adapts to the real-time data processing and complex logic control needs of electric tricycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118769927B_ABST
    Figure CN118769927B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-mode automatic switching control system and method for an electric tricycle, which belongs to the field of electric vehicle power switching, and includes a detection module, a data processing module and a logic control module. The detection module is composed of a sensor arranged on the electric tricycle, and the collected data is sent to the data processing module; the data processing module is connected to the sensor module, and is configured to identify the current driving mode according to the real-time state data, and send the processing result to the logic control module; the logic control module is connected to the data processing module, and is configured to receive the data processed by the data processing module, identify the current driving mode, and automatically switch the tricycle control logic according to the identification result. The present invention processes the real-time data collected by the sensor by using the data processing module, and can process multiple data streams at the same time, thereby improving the reaction speed of the automatic switching of the electric tricycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric vehicle power switching, and in particular to a multi-mode automatic switching control system and method for an electric tricycle. Background Art

[0002] With the development of new energy technologies, electric tricycles, as a key member of new energy transportation, have seen widespread global adoption in recent years. Electric tricycles have a simple structure and are lightweight, making them suitable for short-distance urban commuting and daily shopping. Meanwhile, the development of electric tricycles has brought new requirements for their operation and multi-mode control. Existing gasoline-powered mode control systems are no longer suitable for these vehicles. To conserve battery energy, improve battery life, and achieve intelligent and multifunctional features, electric tricycle control systems require a comprehensive upgrade. Existing technology typically uses an MCU chip as the core of the control system. However, high-performance MCUs are prohibitive for tricycles due to cost constraints, while conventional MUC chips are limited by their weak performance and are inadequate for processing large amounts of real-time data. Currently, electric tricycles rely on numerous sensors to collect driving information for automatic control. Existing technology also lacks methods for dynamically adjusting sensor data usage based on driving scenarios. Furthermore, existing technology lacks methods for dynamically adjusting the FIFO buffer based on scenarios to monitor the flow rate, frequency of changes, and peak values ​​of real-time sensor data, build a historical database, and use the data in the historical database to optimize data storage and improve processing efficiency. Therefore, there is an urgent need to provide an economical mode switching method for an electric tricycle on the market. Summary of the Invention

[0003] One of the purposes of the present invention is to provide a multi-mode automatic switching control system for an electric tricycle, and to solve the problem in the prior art that electric tricycles lack flexible multi-mode automatic switching control.

[0004] The present invention is achieved through the following technical solutions: an electric tricycle multi-mode automatic switching control system, including a detection module, a data processing module and a logic control module.

[0005] Among them, the detection module is composed of sensors arranged on the electric tricycle, which is used to collect real-time status data of the vehicle and send the collected data to the data processing module; the data processing module is connected to the sensor module and is configured to identify the current driving mode based on the real-time status data and send the processing results to the logic control module; the logic control module is connected to the data processing module and is configured to receive the data processed by the data processing module, identify the current driving mode, and automatically switch the tricycle control logic according to the identification results.

[0006] Furthermore, the control system may further include a motor control module, which is connected to the logic control module and is configured to adjust the power output and speed of the hub motor according to different tricycle control logics; when a>athreshold and v>vmin, the motor control module controls the motor to an acceleration mode; when |a|≤ When a<-athreshold and v>vmin, the motor control module controls the motor to a constant speed mode; when a<-athreshold and v>vmin, the motor control module controls the motor to a deceleration mode; when v≤vmin, the motor control module controls the motor to a parking mode; where a is the acceleration, athreshold is the acceleration threshold, v is the speed, and vmin is the minimum speed. is a fixed constant used to determine whether the acceleration is close to zero.

[0007] Furthermore, the data processing module may also include a data cache submodule, a data collection submodule and a decision submodule.

[0008] Among them, the data cache submodule is configured to receive the real-time vehicle status data collected by the sensor module, and store the real-time vehicle status data in the FIFO cache area after classification, and normalize the data in the FIFO cache area; the data collection submodule is connected to the data cache submodule, and is configured to collect the normalized data and convert it into a normalized data set, the normalized data set is x=[vk,ak,Vk,Ik], wherein vk is the normalized speed data, ak is the normalized acceleration data, Vk is the normalized voltage data, and Ik is the normalized current data; the decision submodule is connected to the data collection submodule, and is configured to process the normalized data set through the objective function and constraint conditions, wherein the objective function is, , used to classify the normalized data; among them, w is the normal vector of the hyperplane; is the weight vector, w The square of the L2 norm is used to indicate the size of the weight and prevent overfitting; ξ i is a slack variable, indicating the allowed misclassification; C is a penalty parameter, balancing the interval maximization and the weight of misclassification; N is the classified data set; the constraints are, , ξ i ≥0, i=1, used to filter out abnormal data or noise data to improve the accuracy of automatic switching control; yi For the iThe label of a sample, usually with a value of +1 or -1, indicates the category of the sample; is the weight vector w With the sample feature vector xi The dot product of xi projection onto the decision boundary; b is The bias term is used to adjust the position of the decision boundary. By solving the objective function and the constraints, the decision function f(x) = w·x + b is obtained, and the decision result is obtained by calculating the decision function.

[0009] Furthermore, the FIFO buffer area also includes, by monitoring the flow, change frequency and peak value of real-time sensor data, identifying data characteristics under different driving scenarios, and recording the data characteristics as a historical database; determining the priority of different types of sensor data through the data in the historical database; and dynamically adjusting the FIFO depth according to the obtained priority to optimize the efficiency of data storage and processing.

[0010] Furthermore, the FIFO depth is dynamically adjusted by setting the upper and lower limits of the FIFO depth, including setting the minimum depth of the FIFO to 100 data items and the maximum depth to 1000 data items; when the data traffic is continuously higher than 80% occupancy, the FIFO depth is increased; when the data traffic is continuously lower than 20% occupancy, the FIFO depth is reduced to release system resources.

[0011] Furthermore, the sensors in the measuring module include a speed sensor, a current sensor, a voltage sensor and an acceleration sensor, and the sensors and the data processing module are connected using an SPI bus.

[0012] Furthermore, the data processing module is an FPGA chip, and the logic control module is an MCU chip, wherein the model of the FPGA chip may be XC6SLX9, and the model of the MCU chip may be STM32F407.

[0013] It should be noted that the reason why the SPI bus is used to connect sensors, FPGA chips and MCU chips is because the SPI bus has the advantage of low cost. At the same time, the SPI bus can support high-speed data transmission and can reach speeds of tens of megahertz, which is very beneficial for sensor data collection and processing. The use of the SPI bus can reduce costs while increasing the processing speed of the entire system and prevent the situation where the logic control response is untimely due to bus data transmission.

[0014] On the other hand, the present invention provides a multi-mode automatic switching control method for an electric tricycle, including: S100, a sensor collects real-time status data of the vehicle and sends it to a data processing module for processing; S200, the data processing module identifies the current driving mode according to the real-time status data, and sends the processing result to a logic control module; S300, the logic control module identifies the current driving mode according to the processing result of the data processing module, identifies the current driving mode, and automatically switches the tricycle control logic according to the identification result.

[0015] Furthermore, the sensor may include a speed sensor, a current sensor, a voltage sensor, and an acceleration sensor.

[0016] Furthermore, the data processing module can use a FPGA chip, the logic control module can use an MCU chip, and the sensor and the data processing module can be connected using an SPI bus. The FPGA chip model can be XC6SLX9, and the MCU chip model can be STM32F407.

[0017] Furthermore, step S200 also includes the following sub-steps: S210, classifying the real-time status data of the vehicle and storing it in the FIFO buffer area, and normalizing the data in the buffer area; S220, aggregating the normalized data and converting it into a normalized data set, wherein the normalized data set is x=[vk,ak,Vk,Ik], wherein vk is the normalized speed data, ak is the normalized acceleration data, Vk is the normalized voltage data, and Ik is the normalized current data; S230, processing the normalized data set through the objective function and constraint conditions, wherein the objective function is, , used to classify the normalized data; among them, w is the normal vector of the hyperplane; is the weight vector, w The square of the L2 norm is used to indicate the size of the weight and prevent overfitting; ξ i is a slack variable, indicating the allowed misclassification; C is a penalty parameter, balancing the interval maximization and the weight of misclassification; N is the classified data set; the constraints are, , ξ i ≥0, i=1, used to filter out abnormal data or noise data to improve the accuracy of automatic switching control; yi For the i The label of a sample, usually with a value of +1 or -1, indicates the category of the sample; is the weight vectorw With the sample feature vector xi The dot product of xi projection onto the decision boundary; b is The bias term is used to adjust the position of the decision boundary. By solving the objective function and the constraints, the decision function f(x) = w·x + b is obtained, and the decision result is obtained by calculating the decision function.

[0018] Furthermore, the normalization process may include normalizing the data in the buffer area using Z-score normalization. The Z-score normalization process includes:

[0019] ,

[0020] ,

[0021] ;

[0022] Where Z is the output data after normalization, q is the data in the FIFO buffer, μ is the mean of the data in all FIFO buffers, σ is the standard deviation of the data, M is the total number of data set samples in the FIFO buffer, and qi is the data value of the i-th sample in the FIFO buffer.

[0023] Furthermore, the automatic switching of the tricycle control logic according to the recognition result includes adjusting the power output and speed of the hub motor through different tricycle control logics; when a>athreshold and v>vmin, the motor control module controls the motor to the acceleration mode; when |a|≤ When a<-athreshold and v>vmin, the motor control module controls the motor to a constant speed mode; when a<-athreshold and v>vmin, the motor control module controls the motor to a deceleration mode; when v≤vmin, the motor control module controls the motor to a parking mode; where a is the acceleration, athreshold is the acceleration threshold, v is the speed, and vmin is the minimum speed. is a fixed constant used to determine whether the acceleration is close to zero.

[0024] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0025] 1. The present invention processes the real-time data collected by the sensor by using an FPGA module. FPGA has a high degree of parallel processing capability and can process multiple data streams simultaneously, thereby improving the speed and efficiency of sensor data processing and the response speed of the electric tricycle's automatic switching.

[0026] 2. The present invention adopts FPGA for data processing and MCU for logic processing, which can fully utilize the high-performance data processing capabilities of FPGA and the flexible logic control capabilities of MCU to achieve efficient, flexible and low-cost system design. This combination adapts to the real-time data processing and complex logic control requirements of the multi-mode automatic switching control requirements of electric tricycles, improves development efficiency and saves production costs while simplifying the peripheral circuit.

[0027] 3. The present invention uniquely designs the processing flow inside the FPGA, distinguishes the data from different sensors, sets up a FIFO buffer area inside the FPGA, stores the data collected by the sensor in real time, and normalizes the data, thereby reducing the difficulty of data processing and improving the processing speed and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0029] Figure 1 This is a system structure diagram provided for Example 1 of the present invention.

[0030] Figure 2 This is a flow chart of the method provided in Example 2 of the present invention.

[0031] Description of reference numerals: 100 - detection module, 200 - data processing module. DETAILED DESCRIPTION

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0033] Example 1

[0034] Figure 1 1 shows a system structure diagram of this embodiment, which provides a multi-mode automatic switching control system for an electric tricycle.

[0035] from Figure 1 As can be seen from the figure, this embodiment includes a detection module, a data processing module, a logic control module and a motor control module.

[0036] Among them, the detection module is composed of sensors arranged on the electric tricycle, which is used to collect real-time status data of the vehicle and send the collected data to the data processing module.

[0037] Specifically, in this embodiment, the sensors in the detection module may include a speed sensor, a current sensor, a voltage sensor, and an acceleration sensor, and the sensors and the data processing module are connected using an SPI bus.

[0038] The data processing module is connected to the sensor module and is configured to identify the current driving mode based on the real-time status data and send the processing results to the logic control module.

[0039] Specifically, the data processing module may include the following submodules:

[0040] Data cache submodule, data collection submodule and decision submodule.

[0041] Among them, the data cache submodule is configured to receive the real-time vehicle status data collected by the sensor module, classify the real-time vehicle status data and store it in the FIFO cache area, and normalize the data in the FIFO cache area.

[0042] The data collection submodule is connected to the data cache submodule and is configured to collect the normalized data and convert it into a normalized data set. The normalized data set is x=[vk,ak,Vk,Ik], where vk is the normalized velocity data, ak is the normalized acceleration data, Vk is the normalized voltage data, and Ik is the normalized current data.

[0043] Specifically, Z-score standardization can be used to standardize the data in the buffer area. Z-score standardization includes:

[0044] ,

[0045] ,

[0046] ;

[0047] Where Z is the output data after standardization, q is the data in the FIFO buffer, μ is the mean of the data in all FIFO buffers, σ is the standard deviation of the data, M is the total number of data set samples in the FIFO buffer, and qi is the data value of the i-th sample in the FIFO buffer.

[0048] The decision submodule is connected to the data collection submodule and is configured to process the normalized data set through the objective function and the constraint conditions.

[0049] The objective function is, , used to classify the normalized data.

[0050] in, w is the normal vector of the hyperplane; is the weight vector, w The square of the L2 norm is used to indicate the size of the weight and prevent overfitting; ξ i is a slack variable, indicating the allowed misclassification; C is a penalty parameter, balancing the interval maximization and the weight of misclassification; N is the classified data set.

[0051] The constraints are, , ξi≥0, i=1, is used to filter out abnormal data or noise data and improve the accuracy of automatic switching control.

[0052] in, yi For the i The label of a sample, usually with a value of +1 or -1, indicates the category of the sample; is the weight vector w With the sample feature vector xi The dot product of xi projection onto the decision boundary; b is Bias term, used to adjust the position of the decision boundary; ξi is This is a slack variable that allows for a certain degree of classification error. It is introduced to handle inseparable data.

[0053] In this embodiment, the objective function is designed to quickly and efficiently process high-dimensional data. This is particularly true when the number of input features is large. It can quickly find an optimal classification hyperplane, resulting in excellent performance when processing complex, diverse sensor data. Furthermore, by maximizing the inter-class margin in the objective function, the classifier is constructed, effectively reducing overfitting. Furthermore, because the objective function constructs a model using support vectors (i.e., the points closest to the decision boundary), this means that in real-world sensor data, even with a small number of outliers, the objective function can still reliably perform classification.

[0054] The purpose of constraints is to ensure that data is correctly classified while allowing for a certain degree of misclassification. The constraints set in this embodiment clarify the classification criteria for different sensor data, ensuring that data is classified according to predetermined rules, thereby improving data processing accuracy. In this embodiment, by classifying and processing data based on different thresholds for the velocity sensor, acceleration sensor, current sensor, and voltage sensor, it is possible to effectively avoid misoperations or incorrect decisions caused by data confusion. This, in turn, improves the accuracy of automatic switching control and ensures the effectiveness of the MCU's logical judgment.

[0055] By solving the objective function and the constraints, the decision function f(x)=w·x+b is obtained, and the result is obtained by calculating the decision function.

[0056] The logic control module is connected to the data processing module and is configured to receive the data processed by the data processing module, identify the current driving mode, and automatically switch the tricycle control logic according to the identification result.

[0057] The motor control module is connected to the logic control module and is configured to adjust the power output and speed of the hub motor according to different tricycle control logics.

[0058] Specifically, in this embodiment, the control logic of the tricycle is:

[0059] When a>athreshold and v>vmin, the motor control module controls the motor to acceleration mode.

[0060] When |a|≤ When v> vmin, the motor control module controls the motor to a constant speed mode.

[0061] When a<-athreshold and v>vmin, the motor control module controls the motor to deceleration mode.

[0062] When v≤vmin, the motor control module controls the motor to the parking mode.

[0063] Among them, a is acceleration, athreshold is acceleration threshold, v is velocity, and vmin is minimum velocity. is a fixed constant used to determine whether the acceleration is close to zero.

[0064] Example 2

[0065] This embodiment provides a multi-mode automatic switching control method for an electric tricycle. Figure 2 The method flow chart of this embodiment is shown. The multi-mode automatic switching control method of the electric tricycle in this embodiment specifically includes the following steps:

[0066] Step 1: The sensor collects the real-time status data of the vehicle and sends it to the data processing module for processing.

[0067] Specifically, the sensor may include a speed sensor, a current sensor, a voltage sensor, and an acceleration sensor.

[0068] It should be noted that, since electric tricycles are limited by cost requirements, installing sensors on the vehicle will increase costs. Therefore, this embodiment selects the four types of sensors that have the greatest impact on automatic switching control. However, this does not mean that more other sensors cannot be installed. These four sensors are selected only because they have the highest priority impact on the operation of logic control.

[0069] Step 2: The data processing module identifies the current driving mode based on the real-time status data and sends the processing results to the logic control module.

[0070] Specifically, step 2 may further include the following sub-steps:

[0071] 1) The real-time status data of the vehicle is classified and stored in the FIFO buffer, and the data in the buffer is normalized.

[0072] It should be noted that in this embodiment, the purpose of providing a FIFO buffer in the data processing module is to filter and reduce noise in the sensor data. The hardware-level FIFO buffer effectively buffers data to ensure the sequential and real-time nature of the vehicle's real-time status data. The FIFO buffer can be used to perform preliminary processing on the sensor data, including analog-to-digital conversion, filtering, noise reduction, and normalization.

[0073] Normalization processing, in particular, plays an important role in subsequent data prediction. In this embodiment, the normalization processing method selected is Z-score standardization.

[0074] Specifically, the Z-score standardization process includes:

[0075] ,

[0076] ,

[0077] ;

[0078] Where Z is the output data after standardization, q is the data in the FIFO buffer, μ is the mean of the data in all FIFO buffers, σ is the standard deviation of the data, M is the total number of data set samples in the FIFO buffer, and qi is the data value of the i-th sample in the FIFO buffer.

[0079] Specifically, in this embodiment, the FIFO buffer area may also include detecting the flow, change frequency and peak value of the real-time data of the monitoring sensor to build a historical database, and deeply optimize data storage and improve processing efficiency through the data in the historical database.

[0080] Specifically, it includes the following: by monitoring the flow, change frequency and peak value of real-time sensor data, identifying the data characteristics under different driving scenarios, and recording the data characteristics as a historical database.

[0081] Determine the priority of different types of sensor data through the data in the historical database.

[0082] Dynamically adjust the FIFO depth based on the obtained priority to optimize the efficiency of data storage and processing.

[0083] In addition, the FIFO depth can be dynamically adjusted by setting the upper and lower limits of the FIFO depth.

[0084] Specifically, the minimum depth of the FIFO is set to 100 data items and the maximum depth is set to 1000 data items.

[0085] When the data traffic is continuously higher than 80% occupancy, the FIFO depth is increased. When the data traffic is continuously lower than 20% occupancy, the FIFO depth is reduced to free up system resources.

[0086] By leveraging the parallel processing advantages of FPGA, after storing a large amount of data in the FIFO buffer area, Z-score normalization processing is performed in parallel through the hardware accelerator, which can greatly improve the speed and efficiency of data processing. Data standardization can be completed quickly, which helps in real-time monitoring and control of electric tricycles and ensures the response speed of the system.

[0087] 2) The normalized data are aggregated and converted into a normalized data set, wherein the normalized data set is x=[vk,ak,Vk,Ik], where vk is the normalized velocity data, ak is the normalized acceleration data, Vk is the normalized voltage data, and Ik is the normalized current data.

[0088] 3) Process the normalized data set through the objective function and constraints.

[0089] Among them, the objective function is, , used to classify the normalized data.

[0090] in, w is the normal vector of the hyperplane; is the weight vector, w The square of the L2 norm (L2 norm) is used to indicate the size of the weight to prevent overfitting; ξi is a slack variable, indicating the allowed misclassification; C is a penalty parameter, balancing the interval maximization and the weight of misclassification; N is the classified data set.

[0091] The constraints are, , ξi≥0, i=1, is used to filter out abnormal data or noise data and improve the accuracy of automatic switching control.

[0092] It should be noted that when the sample xi When correctly classified, yi ( w·xi + b ) should be greater than or equal to 1. When the sample xi When misclassified, the slack variable ξi The right side is allowed to be less than 1, thus providing a fault tolerance mechanism. ξi ≥0: The slack variable must be non-negative, which means that the classifier cannot arbitrarily misclassify examples.

[0093] In the formula, yi For the i The label of a sample, usually with a value of +1 or -1, indicates the category of the sample; is the weight vector w With the sample feature vector xi The dot product of xi projection onto the decision boundary; b is The bias term is used to adjust the position of the decision boundary. By solving the objective function and the constraints, the decision function f(x) = w·x + b is obtained, and the decision result is obtained by calculating the decision function.

[0094] By solving the objective function and the constraints, the decision function f(x)=w·x+b is obtained, and the result is obtained by calculating the decision function.

[0095] It's important to note that the objective function in this sub-step is designed to ensure high precision and stability in classification tasks, significantly improving the accuracy of mode switching decisions. For example, by applying the objective function to sensor data, the control logic can more accurately identify different driving states and switch to the appropriate mode. Furthermore, the objective function's real-time nature and responsiveness enable FPAG to rapidly process sensor data and make real-time decisions. This is particularly important for systems requiring rapid response, ensuring that the entire system can adjust driving modes promptly.

[0096] The purpose of setting constraints is to improve the accuracy of automatic switching control and ensure the effectiveness of MCU logical judgment while filtering out abnormal data or noise data. Although the data in the FIFO buffer area can be processed in the above steps to achieve data unification and ensure data accuracy, some sudden abnormal values ​​or noise data may appear in the sensor data processing, and these data may affect the normal operation of the system. By setting constraints, these abnormal data can be identified and filtered out, thereby improving the reliability of the entire method and ensuring the accuracy of the final logical judgment. In addition, in the multi-mode automatic switching process of the electric tricycle, timely and accurate processing of sensor data is crucial for the smooth operation of the vehicle. By classifying the sensor data and setting constraints, the data processing speed can be accelerated, the complexity of data processing can be effectively reduced, the response speed of the entire control method can be improved, and real-time performance can be ensured.

[0097] Step 3: The logic control module identifies the current driving mode according to the processing result of the data processing module, and automatically switches the tricycle control logic according to the identification result.

[0098] Specifically, automatically switching the tricycle control logic according to the recognition result includes adjusting the power output and speed of the hub motor through different tricycle control logics.

[0099] When a>athreshold and v>vmin, the motor control module controls the motor to acceleration mode.

[0100] When |a|≤ When v> vmin, the motor control module controls the motor to a constant speed mode.

[0101] When a<-athreshold and v>vmin, the motor control module controls the motor to deceleration mode.

[0102] When v≤vmin, the motor control module controls the motor to the parking mode.

[0103] Among them, a is acceleration, athreshold is acceleration threshold, v is velocity, and vmin is minimum velocity. is a fixed constant used to determine whether the acceleration is close to zero.

[0104] In order to better understand the present invention, the present invention is further illustrated below with reference to the following examples, but the present invention is not limited to the following examples.

[0105] Example 3

[0106] In this embodiment,

[0107] The detection module includes four sensors: a speed sensor, a current sensor, a voltage sensor, and an acceleration sensor. The data processing module uses an XC6SLX9 FPGA chip, and the logic control module uses an STM32F407 MCU chip.

[0108] The four sensors in the detection module are connected to the FPGA chip through the SPI bus. After receiving the data from the sensors, the FPGA chip performs calculations and sends the calculation results to the MCU chip through the SPI bus. The MCU performs logical processing on the calculation results and controls the motor control module through the SPI bus to achieve automatic switching between multiple modes.

[0109] Specifically, it can include the following:

[0110] The detection module consists of a speed sensor, a current sensor, a voltage sensor, and an acceleration sensor arranged on the electric tricycle. It is used to collect real-time status data of the vehicle and send the collected data to the XC6SLX9 through the SPI bus.

[0111] In order to process the collected data, in this embodiment, a FIFO buffer area is provided in the XC6SLX9.

[0112] The data collected by the sensor is sent to the XC6SLX9 via the SPI bus and is first stored in the FIFO buffer. Specifically, the data collected by the sensor is first converted into a digital signal through analog-to-digital conversion, and then the data of different sensors are stored in different FIFO buffers (that is, the data collected by the speed sensor, current sensor, voltage sensor and acceleration sensor correspond to different FIFO buffers respectively). Then, the data in the FIFO buffer is denoised to filter out abnormal data or noise data. Finally, the data in the buffer is normalized. Through normalization, the offset and scale differences in the data can be eliminated, the impact of outliers and noise on system performance can be reduced, and the consistency of data processing can be improved.

[0113] Specifically, in this embodiment, the FIFO buffer area may also include detecting the flow, change frequency and peak value of the real-time data of the monitoring sensor to build a historical database, and deeply optimize data storage and improve processing efficiency through the data in the historical database.

[0114] Specifically, it includes the following: by monitoring the flow, change frequency and peak value of real-time sensor data, identifying the data characteristics under different driving scenarios, and recording the data characteristics as a historical database.

[0115] Determine the priority of different types of sensor data through the data in the historical database.

[0116] Dynamically adjust the FIFO depth based on the obtained priority to optimize the efficiency of data storage and processing.

[0117] In addition, the FIFO depth can be dynamically adjusted by setting the upper and lower limits of the FIFO depth.

[0118] When the data flow reaches the high flow threshold (for example, the FIFO depth exceeds 800 entries), the FIFO depth is increased by 50 entries each time until the maximum depth is reached.

[0119] If the data flow rate drops below the low flow threshold (for example, the FIFO depth is less than 200 entries), the FIFO depth is reduced by 50 entries at a time until the minimum depth is reached.

[0120] You can also monitor data traffic, cache occupancy, and system response time in real time to provide timely feedback on adjustment needs and set regular inspection time intervals to adjust the FIFO depth in a timely manner when data changes.

[0121] For example, data traffic on urban roads may be relatively stable, while transient peaks may occur on open roads. By recording and detecting the flow rate, change frequency, and peak values ​​of real-time sensor data in the FIFO buffer, the data characteristics in different driving scenarios can be identified, and the priority of various sensor data in different situations can be determined. Where data traffic on urban roads may be relatively stable, the vehicle's speed and acceleration sensor data may require higher priority; whereas on open roads, where transient peaks are more likely to occur, the vehicle's current and voltage sensor data may require higher priority, thereby facilitating the regulation of the battery's output current and making the entire system more adaptable.

[0122] There are many common normalization processing methods. In this embodiment, after comparison, Z-score normalization is finally selected to perform normalization processing on the data in the buffer area.

[0123] This is because Z-score standardization has the characteristic of unifying different sensor data to the same scale, which can well process data from different types of sensors, while eliminating the impact of differences in the magnitude of different sensor data, making subsequent processing and analysis more consistent and reliable. Data processed by Z-score standardization can improve the convergence speed and accuracy of decision-making processing. Especially in the data analysis and decision-making model of electric tricycles, standardized data can improve the accuracy of classification and regression calculations, and enhance the stability and generalization ability of the entire system.

[0124] At the same time, by first storing data in the FIFO buffer area and then performing standardized processing, the stability of the data processing process can be ensured, and the impact of sudden data flow fluctuations on the system can be avoided. This design can modularize data storage and processing, simplifying the design and maintenance of the entire system. It can flexibly respond to different sensors and data processing requirements, is easy to expand and upgrade, and improves the flexibility and maintainability of the system.

[0125] Specifically, the Z-score standardization process includes:

[0126] ,

[0127] ,

[0128] ;

[0129] Where Z is the output data after standardization, q is the data in the FIFO buffer, μ is the mean of the data in all FIFO buffers, σ is the standard deviation of the data, M is the total number of data set samples in the FIFO buffer, and qi is the data value of the i-th sample in the FIFO buffer.

[0130] The data after Z-score normalization are aggregated and converted into a normalized data set, wherein the normalized data set is x=[vk,ak,Vk,Ik], where vk is the normalized velocity data, ak is the normalized acceleration data, Vk is the normalized voltage data, and Ik is the normalized current data.

[0131] Finally, the normalized data set is processed by the objective function and constraints. By solving the objective function and constraints, the decision function f(x)=w·x+b is obtained, and the result is obtained by calculating the decision function.

[0132] Specifically, the objective function is, , used to classify the normalized data.

[0133] In the formula,w is the normal vector of the hyperplane; w ∥ 2 is the weight vector w The square of the L2 norm (L2 norm) indicates the size of the weight. Minimizing this term helps find a simple model and prevent overfitting. ξi It is a slack variable used to deal with inseparable situations. This item allows some samples to be misclassified, making the entire model more flexible.

[0134] ξi is a slack variable, which indicates the allowed misclassification; C is a penalty parameter (also a regularization parameter) used to balance the complexity of the model (by minimizing ∥ w ∥ 2 ) and the penalty for misclassification (by minimizing ), the larger C Larger values ​​make the model focus more on classification accuracy, while smaller values ​​make the model focus more on simplification.

[0135] is the penalty parameter, thereby balancing the weight of margin maximization and misclassification. is the sum of all slack variables, which is used to indicate the number of errors allowed by the model during classification. min mark: indicates that a minimization optimization problem is being performed, and the goal is to find the expression that minimizes this expression. w and ξi . N is the classified data set.

[0136] The constraints are, , ξi ≥ 0, i = 1. The constraint condition is used to filter out abnormal data or noise data, thereby improving the accuracy of automatic switching control.

[0137] When the sample xi When correctly classified, yi ( w ⋅ xi + b ) should be greater than or equal to 1. When the sample xi When misclassified, the slack variable ξi The right side is allowed to be less than 1, thus providing a fault tolerance mechanism. ξi ≥0: The slack variable must be non-negative, which means that the classifier cannot arbitrarily misclassify examples.

[0138] In the formula, yi For the i The label of a sample, usually with a value of +1 or -1, indicates the category of the sample; is the weight vector w With the sample feature vector xi The dot product ofxi projection onto the decision boundary; b is The bias term is used to adjust the position of the decision boundary. By solving the objective function and the constraints, the decision function f(x) = w·x + b is obtained, and the decision result is obtained by calculating the decision function.

[0139] By solving the objective function and the constraints, the decision function f(x)=w·x+b is obtained, and the result is obtained by calculating the decision function.

[0140] It should be noted that

[0141] The objective function is designed to classify the normalized data. Its excellent generalization allows for rapid computation and maintains high classification accuracy even with new sensor data (i.e., when the vehicle is operating in new environments or conditions), ensuring continued effective system operation. This reduces reliance on all data points, thereby reducing data processing complexity. This is particularly beneficial for resource-constrained systems, enabling efficient system operation. Furthermore, as sensor data continues to increase or change, only a small number of support vectors need to be updated to adapt to the new data, ensuring the long-term stability and maintainability of the classifier. This enables the electric tricycle to respond more accurately and quickly to varying driving conditions, thereby optimizing the overall driving experience and system performance.

[0142] The purpose of setting constraints in this embodiment is to improve the accuracy of automatic switching control, ensure the effectiveness of the MCU's logical judgment, and filter out abnormal or noisy data. By classifying sensor data and setting constraints, complex processing logic can be broken down into several simple processing steps, effectively reducing the complexity of data processing and improving the system's response speed. Constraints can also improve system security to a certain extent. For example, a minimum current / voltage threshold can be set for the data of current and voltage sensors. When the battery level falls below this threshold, a safety mode is automatically triggered, reducing the vehicle speed or taking other safety measures to avoid sudden dangers caused by battery depletion. In summary, in the sensor data processing process of electric tricycles, setting appropriate constraints plays an important role in improving the accuracy of data classification, filtering abnormal data, simplifying data processing logic, improving system response speed, and ensuring system safety. Through reasonable constraints, the validity and reliability of sensor data can be ensured, thereby improving the overall performance and safety of the electric tricycle system.

[0143] After the FPGA completes data processing, it sends the processed data to the MCU chip through the SPI bus. The MCU receives the data processed by the data processing module, identifies the current driving mode, and sends instructions to the motor control module based on the identification results to automatically switch the tricycle control logic.

[0144] Specifically, the control logic of the tricycle can be:

[0145] When a>athreshold and v>vmin, the motor control module controls the motor to acceleration mode.

[0146] When |a|≤ When v> vmin, the motor control module controls the motor to a constant speed mode.

[0147] When a<-athreshold and v>vmin, the motor control module controls the motor to deceleration mode.

[0148] When v≤vmin, the motor control module controls the motor to the parking mode.

[0149] Among them, a is acceleration, athreshold is acceleration threshold, v is velocity, and vmin is minimum velocity. is a fixed constant used to determine whether the acceleration is close to zero.

[0150] In summary, in this embodiment, data processing tasks are assigned to the FPGA, while logic processing tasks are assigned to the MCU. The two collaborate to complete the entire switching control. By having the FPGA and MCU each handle different tasks, the entire system has a good modularity, facilitating system design, maintenance, and upgrades. Furthermore, the task allocation between the FPGA and MCU can be flexibly adjusted based on demand, improving system flexibility. By adopting the solution in this embodiment, the mode control of the electric tricycle can be achieved at a low cost, with high system flexibility and accuracy.

[0151] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A multi-mode automatic switching control system for an electric tricycle, characterized in that: The control system comprises: Detection module, data processing module and logic control module, wherein: The detection module is composed of sensors arranged on the electric tricycle, which is used to collect the real-time status data of the vehicle and send the collected data to the data processing module; The data processing module is connected to the sensor module and is configured to identify the current driving mode according to the real-time status data and send the processing result to the logic control module; The logic control module is connected to the data processing module and is configured such that the logic control module receives the data processed by the data processing module, identifies the current driving mode, and automatically switches the control logic of the tricycle according to the identification result; The sensors in the detection module include a speed sensor, a current sensor, a voltage sensor and an acceleration sensor; The data processing module includes a data cache submodule, a data collection submodule and a decision submodule, wherein: The data cache submodule is configured to receive the real-time status data of the vehicle collected by the sensor module, and store the real-time status data of the vehicle into the FIFO cache area after classification, and normalize the data in the FIFO cache area; The data collection submodule is connected to the data cache submodule and is configured to collect the normalized data and convert it into a normalized data set. The normalized data set is x=[v k ,a k ,V k ,I k ], where v k is the normalized speed data, a k is the normalized acceleration data, V k is the voltage data after normalization, I k is the current data after normalization; The decision submodule is connected to the data set submodule and is configured to process the normalized data set through the objective function and constraint conditions, wherein: The objective function is, , used to classify the normalized data; Where w is the normal vector of the hyperplane; is the weight vector, which is the square of the L2 norm of w, used to indicate the size of the weight to prevent overfitting; ξ i is a slack variable, indicating the allowable misclassification; C is a penalty parameter, balancing the interval maximization and the weight of misclassification; N is the classified data set; The constraints are, ,ξ i ≥0, i=1, Used to filter out abnormal data or noise data to improve the accuracy of automatic switching control; Among them, yi is the label of the i-th sample, with a value of +1 or -1, indicating the category of the sample; is the dot product of the weight vector w and the sample feature vector xi, which is used to represent the projection of the sample xi on the decision boundary; b is the bias term, which is used to adjust the position of the decision boundary; By solving the objective function and constraint conditions, the decision function f(x)=w·x+b is obtained, and the decision result is obtained by calculating the decision function; The normalization process includes: using Z-score normalization to normalize the data in the buffer area, and the Z-score normalization process includes: , , ; Where Z is the output data after standardization, q is the data in the FIFO buffer, μ is the mean of the data in all FIFO buffers, σ is the standard deviation of the data, M is the total number of data set samples in the FIFO buffer, and q is the i is the data value of the i-th sample in the FIFO buffer; The FIFO buffer area also includes identifying data characteristics under different driving scenarios by monitoring the flow, change frequency and peak value of real-time sensor data, and recording the data characteristics as a historical database; determining the priority of different types of sensor data through the data in the historical database; and dynamically adjusting the FIFO depth according to the obtained priority to optimize the efficiency of data storage and processing; The FIFO depth is dynamically adjusted by setting the upper and lower limits of the FIFO depth, including setting the minimum depth of the FIFO to 100 data items and the maximum depth to 1000 data items; when the data flow rate is continuously higher than 80% occupancy, the FIFO depth is increased; when the data flow rate is continuously lower than 20% occupancy, the FIFO depth is reduced to release system resources.

2. The electric tricycle multi-mode automatic switching control system according to claim 1, characterized in that: The control system further includes a motor control module, the motor control module being connected to the logic control module and configured to adjust the power output and speed of the hub motor according to different tricycle control logics; When a>athreshold and v>vmin, the motor control module controls the motor to the acceleration mode; When |a|≤ When v> vmin, the motor control module adjusts the motor to a uniform speed mode; When a<-athreshold and v>vmin, the motor control module controls the motor to deceleration mode; When v≤vmin, the motor control module adjusts the motor to the parking mode; Among them, a is acceleration, athreshold is the acceleration threshold, v is speed, and vmin is the minimum speed. is a fixed constant used to determine whether the acceleration is close to zero.

3. The electric tricycle multi-mode automatic switching control system according to claim 1, characterized in that: The sensor in the detection module and the data processing module are connected by an SPI bus.

4. A multi-mode automatic switching control method for an electric tricycle, characterized in that: The control method comprises: S100, the sensor collects real-time status data of the vehicle and sends it to the data processing module for processing; S200, the data processing module identifies the current driving mode according to the real-time status data, and sends the processing result to the logic control module; S300, the logic control module identifies the current driving mode according to the result processed by the data processing module, identifies the current driving mode, and automatically switches the control logic of the tricycle according to the identification result; The sensors include a speed sensor, a current sensor, a voltage sensor and an acceleration sensor; The step S200 further includes the following sub-steps: S210, classifying the real-time status data of the vehicle and storing it in a FIFO buffer area, and normalizing the data in the buffer area; S220, the normalized data are collected and converted into a normalized data set, where the normalized data set is x=[v k ,a k ,V k ,I k ], where v k is the normalized speed data, a k is the normalized acceleration data, V k is the voltage data after normalization, I k is the current data after normalization; S230, processing the normalized data set through the objective function and constraint conditions, wherein: The objective function is, , used to classify the normalized data; Where w is the normal vector of the hyperplane; is the weight vector, which is the square of the L2 norm of w, used to indicate the size of the weight to prevent overfitting; ξ i is a slack variable, indicating the allowable misclassification; C is a penalty parameter, balancing the interval maximization and the weight of misclassification; N is the classified data set; The constraints are, ,ξ i ≥0, i=1, Used to filter out abnormal data or noise data to improve the accuracy of automatic switching control; Among them, yi is the label of the i-th sample, usually with a value of +1 or -1, indicating the category of the sample; is the dot product of the weight vector w and the sample feature vector xi, which is used to represent the projection of the sample xi on the decision boundary; b is the bias term, which is used to adjust the position of the decision boundary; By solving the objective function and constraint conditions, the decision function f(x)=w·x+b is obtained, and the decision result is obtained by calculating the decision function; Z-score standardization is used to standardize the data in the buffer area. Z-score standardization includes: , , ; Where Z is the output data after standardization, q is the data in the FIFO buffer, μ is the mean of the data in all FIFO buffers, σ is the standard deviation of the data, M is the total number of data set samples in the FIFO buffer, and q is the i is the data value of the i-th sample in the FIFO buffer.

5. The multi-mode automatic switching control method for an electric tricycle according to claim 4, characterized in that: The data processing module adopts FPAG chip, the logic control module adopts MCU chip, and the sensor and the data processing module are connected by SPI bus.

6. The multi-mode automatic switching control method for an electric tricycle according to claim 4, characterized in that: The automatic switching of the tricycle control logic according to the recognition result includes adjusting the power output and speed of the hub motor through different tricycle control logics; When a>athreshold and v>vmin, the motor control module controls the motor to the acceleration mode; When |a|≤ When v> vmin, the motor control module adjusts the motor to a uniform speed mode; When a<-athreshold and v>vmin, the motor control module controls the motor to deceleration mode; When v≤vmin, the motor control module adjusts the motor to the parking mode; Among them, a is acceleration, athreshold is the acceleration threshold, v is speed, and vmin is the minimum speed. is a fixed constant used to determine whether the acceleration is close to zero.