Method and device for controlling the stall of an electronic derailleur, electronic derailleur and bicycle

By introducing average current duration judgment and counter increment/decrement mechanism into the bicycle electronic gearbox, combined with pulse drive mode and angle change monitoring, the current threshold and pulse parameters are dynamically adjusted, solving the problems of stall misjudgment and simple recovery strategy during gear shifting, and achieving more stable and consistent gear shifting control.

CN122407782BActive Publication Date: 2026-08-25ZHUHAI L-TWOO SPORT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610878224.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-08-25
Estimated Expiration
2046-06-17

AI Technical Summary

Technical Problem

Existing electronic gearboxes for bicycles are prone to stalling due to instantaneous current fluctuations during gear shifting, and their recovery strategies are simplistic and crude, resulting in a poor user experience.

Method used

The system employs average current duration judgment and counter increment/decrement mechanism to filter out instantaneous current spikes. Combined with pulse drive mode and angle change monitoring, it introduces retry status and backoff protection strategies to dynamically adjust current threshold and pulse parameters.

Benefits of technology

It reduces stalling errors, improves the system's operational stability and shifting robustness under complex conditions, reduces the risk of hardware damage, and enhances shifting continuity and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122407782B_ABST
    Figure CN122407782B_ABST
Patent Text Reader

Abstract

The application provides a stall control method and device of an electronic transmission, an electronic transmission and a bicycle. The method comprises: in a non-stall state, updating a counter according to a comparison result of an average motor current and a threshold value, and entering a stall retry state when the counter reaches the threshold value; in the retry state, performing a pulse driving mode, and monitoring an angle change in a driving off period; if the angle change exceeds a threshold value, resuming operation; if the retry times out and it is the first stall, entering a rollback processing state, performing a rollback operation by modifying a gear shifting target position, and returning to the non-stall state; if it is the second stall, ending protection; and in the resuming operation state, continuously monitoring a current to determine whether to enter the retry state again. Compared with the prior art, the application can reduce the stall misjudgment rate, and has the function of automatically resuming gear shifting stall.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic shifting control technology for bicycles, specifically to a stall control method, device, electronic shifter, and bicycle. Background Technology

[0002] Bicycle electronic derailleurs, especially electronic rear derailleurs, use a built-in motor to drive the derailleur to move between different sprockets on the freewheel, achieving gear shifting. During gear shifting, the motor's drive current must overcome chain tension, spring preload, and mechanical transmission resistance. When encountering chain jamming, obstruction by foreign objects, or reaching its limit position, the motor rotor may stop rotating due to excessive load, entering a stalled state. Traditional stall protection schemes mainly have the following technical defects: 1. The judgment mechanism is simple and prone to misjudgment: Most schemes rely solely on the absolute current threshold for judgment, which is prone to false triggering of protection due to instantaneous current fluctuations (such as starting impact and power supply noise), resulting in interruption of normal gear shifting. 2. The recovery strategy is simple and crude: once a stall is detected, the machine is usually stopped and an error is reported directly, requiring manual intervention from the user (such as resetting or reversing the operation), resulting in a poor user experience and an inability to cope with temporary resistance. Summary of the Invention

[0003] The purpose of this invention is to provide a stall control method, device, electronic gearbox, and bicycle for electronic gearboxes, which can reduce the stall error rate and has the function of automatic recovery from stall during gear shifting.

[0004] In a first aspect, the present invention provides a stall control method for an electronic transmission, comprising: in a stall-free state, acquiring an average current value of a motor drive current; incrementing a counter when the average current value exceeds a preset current threshold, and decrementing the counter when the average current value does not exceed the preset current threshold; entering a stall retry state when the counter value reaches a preset counting threshold; executing a pulse drive mode on the motor in the stall retry state, the pulse drive mode including alternating drive on periods and drive off periods; acquiring the angle change of an angle sensor during the drive off period, and entering a recovery operation state if the angle change exceeds a preset angle change threshold; timing the retry duration in the stall retry state, and if the retry duration exceeds a preset timeout duration and a rollback execution flag indicates that a rollback has not yet been executed... If the state is reached, the system enters the rollback processing state and performs a rollback operation. The rollback operation includes: determining the target gear position, setting the value of the first variable representing the target gear position to the position value corresponding to the target gear position, updating the rollback execution flag to a second state indicating that a rollback has been performed, and returning to the no-stall state. If the retry duration exceeds a preset timeout period and the rollback execution flag is in the second state, the system enters the end protection state and stops outputting drive signals to the motor. The preset current threshold is obtained as follows: the electronic transmission is controlled to perform a non-shifting shuddering action in the current gear position, specifically: first, the motor moves forward, then brakes; then the motor moves in reverse, then brakes again; after the first braking, the angle value of the continued sliding due to inertia is read, and the current threshold is adaptively determined based on the magnitude of this angle value.

[0005] According to one embodiment of the present invention, the preset current threshold and / or the preset count threshold can also be determined by at least one of the following methods: the preset current threshold and / or the preset count threshold can be determined by at least one of the following methods: the present invention also provides a method for determining the preset current threshold and / or the preset count threshold: method 1: dynamically determined according to the real-time operating conditions of the electronic transmission, the real-time operating conditions including battery voltage, ambient temperature, currently connected motor model and current gear change information; the present invention also provides a method 2: obtained through a self-learning calibration process, the self-learning calibration process including controlling the electronic transmission to execute a preset gear shift sequence, recording the current characteristic value and gear shift time during each successful gear shift, and calculating the preset current threshold and / or the preset count threshold based on the recorded data.

