A motor control method, device and equipment for electric two-wheelers

CN122788511APending Publication Date: 2026-09-22ANHUI YADEA LOCOMOTIVE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611245302.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

然而,一旦该路驱动环节出现故障,电子制动控制单元将完全丧失对该电机的控制能力,导致电子制动系统瘫痪,驾驶员在紧急制动场景下面临安全风险

Benefits of technology

[0016]从以上技术方案可以看出,本申请实施例具有以下优点:电子制动控制单元具体包括主电机驱动电路和备用电机驱动电路,主电机驱动电路用于驱动主制动电机,备用电机驱动电路用于驱动备用制动电机,主制动电机和备用制动电机用于向同一制动执行机构进行驱动输出。基于此,电子制动控制单元可以先对主制动电机进行故障检测,得到故障检测结果;在该故障检测结果指示主制动电机存在故障的情况下,可以将驱动输出由主电机驱动电路切换至备用电机驱动电路,并通过备用电机驱动电路控制备用制动电机按照初始驱动参数启动,其中,该初始驱动参数基于主制动电机发生故障前最后一个有效控制周期内的驱动参数确定。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122788511A_ABST
    Figure CN122788511A_ABST
Patent Text Reader

Abstract

The application discloses a motor control method, device and equipment for an electric two-wheeled vehicle. The method is applied to an electronic brake control unit, and the electronic brake control unit comprises a main motor driving circuit and a backup motor driving circuit. The main motor driving circuit is used for driving a main brake motor, and the backup motor driving circuit is used for driving a backup brake motor. The main brake motor and the backup brake motor are used for driving output to the same brake actuator. The method comprises the following steps: performing fault detection on the main brake motor to obtain a fault detection result; when the fault detection result indicates that the main brake motor has a fault, switching the driving output from the main motor driving circuit to the backup motor driving circuit, and controlling the backup brake motor to start according to initial driving parameters through the backup motor driving circuit, wherein the initial driving parameters are determined based on driving parameters in a last valid control period before the main brake motor has the fault. In this way, the braking capability of the electric two-wheeled vehicle can be ensured when a fault occurs in the brake motor driving link.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and device for controlling the motor of an electric two-wheeled vehicle. Background Technology

[0002] Currently, electric two-wheelers typically use a direct-drive braking system to achieve electronic braking. The electronic braking control unit is the core control component of this system, responsible for collecting sensor signals, executing control algorithms, and outputting drive commands for the brake motor. Its reliability directly affects the braking safety of the entire vehicle.

[0003] In practical applications, due to constraints in cost, size, and power consumption, electronic brake control units typically only have a single brake motor drive channel. This means they integrate only one set of motor drive circuits and one set of motor control logic, with the brake motor being driven by this single drive channel to establish braking force. However, if this drive circuit fails, the electronic brake control unit will completely lose its control over the motor, causing the electronic brake system to malfunction and posing a safety risk to the driver in emergency braking scenarios. Summary of the Invention

[0004] This application provides a motor control method, apparatus, and device for electric two-wheeled vehicles to ensure the braking capability of the electric two-wheeled vehicle when a failure occurs in the brake motor drive component.

[0005] In a first aspect, embodiments of this application provide a motor control method for an electric two-wheeled vehicle, applied to an electronic brake control unit. The electronic brake control unit includes a main motor drive circuit and a backup motor drive circuit. The main motor drive circuit drives a main brake motor, and the backup motor drive circuit drives a backup brake motor. The main brake motor and the backup brake motor provide drive outputs to the same brake actuator. The method includes: The main brake motor was subjected to fault detection, and the fault detection results were obtained; If the fault detection result indicates that the main brake motor is faulty, the drive output is switched from the main motor drive circuit to the backup motor drive circuit, and the backup brake motor is started according to the initial drive parameters through the backup motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor failed.

[0006] Optionally, the fault detection result includes the severity of the fault in the main brake motor, and the method further includes: Based on the severity of the fault in the main brake motor, the target safety level of the electronic brake control unit is determined. The target safety level is one of multiple candidate safety levels, which are arranged in ascending order of fault severity, including the first safety level, the second safety level, the third safety level, and the fourth safety level. The fault control logic corresponding to the target safety level is executed. The fault control logic corresponding to the first safety level is used to control the activation of all functions of the electronic brake control unit. The fault control logic corresponding to the second safety level is used to control the deactivation of the auxiliary control function of the electronic brake control unit. The fault control logic corresponding to the third safety level is used to execute the switching from the main brake motor to the backup brake motor and control the activation of the auxiliary control function through the backup brake motor. The fault control logic corresponding to the fourth safety level is used to output alarm information and control the brake actuator to maintain the established braking force.

[0007] Optionally, determining the target safety level of the electronic brake control unit based on the severity of the fault in the main brake motor includes: The severity of the fault in the main brake motor is sequentially checked to see if it meets the fault conditions corresponding to the multiple candidate safety levels; If the severity of the fault in the main brake motor meets the fault conditions corresponding to at least one candidate safety level, the candidate safety level with the highest severity of the fault corresponding to the at least one candidate safety level shall be determined as the target safety level.

[0008] Optionally, the step of switching the drive output from the main motor drive circuit to the backup motor drive circuit, and controlling the backup brake motor to start according to the initial drive parameters through the backup motor drive circuit, includes: Shut down all drive outputs of the main motor drive circuit; A verification pulse is output to the backup motor drive circuit, and the verification pulse is used to verify the continuity of the drive circuit of the backup motor drive circuit. If the drive circuit conduction verification is successful, the backup motor drive circuit is controlled to drive the backup brake motor according to the initial drive parameters. Based on the position feedback signal of the backup brake motor, a closed-loop control for the standby brake motor is constructed.

[0009] Optionally, the step of performing fault detection on the main brake motor and obtaining fault detection results includes: The phase current of the main brake motor is sampled; If the duration of the target state of the phase current within a preset time window exceeds a percentage threshold, the fault detection result is determined to be a progressive overcurrent fault. The target state indicates that the phase current exceeds the overcurrent warning threshold but does not exceed the overcurrent protection threshold. The overcurrent warning threshold is less than the overcurrent protection threshold. If the phase current exceeds the overcurrent protection threshold, the fault detection result is determined to be a fault in the main brake motor. And / or, the step of performing fault detection on the main brake motor and obtaining fault detection results includes: The phase current of the main brake motor is sampled; The waveform factor is obtained by calculating the ratio of the effective value to the average value of the phase current. If the waveform factor deviates from the normal range by more than the deviation threshold, the fault detection result is determined to be an output winding fault.

[0010] Optionally, the step of performing fault detection on the main brake motor and obtaining fault detection results includes: The temperature of the heat sink of the main motor drive circuit is collected; The junction temperature of the power device is determined based on the temperature of the heat sink, the power loss of the main motor drive circuit, and the junction-case thermal resistance of the power device. When the junction temperature exceeds the derating threshold, the maximum drive duty cycle of the main motor drive circuit is limited; If the junction temperature exceeds the shutdown threshold, the drive output of the main motor drive circuit is shut off, and the fault detection result is determined to be a fault in the main brake motor, wherein the derating threshold is less than the shutdown threshold.

[0011] Optionally, the method further includes: Monitor the bus voltage of the electronic braking control unit; A power outage event is determined to have occurred if the rate of voltage drop of the bus exceeds a rate threshold or if the bus voltage falls below an undervoltage threshold. Using the electrical energy provided by the energy storage element connected to the electronic brake control unit, the brake motor in the start state is driven to rotate to the self-locking position, and the drive output is turned off. The established braking force is maintained through the transmission mechanism of the brake actuator, which has a reverse self-locking characteristic.

[0012] Optionally, the method further includes: Obtain the front and rear wheel speeds of an electric two-wheeler; Calculate the slip ratio based on the front wheel speed and the rear wheel speed; If the slip ratio exceeds the slip ratio threshold, a torque limit request is sent to the drive motor controller of the electric two-wheeler. The torque limit request is used to request a limit on the output torque of the drive motor when it is in the starting state.

