A method and system for controlling the speed of an electric vehicle using a throttle grip

CN122560722APending Publication Date: 2026-08-14XUZHOU QINGJU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]因此,本发明提供了一种电动车转把调速控制方法解决了在实际骑行中,转把信号常因接触抖动、电磁干扰或用户手部微颤产生噪声或突变,若采用简单平均滤波,难以区分真实操作与虚假跳变,导致响应迟滞或误判;而固定窗口长度的滤波策略无法兼顾平稳性与动态性的问题

Benefits of technology

[0016]本发明有益效果为:通过引入信号自校准、自适应滤波、情境感知扭矩决策与双闭环执行的机制,实现了对电动车转把调速过程的高精度、高鲁棒性与高响应性控制,有效消除因转把器件老化或个体差异导致的信号漂移,并通过动态调整滤波窗口抑制噪声干扰,提升输入信号可靠性,基于驾驶操作模式智能调节车速补偿系数与电流环PI参数,使系统在缓变工况下运行平稳安静,在急变工况下响应迅速有力,提升了骑行安全性、舒适性与操控精准度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122560722A_ABST
    Figure CN122560722A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for controlling the speed of an electric vehicle throttle, relating to the field of electric vehicle motor control technology. The method includes: after the controller is powered on, it acquires the initial signal level and the full-throttle signal level of the throttle; based on the comparison between the two signal levels and the factory default values, it adjusts the minimum and maximum values ​​of the throttle speed control signal; by adding a safety margin coefficient to the adjusted minimum value, it obtains the minimum effective speed range; and by subtracting the safety margin coefficient from the adjusted maximum value, it obtains the maximum effective speed range. By introducing a mechanism of signal self-calibration, adaptive filtering, context-aware torque decision-making, and dual closed-loop execution, it achieves high-precision, high-robustness, and high-responsiveness control of the electric vehicle throttle speed control process, effectively eliminating signal drift caused by aging of throttle components or individual differences, and suppressing noise interference by dynamically adjusting the filtering window, thereby improving the reliability of the input signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electric vehicle motor control technology, and in particular to a method and system for controlling the speed of an electric vehicle throttle. Background Technology

[0002] Electric vehicle motor control technology refers to a series of hardware and software methods that use electronic controllers to monitor and adjust the operating status of drive motors in real time. Its core objective is to accurately, efficiently, and safely convert user operation commands into motor output power. This technology covers multiple aspects such as signal acquisition and processing, torque / speed closed-loop control, power inverter drive, fault protection, and energy efficiency optimization. It is widely used in electric bicycles, electric motorcycles, and electric vehicles, and is one of the key technologies that determine the performance, safety, range, and driving experience of electric vehicles.

[0003] Due to manufacturing tolerances, component aging, or changes in ambient temperature and humidity, the output voltage range of the throttle on different vehicles or even the same vehicle at different stages of use varies. Traditional controllers use fixed thresholds to determine the speed range, which can easily cause speed dead zones or false triggering of signals that exceed limits, affecting safety and user experience. In actual riding, the throttle signal often produces noise or abrupt changes due to contact vibration, electromagnetic interference, or slight tremors in the user's hand. If a simple averaging filter is used, it is difficult to distinguish between real operation and false jumps, resulting in delayed response or misjudgment. Furthermore, filtering strategies with fixed window lengths cannot balance stability and dynamism. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a method for controlling the speed of an electric vehicle throttle. This method solves the problem that in actual riding, the throttle signal often generates noise or sudden changes due to contact vibration, electromagnetic interference, or slight tremors of the user's hand. If a simple averaging filter is used, it is difficult to distinguish between real operation and false jumps, resulting in delayed response or misjudgment. Furthermore, the filtering strategy with a fixed window length cannot take into account both stability and dynamics.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for controlling the speed regulation of an electric vehicle's throttle, comprising: After the controller is powered on, it collects the initial signal level and the full throttle signal level of the throttle. Based on the comparison between the two signal levels and the factory default value, it adjusts the minimum and maximum values ​​of the throttle speed control signal. The minimum value of the effective speed control range is obtained by adding the safety margin coefficient to the adjusted minimum value, and the maximum value of the effective speed control range is obtained by subtracting the safety margin coefficient from the adjusted maximum value. The analog voltage signal of the throttle is collected within the effective speed regulation range and converted into a digital pulse width modulation signal. The duty cycle is extracted from the digital pulse width modulation signal. When the duty cycle is greater than or equal to a preset threshold, a sliding time window is established and the average value of multiple consecutive duty cycle values ​​is filtered. The current throttle opening is determined based on the filtered duty cycle. Take the current vehicle speed as the first target value and the current throttle opening as the second target value. Determine the operating mode based on the rate of change of the duty cycle after filtering. Calculate the torque change using the first target value, the second target value, and the vehicle speed compensation coefficient. The torque change is input to the speed loop and current loop proportional-integral controllers. The speed loop proportional-integral controller outputs the current loop reference value. The current loop proportional-integral controller outputs the pulse width modulation duty cycle adjustment value based on the deviation between the current loop reference value and the actual motor current. The pulse width modulation duty cycle adjustment value is used to drive the motor. The length of the sliding time window is adjusted based on the signal quality index calculated from the variance and range of multiple consecutive duty cycle values. The operation modes include gradual change operation mode, normal operation mode, and rapid change operation mode. The vehicle speed compensation coefficient is determined by the second target value and the operation mode. The vehicle speed compensation coefficient increases with the increase of the second target value, and the vehicle speed compensation coefficient in the gradual change operation mode is smaller than that in the rapid change operation mode.