[0006] According to one embodiment of the present invention, incrementing the counter when the average current value exceeds a preset current threshold includes: calculating the rate of change of the average current value over time to obtain a current slope value; and incrementing the counter only when the average current value exceeds the preset current threshold and the current slope value exceeds the preset slope threshold.

[0007] According to one embodiment of the present invention, in the stall retry state, at least one parameter of the pulse drive mode is dynamically adjusted according to the retry duration and / or the number of retries performed; the dynamic adjustment includes at least one of the following methods. The present invention also provides: Method 1: As the retry duration and / or the number of retries increases, the duration of the drive on period is gradually shortened and / or the duration of the drive off period is gradually extended; Method 2: The motor drive current during the drive on period is obtained, and the duty cycle of the subsequent pulse cycle is dynamically adjusted according to the rising characteristics of the motor drive current.

[0008] According to one embodiment of the present invention, during the drive conduction period of at least one pulse cycle, the drive conduction period includes a reverse drive sub-stage and a forward drive sub-stage; during the reverse drive sub-stage, a drive signal opposite to the normal shifting direction is applied to the motor, and during the forward drive sub-stage, a drive signal in the same direction as the normal shifting direction is applied to the motor.

[0009] According to one embodiment of the present invention, determining the target gear for reversal includes at least one of the following methods, which is also provided by the present invention: Method 1: obtaining the shift direction information and the starting gear of the current shift, and determining the target gear for reversal based on the shift direction information and the starting gear; Method 2: determining the target gear for reversal as the gear that was last successfully confirmed before the transmission enters the stall retry state; Method 3: querying a preset safe gear table and determining the target gear for reversal from the safe gear table.

[0010] According to one embodiment of the present invention, the execution of the rollback operation further includes: resetting a third variable used to characterize the gear shifting execution process to an initial state value; wherein the third variable is a state flag independent of the first variable, used to indicate the current step stage of the gear shifting process; after returning to the stall-free state, reading the value of the first variable, and performing position closed-loop control based on the value of the first variable to drive the motor to move toward the target position characterized by the first variable.

[0011] Secondly, the present invention also provides a stall control device for an electronic transmission, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the method of the above-described embodiments is implemented.

[0012] Thirdly, the present invention also provides an electronic transmission, including a stall control device for the electronic transmission of the above embodiments.

[0013] Fourthly, the present invention also provides a bicycle including the electronic gearbox of the above embodiments.

[0014] The present invention produces at least the following beneficial effects: By combining average current duration judgment with an anti-interference mechanism of counter increment / decrement, effective filtering of instantaneous current spikes is achieved. This method reduces stall misjudgments caused by electromagnetic interference or small-range load fluctuations, and improves the system's operational stability under complex operating conditions.

[0015] By introducing a stall retry state that includes pulse drive mode and real-time monitoring of angle changes, a breakthrough has been achieved in overcoming temporary mechanical resistance. This method improves the robustness of the shifting process under complex road conditions, enabling the system to overcome more than 60% of temporary stall situations without user intervention, reducing shifting interruptions during riding.

[0016] By employing a timeout-adaptive rollback and secondary protection strategy based on retry duration and rollback execution flags, a safety protection system with progressively stronger and more robust responses is constructed. This method automatically guides the transmission to a safe gear when retry fails and decisively stops the machine in the event of a secondary stall, mitigating the thermal load and mechanical stress damage to the motor and drive circuit caused by continuous high current, thereby reducing the risk of hardware damage and the frequency of after-sales maintenance. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are 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 a stall control method for an electronic transmission according to an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] It should be understood that, when used in this specification and the appended claims, the terms “comprising” and “including” indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more of its features, integrals, steps, operations, elements, components and / or collections thereof.

[0021] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0022] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0023] To facilitate the description of this application, the following concepts related to this application are introduced.

[0024] Electronic gearbox: An electronically controlled shifting system for bicycles that uses battery power, wireless communication, and motor drive to achieve intelligent shifting, rather than traditional mechanical cable control.

[0025] Average current: refers to the current value obtained by averaging the instantaneous sampled values ​​of the motor drive current within a predetermined time window. In this embodiment of the invention, a fixed-length FIFO (First-In-First-Out) array is maintained to store historical current sampled values, and their arithmetic mean is calculated in real time to smooth instantaneous noise and provide stable and reliable current characteristics for stall detection.

[0026] Stalled state: This refers to the operating state where, after receiving a drive command, the motor rotor cannot rotate normally or the rotation angle is less than the expected threshold due to excessive load, mechanical jamming, or external resistance. In this embodiment of the invention, this state characterizes mechanical jamming of the transmission during gear shifting.

[0027] Pulse drive mode: A motor drive strategy in which the drive signal is not continuously applied, but rather consists of a pulse sequence alternating between high level (drive on) and low level (drive off). In this embodiment of the invention, this mode is used to attempt to unlock the stuck mechanical structure by intermittently energizing it after a stall occurs.

[0028] Rollback processing state: A specific control state under a fault recovery mechanism. In this state, the control system no longer attempts to complete the currently failed gear shift, but actively switches the transmission to a safe or known gear to avoid the system being in an abnormal state for an extended period or causing further mechanical damage.

[0029] Stall-free state: This refers to the operating state where the motor drive current and / or motor angle changes are within a preset normal range during normal gear shifting or standby of the electronic transmission. This state serves as the baseline for the system to perform routine position closed-loop control and current monitoring.