[0013] Secondly, embodiments of this application provide a motor control device for an electric two-wheeled vehicle, applied to an electronic brake control unit. The electronic brake control unit includes a main motor drive circuit and a backup motor drive circuit. The main motor drive circuit drives a main brake motor, and the backup motor drive circuit drives a backup brake motor. The main brake motor and the backup brake motor provide drive outputs to the same brake actuator. The device includes: The fault detection module is used to perform fault detection on the main brake motor and obtain the fault detection result. The circuit switching module is used to switch the drive output from the main motor drive circuit to the backup motor drive circuit when the fault detection result indicates that the main brake motor has a fault, and to control the backup brake motor to start according to the initial drive parameters through the backup motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor failed.

[0014] Thirdly, embodiments of this application provide an electronic device, the device including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the above-described motor control method for electric two-wheeled vehicles.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the implementation steps of the motor control method for an electric two-wheeled vehicle described above.

[0016] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: The electronic brake control unit specifically includes a main motor drive circuit and a backup motor drive circuit. The main motor drive circuit is used to drive the main brake motor, and the backup motor drive circuit is used to drive the backup brake motor. The main brake motor and the backup brake motor are used to provide drive output to the same brake actuator. Based on this, the electronic brake control unit can first perform fault detection on the main brake motor and obtain the fault detection result. If the fault detection result indicates that the main brake motor is faulty, the drive output can be switched from the main motor drive circuit to the backup motor drive circuit, and the backup brake motor can be started according to the initial drive parameters through the backup motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor fails.

[0017] Therefore, when the main brake motor fails, switching the drive output from the main motor drive circuit to the backup motor drive circuit allows the backup brake motor to take over from the main brake motor and continue driving the same brake actuator. The braking force of the brake actuator is not lost due to a failure in the drive circuit on the main brake motor side, thus ensuring the braking capability of the electric two-wheeler even when the brake motor drive circuit fails, preventing the driver from losing electronic braking function in emergency braking scenarios. Furthermore, since the initial drive parameters of the backup brake motor are determined based on the drive parameters within the last effective control cycle before the main brake motor failure, the drive output of the backup brake motor at startup is connected to the drive output of the main brake motor before the failure. During the switching process, the braking force output by the brake actuator remains continuous, avoiding brake interruption or braking shock caused by sudden changes in braking force at the moment of switching, making the entire switching process imperceptible to the driver. Attached Figure Description

[0018] Figure 1 A flowchart illustrating a motor control method for an electric two-wheeled vehicle provided in this application embodiment; Figure 2 A flowchart of a security level classification and fault control logic provided in an embodiment of this application; Figure 3 A flowchart of a power-off self-locking control logic provided in an embodiment of this application; Figure 4 A flowchart of a front and rear wheel linkage control logic provided in an embodiment of this application; Figure 5 A hardware architecture diagram of an electronic braking control unit provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a motor control device for an electric two-wheeled vehicle provided in an embodiment of this application. Detailed Implementation

[0019] As mentioned earlier, the electronic brake control unit of a typical electric two-wheeler is equipped with only a single brake motor drive channel, meaning it integrates only one set of motor drive circuitry and motor control logic. This single drive channel drives the brake motor to establish braking force. If any fault occurs in this motor drive channel—such as a short circuit in the power transistor in the power drive circuit, loss of the gate drive signal, an open or short circuit in the brake motor windings, or a stalled and burned-out brake motor—the electronic brake control unit will completely lose control of the brake motor, causing the entire electronic braking system to fail. The driver instantly loses electronic braking function, facing serious safety risks in emergency braking scenarios.

[0020] To address the aforementioned problems, this application provides a motor control method for an electric two-wheeled vehicle. The electronic brake control unit specifically includes a main motor drive circuit and a backup motor drive circuit. The main motor drive circuit drives the main brake motor, and the backup motor drive circuit drives the backup brake motor. Both the main and backup brake motors provide drive output to the same brake actuator. Based on this, the electronic brake control unit can first perform fault detection on the main brake motor and obtain a fault detection result. If the fault detection result indicates a fault in the main brake motor, the drive output can be switched from the main motor drive circuit to the backup motor drive circuit. The backup motor drive circuit then controls the backup brake motor to start according to initial drive parameters, which are determined based on the drive parameters within the last effective control cycle before the main brake motor malfunctions.

[0021] Therefore, when the main brake motor fails, switching the drive output from the main motor drive circuit to the backup motor drive circuit allows the backup brake motor to take over from the main brake motor and continue driving the same brake actuator. The braking force of the brake actuator is not lost due to a failure in the drive circuit on the main brake motor side, thus ensuring the braking capability of the electric two-wheeler even when the brake motor drive circuit fails, preventing the driver from losing electronic braking function in emergency braking scenarios. Furthermore, since the initial drive parameters of the backup brake motor are determined based on the drive parameters within the last effective control cycle before the main brake motor failure, the drive output of the backup brake motor at startup is connected to the drive output of the main brake motor before the failure. During the switching process, the braking force output by the brake actuator remains continuous, avoiding brake interruption or braking shock caused by sudden changes in braking force at the moment of switching, making the entire switching process imperceptible to the driver.

[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0023] Figure 1 This is a flowchart illustrating a motor control method for an electric two-wheeled vehicle, provided as an embodiment of this application. (In conjunction with...) Figure 1 As shown, the motor control method for electric two-wheeled vehicles provided in this application embodiment can be applied to an electronic brake control unit. This electronic brake control unit specifically includes a main motor drive circuit and a backup motor drive circuit. The main motor drive circuit drives the main brake motor, and the backup motor drive circuit drives the backup brake motor. The main brake motor and the backup brake motor provide drive output to the same brake actuator. Accordingly, the method specifically includes the following steps S101-S102.

[0024] S101: Perform fault detection on the main brake motor and obtain the fault detection results.

[0025] Fault detection refers to the process of online monitoring of signals that reflect the working status of the main brake motor and its drive components during the operation of the main brake motor, and determining whether there is a fault on one side of the main brake motor based on the monitoring results.

[0026] In this embodiment of the application, fault detection of the main brake motor includes detecting faults in the main brake motor body, such as open circuit, short circuit or stall of the motor winding, as well as faults in the drive circuit of the main brake motor, such as short circuit of the power transistor or loss of gate drive signal in the main motor drive circuit.

[0027] Furthermore, the fault detection result refers to the output of the fault detection operation, which can indicate whether there is a fault in the main brake motor, and may also include the type and severity of the fault in the main brake motor.

[0028] In practical implementation, the electronic brake control unit may include a control chip, which can perform fault detection periodically. For example, the control chip can process the collected current, temperature, and position signals within each control cycle, and compare the processing results with the corresponding fault criteria to obtain the fault detection result. Here, the control cycle refers to the cycle in which the control chip performs one complete control calculation for the brake motor.

[0029] Furthermore, in the embodiments of this application, various specific implementation methods for fault detection can also be provided, which will be described below.

[0030] As one possible implementation, embodiments of this application can perform fault detection based on phase current. Several examples are provided below.

[0031] As an example, the phase current of the main brake motor is first sampled. Here, phase current refers to the current flowing through each phase winding of the brake motor. Accordingly, in practice, the control chip can perform analog-to-digital sampling twice within each PWM cycle to calculate the instantaneous value of the phase current.

[0032] Next, if the duration of the target phase current within the preset time window exceeds a certain percentage threshold, the fault detection result can be determined as a progressive overcurrent fault. Here, the target phase current indicates that the phase current exceeds the overcurrent warning threshold but does not exceed the overcurrent protection threshold, where the overcurrent warning threshold is less than the overcurrent protection threshold.

[0033] Here, a progressive overcurrent fault refers to an overcurrent fault in which the phase current rises slowly and continuously. This is different from an instantaneous overcurrent and usually corresponds to faults in their nascent stage, such as partial short circuits in the windings. If only a single overcurrent protection threshold is used for judgment, this type of fault cannot be identified before the current reaches the overcurrent protection threshold and is only discovered when it evolves into an actual fault.

[0034] Based on this, in this embodiment, three current thresholds can be set: an upper limit for normal operating current, an overcurrent warning threshold, and an overcurrent protection threshold. As an example, the upper limit for normal operating current can be 2A, the overcurrent warning threshold can be 3A, and the overcurrent protection threshold can be 5A. Furthermore, a sliding window counter can be used to calculate the duration percentage: with a preset time window of 100ms, if the number of sampling points in the target state within the window exceeds 5% of the total number of sampling points within the window, i.e., the duration percentage of the target state exceeds the percentage threshold, then it is determined to be a progressive overcurrent fault.