[0007] As a preferred embodiment of the electric vehicle throttle speed control method of the present invention, the step of establishing a sliding time window and performing mean filtering on multiple consecutive duty cycle values ​​includes: The controller sets up a circular buffer in memory with an initial length of N; During each system sampling cycle, the controller stores the newly acquired duty cycle value into the circular buffer and overwrites the oldest duty cycle value in the buffer. Calculate the variance and range of all duty cycle values ​​within the current circular buffer. The quality of the current throttle signal is determined by combining the calculated variance and range values. When the judgment result is that the signal quality is poor, the controller dynamically increases the length of the ring buffer from N to M, where M is a preset integer greater than N; When the judgment result is that the signal quality is excellent, the controller maintains the length of the circular buffer at N; Perform an arithmetic mean operation on all duty cycle values ​​within the current circular buffer, and output the resulting average value as the filtered duty cycle.

[0008] As a preferred embodiment of the electric vehicle throttle speed control method of the present invention, the step of determining the operating mode based on the rate of change of the filtered duty cycle includes: The controller obtains the filtered duty cycle D(t) corresponding to the current sampling period t, and at the same time obtains the filtered duty cycle D(t-1) corresponding to the previous sampling period t-1; Calculate the duty cycle change rate d using the system's fixed sampling period Δt; The controller takes the absolute value of the duty cycle change rate d, denoted as |d|, and compares |d| with two preset rate thresholds, where the two preset rate thresholds are a first rate threshold A and a second rate threshold B, and the value of the first rate threshold A is less than the value of the second rate threshold B. When the value of |d| is less than the first rate threshold A, the controller determines that the user's current operation behavior belongs to the slow change operation mode. When the value of |d| is greater than or equal to the first rate threshold A and less than the second rate threshold B, the controller determines that the user's current operation behavior belongs to the normal operation mode. When the value of |d| is greater than or equal to the second rate threshold B, the controller determines that the user's current operation behavior belongs to the rapid change operation mode.

[0009] As a preferred embodiment of the electric vehicle throttle speed control method of the present invention, wherein: the calculation of torque change using a first target value, a second target value, and a vehicle speed compensation coefficient includes: The currently detected physical vehicle speed is converted into a discretized first target value i by querying a pre-calibrated vehicle speed-level mapping table; The currently detected physical throttle opening is converted into a discretized second target value j by querying a pre-calibrated opening-level mapping table; Based on the user's operation mode, select one from the pre-stored baseline coefficients as the current baseline coefficient. Specifically, when the operation mode is a gradual change operation mode, the selected baseline coefficient is the minimum value; when the operation mode is a normal operation mode, the selected baseline coefficient is the intermediate value; and when the operation mode is a rapid change operation mode, the selected baseline coefficient is the maximum value. Multiply the selected current reference coefficient by the second target value j to obtain the vehicle speed compensation coefficient a; Multiply the first target value i by the vehicle speed compensation coefficient a to obtain the intermediate product; The intermediate product is added to the second target value j to obtain the torque change.

[0010] As a preferred embodiment of the electric vehicle throttle speed control method of the present invention, wherein: the step of inputting the torque change into the speed loop proportional-integral controller, and the speed loop proportional-integral controller outputting a current loop reference value, includes: The torque change is used as an input parameter and sent to the speed loop controller; The speed loop controller stores a torque-desired speed mapping relationship. Based on the received torque change, the corresponding motor desired speed can be obtained by querying or interpolating in the torque-desired speed mapping relationship. The actual speed of the motor is obtained by using a motor position sensor, and the deviation between the expected speed and the actual speed is calculated to obtain the speed deviation. A proportional-integral control algorithm is used to handle speed deviations and generate current loop reference values ​​for driving the next stage current loop.

[0011] As a preferred embodiment of the electric vehicle throttle speed control method of the present invention, wherein: the current loop proportional-integral controller outputs a pulse width modulation duty cycle adjustment value based on the deviation between the current loop reference value and the actual motor current, including: The actual current value flowing through the motor windings is obtained by a current sampling circuit, and the deviation between the current loop reference value and the actual current value is calculated to obtain the current deviation. Based on the obtained user operation mode, select one of the three PI parameter configuration schemes pre-stored in the controller memory as the currently effective PI parameter configuration scheme; When the user operation mode is the gradual change operation mode, select the first PI parameter configuration scheme, which includes a first proportional gain coefficient Kp1 and a first integral gain coefficient Ki1; When the user's operation mode is normal operation mode, select the second PI parameter configuration scheme, which includes a second proportional gain coefficient Kp2 and a second integral gain coefficient Ki2; When the user's operation mode is the rapid change operation mode, select the third PI parameter configuration scheme, which includes a third proportional gain coefficient Kp3 and a third integral gain coefficient Ki3; Among them, the first proportional gain coefficient Kp1, the second proportional gain coefficient Kp2, and the third proportional gain coefficient Kp3 satisfy the numerical relationship Kp1 < Kp2 < Kp3; Among them, the first integral gain coefficient Ki1, the second integral gain coefficient Ki2, and the third integral gain coefficient Ki3 satisfy the numerical relationship Ki1 < Ki2 < Ki3; Using the proportional gain coefficient and integral gain coefficient in the selected currently effective PI parameter configuration scheme, a proportional-integral operation is performed on the current deviation to generate a pulse width modulation duty cycle adjustment value.