[0030] Please refer to Figure 1 This invention provides a stall control method for an electronic transmission, comprising: S10: In the non-stalled state, the average current value of the motor drive current is acquired. When the average current value exceeds a preset current threshold, the counter is incremented; when the average current value does not exceed the preset current threshold, the counter is decremented. The purpose of this step is to use a counting mechanism with hysteresis to determine the duration of the current amplitude, thereby effectively filtering out instantaneous current spikes and avoiding misjudgment of stalled operation due to occasional noise. Specifically, within a 2ms control cycle, the system first reads the latest current sampling value and updates a sliding window array of length 10 to calculate the sliding average current value Stall_CurrAverage. Then, the average current value is compared with a preset current threshold MOTOR_STALL_CURR_VAL (e.g., 1.8A). If Stall_CurrAverage > 1.8A, the stall counter Stall_CurrReachNum is incremented by 1; otherwise, it is decremented by 1, but the minimum counter value is limited to 0.

[0031] Specifically, obtaining the average current value of the motor drive current involves maintaining a first-in-first-out (FIFO) array of length N to store the instantaneous sampled values ​​of the motor drive current for N consecutive control cycles; and calculating the arithmetic mean of all sampled values ​​in the array during each control cycle as the average current value. Here, N is an integer greater than or equal to 2, for example, 10.

[0032] S20: When the counter value reaches a preset counting threshold, the system enters a stall retry state. The purpose of this step is to formally confirm a stall only if the high current state persists for a sufficiently long time, thus initiating the subsequent retry process. Following the example of step S10, when the value of Stall_CurrReachNum accumulates to 20 (corresponding to 20 control cycles, i.e., 20 * 2ms = 40ms), the system determines that a stall state has indeed occurred. Subsequently, it switches the current stall state machine from the no-stall state to the stall retry state, and simultaneously clears the counter Stall_CurrReachNum to zero, preparing for the next judgment.

[0033] S30: In the stall retry state, a pulse drive mode is executed on the motor. The pulse drive mode includes alternating drive on-time and drive off-time periods. During the drive off-time, the angle change from the angle sensor is acquired. If the angle change exceeds a preset angle change threshold, the system enters the recovery operation state. The purpose of this step is to employ a low-power, low-stress impact-relaxation drive strategy to attempt to overcome temporary mechanical jamming and to determine whether the stall has been eliminated by monitoring minute displacements. Specifically, after entering the stall retry state, the system starts the pulse timer stall_pluse_timer. During the drive on-time (e.g., 20ms), the system sets the motor enable signal stall_motor_stop to false and outputs PWM to drive the motor normally. After 20ms, the system enters the drive off-time (e.g., 100ms), sets stall_motor_stop to true, and stops the PWM output. During the off-time, the system reads the current angle sensor value and calculates the difference between it and the previously recorded angle. If the absolute value of the difference is greater than the preset angle change threshold continue_diff_angle (e.g., corresponding to a physical angle of 0.4°), it is determined that the motor has successfully overcome the resistance, and the state machine transitions to the resumed operation state.

[0034] S40: In the stall retry state, the retry duration is timed. If the retry duration exceeds a preset timeout period and the rollback execution flag is in the first state indicating that rollback has not yet been performed, the rollback processing state is entered, and a rollback operation is performed. The rollback operation includes: determining the target gear for rollback, setting the value of the first variable representing the target gear position to the position value corresponding to the target gear, updating the rollback execution flag to the second state indicating that rollback has been performed, and returning to the no-stall state. If the retry duration exceeds the preset timeout period and the rollback execution flag is in the second state, the end protection state is entered, and the drive signal to the motor is stopped. The purpose of this step is to set a time limit for the retry process, providing a safe adaptive rollback mechanism when recovery is not possible for an extended period, and determining whether to rollback or completely stop the machine based on whether it is a secondary stall, thereby avoiding infinite loops and hardware damage. Specifically, in the stall retry state, another timer, stall_retry_timer, increments in each cycle. When its value reaches the preset timeout duration MOTOR_STALL_ENDTIME (e.g., 3000 cycles, or 6 seconds), the system checks the stall_back_flg flag. If the stall_back_flg flag == 0 (i.e., the first state, indicating that no stall operation has been performed), the stall logic is executed: the target gear variable LevelTarget is forcibly set to the current gear variable LevelNow, and the stall_back_flg flag is set to 1. Finally, the state machine is transitioned to the no-stall state, and step S10 is re-executed, that is, the steps of obtaining the average current value of the motor drive current and incrementing or decrementing the counter in the no-stall state are re-executed. If the stall_back_flg flag == 1 (i.e., the second state, indicating that a stall operation has been performed), it means that the stall has occurred again during the stall process. The system transitions to the end protection state and sets the motor total enable signal IsRunning = 0, causing the motor of the electronic transmission to completely stop driving.