[0035] If the phase current exceeds the overcurrent protection threshold, the fault detection result can be determined to be a fault in the main brake motor. Specifically, when the phase current instantaneously exceeds the overcurrent protection threshold, it indicates that an actual fault has occurred on the main brake motor side. At this time, the fault detection result can be determined to be a fault in the main brake motor, thereby triggering the subsequent redundancy switching process, such as immediately shutting down the output of the three-phase bridge of the main motor drive circuit and performing the switching.

[0036] Therefore, it is evident that in the process of fault detection based on phase current, the combination of three-level current thresholds and time window proportions can identify progressive overcurrents in their nascent stage, realizing a shift from passive shutdown after a fault to proactive prevention before a fault occurs. Simultaneously, for instantaneous severe overcurrents, it can still promptly determine that the main brake motor has failed and trigger switching, thus combining early warning and fault protection.

[0037] As another example, firstly, the phase current of the main brake motor is sampled. Next, the ratio of the effective value to the average value of the phase current is calculated to obtain the waveform factor. The waveform factor is the ratio of the effective value to the average value of the current, reflecting the degree of distortion in the current waveform. When an inter-turn short circuit occurs in the motor windings, the electrical parameters of the windings change, causing distortion in the phase current waveform, thus causing the waveform factor to deviate from the normal range.

[0038] Based on this, when the waveform factor deviates from the normal range by more than the deviation threshold, it can be determined as an early sign of an inter-turn short circuit in the motor winding, confirming the fault detection result as an output winding fault, and a winding fault warning signal can be output. In this way, inter-turn short circuits can be identified and warned of in their early stages, preventing them from developing into serious faults such as winding open circuits or short circuits.

[0039] As another possible implementation, the embodiments of this application can perform fault detection based on position feedback. Specifically, multiple position signals from the position sensor built into the main brake motor can be collected, and a logical consistency check can be performed on the multiple position signals. If an illegal combination of all high or all low signals appears in the multiple position signals, the position sensor is determined to be faulty.

[0040] Furthermore, cross-verification can be performed by combining position signals and current signals. If the position signal indicates that the motor is rotating but the phase current is zero, it is determined to be an open circuit fault; if the phase current is normal but the position signal does not change, it is determined to be a stall fault.

[0041] As another possible implementation, the embodiments of this application can also perform stall detection. Specifically, when the drive duty cycle is greater than the duty cycle threshold and the position sensor signal does not flip within one electrical cycle, stall timing is started; when the timing reaches the stall determination duration and the phase current is greater than the stall current threshold, a stall fault is confirmed. As an example, the duty cycle threshold can be 10%, the stall determination duration can be 200ms, and the stall current threshold can be 3 times the rated current.

[0042] Furthermore, after the stall is confirmed, the motor output can be shut off and the cooling time can be waited. Then, an attempt can be made to reverse and get out of the stall at a low duty cycle. If the stall fails to get out of the stall, it is determined to be a permanent mechanical failure and a redundancy switch is triggered.

[0043] In this way, for temporary stalls that can be eliminated by reversing, unnecessary switching can be avoided; for permanent mechanical failures that cannot be resolved, the backup brake motor can be switched to in a timely manner.

[0044] As another possible implementation, the embodiments of this application can also perform communication timeout detection, that is, if no communication data is received within a preset time period, it is determined that a communication failure has occurred.

[0045] Furthermore, embodiments of this application can also perform fault detection based on temperature. Specifically, firstly, the temperature of the heat sink of the main motor drive circuit is collected. For example, the temperature of the heat sink can be collected in real time using a thermistor mounted on the heat sink of the main motor drive circuit. The sampled value of the thermistor can be converted into a temperature value using a lookup table, and the acquisition period can be 10ms.

[0046] Next, the junction temperature of the power device is determined based on the temperature of the heat sink, the power loss of the main motor drive circuit, and the junction-to-case thermal resistance of the power device. Junction-to-case thermal resistance refers to the thermal resistance between the junction region of the power device and its outer casing, characterizing the ease with which heat is conducted from the junction region to the casing. Power loss can be calculated based on the effective value of the phase current and the on-resistance of the power device. Junction temperature, on the other hand, refers to the temperature of the chip junction region inside the power device.

[0047] Furthermore, since the junction region of power devices is located inside the package, the junction temperature cannot be directly measured by external sensors. Therefore, the junction temperature can be indirectly monitored by establishing a junction temperature estimation model.

[0048] Based on this, the junction temperature estimation in this application embodiment can adopt a first-order thermal model, and the junction temperature can be determined by the following formula (1): (1) in, Indicates the junction temperature of the power device. Indicates the temperature of the heatsink. This represents the effective value of the phase current. This represents the on-resistance of a power device. This indicates the junction-to-case thermal resistance of a power device.

[0049] As an example, It can be set to 2°C / W, and the junction temperature can be updated once per control cycle.

[0050] In this way, if the calculated junction temperature exceeds the derating threshold, the maximum drive duty cycle of the main motor drive circuit can be limited. The derating threshold is the junction temperature threshold that triggers derating. Limiting the maximum drive duty cycle means lowering the upper limit of the drive duty cycle, thereby limiting the output power and heat generation of the main motor drive circuit. Thus, when the junction temperature is high but not yet dangerous, limiting the output instead of directly shutting down the machine allows the electronic brake control unit to retain braking capability in the initial stages of overheating.

[0051] If the junction temperature exceeds the shutdown threshold, the drive output of the main motor drive circuit is shut off, and the fault detection result is determined to be a fault in the main brake motor, wherein the derating threshold is less than the shutdown threshold.

[0052] Specifically, when the junction temperature rises further and exceeds the turn-off threshold, it indicates that the power device is at risk of thermal runaway. At this point, the drive output of the main motor drive circuit is immediately shut down, and the fault detection result is determined to be a fault in the main brake motor, thereby triggering the subsequent brake motor switching process. For example, the derating threshold can be 105°C, and the turn-off threshold can be 125°C.

[0053] Therefore, it can be seen that in the process of fault detection based on temperature, the internal junction temperature of the power device is indirectly monitored, and the over-temperature treatment is divided into two levels: derating treatment that limits the output and shutdown treatment that shuts down the output. This avoids problems such as thermal runaway of the power device, demagnetization of the magnet, and insulation aging caused by excessive temperature, and also avoids the loss of braking ability caused by direct shutdown when the temperature is slightly over-temperature.

[0054] In summary, in this embodiment of the application, through the above step S101, the fault on the main brake motor side can be identified online by the electronic brake control unit, instead of being discovered only after the braking function is completely lost, thereby providing a trigger basis for the drive output switching in subsequent steps.

[0055] S102: If the fault detection result indicates that the main brake motor is faulty, the drive output is switched from the main motor drive circuit to the standby motor drive circuit, and the standby brake motor is started according to the initial drive parameters through the standby motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor failed.

[0056] In the embodiments of this application, the main motor drive circuit and the backup motor drive circuit refer to circuits that convert the control signals output by the control chip into power signals that can drive the brake motor to operate.

[0057] Accordingly, switching the drive output from the main motor drive circuit to the backup motor drive circuit means that the control chip stops outputting drive signals to the main brake motor through the main motor drive circuit, and instead outputs drive signals to the backup brake motor through the backup motor drive circuit, so that the drive task originally undertaken by the main brake motor is undertaken by the backup brake motor.

[0058] The initial drive parameters refer to the drive parameters used by the standby brake motor at startup. As an optional implementation, the drive parameters may include the duty cycle of the pulse width modulation (PWM) signal. The duty cycle represents the proportion of time occupied by the effective level within one PWM cycle. The larger the duty cycle, the higher the average voltage output by the motor drive circuit to the brake motor, and the greater the driving force output by the brake motor.

[0059] Based on this, the initial drive parameters are determined using the drive parameters from the last effective control cycle before the main brake motor malfunctions. This can mean using the duty cycle from the last effective control cycle before the main brake motor malfunctions as the duty cycle at the start-up time of the standby brake motor. The effective control cycle refers to the last control cycle in which the drive output of the main brake motor was still in a normal state before the malfunction occurred.