[0012] As a preferred embodiment of the electric vehicle throttle speed control method of the present invention, the step of using pulse width modulation duty cycle adjustment value to drive the motor to run specifically includes the following steps: The controller sends the pulse width modulation duty cycle adjustment value to the power inverter unit of the motor driver; The power inverter unit generates a corresponding switching drive signal based on the received pulse width modulation duty cycle adjustment value; The switch drive signal controls the on and off of the power semiconductor switching devices inside the power inverter unit; By adjusting the duty cycle of the power semiconductor switching device, the average voltage applied to the three-phase windings of the motor is changed, generating an electromagnetic torque that matches the change in torque, thus driving the electric vehicle.

[0013] In a second aspect, the present invention provides an electric vehicle throttle speed control system, comprising: The system includes a signal self-calibration module, an adaptive filtering module, a context-aware torque decision module, and a dual closed-loop execution module. The signal self-calibration module is used to collect the initial and full-scale signal levels of the throttle when powered on, compare them with the factory default values, correct the speed regulation range, and determine the upper and lower limits of the effective speed regulation range in combination with the safety margin coefficient. The adaptive filtering module is used to extract the throttle duty cycle within the effective speed regulation range. When the duty cycle exceeds the threshold, the signal quality is evaluated based on the variance and range of the data within the sliding window, and the window length is dynamically adjusted. The duty cycle after mean filtering is output as the current throttle opening. The context-aware torque decision module is used to map the current vehicle speed and the filtered throttle opening to a first target value and a second target value, respectively. It determines the gradual, normal, or rapid change operation mode based on the duty cycle change rate, and combines the operation mode with the second target value to generate a vehicle speed compensation coefficient to calculate the torque change. The dual closed-loop execution module is used to convert the torque change into a current loop reference value via a speed loop PI controller. Then, the current loop PI controller selects the corresponding gain parameter according to the operating mode, calculates the current deviation to generate a PWM duty cycle adjustment value, and drives the power inverter unit to control the motor to output a matching electromagnetic torque.

[0014] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the electric vehicle throttle speed control method as described in the first aspect of the present invention.