[0035] S50: The preset current threshold is obtained as follows: The electronic transmission is controlled to perform a non-shifting shuddering action in the current gear, specifically: first, the motor moves forward, then brakes; then the motor moves in the reverse direction, then brakes again; after the first braking, the angle value of the continued movement due to inertia is read, and the current threshold is adaptively determined based on the magnitude of this angle value. Specifically, the electronic transmission is controlled to perform a non-shifting shuddering action in the current gear, that is, to perform a back-and-forth movement of a fixed duration. Specifically: first, the motor moves forward for 30ms, then brakes for 100ms; then the motor moves in the reverse direction for 30ms, then brakes again for 100ms. After the first braking, the angle value of the continued movement due to inertia is read, and the current threshold is adaptively determined based on the magnitude of this inertial angle. For example, if the inertial angle is greater than 10 degrees, the current threshold is set to 1.8A; if the inertial angle is less than 10 degrees, the current threshold is set to 1.6A. Similarly, this method can also be used to dynamically determine the slope threshold. For example, a full-scale slope K is used when the inertia angle is greater than 10 degrees, and 0.8×K is used when it is less than 10 degrees. The purpose of this step is to replace the fixed preset threshold and, by introducing a dynamic adjustment or self-learning mechanism, enable the sensitivity of the stall detection to adapt to different external environments and hardware states, thereby further improving the system's adaptability and accuracy. By introducing a dynamic threshold determination method, this method enables the stall detection to adapt to changes in discharge capacity under different battery voltages. This method reduces protection delays or false triggering caused by improper threshold settings under low-voltage, high-load conditions, thereby improving the environmental adaptability of the stall detection.

[0036] Optionally, in the restored operation state, closed-loop control of the motor position is resumed, and the motor drive current is continuously monitored. If the motor drive current exceeds the preset current threshold, the system returns to the stall retry state. The purpose of this step is to seamlessly continue the normal speed change process after successfully overcoming stall, while continuing to monitor the current to prevent stalling from occurring again in subsequent operations and thus losing protection. Specifically, when the state machine enters the restored operation state, the system resumes normal position PID (proportional-integral-derivative) control logic, and the motor continues to move towards the original target gear. In this state, the system still calls the current monitoring logic described in step S10 in each control cycle. Once the average current Stall_CurrAverage is detected to continuously exceed 1.8A for 40ms, the system will switch back to the stall retry state and re-execute the pulse drive attempt.

[0037] Optionally, in some embodiments, the five-state finite state machine (i.e., no-blocking state, block retry state, recovery operation state, rollback processing state, and end protection state) in the above-described stall control method can be simplified to suit resource-constrained microcontrollers. Specifically, the recovery operation state can be merged into the no-blocking state. In this embodiment: No stalled state: It retains the original current duration judgment logic, and also assumes the monitoring function of the original recovery operation state.

[0038] Stalled retry status: remains unchanged, still executing pulse drive mode, angle change detection and timeout backoff logic.

[0039] Restore running status: Cancelled, its function is absorbed by the no-blocking state with added temporary flag.

[0040] Rollback status: Remains unchanged, responsible for performing rollback operations after timeout and secondary protection judgment.

[0041] End of protection status: Remain unchanged, used for final shutdown protection after secondary stall.

[0042] When the stalled retry state detects that the stall has been overcome through angle change, the state machine does not enter a separate recovery operation state, but directly switches back to the stall-free state.

[0043] The embodiments of this application employ the above method, which produces at least the following beneficial effects: By combining average current duration judgment with an anti-interference mechanism of counter increment / decrement, effective filtering of instantaneous current spikes is achieved. This method reduces stall misjudgments caused by electromagnetic interference or small-range load fluctuations, and improves the system's operational stability under complex operating conditions.

[0044] By introducing a stall retry state that includes pulse drive mode and real-time monitoring of angle changes, a breakthrough has been achieved in overcoming temporary mechanical resistance. This method improves the robustness of the shifting process under complex road conditions, enabling the system to overcome more than 60% of temporary stall situations without user intervention, reducing shifting interruptions during riding.

[0045] By employing a timeout-adaptive rollback and secondary protection strategy based on retry duration and rollback execution flags, a safety protection system with progressively stronger and more robust responses is constructed. This method automatically guides the transmission to a safe gear when retry fails and decisively stops the machine in the event of a secondary stall, mitigating the thermal load and mechanical stress damage to the motor and drive circuit caused by continuous high current, thereby reducing the risk of hardware damage and the frequency of after-sales maintenance.

[0046] This method can be applied to electronic shifting systems in professional sports bicycles. When a rider performs aggressive shifting, if the rear derailleur motor jams due to a sudden chain impact or foreign object embedding, the method automatically executes a pulse retry to overcome the resistance. This overcomes the operational bottleneck of traditional solutions that require manual resetting after stopping, thus improving the smoothness of shifting during cycling.

[0047] This method can be applied to electronic gearboxes in electric bicycles or urban commuter vehicles. When faced with gradually increasing resistance due to factors such as cable aging and sediment buildup from long-term use, this method uses an adaptive backoff mechanism to maintain the gearbox in a usable gear, preventing the entire transmission system from locking up due to a single failed shift and reducing maintenance anxiety for non-professional users.

[0048] In some embodiments, the preset current threshold and / or the preset count threshold can also be determined by at least one of the following methods: Method 1: Dynamically determined based on the real-time operating conditions of the electronic transmission, wherein the real-time operating conditions include at least one of the following: battery voltage, ambient temperature, currently connected motor model, and current gear shift information; Method 2: Obtained through a self-learning calibration process, which includes controlling the electronic transmission to execute a preset shift sequence, recording the current characteristic value and shift time during each successful shift, and calculating the preset current threshold and / or the preset count threshold based on the recorded data.