[0060] In this way, since the drive parameters of the main brake motor in the last effective control cycle before the failure correspond to the actual braking force output by the brake actuator before the switch, after the standby brake motor starts with the initial drive parameters determined based on these drive parameters, its drive output at the start time is connected with the drive output of the main brake motor before the failure, and the braking force output by the brake actuator will not suddenly disappear or suddenly increase at the moment of switch.

[0061] Furthermore, for ease of understanding, the implementation process of step S102 can be described below with reference to one possible implementation method.

[0062] As one possible implementation, for step S102, in a specific implementation, firstly, all drive outputs of the main motor drive circuit can be turned off.

[0063] Specifically, when the fault detection result indicates a fault in the main brake motor, the electronic brake control unit can first shut down all drive outputs of the main motor drive circuit via the control chip, for example, by shutting down all PWM outputs of the three-phase bridge of the main motor drive circuit. This prevents the main brake motor from continuing to receive drive signals and causing uncontrollable actions under fault conditions, while simultaneously making way for the brake actuator to connect to the backup motor drive circuit.

[0064] Next, a verification pulse is output to the backup motor drive circuit. This verification pulse verifies the continuity of the backup motor drive circuit's drive loop. The verification pulse is a pulse signal with a small pulse width or amplitude, its function being to detect whether the drive loop of the backup motor drive circuit is continuous without causing significant braking action from the backup brake motor. In this embodiment, since the backup motor drive circuit itself may also have abnormal conditions such as loop failure, directly outputting a complete drive signal to the backup brake motor without verification could lead to switching failure or even circuit damage. Therefore, verifying the backup motor drive circuit before startup using a verification pulse helps improve circuit safety.

[0065] More specifically, the electronic brake control unit can configure the PWM parameters of the backup motor drive circuit through the control chip and output micropulses, and then determine whether the drive circuit is conducting based on the sampling results of the current sampling circuit.

[0066] Accordingly, once the drive circuit conduction verification is passed, the backup motor drive circuit can be controlled to drive the backup brake motor according to the initial drive parameters.

[0067] Specifically, if the verification results show that the drive circuit of the backup motor drive circuit is conducting, the electronic brake control unit can control the backup motor drive circuit to drive the backup brake motor according to the initial drive parameters through the control chip. For example, the PWM output of the backup motor drive circuit can be started with the duty cycle value of the last effective control cycle before the main brake motor failure, so that the drive output of the backup brake motor is connected with the drive output before the main brake motor failure, and the braking force can be seamlessly connected.

[0068] Finally, the electronic brake control unit constructs a closed-loop control system for the backup brake motor based on the position feedback signal from the backup brake motor. Closed-loop control refers to a control method that adjusts the drive output according to the deviation between the actual state and the target state of the controlled object. The position feedback signal can be provided by the position sensor built into the backup brake motor.

[0069] Specifically, after the backup brake motor starts according to the initial drive parameters, closed-loop control can be re-established based on the position feedback signal of the backup brake motor, and the parameters of the closed-loop control can be adaptively adjusted. As an optional implementation method, the closed-loop control can adopt proportional-integral-derivative (PID) control, and the PID parameters can be adaptively adjusted after switching.

[0070] In this way, the switching process first shuts off the drive output on the faulty side, then verifies the drive circuit on the backup side, then starts the backup brake motor according to the inherited initial drive parameters, and finally rebuilds the closed-loop control. During the entire switching process, the braking force fluctuation is less than the preset threshold, the driver does not perceive it, and the switching failure caused by the backup motor drive circuit itself is avoided, thus improving the reliability of redundant switching.

[0071] Furthermore, as an example, the state machine of the above switching process can run in the timer interrupt service routine of the control chip of the electronic brake control unit, with a timer interrupt period of 1ms. Specifically, after the switching is triggered, the control chip can sequentially execute the following logic in subsequent timer interrupt cycles: In the first cycle, all PWM outputs of the three-phase bridge of the main motor drive circuit are turned off; in the second to fifth cycles, the PWM parameters of the three-phase bridge of the standby motor drive circuit are configured and micropulses are output to verify the circuit conduction; in the sixth to tenth cycles, the PWM output of the standby brake motor is started with the last effective duty cycle value before the main brake motor failure, achieving seamless braking force connection; in the eleventh to fiftyth cycles, the control algorithm re-establishes closed-loop control based on the position feedback signal of the standby brake motor and performs adaptive adjustment of PID parameters. The entire switching process can be completed within 50ms.

[0072] Furthermore, in this embodiment, the main motor drive circuit and the backup motor drive circuit can also be configured with cycle-by-cycle current limiting protection. Specifically, the control chip of the electronic brake control unit can compare the current sample value with the hardware threshold in real time through an internal analog comparator. When the instantaneous current exceeds the hardware threshold, the output of the current PWM cycle is immediately shut off, and it automatically resumes in the next cycle. In this way, the current spike is suppressed within a single PWM cycle, and the current limiting action does not affect the normal drive of subsequent cycles, achieving refined protection for the three-phase bridge drive circuit.

[0073] Based on the relevant content of steps S101-S102 above, it can be seen that in this embodiment, when the main brake motor fails, the drive output is switched from the main motor drive circuit to the backup motor drive circuit. This allows the backup brake motor to take over from the main brake motor and continue to drive the same brake actuator. The braking force of the brake actuator is not lost due to the failure of the drive circuit on the main brake motor side, thus ensuring the braking capability of the electric two-wheeler even when the brake motor drive circuit fails, preventing the driver from losing electronic braking function in emergency braking scenarios. Furthermore, since the initial drive parameters of the backup brake motor are determined based on the drive parameters in the last effective control cycle before the main brake motor fails, the drive output of the backup brake motor at the time of startup is connected to the drive output of the main brake motor before the failure. During the switching process, the braking force output by the brake actuator can remain continuous, avoiding brake interruption or brake shock caused by sudden changes in braking force at the moment of switching, making the entire switching process imperceptible to the driver.

[0074] Furthermore, the motor control method provided in this application embodiment can also perform graded control according to the severity of the fault. For ease of understanding, the following describes... Figure 2 This hierarchical control process will be introduced.

[0075] Figure 2 This is a flowchart illustrating a security level classification and fault control logic provided in an embodiment of this application. (Combined with...) Figure 2 As shown, the fault detection result may include the severity of the fault existing in the main brake motor. Accordingly, the motor control method may also include the following steps S201 and S202.

[0076] S201: Based on the severity of the fault in the main brake motor, determine the target safety level of the electronic brake control unit. The target safety level is one of several candidate safety levels, which are ranked in ascending order of fault severity: first safety level, second safety level, third safety level, and fourth safety level.

[0077] Here, the safety level refers to the level used to characterize the current permissible operating range of the electronic brake control unit. The higher the severity of the fault, the higher the corresponding safety level, and the more functions of the electronic brake control unit are disabled.

[0078] Therefore, in specific implementation, the process of determining the target safety level can be carried out by sequentially checking whether the severity of the fault in the main brake motor meets the fault conditions corresponding to multiple candidate safety levels. If the severity of the fault in the main brake motor meets the fault conditions corresponding to at least one candidate safety level, the candidate safety level with the highest fault severity among these at least one candidate safety levels is determined as the target safety level.

[0079] S202: Execute the fault control logic corresponding to the target safety level. The fault control logic corresponding to the first safety level is used to control the activation of all functions of the electronic brake control unit. The fault control logic corresponding to the second safety level is used to control the shutdown of the auxiliary control function of the electronic brake control unit. The fault control logic corresponding to the third safety level is used to execute the switch from the main brake motor to the backup brake motor and control the activation of the auxiliary control function through the backup brake motor. The fault control logic corresponding to the fourth safety level is used to output alarm information and control the brake actuator to maintain the established braking force.

[0080] Among them, auxiliary control functions refer to functions set up to improve the braking or driving performance of a vehicle in addition to basic braking functions. For example, auxiliary control functions may include at least one of Anti-lock Braking System (ABS), Traction Control System (TCS), and Hill Descent Control (HDC). Basic braking function refers to the function of controlling the brake motor to establish braking force based on the driver's braking operation.