[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the electric vehicle throttle speed control method as described in the first aspect of the present invention.

[0016] The beneficial effects of this invention are as follows: By introducing a mechanism of signal self-calibration, adaptive filtering, context-aware torque decision-making, and dual closed-loop execution, high-precision, high-robustness, and high-responsiveness control of the electric vehicle throttle speed adjustment process is achieved. This effectively eliminates signal drift caused by aging of throttle components or individual differences. Furthermore, by dynamically adjusting the filtering window, noise interference is suppressed, improving the reliability of the input signal. Based on the driving operation mode, the vehicle speed compensation coefficient and current loop PI parameters are intelligently adjusted, enabling the system to operate smoothly and quietly under gradually changing conditions and respond quickly and powerfully under rapidly changing conditions, thereby improving riding safety, comfort, and control precision. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of the electric vehicle throttle speed control method in Example 1.

[0019] Figure 2 This is a schematic diagram of the electric vehicle throttle speed control system in Example 1. Detailed Implementation

[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0021] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1, referring to Figure 1 and Figure 2 As one embodiment of the present invention, this embodiment provides a method for controlling the speed of an electric vehicle throttle, comprising the following steps: S1. After the controller is powered on, it collects the initial signal level and the full throttle signal level of the throttle. Based on the comparison between the two signal levels and the factory default value, it adjusts the minimum and maximum values ​​of the throttle speed control signal. The minimum value of the effective speed control range is obtained by adding the safety margin coefficient to the adjusted minimum value, and the maximum value of the effective speed control range is obtained by subtracting the safety margin coefficient from the adjusted maximum value.

[0024] Furthermore, during the power-on initialization phase, the controller detects the voltage signal output when the throttle is fully released, using it as the initial signal level. It then prompts the user to turn the throttle all the way to the bottom, detecting the voltage signal output at this point, which is taken as the full throttle signal level. The initial signal level is compared with the factory default minimum value stored in the controller. If the deviation is within the allowable range, the default value is retained; otherwise, the measured value is used as the new minimum reference for the speed control signal. The full throttle signal level is then compared with the factory default maximum value. If the deviation is within the allowable range, the default value is retained; otherwise, the measured value is used as the new maximum reference for the speed control signal. After determining the new minimum and maximum references, a fixed safety margin is indented to obtain the final effective speed control range's lower and upper limits. The effective speed control range is used for subsequent throttle signal sampling, mapping, and control, ensuring accurate speed control response and providing hardware tolerance and safety redundancy.

[0025] The expression for the minimum value of the effective speed regulation range is: ; In the formula, This is the minimum reference value for the speed control signal determined after comparison. This is the factory default minimum value. This is the maximum reference value for the speed control signal. This is the normalized safety margin coefficient.

[0026] It should be noted that the above self-calibration process can effectively eliminate signal drift caused by individual differences in throttle components, long-term aging, or changes in ambient temperature. By dynamically adapting to actual hardware characteristics and introducing safety margins, it not only improves the accuracy of identifying the start and end points of speed regulation, but also avoids false triggering or control failure caused by signal exceeding limits, thereby enhancing the system's compatibility and operational safety under different vehicle and usage conditions.

[0027] In particular, traditional solutions use fixed thresholds to determine the speed regulation range. Once the hardware characteristics deviate, it is easy to cause speed regulation dead zones or false triggers. This invention actively guides the user to complete the signal acquisition of two typical states, "loosening" and "turning all the way," during the power-on stage. The measured values ​​are compared with the factory default values ​​with tolerance. The reference is only updated when the deviation exceeds a reasonable range. This not only preserves the reliability of the factory calibration, but also gives the system the ability to adapt to individual differences. On this basis, an inward-shrinking safety margin is introduced. Essentially, it artificially constructs a buffer zone within the effective signal range to prevent false judgment of effective operation due to signal edge jitter. Thus, it achieves the unity of hardware independence and control robustness at the underlying logic level.

[0028] S2. Acquire the analog voltage signal of the throttle within the effective speed regulation range and convert it into a digital pulse width modulation signal. Extract the duty cycle from the digital pulse width modulation signal. When the duty cycle is greater than or equal to a preset threshold, establish a sliding time window and perform mean filtering on multiple consecutive duty cycle values. Determine the current throttle opening based on the filtered duty cycle.

[0029] Furthermore, the controller sets up a circular buffer with an initial length of N in memory. During each system sampling cycle, the controller stores the newly acquired duty cycle value into the circular buffer, overwriting the oldest duty cycle value in the buffer. It calculates the variance and range of all duty cycle values ​​in the current circular buffer. Based on the calculated variance and range, it determines the quality of the current throttle signal. When the signal quality is deemed poor, the controller dynamically increases the length of the circular buffer from N to M, where M is a preset integer greater than N. When the signal quality is deemed good, the controller maintains the length of the circular buffer at N. It then performs an arithmetic mean operation on all duty cycle values ​​in the current circular buffer and outputs the resulting average as the filtered duty cycle.

[0030] Among them, variance is used to characterize the dispersion of all duty cycle values ​​in the circular buffer around their own average value. The larger the variance value, the more dispersed the data points are and the stronger the random noise component in the signal. Range is used to characterize the difference between the maximum and minimum values ​​of all duty cycle values ​​in the circular buffer. The larger the range value, the more drastic the signal fluctuation or spike interference occurs in a short period of time. The controller comprehensively considers the information of both variance and range. If the variance value or the range value is large, it will be judged as poor signal quality, thereby triggering the adaptive adjustment mechanism of window length.

[0031] The expression for the signal quality degradation criterion is as follows: ; In the formula, The standard deviation of the duty cycle values ​​within the circular buffer zone. Its mean, It is the range (maximum value minus minimum value). and These are the upper and lower limits of the effective speed regulation range, respectively. To prevent division by zero of small constants; when When the signal quality exceeds a preset threshold, it is determined that the signal quality is poor, and window expansion is triggered.

[0032] It should be noted that this adaptive filtering mechanism can intelligently adjust the length of the data processing window according to the real-time stability of the throttle signal. It maintains a fast response when the signal is stable and automatically enhances the smoothing capability when the signal is interfered with or jitters. It effectively suppresses noise and abnormal jumps, ensuring the accuracy of throttle opening recognition and avoiding operation lag caused by excessive filtering, thereby improving the naturalness and reliability of human-vehicle interaction.

[0033] In particular, the sliding time window combined with variance and range signal quality assessment method is not a simple application of general filtering algorithms, but is specifically designed to address the characteristics of throttle signals in actual riding, which are easily affected by electromagnetic interference, contact jitter, or slight tremors of the user's hand. Variance reflects the degree of dispersion of data around the mean and is used to capture random noise; range directly reflects short-term abrupt changes and is used to identify spike interference or false touches; the combined judgment of the two can more comprehensively distinguish between genuine slow adjustments and false jitters; when the signal quality is determined to be poor, the window length is dynamically extended, which essentially smooths out anomalies by increasing the weight of historical data, rather than simply increasing the filtering intensity, thereby suppressing interference while preserving as much of the original characteristics of the operating intention as possible; the adaptive mechanism based on the inherent statistical characteristics of the signal upgrades the filtering strategy from static configuration to context-awareness.

[0034] S3. Take the current vehicle speed as the first target value and the current throttle opening as the second target value. Determine the operating mode based on the rate of change of the duty cycle after filtering. Calculate the torque change using the first target value, the second target value, and the vehicle speed compensation coefficient.

[0035] Furthermore, the controller obtains the filtered duty cycle D(t) corresponding to the current sampling period t, and simultaneously obtains the filtered duty cycle D(t-1) corresponding to the previous sampling period t-1; using the system's fixed sampling period Δt, the duty cycle change rate d is calculated; the controller takes the absolute value of the duty cycle change rate d, denoted as |d|, and compares |d| with two preset rate thresholds, where the two preset rate thresholds are the first rate threshold A and the second rate threshold B, and the value of the first rate threshold A is less than the value of the second rate threshold B.

[0036] When the value of |d| is less than the first rate threshold A, the controller determines that the user's current operation behavior belongs to the gradual change operation mode; when the value of |d| is greater than or equal to the first rate threshold A and less than the second rate threshold B, the controller determines that the user's current operation behavior belongs to the normal operation mode; when the value of |d| is greater than or equal to the second rate threshold B, the controller determines that the user's current operation behavior belongs to the rapid change operation mode.

[0037] The gradual change operation mode corresponds to the user making extremely slight and slow adjustments to the throttle, which occurs when the vehicle is crawling at low speed or when fine speed control is required; the normal operation mode corresponds to the user's usual acceleration or deceleration operations during daily riding; and the sudden change operation mode corresponds to the user quickly twisting or releasing the throttle in order to perform emergency acceleration to overtake or emergency braking.

[0038] The currently detected physical vehicle speed is converted into a discretized first target value i by querying a pre-calibrated speed-level mapping table; the currently detected physical throttle opening is converted into a discretized second target value j by querying a pre-calibrated opening-level mapping table.

[0039] Based on the user's operation mode, select one from the pre-stored reference coefficients as the current reference coefficient. When the operation mode is gradual change operation mode, the selected reference coefficient is the minimum value; when the operation mode is normal operation mode, the selected reference coefficient is the intermediate value; when the operation mode is rapid change operation mode, the selected reference coefficient is the maximum value. Multiply the selected current reference coefficient by the second target value j to obtain the vehicle speed compensation coefficient a.

[0040] The vehicle speed compensation coefficient is determined by the second target value and the operating mode. The vehicle speed compensation coefficient increases with the increase of the second target value, and the vehicle speed compensation coefficient in the gradual change operating mode is smaller than that in the rapid change operating mode.

[0041] Multiply the first target value i by the vehicle speed compensation coefficient a to obtain an intermediate product; add the intermediate product to the second target value j to obtain the torque change.

[0042] Here, the first target value i represents the weight of the influence of the current vehicle speed on the motor torque demand, the second target value j represents the direct influence of the current throttle opening on the motor torque demand, and the vehicle speed compensation coefficient a is an amplification factor that is dynamically adjusted by the intensity of the user's operation. This factor enhances the contribution of vehicle speed information to the final torque decision in the rapid change operation mode, while suppressing the contribution of vehicle speed information in the gradual change operation mode, so that the torque output can accurately match the user's true intention in different driving situations.

[0043] The expression for the change in torque is as follows: ; In the formula, For discrete levels corresponding to vehicle speed, Here, represents the discrete levels corresponding to the throttle opening, and represents the absolute value of the duty cycle change rate. This represents the upper limit of the opening level. The basic compensation bias is denoted as , and the operational sensitivity coefficient is denoted as .

[0044] It should be noted that by dynamically generating torque changes by combining vehicle speed, throttle opening, and operating mode, the system can accurately distinguish between different driving intentions such as subtle speed adjustments and emergency acceleration. Based on this, it adjusts the influence weight of vehicle speed on torque decision-making, so that the motor output not only meets the current driving state but also responds quickly to sudden operating needs. This improves acceleration response speed and control sensitivity while ensuring riding stability.

[0045] In particular, the determination of the operating mode does not rely on a single parameter in isolation, but rather uses the duty cycle change rate as the core, combined with human-computer interaction behavior to model the scenario. The division into three modes—gradual change, normal, and rapid change—is essentially a semantic abstraction of the user's driving intention; fine adjustments correspond to precise vehicle control, regular operations correspond to smooth commuting, and rapid actions correspond to emergency response; the introduction of a discretized mapping between vehicle speed and throttle opening is to transform continuous physical quantities into hierarchical variables that facilitate logical decision-making, avoiding the resource consumption and nonlinear errors caused by floating-point operations; and the dynamic generation mechanism of the vehicle speed compensation coefficient reflects the control philosophy of prioritizing intention; the more intense the user's operation, the more the system values ​​the impact of the current vehicle speed on the safe torque, thus providing stronger power support when overtaking and accelerating, and avoiding torque overshoot when fine-tuning at low speeds.

[0046] S4. Input the torque change into the speed loop and current loop proportional-integral controllers. The speed loop proportional-integral controller outputs the current loop reference value. The current loop proportional-integral controller outputs the pulse width modulation duty cycle adjustment value based on the deviation between the current loop reference value and the actual motor current. The pulse width modulation duty cycle adjustment value is used to drive the motor.

[0047] Furthermore, the torque change is used as an input parameter and fed into the speed loop controller. The speed loop controller internally stores a torque-desired speed mapping relationship. Based on the received torque change, the corresponding motor desired speed is obtained by querying or interpolating in the torque-desired speed mapping relationship. The actual speed of the motor is obtained through the motor position sensor, and the deviation between the motor desired speed and the actual speed is calculated to obtain the speed deviation. The proportional-integral control algorithm is used to process the speed deviation and generate a current loop reference value for driving the next stage current loop.

[0048] The actual current value flowing through the motor winding is obtained by the current sampling circuit, and the deviation between the current loop reference value and the actual current value is calculated to obtain the current deviation. Based on the obtained user operation mode, one of the three PI parameter configuration schemes pre-stored in the controller memory is selected as the currently effective PI parameter configuration scheme.

[0049] When the user's operating mode is a gradual change operating mode, the first PI parameter configuration scheme is selected, which includes a first proportional gain coefficient Kp1 and a first integral gain coefficient Ki1; when the user's operating mode is a normal operating mode, the second PI parameter configuration scheme is selected, which includes a second proportional gain coefficient Kp2 and a second integral gain coefficient Ki2; when the user's operating mode is a rapid change operating mode, the third PI parameter configuration scheme is selected, which includes a third proportional gain coefficient Kp3 and a third integral gain coefficient Ki3; wherein, the first proportional gain coefficient Kp1, the second proportional gain coefficient Kp2, and the third proportional gain coefficient Kp3 satisfy the numerical relationship Kp1 < Kp2 < Kp3; the first integral gain coefficient Ki1, the second integral gain coefficient Ki2, and the third integral gain coefficient Ki3 satisfy the numerical relationship Ki1 < Ki2 < Ki3; using the proportional gain coefficient and integral gain coefficient in the selected currently effective PI parameter configuration scheme, proportional-integral operation is performed on the current deviation to generate a pulse width modulation duty cycle adjustment value.

[0050] Among them, the proportional gain coefficient is used to determine the instantaneous response strength of the controller to current deviation, and the integral gain coefficient is used to determine the cumulative effect strength of the controller to eliminate current steady-state error. By adopting the PI parameter configuration scheme, in the slow change operation mode, the current loop controller suppresses system noise with the weakest dynamic response to ensure smooth vehicle operation; in the rapid change operation mode, the current loop controller quickly tracks the current command with the strongest dynamic response to ensure that the motor torque can be generated instantly.

[0051] The controller sends the pulse width modulation duty cycle adjustment value to the power inverter unit of the motor driver; the power inverter unit generates a corresponding switching drive signal based on the received pulse width modulation duty cycle adjustment value; the switching drive signal controls the on and off of the power semiconductor switching devices inside the power inverter unit; by adjusting the on-time duty cycle of the power semiconductor switching devices, the average voltage applied to the three-phase windings of the motor is changed, generating an electromagnetic torque that matches the torque change, driving the electric vehicle to run.

[0052] The adaptive expression for the current loop proportional gain is: ; In the formula, This is the base proportional gain in the slowly varying mode. The absolute value of the duty cycle rate of change. For gain adjustment depth, For response sensitivity coefficient; hyperbolic tangent function It provides a smooth S-shaped transition, allowing the gain to increase gradually with the intensity of operation, avoiding control oscillations caused by step switching, while ensuring that it approaches the maximum gain under extreme operation, thus balancing dynamic performance and system stability.

[0053] It should be noted that the dual closed-loop control structure, combined with the PI parameter switching strategy that adapts to the operating mode, enables the current loop to automatically match the optimal control intensity under different driving scenarios: suppressing high-frequency noise and improving comfort during gradual changes, and enhancing dynamic tracking capability and ensuring instantaneous torque output during rapid changes, thus balancing system stability and response performance and effectively improving the driving efficiency and driving experience of the entire vehicle across all operating conditions.

[0054] In particular, the coordination between the speed loop and the current loop in the dual-loop control structure is not merely based on classical motor control theory, but is deeply coupled with the aforementioned operating mode information, achieving contextualized scheduling of control parameters. Traditional PI controllers typically use fixed parameters, making it difficult to balance stability and responsiveness. This invention divides the PI parameters into three configurations, each corresponding to the control objectives under different operating modes. During gradual changes, steady-state accuracy and noise suppression are emphasized, hence the gain is lower; during rapid changes, fast tracking and disturbance rejection capabilities are pursued, hence the gain is higher.

[0055] This embodiment also provides an electric vehicle throttle speed control system, including: The system includes a signal self-calibration module, an adaptive filtering module, a context-aware torque decision module, and a dual closed-loop execution module. The signal self-calibration module is used to collect the initial and full-scale signal levels of the throttle when powered on, compare them with the factory default values, correct the speed regulation range, and determine the upper and lower limits of the effective speed regulation range in combination with the safety margin coefficient. The adaptive filtering module is used to extract the throttle duty cycle within the effective speed regulation range. When the duty cycle exceeds the threshold, the signal quality is evaluated based on the variance and range of the data within the sliding window, and the window length is dynamically adjusted. The duty cycle after mean filtering is output as the current throttle opening. The context-aware torque decision module maps the current vehicle speed and the filtered throttle opening to a first target value and a second target value, respectively. It determines the gradual, normal, or rapid change operation mode based on the duty cycle change rate, and combines the operation mode with the second target value to generate a vehicle speed compensation coefficient to calculate the torque change. The dual closed-loop execution module converts the torque change into a current loop reference value via a speed loop PI controller. Then, the current loop PI controller selects the corresponding gain parameter according to the operating mode, calculates the current deviation to generate a PWM duty cycle adjustment value, and drives the power inverter unit to control the motor to output a matched electromagnetic torque.

[0056] This embodiment also provides a computer device applicable to the electric vehicle throttle speed control method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the electric vehicle throttle speed control method proposed in the above embodiment.

[0057] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0058] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the electric vehicle throttle speed control method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0059] In summary, this invention achieves high-precision, robust, and responsive control of the electric vehicle throttle speed adjustment process by introducing four core mechanisms: signal self-calibration, adaptive filtering, context-aware torque decision-making, and dual closed-loop execution. It effectively eliminates signal drift caused by aging of throttle components or individual differences, suppresses noise interference by dynamically adjusting the filtering window, improves the reliability of the input signal, and intelligently adjusts the vehicle speed compensation coefficient and current loop PI parameters based on the driving operation mode. This ensures that the system operates smoothly and quietly under gradually changing conditions and responds quickly and powerfully under rapidly changing conditions, thereby improving riding safety, comfort, and control precision.

