Motor controller and control method
By employing adaptive tolerance threshold adjustment, deviation density analysis, and high-frequency sampling, the motor controller achieves highly sensitive and stable fault identification and early warning under different operating conditions, solving the problems of false alarms and missed alarms, and improving the availability and security of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-03-31
AI Technical Summary
Existing motor controllers struggle to balance safety and availability under different operating conditions. Fixed thresholds lead to false alarms or missed alarms, and they lack the ability to identify early fault characteristics in signals.
Adaptive tolerance threshold adjustment, deviation density analysis, and rate of change feature identification are employed, combined with high-frequency sampling, to dynamically adjust monitoring standards in order to identify and suppress faults.
It improves the availability and safety of motor controllers under different operating conditions, reduces false alarm rate, and enables early identification and effective warning of faults.
Smart Images

Figure CN121756931A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electric vehicle power units, and in particular to a control method for a motor controller. Background Technology
[0002] With the increasing popularity of new energy vehicles, the motor controller, as a core component of the power system, directly impacts the safety of the vehicle and its passengers. To meet functional safety standards, motor controllers typically employ a dual-machine redundancy verification architecture. In this architecture, the main control unit calculates the target torque command, while an independent monitoring unit calculates the permissible torque command in parallel, and the two are compared in real time. When the difference between the two exceeds a preset fault threshold and persists for a certain period, the system usually determines that torque is out of control, thereby forcibly triggering safety states such as shutting down the PWM output or actively short-circuiting.
[0003] However, in practical engineering applications, existing monitoring strategies typically employ fixed static tolerance thresholds, which makes it difficult to strike a balance between safety and availability. If the threshold is set too wide, in scenarios where high control precision is required, such as low vehicle speeds or light loads, minute signal drifts or calculation errors may not be detected in time, leading to the risk of missed detections. Conversely, if the threshold is set too tight, under conditions of high vehicle speeds, rapid acceleration, or harsh electromagnetic environments, the inherent thermal noise or signal jitter of the sensors can easily exceed the threshold, causing the system to frequently trigger false shutdowns, significantly reducing vehicle availability and driving experience.
[0004] Furthermore, existing technologies typically focus only on whether the instantaneous amplitude of signal deviation exceeds the limit, neglecting the density and rate of change characteristics of the deviation. In the early stages of many faults, such as sensor aging or poor contact, the signal often initially exhibits high-frequency minute fluctuations or drift trends, before reaching the fault threshold. Due to the lack of ability to perceive these early characteristics, existing technologies cannot intervene in advance at this stage, often only able to wait for the fault to occur, thus missing the best opportunity for preventative verification. Summary of the Invention
[0005] The purpose of this invention is to provide a control method for a motor controller that has the advantages of balancing high sensitivity and high stability, and effectively avoiding false alarms and missed alarms.
[0006] The above-mentioned technical objective of the present invention is achieved through the following technical solution: A control method for a motor controller, applied to a motor controller including a main control unit and an independent monitoring unit. S1: Baseline tolerance anchoring step; The main control unit acquires the current operating condition parameters of the vehicle in real time, and sets the first tolerance threshold T1 for routine monitoring based on the operating condition parameters; S2: Deviation Trend Capture Step; The main control unit acquires its own main control input signal and the monitoring input signal of the independent monitoring unit, and performs real-time differential calculation; If the calculated instantaneous deviation continuously exceeds the first tolerance threshold T1 within M consecutive sampling points, a mutation trigger signal is directly generated; If the instantaneous deviation is within the constraint range of the first tolerance threshold T1, the deviation density parameter of the instantaneous deviation within the sliding time window is calculated; A mutation trigger signal is generated only when the deviation density parameter exceeds the preset warning trigger threshold; otherwise, normal monitoring is maintained at the current first tolerance threshold T1. S3: Adaptive convergence verification step; In response to the mutation trigger signal, the main control unit generates a shrinkage coefficient based on the change rate characteristics of the current signal deviation, and uses the shrinkage coefficient to tighten the first tolerance threshold T1 to the second tolerance threshold T2; S4: State decision and damping reset steps; The main control unit acquires the verification sampling sequence under the constraint of the second tolerance threshold T2; If the instantaneous deviation in the verification sampling sequence continues to exceed the second tolerance threshold T2, it is determined to be a fault lockout state and a degraded operation mode is executed; If the instantaneous deviation in the verification sampling sequence falls back to the range of the second tolerance threshold T2, it enters the damping observation state, maintains the second tolerance threshold T2 until the preset stability condition is met, and then executes a logic reset and restores to the first tolerance threshold T1.
[0007] Further settings: In step S2, the deviation density parameter of the instantaneous deviation within the sliding time window is calculated, specifically including the following sub-steps: S21: The main control unit performs real-time differential calculation between the main control input signal it collects and the monitoring input signal received from the independent monitoring unit to generate an instantaneous deviation sequence; S22: The aggregation index of the instantaneous deviation sequence exceeding the preset benchmark value within the sliding time window is statistically analyzed. The aggregation index is quantified into a deviation density parameter to characterize the frequency trend of signal drift.
[0008] Further settings: In step S3, the shrinkage coefficient is generated, including the following sub-steps: S31: The main control unit calculates the first derivative of the instantaneous deviation with time to determine the rate of change characteristics; S32: Establish a nonlinear mapping relationship between the rate of change characteristic and the shrinkage coefficient, wherein the larger the value of the rate of change characteristic, the smaller the shrinkage coefficient is generated; the main control unit calculates the second tolerance threshold T2 by multiplying the first tolerance threshold T1 by the shrinkage coefficient.
[0009] Further settings: Step S3 also includes the following sub-steps: S33: While generating the second tolerance threshold T2, the main control unit generates a sampling frequency adjustment command; S34: Based on the sampling frequency adjustment command, by adjusting the sampling configuration for the main control input signal, the sampling frequency for the main control input signal is temporarily increased from the normal first frequency to a higher second frequency, so as to improve the time domain resolution of the verification data.
[0010] Further settings: In step S4, entering the damping observation state includes the following sub-steps: S41: Start the damping counter and forcibly lock the effective determination threshold to the second tolerance threshold T2 to shield the instantaneous reset operation triggered by the instantaneous deviation fall in the verification sampling sequence. S42: After entering the damping observation state, the main control input signal and the monitoring input signal are continuously monitored. If the instantaneous deviation of each sampling point does not exceed the second tolerance threshold T2 within N consecutive sampling periods, and the deviation density parameter does not trigger the variation trigger signal again, then the stability condition is determined to be met. S43: In response to the satisfaction of the stability condition, the effective judgment threshold is reset to the first tolerance threshold T1 and the damping counter is cleared.
[0011] Further settings: In step S1, the operating condition parameters include at least vehicle speed and motor load; the main control unit sets the first tolerance threshold T1 in step S1 according to the operating condition parameters; Among them, when the vehicle speed is greater than the preset speed threshold, or when the motor load is greater than the preset load threshold, it is determined to be a high-risk working condition, and the first tolerance threshold T1 is set to the first value. When the vehicle speed is less than or equal to the speed threshold and the motor load is less than or equal to the load threshold, it is determined to be a low-risk operating condition, and the first tolerance threshold T1 is set to the second value. The second value is greater than the first value.
[0012] Further settings: Degraded operating modes in S4 include controlled deceleration shutdown, prohibition of lifting operations, prohibition of acceleration operations, or restriction of driving speed.
[0013] Another object of the present invention is to provide a motor controller, comprising: Main control unit and independent monitoring unit; Memory, used to store computer programs; The main control unit and the independent monitoring unit execute the control method of the motor controller described above by running the computer program.
[0014] Another object of the present invention is to provide a vehicle including the above-described motor controller.
[0015] In summary, the present invention has the following beneficial effects: First, in step S1, the control unit acquires the vehicle's current operating parameters in real time and sets a first tolerance threshold T1 for routine monitoring, breaking away from the rigid mode of using fixed thresholds in traditional technologies. Fixed thresholds often face a dilemma: if set too high, the accuracy is insufficient at low speeds, leading to missed alarms; if set too low, the noise floor is too high at high speeds, leading to false alarms. Through operating condition anchoring, the system establishes a baseline that dynamically floats with vehicle speed and load. Especially in high-risk conditions such as high speeds or heavy loads, the first tolerance threshold T1 is set to a smaller value to tighten the safety baseline. Although this setting is prone to false alarms due to high noise floor in traditional logic, this invention, by combining the deviation density trend capture mechanism in step S2, uses time-domain density rather than simple amplitude detection to identify anomalies, thus successfully reducing the threshold while effectively suppressing false triggers caused by background noise, resolving the contradiction between false alarms and missed alarms, and maximizing system availability without compromising safety.
[0016] In S2, the deviation density parameter within the sliding time window is calculated, and a mutation trigger signal is generated only when the density exceeds the warning trigger threshold. Unlike simple single-point amplitude comparison, introducing density and a time window introduces frequency and trend dimensions. This allows the system to identify signals that, while not exceeding the limit at a single point, exhibit high-frequency jitter or continuous drift. This enables early detection of fault precursors. It effectively distinguishes between sporadic random thermal noise and systemic fault trends, avoiding overreaction to normal fluctuations and providing preventative detection capabilities.
[0017] In S3, in response to the variation signal, a contraction coefficient is generated based on the rate of change characteristics, tightening the first tolerance threshold T1 to the second tolerance threshold T2. This is an adaptive zooming process. When S2 is triggered, the system no longer satisfies the broad T1, but actively tightens the standard T2. This achieves deep focus verification, significantly reduces the false negative rate, and ensures the integrity of functional safety.
[0018] In step S4, if the deviation falls back to the range of T2, the system enters a damped observation state until a preset stability condition is met before performing a logic reset. This step introduces hysteresis or buffering. Without this step, once the signal returns to T2, it immediately relaxes to T1. If the signal is unstable, it will repeatedly jump between T1 and T2, causing system logic oscillation. This step establishes a buffer mechanism for returning to normal. It forces the system to confirm that the signal is truly stable and not a false decline before clearing the alarm, which significantly improves the system's robustness to transient disturbances and prevents control risks caused by logic oscillation.
[0019] Second, by using S21 to differentially analyze the main control and monitoring signals, the comparison of the two signals is transformed into a continuous instantaneous deviation sequence. Then, by using S22, the clustering degree of these deviations exceeding the baseline value is statistically analyzed within a sliding time window and quantified as a deviation density parameter. The essence of this process is a shift from single-point amplitude analysis to time-domain statistical analysis. Traditional single-point comparison easily overlooks the distribution pattern of deviations along the time axis, while this solution, by calculating the clustering degree, can keenly capture the frequency and concentration of deviations. If deviations occur only occasionally, they may be random noise; if deviations occur frequently and densely in a short period, even if the individual amplitude is small, it means that the signal has a systematic drift trend. This solves the problem of overlooking high-frequency minor faults in traditional threshold control, enabling the system to provide early warning by identifying high-density drift trends before a fault fully erupts, significantly improving the dimensionality and depth of diagnosis.
[0020] Third, in step S31, the main control unit calculates the first derivative of the instantaneous deviation over time to determine the rate of change characteristic, and uses a differential operator to extract the dynamic evolution speed of the signal deviation. Conventional amplitude monitoring can only know how large the deviation is, while the first derivative can reveal how fast the deviation is moving. This allows the system to distinguish between slow thermal drift and sudden sensor failure or circuit breakage, providing data support for differentiated processing. Secondly, regarding the establishment of a nonlinear mapping relationship between the rate of change characteristic and the contraction coefficient in step S32, where a larger rate of change characteristic value results in a smaller contraction coefficient, and a second tolerance threshold T2 is calculated accordingly, this is equivalent to a reverse dynamic constraint mechanism. When the signal deviation exhibits a drastic divergence trend, the system does not passively wait for it to reach its original boundary, but instead rapidly reduces the contraction coefficient through nonlinear mapping, actively tightening the tolerance threshold. This mechanism is equivalent to the system automatically compressing its activity space at the moment the signal attempts to escape. Ultimately, this achieves dynamic interception of malignant sudden faults. It solves the problem of delayed response of fixed threshold in the face of fast divergent faults, and ensures that protection can be triggered when the deviation amplitude has not yet reached the absolute high level but changes extremely rapidly. At the same time, the nonlinear mapping retains the tolerance for low rate of change signals, and achieves a balance between fault response speed and false alarm suppression capability.
[0021] Fourth, during steps S33 and S34, the main control unit temporarily increases the sampling frequency of the main control input signal from the normal first frequency to a higher second frequency during the acquisition of the verification sampling sequence, using the physical level to换取 higher information density. In regular monitoring, a lower first frequency is usually used to reduce the processor load; however, during the critical window period when a fault needs to be diagnosed, a low sampling rate may cause aliasing of high-frequency transient interference signals or omission during sampling intervals. By temporarily increasing the frequency, the number of data points acquired by the system per unit time significantly increases, thus greatly enhancing the time-domain resolution of the verification data. This high-resolution sampling enables the system to more completely restore the waveform details of abnormal signals. If the signal is just an extremely short spike, low-frequency sampling may only capture one abnormal point and is easily filtered as noise; while high-frequency sampling can capture multiple consecutive abnormal points, thus verifying its physical authenticity. Ultimately, without increasing the normal computing power burden, the confidence level and response speed of fault confirmation are significantly improved. The problem of sampling loss or confirmation delay that may occur with a fixed sampling rate when facing nanosecond- or microsecond-level transient faults is solved, ensuring that the state adjudication in the subsequent step S4 is based on a high-fidelity and non-omissive data sequence.
[0022] Fifth, in step S41, the damping counter is started and the determination threshold for forced locking to take effect is the second tolerance threshold T2 to shield the immediate reset operation triggered by the instantaneous deviation fallback in the verification sampling sequence, which is equivalent to constructing a one-way hysteresis interval. In regular logic, once the signal falls below the threshold, an alarm is usually immediately released; however, in an environment with complex electromagnetic interference, the signal often exhibits ringing phenomena, that is, it repeatedly jumps above and below the threshold critical point. Forcing the locking of T2 means that the system rejects the instantaneous compliance of the signal and establishes a viewing period that must be passed.
[0023] Secondly, regarding the continuous monitoring of the main control input signal and the monitoring input signal collected after entering the damping observation state in step S42, it is required that the instantaneous deviation does not exceed the second tolerance threshold T2 and the deviation density parameter does not trigger the mutation trigger signal again within N consecutive sampling periods. The core is to perform double verification of time-domain persistence and frequency-domain stability. A simple amplitude fallback (<T2) may just be a fluctuation valley value, and the requirement of N-period persistence excludes occasional fallbacks; while introducing the verification of the deviation density parameter further ensures that the signal not only meets the amplitude standard but also eliminates the high-frequency jitter characteristics in the change trend. Ultimately, the effective filtering of the pseudo-stable state is achieved. The problem of logic oscillation or misreset caused by the repeated fluctuation of the signal in the critical state of the system is solved, ensuring that the system safely returns to regular monitoring (T1) only when the signal truly returns to physical-level stability, greatly enhancing the robustness of the control strategy.
[0024] Sixth, this invention specifies the operating condition parameters as vehicle speed and motor load, and sets a smaller first tolerance threshold when the vehicle is in a high-risk condition characterized by high speed or heavy load, and a larger second tolerance threshold when the vehicle is in a low-risk condition characterized by low speed or light load. This constructs a graded monitoring mechanism that strictly matches the degree of hazard of the operating condition, ensuring that in high-risk scenarios with high kinetic energy and serious harmful consequences, the system can automatically tighten the monitoring scale to maintain extremely high fault sensitivity and safety, while in low-risk scenarios with low kinetic energy and controllable harmful risks, the tolerance range is appropriately relaxed to enhance the system's anti-interference ability and operational smoothness, thereby maximizing the actual availability of the vehicle while ensuring the bottom line of core functional safety. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the overall control method of the motor controller; Figure 2 This is a detailed flowchart of step S1, the benchmark tolerance anchoring step. Figure 3 This is a detailed flowchart of step S2, the deviation trend capture step; Figure 4 This is a detailed flowchart of step S3, the adaptive convergence verification step. Figure 5 This is a detailed flowchart of step S4, the state decision and damping reset step. Detailed Implementation
[0026] The present invention will be further described in detail below with reference to the accompanying drawings.
[0027] A control method for a motor controller, such as Figure 1 As shown, this invention is applied to a motor controller that includes a main control unit and an independent monitoring unit. It is suitable for electric forklifts and stacker cranes that require extremely high control precision and stability. When these vehicles are operating at high load levels, even slight sensor drift can cause mast swaying or cargo tipping, thus necessitating a more stringent active safety monitoring mechanism than conventional vehicles.
[0028] In this embodiment, for the specific application of electric forklifts, the control method of the motor controller first executes step S1, namely the reference tolerance anchoring step.
[0029] like Figure 1 and Figure 2 As shown, in this step, the main control unit first acquires the vehicle's operating condition parameters. These parameters include vehicle speed and motor load. Based on the acquired operating condition parameters, the main control unit sets a first tolerance threshold for routine monitoring.
[0030] The specific setting logic is as follows: The system internally presets speed thresholds and load thresholds. The main control unit compares the real-time collected vehicle speed with the preset speed threshold and the real-time collected motor load with the preset load threshold. When the vehicle speed exceeds the speed threshold, or the motor load exceeds the load threshold, the system determines that it is currently in a high-risk operating condition. In response to the determination of a high-risk operating condition, the main control unit sets the first tolerance threshold to a first value.
[0031] Conversely, when the vehicle speed is less than or equal to the speed threshold, and the motor load is less than or equal to the load threshold, the system determines that it is currently in a low-risk operating condition. In response to the determination of a low-risk operating condition, the main control unit sets the first tolerance threshold to a second value. Specifically, to provide a larger fault tolerance margin under low-risk conditions, the second value is set to be greater than the first value.
[0032] As a specific implementation example, assume the system's preset speed threshold is 10 kilometers per hour, and the preset load threshold is 50% of the rated load. When the vehicle travels at 12 kilometers per hour, regardless of the load, the system classifies it as a high-risk condition because the speed exceeds the speed threshold, and sets the first tolerance threshold to a smaller 3 Nm. However, when the vehicle is crawling at 2 kilometers per hour and the load is only 10% of the rated value, the system classifies it as a low-risk condition because both the speed and load are below their respective thresholds, and sets the first tolerance threshold to a larger 8 Nm.
[0033] like Figure 1 and Figure 3 As shown, after setting the baseline tolerance threshold T1, step S2, namely the deviation trend capture step, is executed immediately.
[0034] The purpose of step S2 is to ensure that even if the current signal deviation has not yet exceeded the hard constraint of the first tolerance threshold T1, the system remains alert to the potential variation trend of the signal and detects fault signs in advance by analyzing the distribution density of the deviation.
[0035] In step S2, the main control unit continuously acquires the main control input signal calculated by itself and the monitoring input signal sent by the independent monitoring unit, and calculates the deviation density parameter of the instantaneous deviation within the sliding time window within the constraint range of the first tolerance threshold T1. Only when the deviation density parameter exceeds the preset warning trigger threshold will the system determine that the signal has an abnormal variation and generate a variation trigger signal; otherwise, it will continue to maintain the current first tolerance threshold T1 for normal monitoring.
[0036] like Figure 3 As shown, in order to achieve the above function, step S2 is broken down into specific sub-steps S21 and S22 for implementation.
[0037] First, step S21 is executed. The main control unit performs real-time differential calculations on the main control input signal it collects and the monitoring input signal received from the independent monitoring unit to generate an instantaneous deviation sequence. During this process, the main control unit first determines whether the latest instantaneous deviation continuously exceeds the first tolerance threshold T1. If it is confirmed to continuously exceed T1, it indicates a significant step change in the signal. The system does not need to perform density statistics and directly generates a mutation trigger signal to proceed to step S3. If the instantaneous deviation does not exceed T1, the subsequent density analysis logic continues. For the determination of whether the instantaneous deviation exceeds T1, it is only considered an abnormal mutation when the instantaneous deviation exceeds T1 for M consecutive control cycles. Millisecond-level electromagnetic interference spikes are eliminated to prevent the system from frequently triggering the verification process due to simple electromagnetic noise under normal high-load operation. M is an integer of 1 or greater than 1.
[0038] Following the aforementioned scenario of high-speed, heavy-load operation of the electric forklift, the first tolerance threshold T1 is now set to a stringent 3 Nm. Under this condition, the main control unit synchronously reads its own torque command value and the permissible torque value from the independent monitoring unit in each control cycle. Assuming that at a certain sampling moment, the torque calculated by the main control unit is 120 Nm, while the torque calculated by the independent monitoring unit is 121.2 Nm, the system immediately calculates the absolute difference between the two as 1.2 Nm. As time progresses, the system continuously repeats this process, arranging the continuously generated differences in chronological order, thus forming a sequence of instantaneous deviations reflecting the dynamic changes in consistency between the two channels.
[0039] Then, step S22 is executed, in which the system statistically analyzes the clustering index of the instantaneous deviation sequence that exceeds the preset benchmark value within the sliding time window, and quantifies the clustering index into a deviation density parameter to characterize the frequency trend of signal drift.
[0040] To illustrate this process more precisely, step S22 is further subdivided into the following sub-steps S221 to S223 for specific implementation.
[0041] First, step S221 is executed. The main control unit allocates a first-in, first-out (FIFO) circular buffer in memory as a sliding time window to store the N most recently generated instantaneous deviation data. For example, the system sets the length N of the sliding time window to 50 sampling points and the sampling period to 10 milliseconds, meaning that the window covers the signal history within the past 500 milliseconds. Whenever a new instantaneous deviation is generated in step S21, this value is pushed into the head of the window, while the oldest data is removed, ensuring that the data within the window always reflects the latest signal state.
[0042] Next, step S222 is executed. The system sets a preset reference value, which is significantly smaller than the first tolerance threshold T1, to distinguish between normal background white noise and abnormal signal drift. Continuing with the above scenario, T1 is 3 Nm, and the system sets the preset reference value to 1.0 Nm. Under normal circumstances, due to the presence of sensor thermal noise, the instantaneous deviation should randomly fluctuate between 0 and 0.5 Nm. At this time, the main control unit traverses the 50 data points within the sliding window and counts the number of data points with values greater than 1.0 Nm, recording this as the abnormal point count.
[0043] Finally, in step S223, the main control unit divides the anomaly count by the total window length N to calculate the deviation density parameter, and compares the deviation density parameter with the preset warning trigger threshold. Assume that the internal circuitry of a torque sensor in the electric forklift is experiencing premature aging, causing high-frequency unidirectional drift in the signal. Although its deviation amplitude has not yet reached the 3Nm alarm threshold, in the most recent 50 sampling points, 40 points have instantaneous deviations fluctuating between 1.2Nm and 1.5Nm. At this point, the anomaly count recorded in step S222 is 40, and the deviation density parameter calculated in step S223 is 0.8. The system's preset warning trigger threshold is 0.6. Since 0.8 is greater than 0.6, this indicates that although the deviation is not exceeded, it exhibits a highly dense abnormal distribution in the time domain. Therefore, the main control unit determines that the deviation trend has changed and immediately generates a change trigger signal, thereby activating the subsequent convergence verification process.
[0044] like Figure 1 and Figure 4 As shown, when the deviation density parameter in step S2 triggers the mutation trigger signal, the process immediately proceeds to step S3, which is the adaptive convergence verification step.
[0045] Step S3 aims to conduct a thorough investigation of suspicious signals by dynamically tightening monitoring standards and improving observation accuracy, forcing potential faults to surface under more stringent conditions. The main control unit responds to the variation trigger signal, generates a contraction coefficient based on the rate of change of the current signal deviation, and uses this contraction coefficient to tighten the first tolerance threshold T1 to the second tolerance threshold T2. To ensure the rigor and feasibility of the verification, step S3 is broken down into several specific sub-processes for implementation.
[0046] like Figure 4 As shown, step S31 is executed first, where the main control unit calculates the first derivative of the instantaneous deviation with time to determine the rate of change characteristics. To accurately capture dynamic changes, step S31 is further refined into sub-steps S311 and S312.
[0047] First, step S311 is executed. The main control unit extracts the instantaneous deviations of the two most recent sampling periods from the cache, denoted as the current instantaneous deviation and the previous instantaneous deviation. Continuing with the aforementioned high-speed, heavy-load scenario of the electric forklift, assuming that at the instant the mutation is triggered, the instantaneous deviation collected by the system at the current moment is 1.8 Nm, while the instantaneous deviation of the previous sampling period, i.e., 10 milliseconds ago, is 1.2 Nm. Although neither of these values exceeds the first tolerance threshold of 3 Nm, they show a rapidly increasing trend.
[0048] Following step S312, the main control unit calculates the first derivative of the deviation, i.e., the rate of change characteristic, using a differential algorithm. The main control unit subtracts the previous instantaneous deviation from the current instantaneous deviation and then divides by the sampling period. In the example above, the main control unit calculates the difference to be 0.6 Nm, divides it by the 0.01-second time interval, and obtains a current signal deviation rate of change of 60 Nm per second. This value quantifies the rate of signal degradation, indicating that the sensor signal is experiencing severe jitter or drift.
[0049] After determining the rate of change characteristics, the main control unit executes step S32 to establish a nonlinear mapping relationship between the rate of change characteristics and the shrinkage coefficient, and calculates the second tolerance threshold T2.
[0050] Step S32 specifically includes sub-steps S321 and S322.
[0051] First, step S321 is executed, where the main control unit inputs the rate of change characteristic calculated in step S312 into a preset shrinkage coefficient lookup table. The lookup table follows a reverse constraint principle: the larger the rate of change, the smaller the coefficient. For example, the system's preset logic is: when the rate of change is below 20 Nm per second, the shrinkage coefficient is 0.8, indicating slight shrinkage; when the rate of change is between 20 Nm and 100 Nm per second, the shrinkage coefficient drops sharply to 0.5, indicating strong shrinkage. In the scenario of 60 Nm per second, the main control unit matches a shrinkage coefficient of 0.5.
[0052] Then, step S322 is executed, where the main control unit uses a contraction factor to perform a weighted calculation on the first tolerance threshold T1. The system multiplies the first tolerance threshold of 3Nm under the current operating condition by a contraction factor of 0.5 to calculate the second tolerance threshold T2 as 1.5Nm. At this point, the monitoring standard is instantly tightened by half. The seemingly compliant instantaneous deviation of 1.8Nm has become a significant exceedance under the new T2 standard, thus providing a stringent judgment basis for subsequent fault diagnosis.
[0053] While generating the second tolerance threshold T2, the system simultaneously executes steps S33 and S34 to adjust the sampling frequency. This process is specifically implemented through sub-steps S331 and S341.
[0054] First, step S331 is executed, whereby the main control unit generates a sampling frequency adjustment command. This command includes a target frequency parameter and a duration parameter. Given that the current signal change rate is as high as 60 nm per second, in order to fully reproduce the signal's millisecond-level fluctuation details and prevent aliasing from obscuring the true waveform, the main control unit decides to enable oversampling mode, generating an adjustment command that increases the sampling frequency by 5 times.
[0055] Finally, in step S341, based on the sampling frequency adjustment command, the main control unit, during the execution of the subsequent S4 verification sampling sequence, temporarily increases the sampling frequency for the main control input signal from the normal first frequency to a higher second frequency by modifying the register configuration of the analog-to-digital converter and interrupt controller. In specific implementation, the main control unit of the electric forklift instantly increases the original normal sampling frequency of 1 kHz to 5 kHz. This means that the system collects torque data every 200 microseconds, greatly improving the time-domain resolution of the verification data and ensuring that every tiny change in the 1.8 Nm deviation signal can be captured and recorded without omission. Crucially, this frequency increase is performed while maintaining the same duration of a single control cycle. Therefore, within one control cycle, the number of sampling points acquired by the main control unit increases proportionally from the original N to 5N. This ensures that the subsequent S4 verification process has both millisecond-level microscopic capture capability and maintains the original macroscopic verification observation duration, ensuring that every tiny change in the 1.8 Nm deviation signal can be captured and recorded without omission.
[0056] like Figure 1 and Figure 5 As shown, after setting the second tolerance threshold and increasing the sampling frequency, the system enters step S4, namely the state decision and damping reset step.
[0057] Step S4 is the core decision-making step of the entire control logic. It aims to use high-resolution real-time data streams to ultimately determine whether the current signal anomaly is a substantial fault that should trigger shutdown protection or a transient interference that can be automatically recovered.
[0058] In step S4, the main control unit executes a high-frequency verification sampling sequence under the strict constraint of the second tolerance threshold of 1.5 Nm. If, during subsequent continuous monitoring, the instantaneous deviation in the verification sampling sequence continues to exceed 1.5 Nm, for example, remains at 1.8 Nm or further increases, the main control unit will determine that the system has entered a fault-locked state and immediately cut off the PWM drive signal to execute a degraded operation mode. Although the instantaneous deviation may still be less than the first tolerance threshold T1, a continuous deviation exceeding T2 indicates that the sensor has lost the high-precision linearity required for heavy-duty operations, and the signal is no longer reliable. Considering the safety requirements of heavy-duty forklifts, the main control unit determines that the system has entered a fault-locked state. Conversely, if the instantaneous deviation in the verification sampling sequence begins to fall back and enters the range of 1.5 Nm, for example, decreasing to 1.2 Nm, the system will not immediately clear the alarm but will instead enter a damped observation state. This state requires maintaining the second tolerance threshold as the verification standard until a preset stability condition is met before performing a logic reset and restoring to the first tolerance threshold of 3 Nm.
[0059] In this embodiment, the degraded operation mode in S4 includes controlled deceleration shutdown, prohibition of lifting operation, prohibition of acceleration operation, or restriction of driving speed operation.
[0060] like Figure 5 As shown, after entering the damping observation state, the system will strictly follow the detailed sub-step process below to ensure the safety of the reset.
[0061] First, step S41 is executed. The main control unit starts the internal damping counter and forcibly locks the effective judgment threshold to the second tolerance threshold of 1.5Nm. This operation masks the system's immediate response to the instantaneous deviation drop. That is, although the current instantaneous deviation of 1.2Nm is less than the alarm line, the system determines that it is still in a high-risk period of ringing or instability and must be forcibly kept in place for observation.
[0062] Finally, steps S42 and S43 are executed. If, within N consecutive sampling periods, the instantaneous deviation of each sampling point successfully falls back to the currently effective judgment threshold range, for example, stabilizing at 0.4 Nm, and the deviation density parameter does not trigger a variation signal again, the system determines that the stability condition is finally met. In response, the main control unit resets the effective judgment threshold to the normal first tolerance threshold of 3 Nm and clears the damping counter, marking the end of this adaptive convergence verification process and the vehicle returning to normal operation mode. The N consecutive sampling periods in step S42 refer to maintaining the total physical verification time unchanged, capturing extremely short-duration signal fluctuations through higher-density sampling data, thereby achieving a more stringent verification of sensor stability.
[0063] This specific embodiment also provides a motor controller, including: a main control unit and an independent monitoring unit, and a memory for storing a computer program; wherein, the main control unit and the independent monitoring unit execute the control method of the motor controller as described above by running the computer program.
[0064] This specific embodiment also provides a vehicle including the above-described motor controller.
[0065] The above embodiments are merely explanations of the present invention and are not intended to limit the present invention. After reading this specification, those skilled in the art can make modifications to these embodiments without contributing any inventive step, but as long as they are within the scope of the claims of the present invention, they are protected by patent law.
Claims
1. A control method for a motor controller, applied to a motor controller including a main control unit and an independent monitoring unit, characterized in that: S1: Baseline tolerance anchoring step; The main control unit acquires the current operating condition parameters of the vehicle in real time, and sets the first tolerance threshold T1 for routine monitoring based on the operating condition parameters; S2: Deviation Trend Capture Step; The main control unit acquires its own main control input signal and the monitoring input signal of the independent monitoring unit, and performs real-time differential calculation; if the calculated instantaneous deviation exceeds the first tolerance threshold T1 continuously within M consecutive sampling points, a mutation trigger signal is directly generated. If the instantaneous deviation is within the constraint range of the first tolerance threshold T1, the deviation density parameter of the instantaneous deviation within the sliding time window is calculated; only when the deviation density parameter exceeds the preset warning trigger threshold is a mutation trigger signal generated, otherwise normal monitoring is maintained at the current first tolerance threshold T1. S3: Adaptive convergence verification steps; In response to the mutation trigger signal, the main control unit generates a shrinkage coefficient based on the rate of change of the instantaneous deviation in step S2, and uses the shrinkage coefficient to tighten the first tolerance threshold T1 to the second tolerance threshold T2. S4: State decision and damping reset steps; The main control unit acquires the verification sampling sequence under the constraint of the second tolerance threshold T2; If the instantaneous deviation in the verification sampling sequence continues to exceed the second tolerance threshold T2, it is determined to be a fault lockout state and a degraded operation mode is executed; If the instantaneous deviation in the verification sampling sequence falls back to the range of the second tolerance threshold T2, it enters the damping observation state, maintains the second tolerance threshold T2 until the preset stability condition is met, and then executes a logic reset and restores to the first tolerance threshold T1.
2. The control method of the motor controller according to claim 1, characterized in that: In step S2, the deviation density parameter of the instantaneous deviation within the sliding time window is calculated, which specifically includes the following sub-steps: S21: The main control unit performs real-time differential calculation between the main control input signal it collects and the monitoring input signal received from the independent monitoring unit to generate an instantaneous deviation sequence; S22: The aggregation index of the instantaneous deviation sequence exceeding the preset benchmark value within the sliding time window is statistically analyzed. The aggregation index is quantified into a deviation density parameter to characterize the frequency trend of signal drift.
3. The control method of the motor controller according to claim 1, characterized in that: In step S3, the shrinkage coefficient is generated, which includes the following sub-steps: S31: The main control unit calculates the first derivative of the instantaneous deviation with time to determine the rate of change characteristics; S32: Establish a nonlinear mapping relationship between the rate of change characteristic and the shrinkage coefficient, wherein the larger the value of the rate of change characteristic, the smaller the shrinkage coefficient is generated; the main control unit calculates the second tolerance threshold T2 by multiplying the first tolerance threshold T1 by the shrinkage coefficient.
4. The control method of the motor controller according to claim 1, characterized in that: Step S3 also includes the following sub-steps: S33: While generating the second tolerance threshold T2, the main control unit generates a sampling frequency adjustment command; S34: Based on the sampling frequency adjustment command, by adjusting the sampling configuration for the main control input signal, the sampling frequency for the main control input signal is temporarily increased from the normal first frequency to a higher second frequency, so as to improve the time domain resolution of the verification data.
5. The control method of the motor controller according to claim 1, characterized in that: In step S4, entering the damping observation state includes the following sub-steps: S41: Start the damping counter and forcibly lock the effective determination threshold to the second tolerance threshold T2 to shield the instantaneous reset operation triggered by the instantaneous deviation fall in the verification sampling sequence. S42: After entering the damping observation state, the main control input signal and the monitoring input signal are continuously monitored. If the instantaneous deviation of each sampling point does not exceed the second tolerance threshold T2 within N consecutive sampling periods, and the deviation density parameter does not trigger the variation trigger signal again, then the stability condition is determined to be met. S43: In response to the satisfaction of the stability condition, the effective judgment threshold is reset to the first tolerance threshold T1 and the damping counter is cleared.
6. The control method of the motor controller according to claim 1, characterized in that: In step S1, the operating condition parameters include at least vehicle speed and motor load; the main control unit sets the first tolerance threshold T1 in step S1 according to the operating condition parameters. Among them, when the vehicle speed is greater than the preset speed threshold, or when the motor load is greater than the preset load threshold, it is determined to be a high-risk working condition, and the first tolerance threshold T1 is set to the first value. When the vehicle speed is less than or equal to the speed threshold and the motor load is less than or equal to the load threshold, it is determined to be a low-risk operating condition, and the first tolerance threshold T1 is set to the second value. The second value is greater than the first value.
7. The control method of the motor controller according to claim 1, characterized in that: The degraded operating modes in S4 include controlled deceleration shutdown, prohibition of lifting operations, prohibition of acceleration operations, or restriction of driving speed.
8. A motor controller, characterized in that, include: Main control unit and independent monitoring unit; Memory, used to store computer programs; The main control unit and the independent monitoring unit execute the control method of the motor controller as described in any one of claims 1 to 7 by running the computer program.
9. A vehicle, characterized in that, Includes the motor controller as described in claim 8.