[0081] Since malfunctions in auxiliary control functions typically do not affect the basic braking function, confusing these malfunctions with hardware failures in the brake motor drive system and directly shutting down the machine would result in unnecessary functional loss. Therefore, through the aforementioned tiered control, in the second safety level, only the faulty auxiliary control function is disabled while the basic braking function is retained; in the third safety level, a primary / backup switch is performed, and the auxiliary control function remains available on the backup brake motor after the switch; in the fourth safety level, alarm information is output while maintaining the established braking force, thus progressively reducing functionality while always preserving usable braking capability.

[0082] Furthermore, in practical implementation, the fault conditions corresponding to each candidate safety level can be set as follows: The fault conditions corresponding to the fourth safety level may include faults in both the main brake motor and the backup brake motor, or a complete interruption of the communication node of the electronic brake control unit.

[0083] The fault conditions corresponding to the third safety level can include a fault in either the main brake motor or the backup brake motor.

[0084] The fault conditions corresponding to the second safety level may include abnormal auxiliary control functions or a decline in the communication quality of communication nodes.

[0085] The fault condition corresponding to the first safety level is that there is no fault.

[0086] Specifically, the state machine of the hierarchical control process can run in the system management task of the control chip of the electronic braking control unit. The cycle of the system management task can be 10ms. Every 10ms, the global fault flag register is scanned. The fault conditions corresponding to each safety level are checked in descending order of safety level, and the highest safety level that meets the fault conditions is determined as the target safety level.

[0087] Furthermore, if the fault conditions corresponding to the current target safety level disappear and their duration exceeds the recovery confirmation time, the electronic brake control unit can be restored to a lower safety level. For example, the recovery confirmation time can be 3 seconds. In this way, the function of the electronic brake control unit can be automatically restored after the fault is cleared, avoiding prolonged stay in a degraded state due to a momentary fault.

[0088] Based on the relevant content of steps S201-S202 above, it can be seen that in this embodiment of the application, the electronic brake control unit degrades step by step according to the severity of the fault, but always retains the braking capability available under the current conditions. No single fault will cause complete loss of braking, and the abnormality of the auxiliary control function will not cause unnecessary loss of the basic braking function.

[0089] Furthermore, the motor control method provided in this application embodiment may also include self-locking holding control logic after power failure. The following is in conjunction with... Figure 3 This paper introduces the self-locking control logic for power failure.

[0090] Figure 3 A flowchart illustrating a power-off self-locking control logic provided in an embodiment of this application. (In conjunction with...) Figure 3 As shown, the power-off self-locking control logic may include the following steps S301 to S303.

[0091] S301: Monitors the bus voltage of the electronic brake control unit.

[0092] Here, bus voltage refers to the voltage of the DC bus that supplies power from the battery to the electronic braking control unit. For example, the bus voltage can be connected to the analog-to-digital conversion channel of the MCU through a resistor divider network and monitored in real time with a period of 1ms.

[0093] S502: A power outage event is determined to have occurred if the rate of voltage drop on the bus exceeds the rate threshold or the bus voltage falls below the undervoltage threshold.

[0094] A power outage event refers to an event in which the electronic brake control unit loses power to the vehicle. For example, the criteria for determining a power outage event could be that the bus voltage drop rate is greater than 50V / ms and the bus voltage is lower than an undervoltage threshold, which could be, for example, 36V.

[0095] In this way, by judging the two dimensions of drop rate and undervoltage threshold, a real power outage event can be distinguished from the normal fluctuation of bus voltage, thus avoiding misjudgment.

[0096] S503: Using the electrical energy provided by the energy storage element connected to the electronic brake control unit, the brake motor in the starting state is driven to rotate to the self-locking position and the drive output is turned off. The established braking force is maintained through the transmission mechanism of the brake actuator. The transmission mechanism has a reverse self-locking characteristic.

[0097] The energy storage element refers to a component located at the power input terminal of the electronic brake control unit, used to provide sustaining power to the electronic brake control unit after a power outage. For example, the energy storage element can be a 4700μF / 63V electrolytic capacitor, which has a sustaining time of approximately 300ms under full load conditions.

[0098] The self-locking position refers to the motor position where, after the brake motor has rotated to the correct position, the transmission mechanism of the brake actuator is in a reverse self-locking state.

[0099] The reverse self-locking characteristic refers to the mechanical property of a transmission mechanism that can only be actively driven by the brake motor side and cannot be dragged in the reverse direction by the load on the brake pad side. For example, the transmission mechanism may include a lead screw mechanism or a worm gear mechanism, which have the aforementioned reverse self-locking characteristic.

[0100] Based on this, in specific implementation, after a power failure event is determined, the control chip of the electronic brake control unit can enter the emergency interrupt service program and directly execute the self-locking sequence, that is: read the current Hall position of the brake motor, calculate the electrical angle difference required to reach the self-locking position, drive the brake motor to rotate forward to the target position with the maximum duty cycle, and turn off the PWM output after reaching the target position.

[0101] For example, the maximum duty cycle can be 95%, and the entire self-locking process can be controlled within 100ms, providing ample margin compared to the approximately 300ms maintenance time of the energy storage element. After the brake motor reaches its position, the transmission mechanism reverses and self-locks, passively maintaining the clamping force of the brake pads on the disc brake until actively released by the electronic brake control unit upon the next power-on.

[0102] Based on the relevant content of steps S301-S303 above, it can be seen that in this embodiment of the application, after the vehicle is powered off, the electronic brake control unit actively drives the brake motor to the self-locking position using the limited electrical energy of the energy storage element, and then uses the reverse self-locking characteristic of the transmission mechanism to passively maintain the braking force after the power is cut off, so as to avoid the brake pads releasing the disc brake disc under the action of the return spring and causing the established braking force to be lost instantly, thereby eliminating the risk of vehicle rollover in scenarios such as parking on a slope or power failure after emergency braking.

[0103] Furthermore, the motor control method provided in this application embodiment may also include front and rear wheel linkage control logic. The following is in conjunction with... Figure 4 The control logic for the linkage between the front and rear wheels is introduced.

[0104] Figure 4 This is a flowchart illustrating a front-to-rear wheel linkage control logic provided in an embodiment of this application. (In conjunction with...) Figure 4 As shown, the front and rear wheel linkage control logic may include the following steps S401 to S403.

[0105] S401: Obtain the front and rear wheel speeds of the electric two-wheeler.

[0106] In practice, the front wheel speed can be collected by an independent sensor mounted on the front wheel hub and directly connected to the electronic brake control unit. The rear wheel speed can be calculated in real time by the drive motor controller based on the position sensor built into the drive motor, and sent to the electronic brake control unit at preset intervals through the communication node between the electronic brake control unit and the drive motor controller.

[0107] The drive motor refers to the motor that propels the electric two-wheeler, and its function differs from that of the brake motor. The drive motor controller is the controller used to control the drive motor. The communication node is the real-time communication link established between the electronic brake control unit and the drive motor controller. In this way, the rear wheel speed no longer relies on a separately installed rear wheel speed sensor, but instead reuses the existing speed detection capability of the drive motor controller, thus eliminating the need for a separate rear wheel speed sensor, reducing hardware costs, decreasing wiring harness connection points, and lowering the sensor failure rate.

[0108] S402: Calculate slip ratio based on front wheel speed and rear wheel speed.

[0109] Slip ratio is a parameter used to characterize the degree of wheel slippage relative to the road surface.

[0110] For example, the slip ratio under braking conditions can be represented by the following formula (2-1): (2-1) The slip ratio under driving conditions can be expressed by the following formula (2-2): (2-2) in, Indicates the slip ratio under braking conditions. Indicates the slip ratio under driving conditions. , This indicates the speed of the front wheels.

[0111] Furthermore, the calculated slip ratio can be smoothed by a first-order low-pass filter, with a cutoff frequency of, for example, 10Hz, to avoid slip ratio jumps caused by instantaneous fluctuations in the wheel speed signal.

[0112] S403: When the slip ratio exceeds the slip ratio threshold, a torque limit request is sent to the drive motor controller of the electric two-wheeler. The torque limit request is used to request a limit on the output torque of the drive motor when it is in the running state.