[0060] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for controlling the speed of an electric vehicle using a throttle grip, characterized in that: include: After the controller is powered on, it collects the initial signal level and the full throttle signal level of the throttle. Based on the comparison between the two signal levels and the factory default value, it adjusts the minimum and maximum values ​​of the throttle speed control signal. The minimum value of the effective speed control range is obtained by adding the safety margin coefficient to the adjusted minimum value, and the maximum value of the effective speed control range is obtained by subtracting the safety margin coefficient from the adjusted maximum value. The analog voltage signal of the throttle is collected within the effective speed regulation range and converted into a digital pulse width modulation signal. The duty cycle is extracted from the digital pulse width modulation signal. When the duty cycle is greater than or equal to a preset threshold, a sliding time window is established and the average value of multiple consecutive duty cycle values ​​is filtered. The current throttle opening is determined based on the filtered duty cycle. Take the current vehicle speed as the first target value and the current throttle opening as the second target value. Determine the operating mode based on the rate of change of the duty cycle after filtering. Calculate the torque change using the first target value, the second target value, and the vehicle speed compensation coefficient. The torque change is input to the speed loop and current loop proportional-integral controllers. The speed loop proportional-integral controller outputs the current loop reference value. The current loop proportional-integral controller outputs the pulse width modulation duty cycle adjustment value based on the deviation between the current loop reference value and the actual motor current. The pulse width modulation duty cycle adjustment value is used to drive the motor. The length of the sliding time window is adjusted based on the signal quality index calculated from the variance and range of multiple consecutive duty cycle values. The operation modes include gradual change operation mode, normal operation mode, and rapid change operation mode. The vehicle speed compensation coefficient is determined by the second target value and the operation mode. The vehicle speed compensation coefficient increases with the increase of the second target value, and the vehicle speed compensation coefficient in the gradual change operation mode is smaller than that in the rapid change operation mode.