[0049] The purpose of this step is to replace the fixed preset threshold by introducing a dynamic adjustment or self-learning mechanism, enabling the sensitivity of the stall detection to adapt to different external environments and hardware conditions, thereby further improving the system's adaptability and accuracy. The specific implementation steps are as follows: Determine the dynamic threshold acquisition method: The system can look up a suitable current threshold in a table based on the current battery voltage. For example, a voltage-current threshold mapping table can be pre-stored in the microcontroller's Flash memory: when the battery voltage is ≥8.0V, the current threshold is set to 1.80A; when the voltage is between 7.5V and 8.0V, the threshold is set to 1.60A; and when the voltage is below 6.5V, the threshold is set to 1.40A. The system reads this table and updates the value of MOTOR_STALL_CURR_VAL after each battery voltage refresh.

[0050] Determine the self-learning threshold acquisition method: The system can execute a self-learning program during power-on or idle: First, control the motor to move from the current gear towards the large flywheel for 30ms, then brake for 100ms; then move in the opposite direction towards the small flywheel for 30ms, then brake again for 100ms. During this process, record the angle of continued sliding due to inertia after the first braking. If this inertia angle is greater than 10 degrees, it indicates that the current system resistance is small, and a higher current threshold (e.g., 1.8A) can be selected; if the inertia angle is less than 10 degrees, it indicates that the system resistance is large, and a lower current threshold (e.g., 1.6A) should be selected to trigger the stall protection earlier.

[0051] Optionally, the self-learning calibration process can also be implemented in the following specific way: The electronic transmission is controlled to perform a non-shifting jerking motion in the current gear, i.e., a back-and-forth movement of a fixed duration. Specifically: the motor moves forward for 30ms, then brakes for 100ms; then the motor moves backward for 30ms, then brakes again for 100ms. After the first braking, the angle value of the continued movement due to inertia is read, and the current threshold is adaptively determined based on the magnitude of this inertia angle. For example, if the inertia angle is greater than 10 degrees, the current threshold is set to 1.8A; if the inertia angle is less than 10 degrees, the current threshold is set to 1.6A. Similarly, this method can also be used to dynamically determine the slope threshold, for example, using a full-scale slope K when the inertia angle is greater than 10 degrees, and 0.8×K when it is less than 10 degrees.

[0052] By introducing a dynamic threshold determination method, this approach enables stall detection to adapt to variations in discharge capacity under different battery voltages. This method reduces protection delays or false triggering caused by improper threshold settings under low-voltage, high-load conditions, thereby improving the environmental adaptability of stall detection.

[0053] By introducing a self-learning threshold determination method, this approach enables the electronic transmission to automatically calibrate the stall judgment criteria based on its own mechanical state (such as cable resistance). This method shortens the protection strategy mismatch cycle caused by changes in condition during the break-in period of new equipment or after maintenance, and reduces the degree of inconsistency in the effect of the same threshold due to individual differences.

[0054] In some embodiments, step S10, incrementing the counter when the average current value exceeds a preset current threshold, includes: calculating the rate of change of the average current value over time to obtain a current slope value; the counter is incremented only when both the average current value and the current slope value exceed the preset current threshold. The purpose of this step is to introduce the trend of current change as an auxiliary judgment to distinguish between a sustained high current but steady-state uphill riding condition and a rapidly rising current motor stall condition, thereby further reducing the false judgment rate. The specific implementation steps are as follows: The first step is to calculate the current slope. In each control cycle, the system calculates the current slope (Stall_CurrSlope) using the differences between adjacent data in the sliding window array Stall_CurrVal. For example, the average current change over the most recent N cycles is calculated as the current slope for the current cycle.

[0055] Specifically, calculating the rate of change of the average current value over time to obtain the current slope value involves: based on the average current value over the most recent M control cycles, using the least squares method or calculating the difference between the first and last values ​​divided by the time difference to obtain the current change per unit time, which is then used as the current slope value. Here, M is an integer greater than or equal to 2, for example, 5.

[0056] The second step is conditional judgment. When determining whether to increment the stall counter Stall_CurrReachNum, the system no longer relies solely on the average current value, but instead performs a logical AND operation: Stall_CurrReachNum is incremented only when both the moving average current and the current slope are greater than a preset slope threshold (e.g., 4A / 5ms). If only the average current is high but the slope is low (flat), then the stall accumulation is not included.

[0057] Optionally, the current slope value can also be used to filter out large current spikes at the moment of motor startup to further reduce false alarms. In one example, the counter is incremented only when the average current value exceeds a preset current threshold (e.g., 1.8A) and the current slope value is less than a preset slope threshold (e.g., 4A / 5ms); conversely, if the current slope value is too large (exceeding 4A / 5ms), it is determined to be a transient current during normal motor startup and is not included in the stall count.

[0058] Optionally, the calculated current slope value can also be used to dynamically adjust the stall retry strategy. When the slope value is large (indicating a rapid current rise and a stiff stall), a more aggressive pulse mode is adopted (such as shortening the drive off period or increasing the duty cycle); when the slope value is small (indicating a milder resistance), a milder retry strategy is adopted (such as extending the drive off period to reduce thermal load).

[0059] By combining average current and current slope as a joint criterion, this method achieves accurate capture of the transient characteristics of motor stall. This method mitigates the problem of falsely triggering stall protection due to persistently high average current during high-load but non-stalled conditions such as continuous uphill climbing, thereby improving the system's accuracy in diverse riding scenarios.

[0060] In some embodiments, in step S30, during the stall retry state, at least one parameter of the pulse drive mode is dynamically adjusted based on the retry duration and / or the number of retries performed; the dynamic adjustment includes at least one of the following methods: Method 1: As the retry duration and / or the number of retry increases, gradually shorten the duration of the drive on-time and / or gradually extend the duration of the drive off-time; Method 2: Obtain the motor drive current during the drive conduction period, and dynamically adjust the duty cycle of subsequent pulse cycles according to the rising characteristics of the motor drive current.