[0113] Specifically, when the slip ratio exceeds the slip ratio threshold, it indicates that the wheel is showing signs of slipping. At this time, the electronic brake control unit sends a torque limit request to the drive motor controller through the communication node. In response to the torque limit request, the drive motor controller limits the output torque of the drive motor, thereby suppressing wheel slippage.

[0114] Furthermore, under braking conditions, when the slip ratio exceeds the slip ratio threshold, the electronic brake control unit can also control the brake motor in the starting state to perform intermittent braking control.

[0115] It should be noted that intermittent braking control refers to a control method that controls the brake motor to rapidly and repeatedly clamp and release the brake pads. Specifically, the duty cycle of intermittent braking control can be gradually decreased, for example, initially 100%, then 80%, 60%, and 40% respectively, with each clamping lasting 5ms and each releasing lasting 5ms, forming an intermittent braking frequency of 100Hz. During intermittent braking control, the electronic brake control unit simultaneously sends a braking torque request frame to the drive motor controller through the communication node, requesting the drive motor to stop outputting driving force.

[0116] In non-braking conditions, when the slip ratio exceeds the slip ratio threshold, the electronic brake control unit can send a torque limiting request frame to the drive motor controller via a communication node, requesting that the output torque of the drive motor be limited to below a target value. The torque limiting amplitude can be adjusted according to the degree of slip ratio exceeding the limit. For example, a 10% slip ratio exceeding the limit results in a 30% torque limit, a 20% exceeding limit results in a 60% torque limit, and a 30% exceeding limit results in a 90% torque limit.

[0117] Furthermore, if the slip ratio after torque limitation still exceeds the standard, the brake motor in the starting state can be controlled to apply auxiliary braking force to suppress rear wheel spin.

[0118] Furthermore, when the slip ratio returns to the normal range and remains there for a preset duration, the intermittent braking control or torque limiting control is deactivated, and a cooldown period is set after deactivation to avoid frequent switching between control modes. For example, the normal range could be a slip ratio of less than 5%, the preset duration could be 100ms, and the cooldown period could be 500ms.

[0119] Furthermore, the front and rear wheel linkage control logic can also include a linkage arbitration mechanism, which determines the currently active control mode according to a preset priority when both braking and driving conditions simultaneously meet the triggering conditions. As an example, the preset priorities from high to low can be: emergency braking, intermittent braking control mode, torque limiting control mode, and normal braking, thereby ensuring that only one linkage control mode is active at any given time and eliminating control conflicts under boundary conditions.

[0120] Based on the relevant content of steps S301-S303 above, it can be seen that in this embodiment of the application, the electronic brake control unit calculates the slip ratio based on the front wheel speed and the rear wheel speed. When the slip ratio exceeds the limit, it requests the drive motor controller to limit the output torque of the drive motor through the communication node. It can also cooperate with the intermittent braking control of the brake motor, so that the anti-slip control on the braking side and the torque limiting control on the driving side can make coordinated decisions within the same control unit. It can prevent wheel slippage under both braking and driving conditions, and avoids control conflicts caused by the separation of front and rear wheel control.

[0121] Furthermore, as mentioned earlier, the communication node is the real-time communication link established between the electronic brake control unit and the drive motor controller. Based on this, the specific implementation of the communication node will be described below with reference to one possible implementation method.

[0122] As one possible implementation, the electronic brake control unit and the drive motor controller can establish a communication node via a CAN bus with a communication rate of 500kbps. The message types transmitted on the communication node can include at least drive motor status frames, brake torque request frames, heartbeat frames, and fault alarm frames.

[0123] Specifically, the drive motor status frame can be actively sent by the drive motor controller every 10ms. Its data field can include rear wheel speed, drive motor temperature, controller temperature, operating status, fault code, and checksum byte. For example, the rear wheel speed can be 16-bit data in rpm, and the checksum byte can be a Cyclic Redundancy Check (CRC) byte, such as CRC8. The electronic brake control unit parses the drive motor status frame in the CAN receive interrupt, and updates the rear wheel speed variable after the checksum is passed. The brake torque request frame can be actively sent by the electronic brake control unit every 10ms. Its data field can include target braking torque, torque limit request value, emergency braking flag, and intermittent braking activation flag.

[0124] As another possible implementation, the communication node may also include a heartbeat mechanism and timeout detection. Specifically, the electronic brake control unit and the drive motor controller can exchange heartbeat frames at a preset period, and the heartbeat frame may contain an incrementing communication counter. For example, the heartbeat frame can be sent bidirectionally every 100ms. The electronic brake control unit maintains a timeout timer for receiving drive motor status frames. If no valid drive motor status frame is received for a consecutive preset number of periods, it is determined that the communication node is faulty. At this time, the rear wheel speed variable can be marked as invalid, and a degradation is triggered, i.e., switching to the backup speed estimation mode: the front wheel speed is calculated using the pulse period of the front wheel sensor, and the brake motor speed is calculated using the flip period of the three Hall signals of the brake motor. After conversion by the reduction ratio, it is used as the approximate wheel speed of the rear wheel.

[0125] As another possible implementation, the communication node can also include data verification and fault tolerance. Specifically, the receiver verifies the verification byte of each frame of data; if the verification does not match, the frame is discarded and recorded. The electronic braking control unit can count the verification failure rate of the most recent preset number of frames. If the failure rate exceeds a warning threshold, a communication quality warning is triggered; if the failure rate exceeds a fault threshold, a communication node fault is determined and a degradation is triggered. A sliding window mean filter can also be performed on the received rear wheel speed data.

[0126] As another possible implementation, the electronic brake control unit and the drive motor controller can also communicate using a UART serial bus. The communication rate can be, for example, 115200bps. The frame format can be a custom frame format with start byte, frame identifier, data field, check byte and end byte. The heartbeat cycle and transmission content are consistent with the CAN scheme. This scheme has lower hardware costs.

[0127] Furthermore, communication can be achieved using an RS-485 differential bus, with a maximum communication rate of 1Mbps. It supports multi-point networking, has strong anti-common-mode interference capabilities, and is suitable for long-distance transmission or environments with strong electromagnetic interference.

[0128] Furthermore, Bluetooth BLE or ZigBee wireless communication can be used to achieve communication, making it suitable for applications that do not require wiring, such as vehicle modification or the aftermarket.

[0129] Furthermore, the motor control method provided in this application embodiment may also include a power-on self-test process. Specifically, after the control chip of the electronic brake control unit is powered on, the reset boot program can sequentially perform the following self-tests: a self-test of the control chip's own health, including CRC32 verification of the program storage area, March-C testing of the data storage area, and verification of key peripheral registers, wherein the CRC32 check value can be written to the end of the program storage area at the factory; a self-test of the motor drive circuit, including micro-pulse continuity testing of the three-phase bridge of the main motor drive circuit and the backup motor drive circuit, and zero-point calibration of the current sampling circuit, wherein, as an example, the pulse width of the micro-pulse can be 50μs; a sensor self-test, including verification of the validity of the sensor signal level and the legality of the logic state; and a communication link self-test, including confirmation of heartbeat frame transmission and response and verification of communication node handshake connection. In this way, the electronic brake control unit completes a comprehensive test of the control chip, drive circuit, sensors, and communication link after power-on and before entering the working mode, preventing the electronic brake control unit from entering the working mode in the presence of potential hardware defects.

[0130] Furthermore, the motor control method provided in this application embodiment may also include a three-level watchdog monitoring mechanism. Here, a watchdog refers to a mechanism used to monitor the program's running status and trigger recovery when the program runs abnormally. Specifically, the first level is an independent hardware watchdog, periodically fed by the main safety task. If the watchdog times out, it triggers a hardware reset of the control chip of the electronic braking control unit. As an example, the timeout time of the independent hardware watchdog can be 8ms. The second level is a software task monitoring timer array, assigning an independent timer to each critical task. When a task times out, it attempts partial recovery rather than a complete reset. As an example, the software task monitoring timer array can contain six timers, corresponding to the motor control task, communication management task, fault detection task, state machine management task, communication node management task, and linkage control task, respectively. Their timeout times can be 2ms, 50ms, 5ms, 20ms, 50ms, and 2ms, respectively. The third level is a control logic consistency check, where critical control variables are independently calculated and compared at the end of each control cycle. If the results are inconsistent, a safety-side output is executed. In this way, task-level anomalies result in partial restarts, peripheral-level anomalies require module reinitialization, and system-level anomalies require hardware resets, achieving tiered recovery and avoiding unnecessary system-wide resets that could lead to system-wide interruptions.