2. The electric vehicle throttle speed control method as described in claim 1, characterized in that: The step of establishing a sliding time window and performing mean filtering on multiple consecutive duty cycle values ​​includes: The controller sets up a circular buffer in memory with an initial length of N; During each system sampling cycle, the controller stores the newly acquired duty cycle value into the circular buffer and overwrites the oldest duty cycle value in the buffer. Calculate the variance and range of all duty cycle values ​​within the current circular buffer. The quality of the current throttle signal is determined by combining the calculated variance and range values. When the judgment result is that the signal quality is poor, the controller dynamically increases the length of the ring buffer from N to M, where M is a preset integer greater than N; When the judgment result is that the signal quality is good, the controller maintains the length of the circular buffer at N; Perform an arithmetic mean operation on all duty cycle values ​​within the current circular buffer, and output the resulting average value as the filtered duty cycle.

3. The electric vehicle throttle speed control method as described in claim 2, characterized in that: The step of determining the operation mode based on the rate of change of the filtered duty cycle includes: The controller obtains the filtered duty cycle D(t) corresponding to the current sampling period t, and at the same time obtains the filtered duty cycle D(t-1) corresponding to the previous sampling period t-1; Calculate the duty cycle change rate d using the system's fixed sampling period Δt; The controller takes the absolute value of the duty cycle change rate d, denoted as |d|, and compares |d| with two preset rate thresholds, where the two preset rate thresholds are a first rate threshold A and a second rate threshold B, and the value of the first rate threshold A is less than the value of the second rate threshold B. When the value of |d| is less than the first rate threshold A, the controller determines that the user's current operation behavior belongs to the slow change operation mode. When the value of |d| is greater than or equal to the first rate threshold A and less than the second rate threshold B, the controller determines that the user's current operation behavior belongs to the normal operation mode. When the value of |d| is greater than or equal to the second rate threshold B, the controller determines that the user's current operation behavior belongs to the rapid change operation mode.