[0061] The purpose of this step is to make the pulse retry strategy more adaptive, employing an aggressive approach in the early stages of stalling for rapid recovery, while switching to a conservative strategy to control temperature rise and power consumption after prolonged stalling. The specific implementation steps are as follows: Time-based pulse width adjustment is implemented: the system monitors a counter during stall retry. During the first retry, a long on-time and short off-time pulse is used (40ms on, 60ms off). If stall persists, the counter increments, initiating a second retry with a shorter on-time and a longer off-time (20ms on, 80ms off). In the third retry, the on-time is further shortened to 10ms, and the off-time extended to 190ms, using longer intervals to reduce average current and heat accumulation in the motor and drive circuit.

[0062] Optionally, one way to gradually extend the duration of the drive shutdown period as the retry duration increases is as follows: from the 1st to the 3rd second after the stall occurs, a pulse mode of 20ms on / 100ms off is used; from the 3rd to the 6th second, the pulse mode of 20ms on / 200ms off is switched.

[0063] Implement duty cycle gradient based on current rise characteristics: Monitor the current rise rate and peak value within 5ms after the start of each drive conduction period. If the current rises to 90% of the overcurrent protection threshold in a very short time (e.g., 2ms), it indicates very high mechanical resistance. In subsequent pulse cycles, linearly reduce the duty cycle of the drive signal from 100% to 60% to avoid excessive instantaneous inrush current; if the current rise is gradual, maintain a 100% duty cycle.

[0064] Optionally, one way to dynamically adjust the duty cycle of subsequent pulse cycles based on the rising characteristics of the motor drive current is as follows: when stall is overcome and the system is ready to resume normal operation, a gradual duty cycle recovery strategy is adopted. For example, it first operates in a 20ms on / 200ms off mode, then gradually increases to 50ms on / 200ms off, then to 100ms on / 200ms off, and finally switches to continuous full duty cycle drive, thereby achieving a smooth transition and avoiding secondary current surges.

[0065] By introducing time-based dynamic pulse width adjustment, this method enables the stall retry strategy to adaptively balance breakthrough efficiency and system temperature rise. During continuous stalling, this method reduces the average heat buildup rate of the motor windings and drive MOSFETs by extending the drive off-time, mitigating the risk of overheating protection or hardware damage due to prolonged retries.

[0066] By introducing a duty cycle gradual recovery strategy based on current rise characteristics, this method avoids the secondary current surge that may occur when suddenly switching from a stalled state to a fully driven state. This method shortens the fluctuation range of the motor current during the recovery from a high-resistance state to a stable state, improving the smoothness of the recovery process and electrical safety.

[0067] In some embodiments, in step S30, during the drive conduction period of at least one pulse cycle, the drive conduction period includes a reverse drive sub-phase and a forward drive sub-phase; during the reverse drive sub-phase, a drive signal opposite to the normal shifting direction is applied to the motor, and during the forward drive sub-phase, a drive signal in the same direction as the normal shifting direction is applied to the motor. The purpose of this step is to introduce a brief reverse impact in the pulse drive, using the reverse and forward impact sequence to more effectively loosen or disengage mechanical components that are stuck, especially for certain specific hard jams. The specific implementation steps are as follows: The first step is stopping and braking. When a stall is detected during forward gear shifting and a stall retry state is entered, forward drive is not immediately executed in the first pulse cycle. The system first short-circuits two phases of the motor and performs a 50ms braking operation to consume the system's kinetic energy and stabilize the transmission components.

[0068] The second step is to apply a reverse pulse. After braking is completed, the system applies a 100% duty cycle drive pulse to the motor for 30ms, which is opposite to the normal shift direction (for example, if the target is to move towards the large flywheel, then the opposite direction is to move towards the small flywheel).

[0069] The third step involves braking again and then driving in the forward direction. After the reverse pulse ends, braking is applied again for 50ms to eliminate the inertia of the reverse motion. Finally, the standard forward drive conduction period begins, attempting to complete the gear shift.

[0070] Optionally, the specific timing sequence of the reverse drive sub-stage and the forward drive sub-stage is as follows: when encountering a stall during forward gear shifting and entering a retry state, a 50ms motor braking is first performed to consume system kinetic energy and stabilize the transmission components; then a 30ms reverse drive pulse (duty cycle of 100%) with the opposite direction to normal gear shifting is applied; after the reverse pulse ends, another 50ms braking is performed; finally, the forward drive conduction period is entered to continue attempting to complete the gear shift.

[0071] By integrating braking, reverse pulse, braking, and forward compound actions during the drive conduction period, this method offers an enhanced breakthrough attempt to overcome persistent mechanical jamming. This method increases the possibility of minute misalignments within the drivetrain to address hard-on-hard engagement conditions that cannot be resolved by single-direction pulses, thereby improving the success rate of stall recovery under extreme conditions.

[0072] In some embodiments, step S40, determining the target reversal gear, includes at least one of the following methods: Method 1: Obtain the gear shift direction information and the starting gear position of this gear shift, and determine the target gear position for reversing based on the gear shift direction information and the starting gear position; Method 2: The target gear for reversal is determined as the last successfully confirmed gear of the transmission before it enters the stall retry state; Method 3: Query the preset safety gear table and determine the target reversal gear from the safety gear table.