[0131] Furthermore, the motor control method provided in this application embodiment may also include fault data recording. Specifically, after the brake motor switching process is completed, the electronic brake control unit can write the fault type, occurrence timestamp, and data snapshots from multiple control cycles prior to the switching into a non-volatile storage area, and send a fault alarm frame to the vehicle controller and instrument display unit via the communication bus. In this way, diagnostic information can be provided after a fault occurs, providing a basis for after-sales maintenance.

[0132] Furthermore, the main brake motor and the backup brake motor can each independently drive a set of transmission mechanisms. These two transmission mechanisms act on opposite sides of the brake disc, or at different positions on the same side of the brake disc. Compared to a scheme where the main brake motor and the backup brake motor share a transmission mechanism, this scheme offers greater redundancy; even if one transmission mechanism jams, the other can still operate independently.

[0133] To facilitate understanding of the hardware foundation upon which the motor control method provided in this application's embodiments relies, the following will be combined with... Figure 5 The hardware architecture of the electronic braking control unit is introduced.

[0134] Figure 5 This is a hardware architecture diagram of an electronic braking control unit provided in an embodiment of this application. (In conjunction with...) Figure 5 As shown, the circuit board of the electronic braking control unit integrates a control chip, a main motor drive circuit, a backup motor drive circuit, a current sampling circuit, a temperature detection circuit, an energy storage element, and a communication interface. The control chip can be a microcontroller unit (MCU), which is a control chip that integrates a processor, memory, and peripheral interfaces onto a single chip.

[0135] Specifically, the main motor drive circuit can employ a three-phase bridge drive circuit, consisting of six power switching transistors forming a three-phase full bridge. This three-phase full bridge converts the DC power supplied by the battery bus into three-phase AC power to drive the brake motor. As an example, the six power switching transistors can be N-channel metal-oxide-semiconductor field-effect transistors (MOSFETs) with a withstand voltage of 60V, a continuous drain current of 10A, and an on-resistance of less than 15mΩ. They are paired with a dedicated gate driver chip, which incorporates a bootstrap circuit and dead-time insertion function, and the PWM switching frequency can be set to 20kHz. The backup motor drive circuit has the same circuit design as the main motor drive circuit. Both three-phase bridges share the battery bus input, but the power devices and gate driver chips for the two circuits are completely independent. It should be explained that the power devices and gate driver chips are completely independent, which means that the main motor drive circuit and the backup motor drive circuit each use power switching transistors and gate driver chips that are not shared. In this way, the failure of a power device in one circuit will not affect the other circuit, thus avoiding a single point of failure that causes both drive circuits to fail simultaneously.

[0136] Furthermore, current sampling can employ a low-side sampling scheme, with two 5mΩ precision sampling resistors configured on the low side for each three-phase bridge. The sampled signal is then processed by an operational amplifier with a gain of 20 before being input to the MCU's built-in 12-bit analog-to-digital converter (ADC). The sampling frequency is synchronized with the PWM frequency, i.e., 20kHz. Temperature detection can be achieved using two 10kΩ negative temperature coefficient thermistors with a B value of 3950, mounted on the heatsinks of the main motor drive circuit and the backup motor drive circuit, respectively. Temperature data is acquired via the MCU's ADC at a 10ms cycle. The power input of the electronic brake control unit can be configured with a 4700μF / 63V electrolytic capacitor as an energy storage element. This energy storage element provides sustaining power to the electronic brake control unit after a power outage. The bus voltage can be monitored in real-time via a 1:20 resistor divider network connected to the MCU's ADC. The communication interface can use the MCU's built-in Controller Area Network (CAN) controller, an external CAN transceiver chip, and connect to the drive motor controller and the vehicle's CAN bus network via twisted pair cable, with a communication rate of 500kbps.

[0137] It should be noted that the specific values ​​of withstand voltage, current, resistance, frequency, capacity, etc. mentioned above are only illustrative examples. In actual applications, the values ​​can be selected according to the power rating of the brake motor and the electrical platform of the vehicle. This application embodiment does not specifically limit these values.

[0138] Based on the motor control method for electric two-wheeled vehicles provided in the above embodiments, this application can also provide a motor control device for electric two-wheeled vehicles. The motor control device for electric two-wheeled vehicles will be described below with reference to embodiments and accompanying drawings.

[0139] Figure 6 This is a schematic diagram of a motor control device for an electric two-wheeled vehicle, provided as an embodiment of this application. (Combined with...) Figure 6 As shown in the embodiment of this application, the motor control device 600 for an electric two-wheeled vehicle is applied to an electronic brake control unit. The electronic brake control unit includes a main motor drive circuit and a backup motor drive circuit. The main motor drive circuit drives the main brake motor, and the backup motor drive circuit drives the backup brake motor. The main brake motor and the backup brake motor are used to provide drive output to the same brake actuator. The device 600 includes: The fault detection module 601 is used to perform fault detection on the main brake motor and obtain the fault detection result; The circuit switching module 602 is used to switch the drive output from the main motor drive circuit to the backup motor drive circuit when the fault detection result indicates that the main brake motor has a fault, and to control the backup brake motor to start according to the initial drive parameters through the backup motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor failed.

[0140] Optionally, the fault detection result includes the severity of the fault in the main brake motor, and the device 600 further includes: The safety level determination module is used to determine the target safety level of the electronic brake control unit based on the severity of the fault in the main brake motor. The target safety level is one of a plurality of candidate safety levels, which are arranged in ascending order of fault severity, including the first safety level, the second safety level, the third safety level, and the fourth safety level. The logic execution module is used to execute fault control logic corresponding to the target safety level. The fault control logic corresponding to the first safety level is used to control the activation of all functions of the electronic brake control unit. The fault control logic corresponding to the second safety level is used to control the deactivation of the auxiliary control function of the electronic brake control unit. The fault control logic corresponding to the third safety level is used to execute the switching from the main brake motor to the backup brake motor and control the activation of the auxiliary control function through the backup brake motor. The fault control logic corresponding to the fourth safety level is used to output alarm information and control the brake actuator to maintain the established braking force.

[0141] Optionally, the security level determination module is specifically used for: The severity of the fault in the main brake motor is sequentially checked to see if it meets the fault conditions corresponding to the multiple candidate safety levels; If the severity of the fault in the main brake motor meets the fault conditions corresponding to at least one candidate safety level, the candidate safety level with the highest severity of the fault corresponding to the at least one candidate safety level shall be determined as the target safety level.

[0142] Optionally, the circuit switching module 602 is specifically used for: Shut down all drive outputs of the main motor drive circuit; A verification pulse is output to the backup motor drive circuit, and the verification pulse is used to verify the continuity of the drive circuit of the backup motor drive circuit. If the drive circuit conduction verification is successful, the backup motor drive circuit is controlled to drive the backup brake motor according to the initial drive parameters. Based on the position feedback signal of the backup brake motor, a closed-loop control for the standby brake motor is constructed.

[0143] Optionally, the fault detection module 601 is specifically used for: The phase current of the main brake motor is sampled; If the duration of the target state of the phase current within a preset time window exceeds a percentage threshold, the fault detection result is determined to be a progressive overcurrent fault. The target state indicates that the phase current exceeds the overcurrent warning threshold but does not exceed the overcurrent protection threshold. The overcurrent warning threshold is less than the overcurrent protection threshold. If the phase current exceeds the overcurrent protection threshold, the fault detection result is determined to be a fault in the main brake motor. And / or, the step of performing fault detection on the main brake motor and obtaining fault detection results includes: The phase current of the main brake motor is sampled; The waveform factor is obtained by calculating the ratio of the effective value to the average value of the phase current. If the waveform factor deviates from the normal range by more than the deviation threshold, the fault detection result is determined to be an output winding fault.