4. The electric vehicle throttle speed control method as described in claim 3, characterized in that: The calculation of torque change using the first target value, the second target value, and the vehicle speed compensation coefficient includes: The currently detected physical vehicle speed is converted into a discretized first target value i by querying a pre-calibrated vehicle speed-level mapping table; The currently detected physical throttle opening is converted into a discretized second target value j by querying a pre-calibrated opening-level mapping table; Based on the user's operation mode, select one from the pre-stored baseline coefficients as the current baseline coefficient. Specifically, when the operation mode is a gradual change operation mode, the selected baseline coefficient is the minimum value; when the operation mode is a normal operation mode, the selected baseline coefficient is the intermediate value; and when the operation mode is a rapid change operation mode, the selected baseline coefficient is the maximum value. Multiply the selected current reference coefficient by the second target value j to obtain the vehicle speed compensation coefficient a; Multiply the first target value i by the vehicle speed compensation coefficient a to obtain the intermediate product; The intermediate product is added to the second target value j to obtain the torque change.

5. The electric vehicle throttle speed control method as described in claim 4, characterized in that: The step of inputting the torque change into the speed loop proportional-integral controller, and the speed loop proportional-integral controller outputting a current loop reference value, includes: The torque change is used as an input parameter and sent to the speed loop controller; The speed loop controller stores a torque-desired speed mapping relationship. Based on the received torque change, the corresponding motor desired speed can be obtained by querying or interpolating in the torque-desired speed mapping relationship. The actual speed of the motor is obtained by using a motor position sensor, and the deviation between the expected speed and the actual speed is calculated to obtain the speed deviation. A proportional-integral control algorithm is used to handle speed deviations and generate current loop reference values ​​for driving the next stage current loop.