[0073] The purpose of this step is to provide a variety of flexible and safe methods for determining the target gear for reversal, to adapt to different mechanical structures and safety requirements. The specific implementation steps are as follows: The first step is the logical selection of the rollback method: The system has a preset priority logic: first try method one; if method one is invalid or cannot obtain information (e.g., cannot obtain the starting gear), then use method two; if method two also fails (e.g., the position sensor is completely malfunctioning), then use method three.

[0074] The second step, in a specific implementation of Method 1, is as follows: The system reads the direction indicator (upshift or downshift) and the starting gear value (e.g., currently in 5th gear) of the current gear shift operation. If the gear stalls during upshifting, the target gear for reversing is set to the starting gear (5th gear); if the gear stalls during downshifting, the target gear for reversing is set to a position one gear higher than the starting gear (6th gear) to restore a gear with less resistance.

[0075] Optionally, another specific embodiment of Method 1 is as follows: The actual angular position of the motor when stall occurs is obtained, and the retraction target is determined based on the ratio of this angle to the total angle of the current gear shift. For example, when shifting from gear 5 (corresponding to an angle of 100 degrees) to gear 6 (corresponding to an angle of 200 degrees), if the angle is less than or equal to 150 degrees when stall occurs, the gear is retracted to the starting gear (gear 5); if the angle is greater than 150 degrees, the gear is retracted to the target gear (gear 6) or a more conservative gear (gear 6).

[0076] The third step, a specific implementation of Method Two, involves the system reading the motor's current actual position value using an angle sensor or position encoder, and mapping this position value to the gear shift table of the transmission to obtain the current actual gear. For example, if the position sensor returns a coded value of 1500, and the table shows that this coded value corresponds to gear 4, then the target gear for reversing is determined to be gear 4. This method does not rely on the initial gear or direction information of this gear shift, but directly performs reversal based on the current actual position of the machinery.

[0077] The fourth step, specifically the implementation of method three, involves reading a preset safe gear list [2, 4, 6] from memory. The system uses a position sensor to determine the approximate position of the derailleur and selects the nearest safe gear as the reversal target. If the current gear is stuck between 3 and 4, then 4 is selected as the target.

[0078] Optionally, the safety gear table in Method 3 can be constructed in at least one of the following ways: Factory preset settings: Depending on the type of cassette used, gears with smaller tooth drop and lower shifting resistance are preset as safe gears. For example, for a 12-speed cassette, gears 9, 10, 11, and 12 (on the smaller cassette side) are preset as safe gears. If stalling occurs during a shift from 8th to 7th gear, the system queries the safe gear table and determines the nearest safe gear (i.e., 9th gear) as the target gear for reversing.

[0079] User-defined mode: Riders can manually specify one or more preferred safety gears via the onboard display or mobile application, based on their personal riding habits and the resistance characteristics of their usual routes. The system will then write this setting into the safety gear table. For example, if a user sets the safety gears to 6, 7, and 8, and stalls during a shift from 9 to 10 gear, the system will revert to 8 gear; if stalls during a shift from 5 to 4 gear, the system will revert to 6 gear.

[0080] Self-learning dynamic update method: The system records parameters such as the starting gear, target gear, shift time, and maximum drive current for each successful gear shift. After accumulating a certain number of shifts (e.g., 50 successful shifts), the historical data is analyzed to identify gear combinations with significantly high shift resistance. The target gear in these combinations is then downgraded or removed from the safe gear list. Conversely, gears with smooth shifts and low resistance are upgraded in the safe gear list. For example, a successful / failed shift statistics table is stored: if shifting to gear 6 is successful 50 times and fails 1 time, while shifting to gear 7 is successful 20 times and fails 30 times, then when a stall timeout occurs during the shift from gear 8 to gear 9, the system compares the success rates of the two candidate shift gears (gear 6 and gear 7) and selects gear 6, which has a higher success rate, as the target shift gear.

[0081] By providing multiple methods for determining the rollback gear, this approach establishes a complete decision chain from attempting to roll back to the original state to returning to the stable gear. This method reduces the probability of situations where the rollback target cannot be determined when the position sensor fails, while also shortening the computational latency of the system when making rollback decisions, thereby improving the robustness and universality of the fault recovery mechanism.

[0082] In some embodiments, step S40 further includes: resetting a third variable characterizing the gear shifting process to its initial state value; wherein the third variable is a state flag independent of the first variable, used to indicate the current stage of the gear shifting process; after returning to the stall-free state, reading the value of the first variable, and performing position closed-loop control based on the value of the first variable to drive the motor to move towards the target position characterized by the first variable. The purpose of this step is to ensure the integrity and executability of the rollback process. By resetting the gear shifting state machine and coordinating it with the modified target position variable, the system can smoothly execute the rollback action as if performing a completely new gear shift. Specific implementation steps are as follows: The first step is to reset the gear shifting process. In the rollback processing state, in addition to modifying the target gear variable to the rollback target gear, the system also clears the gear shifting step variable to zero. This variable is a third variable used to indicate which stage the current gear shift is in (e.g., waiting for the motor to start, in motion, reaching the target position).

[0083] The second step is coordinated execution of the rollback. Once the system returns to a stall-free state, the main control loop will detect in the next scan that the target gear is not equal to the current actual gear, and the gear shift step variable is 0 (initial state value). Therefore, the standard gear shift control process is triggered, and the system begins to execute position closed-loop control, driving the motor to move towards the updated target position, thus safely completing the rollback shift.