[0144] Optionally, the fault detection module 601 is specifically used for: The temperature of the heat sink of the main motor drive circuit is collected; The junction temperature of the power device is determined based on the temperature of the heat sink, the power loss of the main motor drive circuit, and the junction-case thermal resistance of the power device. When the junction temperature exceeds the derating threshold, the maximum drive duty cycle of the main motor drive circuit is limited; If the junction temperature exceeds the shutdown threshold, the drive output of the main motor drive circuit is shut off, and the fault detection result is determined to be a fault in the main brake motor, wherein the derating threshold is less than the shutdown threshold.

[0145] Optionally, the device 600 further includes: A voltage monitoring module is used to monitor the bus voltage of the electronic braking control unit; The event determination module is used to determine that a power outage event has occurred when the rate of voltage drop of the bus exceeds a rate threshold or the bus voltage is lower than an undervoltage threshold. The drive output shutdown module is used to drive the brake motor in the start state to rotate to the self-locking position using the electrical energy provided by the energy storage element connected to the electronic brake control unit, and shut off the drive output. The established braking force is maintained through the transmission mechanism of the brake actuator, and the transmission mechanism has a reverse self-locking characteristic.

[0146] Optionally, the device 600 further includes: Wheel speed acquisition module, used to acquire the front wheel speed and rear wheel speed of electric two-wheeler; A slip ratio calculation module is used to calculate the slip ratio based on the front wheel speed and the rear wheel speed; A torque limit request sending module is used to send a torque limit request to the drive motor controller of the electric two-wheeler when the slip ratio exceeds the slip ratio threshold. The torque limit request is used to request a limit on the output torque of the drive motor when it is in the starting state.

[0147] Furthermore, embodiments of this application also provide an electronic device, including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the above-described motor control method for electric two-wheeled vehicles.

[0148] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on an electronic device, cause any of the above-described motor control method for an electric two-wheeled vehicle to be implemented.

[0149] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on describing the differences from other embodiments. The same or similar parts between the various embodiments can be referred to mutually.

[0150] The system disclosed in the embodiments is described in a relatively simple manner because it corresponds to the method disclosed in the embodiments. For relevant details, please refer to the method section.

[0151] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0152] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A motor control method for an electric two-wheeled vehicle, characterized in that, An electronic brake control unit, comprising a main motor drive circuit and a backup motor drive circuit, wherein the main motor drive circuit drives a main brake motor, and the backup motor drive circuit drives a backup brake motor, and the main brake motor and the backup brake motor provide drive output to the same brake actuator, the method comprising: The main brake motor was subjected to fault detection, and the fault detection results were obtained; If the fault detection result indicates that the main brake motor is faulty, the drive output is switched from the main motor drive circuit to the backup motor drive circuit, and the backup brake motor is started according to the initial drive parameters through the backup motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor failed.

2. The motor control method for an electric two-wheeled vehicle according to claim 1, characterized in that, The fault detection result includes the severity of the fault existing in the main brake motor, and the method further includes: Based on the severity of the fault in the main brake motor, the target safety level of the electronic brake control unit is determined. The target safety level is one of multiple candidate safety levels, which are arranged in ascending order of fault severity, including the first safety level, the second safety level, the third safety level, and the fourth safety level. The fault control logic corresponding to the target safety level is executed. The fault control logic corresponding to the first safety level is used to control the activation of all functions of the electronic brake control unit. The fault control logic corresponding to the second safety level is used to control the deactivation of the auxiliary control function of the electronic brake control unit. The fault control logic corresponding to the third safety level is used to execute the switching from the main brake motor to the backup brake motor and control the activation of the auxiliary control function through the backup brake motor. The fault control logic corresponding to the fourth safety level is used to output alarm information and control the brake actuator to maintain the established braking force.

3. The motor control method for an electric two-wheeled vehicle according to claim 2, characterized in that, Determining the target safety level of the electronic brake control unit based on the severity of the fault in the main brake motor includes: The severity of the fault in the main brake motor is sequentially checked to see if it meets the fault conditions corresponding to the multiple candidate safety levels; If the severity of the fault in the main brake motor meets the fault conditions corresponding to at least one candidate safety level, the candidate safety level with the highest severity of the fault corresponding to the at least one candidate safety level shall be determined as the target safety level.

4. The motor control method for an electric two-wheeled vehicle according to claim 1, characterized in that, The step of switching the drive output from the main motor drive circuit to the backup motor drive circuit, and controlling the backup brake motor to start according to the initial drive parameters through the backup motor drive circuit, includes: Shut down all drive outputs of the main motor drive circuit; A verification pulse is output to the backup motor drive circuit, and the verification pulse is used to verify the continuity of the drive circuit of the backup motor drive circuit. If the drive circuit conduction verification is successful, the backup motor drive circuit is controlled to drive the backup brake motor according to the initial drive parameters. Based on the position feedback signal of the backup brake motor, a closed-loop control for the standby brake motor is constructed.

5. The motor control method for an electric two-wheeled vehicle according to any one of claims 1 to 4, characterized in that, The fault detection of the main brake motor, and the resulting fault detection, include: The phase current of the main brake motor is sampled; If the duration of the target state of the phase current within a preset time window exceeds a percentage threshold, the fault detection result is determined to be a progressive overcurrent fault. The target state indicates that the phase current exceeds the overcurrent warning threshold but does not exceed the overcurrent protection threshold. The overcurrent warning threshold is less than the overcurrent protection threshold. If the phase current exceeds the overcurrent protection threshold, the fault detection result is determined to be a fault in the main brake motor. And / or, the step of performing fault detection on the main brake motor and obtaining fault detection results includes: The phase current of the main brake motor is sampled; The waveform factor is obtained by calculating the ratio of the effective value to the average value of the phase current. If the waveform factor deviates from the normal range by more than the deviation threshold, the fault detection result is determined to be an output winding fault.

6. The motor control method for an electric two-wheeled vehicle according to any one of claims 1 to 4, characterized in that, The fault detection of the main brake motor, and the resulting fault detection, include: The temperature of the heat sink of the main motor drive circuit is collected; The junction temperature of the power device is determined based on the temperature of the heat sink, the power loss of the main motor drive circuit, and the junction-case thermal resistance of the power device. When the junction temperature exceeds the derating threshold, the maximum drive duty cycle of the main motor drive circuit is limited; If the junction temperature exceeds the shutdown threshold, the drive output of the main motor drive circuit is shut off, and the fault detection result is determined to be a fault in the main brake motor, wherein the derating threshold is less than the shutdown threshold.

7. The motor control method for an electric two-wheeled vehicle according to any one of claims 1 to 4, characterized in that, The method further includes: Monitor the bus voltage of the electronic braking control unit; A power outage event is determined to have occurred if the rate of voltage drop of the bus exceeds a rate threshold or if the bus voltage falls below an undervoltage threshold. Using the electrical energy provided by the energy storage element connected to the electronic brake control unit, the brake motor in the start state is driven to rotate to the self-locking position, and the drive output is turned off. The established braking force is maintained through the transmission mechanism of the brake actuator, which has a reverse self-locking characteristic.

8. The motor control method for an electric two-wheeled vehicle according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the front and rear wheel speeds of an electric two-wheeler; Calculate the slip ratio based on the front wheel speed and the rear wheel speed; If the slip ratio exceeds the slip ratio threshold, a torque limit request is sent to the drive motor controller of the electric two-wheeler. The torque limit request is used to request a limit on the output torque of the drive motor when it is in the starting state.

9. A motor control device for an electric two-wheeled vehicle, characterized in that, An electronic brake control unit is applied to an electronic brake control unit, the electronic brake control unit including a main motor drive circuit and a backup motor drive circuit, the main motor drive circuit driving a main brake motor, the backup motor drive circuit driving a backup brake motor, the main brake motor and the backup brake motor providing drive output to the same brake actuator, the device comprising: The fault detection module is used to perform fault detection on the main brake motor and obtain the fault detection result. The circuit switching module is used to switch the drive output from the main motor drive circuit to the backup motor drive circuit when the fault detection result indicates that the main brake motor has a fault, and to control the backup brake motor to start according to the initial drive parameters through the backup motor drive circuit. The initial drive parameters are determined based on the drive parameters in the last effective control cycle before the main brake motor failed.

10. An electronic device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform the steps of the motor control method for an electric two-wheeled vehicle according to any one of claims 1 to 8.