6. The electric vehicle throttle speed control method as described in claim 5, characterized in that: The current loop proportional-integral controller outputs a pulse width modulation duty cycle adjustment value based on the deviation between the current loop reference value and the actual motor current, including: The actual current value flowing through the motor windings is obtained by a current sampling circuit, and the deviation between the current loop reference value and the actual current value is calculated to obtain the current deviation. Based on the obtained user operation mode, select one of the three PI parameter configuration schemes pre-stored in the controller memory as the currently effective PI parameter configuration scheme; When the user operation mode is the gradual change operation mode, select the first PI parameter configuration scheme, which includes a first proportional gain coefficient Kp1 and a first integral gain coefficient Ki1; When the user's operation mode is normal operation mode, select the second PI parameter configuration scheme, which includes a second proportional gain coefficient Kp2 and a second integral gain coefficient Ki2; When the user's operation mode is the rapid change operation mode, select the third PI parameter configuration scheme, which includes a third proportional gain coefficient Kp3 and a third integral gain coefficient Ki3; Among them, the first proportional gain coefficient Kp1, the second proportional gain coefficient Kp2, and the third proportional gain coefficient Kp3 satisfy the numerical relationship Kp1 < Kp2 < Kp3; Among them, the first integral gain coefficient Ki1, the second integral gain coefficient Ki2, and the third integral gain coefficient Ki3 satisfy the numerical relationship Ki1 < Ki2 < Ki3; Using the proportional gain coefficient and integral gain coefficient in the selected currently effective PI parameter configuration scheme, a proportional-integral operation is performed on the current deviation to generate a pulse width modulation duty cycle adjustment value.

7. The electric vehicle throttle speed control method as described in claim 6, characterized in that: The method of adjusting the duty cycle value using pulse width modulation and driving the motor specifically includes the following steps: The controller sends the pulse width modulation duty cycle adjustment value to the power inverter unit of the motor driver; The power inverter unit generates a corresponding switching drive signal based on the received pulse width modulation duty cycle adjustment value; The switch drive signal controls the on and off of the power semiconductor switching devices inside the power inverter unit; By adjusting the duty cycle of the power semiconductor switching device, the average voltage applied to the three-phase windings of the motor is changed, generating an electromagnetic torque that matches the change in torque, thus driving the electric vehicle.

8. A throttle speed control system for an electric vehicle, based on the throttle speed control method for an electric vehicle according to any one of claims 1 to 7, characterized in that: include: The system includes a signal self-calibration module, an adaptive filtering module, a context-aware torque decision module, and a dual closed-loop execution module. The signal self-calibration module is used to collect the initial and full-scale signal levels of the throttle when powered on, compare them with the factory default values, correct the speed regulation range, and determine the upper and lower limits of the effective speed regulation range in combination with the safety margin coefficient. The adaptive filtering module is used to extract the throttle duty cycle within the effective speed regulation range. When the duty cycle exceeds the threshold, the signal quality is evaluated based on the variance and range of the data within the sliding window, and the window length is dynamically adjusted. The duty cycle after mean filtering is output as the current throttle opening. The context-aware torque decision module is used to map the current vehicle speed and the filtered throttle opening to a first target value and a second target value, respectively. It determines the gradual, normal, or rapid change operation mode based on the duty cycle change rate, and combines the operation mode with the second target value to generate a vehicle speed compensation coefficient to calculate the torque change. The dual closed-loop execution module is used to convert the torque change into a current loop reference value via a speed loop PI controller. Then, the current loop PI controller selects the corresponding gain parameter according to the operating mode, calculates the current deviation to generate a PWM duty cycle adjustment value, and drives the power inverter unit to control the motor to output a matching electromagnetic torque.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the electric vehicle throttle speed control method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the electric vehicle throttle speed control method according to any one of claims 1 to 7.