[0084] By resetting the third variable of the shifting execution process during the rollback operation, this method achieves deep coordination between the stalled rotor system and the main shifting control system. This method ensures that the modified target position variable can be correctly responded to by the main control process, avoiding control logic confusion caused by inconsistent states, thereby improving the reliability and determinism of the rollback action.

[0085] In some embodiments, this application also provides a stall control device for an electronic transmission. The device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the stall control method for the electronic transmission described above. This device can be integrated as a separate controller unit onto the motor drive circuit board of the electronic transmission.

[0086] In some embodiments, this application also provides an electronic derailleur. The electronic derailleur includes the stall control device described above. The electronic derailleur may be a bicycle rear derailleur, an internal derailleur hub, or a front derailleur.

[0087] In some embodiments, this application also provides a bicycle. The bicycle includes the electronic gearbox of the above embodiments. The bicycle can be a road bicycle, a mountain bike, or an electric-assist bicycle.

[0088] The above-described 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 the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A stall control method for an electronic gearbox, applied to a bicycle, characterized in that, include: In a no-stall state, the average current value of the motor drive current is obtained. When the average current value exceeds a preset current threshold, the counter is incremented. When the average current value does not exceed the preset current threshold, the counter is decremented. When the counter value reaches the preset counting threshold, it enters the stall retry state; In the stall retry state, the motor is executed in a pulse drive mode, which includes alternating drive on-time and drive off-time. During the drive shutdown period, the angle change of the angle sensor is acquired. If the angle change exceeds a preset angle change threshold, the system enters the recovery operation state. In the stall retry state, the retry duration is timed. If the retry duration exceeds a preset timeout period and the rollback execution flag is in the first state indicating that rollback has not yet been performed, then the rollback processing state is entered, and the rollback operation is performed. The rollback operation includes: determining the rollback target gear, setting the value of the first variable used to characterize the gear shift target position to the position value corresponding to the rollback target gear, updating the rollback execution flag to the second state indicating that rollback has been performed, and returning to the stall-free state. If the retry duration exceeds the preset timeout period and the rollback execution flag is in the second state, then the end protection state is entered, and the drive signal to the motor is stopped. The preset current threshold is obtained in the following way: the electronic transmission is controlled to perform a non-shifting shuddering action in the current gear, specifically: first, the motor moves forward, then brakes; then the motor moves in reverse, then brakes again; after the first braking ends, the angle value of the sliding due to inertia is read, and the current threshold is adaptively determined according to the magnitude of the angle value.

2. The method according to claim 1, characterized in that, The preset current threshold and / or the preset count threshold are further determined by at least one of the following methods: Method 1: Dynamically determined based on the real-time operating conditions of the electronic transmission, wherein the real-time operating conditions include at least one of the following: battery voltage, ambient temperature, currently connected motor model, and current gear shift information; Method 2: Obtained through a self-learning calibration process, which includes controlling the electronic transmission to execute a preset shift sequence, recording the current characteristic value and shift time during each successful shift, and calculating the preset current threshold and / or the preset count threshold based on the recorded data.

3. The method according to claim 1, characterized in that, Incrementing the counter when the average current value exceeds a preset current threshold includes: calculating the rate of change of the average current value over time to obtain a current slope value; incrementing the counter only when the average current value exceeds the preset current threshold and the current slope value exceeds the preset slope threshold.

4. The method according to claim 1, characterized in that, In the stall retry state, at least one parameter of the pulse drive mode is dynamically adjusted based on the retry duration and / or the number of retries performed; the dynamic adjustment includes at least one of the following: Method 1: As the retry duration and / or the number of retries increase, gradually shorten the duration of the drive on-time and / or gradually extend the duration of the drive off-time; Method 2: Obtain the motor drive current during the drive conduction period, and dynamically adjust the duty cycle of subsequent pulse cycles according to the rising characteristics of the motor drive current.

5. The method according to claim 1, characterized in that, During the drive conduction period of at least one pulse cycle, the drive conduction period includes a reverse drive sub-stage and a forward drive sub-stage; during the reverse drive sub-stage, a drive signal opposite to the normal shifting direction is applied to the motor, and during the forward drive sub-stage, a drive signal in the same direction as the normal shifting direction is applied to the motor.

6. The method according to claim 1, characterized in that, Determining the target reversal gear includes at least one of the following methods: Method 1: Obtain the gear shift direction information and the starting gear position of this gear shift, and determine the target gear position for reversing based on the gear shift direction information and the starting gear position; Method 2: The target gear for reversal is determined as the last successfully confirmed gear of the transmission before it enters the stall retry state; Method 3: Query the preset safety gear table and determine the target reversal gear from the safety gear table.

7. The method according to claim 1, characterized in that, The execution of the rollback operation further includes: resetting a third variable used to characterize the gear shifting process to its initial state value; wherein the third variable is a state flag independent of the first variable, used to indicate the current step stage of the gear shifting process; after returning to the stall-free state, reading the value of the first variable, and performing position closed-loop control based on the value of the first variable to drive the motor to move toward the target position characterized by the first variable.

8. A stall control device for an electronic transmission, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, implement the method of any one of claims 1 to 7.

9. An electronic transmission, characterized in that, Includes the stall control device for the electronic transmission as described in claim 8.

10. A bicycle, characterized in that, Including the electronic transmission as described in claim 9.

Citation Information

Patent Citations

  • Motor control method and device, electronic equipment, storage medium and vehicle

    CN122185917A

  • Power derailluer for bicycle

    JP2005306369A