Zero-point dynamic learning method and device, computer device and storage medium
By performing online dynamic sampling and multiple redundancy verification of zero-point current during the PWM turn-off window, the problems of drift tracking and fault diagnosis in traditional zero-point current detection methods are solved, achieving real-time accuracy of current measurement and high system reliability, and meeting functional safety standards.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI LEEKR TECHNOLOGY CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-05-29
AI Technical Summary
Traditional zero-point current detection methods cannot track dynamic drift in real time, and the calibration and initialization are too tightly coupled, lacking online sensing and fault diagnosis capabilities, resulting in decreased current measurement accuracy and system stability issues.
By utilizing the PWM shutdown window period for online dynamic sampling of zero-point current, combined with moving average processing and multiple redundancy verification mechanisms, real-time dynamic updating of the zero-point reference and fault diagnosis are achieved, ensuring current measurement accuracy and system robustness.
It achieves real-time dynamic self-adaptation of the zero-point reference under all operating conditions, eliminates calibration blind spots, improves current measurement accuracy and system operational reliability, meets functional safety standards, and requires no additional hardware costs.
Smart Images

Figure CN122109602A_ABST
Abstract
Description
Technical Field
[0001] This application relates to a zero-point dynamic learning method, apparatus, computer equipment, and storage medium, belonging to the field of zero-point current detection technology. Background Technology
[0002] Zero-point current sensing technology is a crucial supporting component in motor drive control systems. It uses the voltage across a sampling resistor measured under zero-current conditions as a reference, and its accuracy directly determines the initial precision of the entire current sensing channel, ultimately affecting the control quality and operational stability of the drive system.
[0003] like Figure 1 As shown, in a motor drive control system, the current detection channel, as the core of the sampling link, has its zero-point reference calibration accuracy constituting the main source of initial error for the entire link. During the entire signal transmission process, the zero-point deviation is superimposed as a DC bias, causing a fixed offset between the current feedback sample value and the actual phase current value of the motor. This ultimately manifests as torque pulsation and steady-state error at the system level, and in severe cases, even oscillation. Therefore, establishing an accurate, stable, and repeatable zero-point reference calibration and adjustment mechanism is a crucial foundation and prerequisite for achieving high-performance motor current closed-loop control.
[0004] Faced with the stringent requirements of motor drive for current measurement accuracy and long-term stability, the traditional zero-point current detection method, which relies on the self-learning of the pre-driver chip during power-on initialization, has the following shortcomings: (1) Static reference cannot track dynamic drift: Zero-point calibration is only performed once when the chip is powered on, and cannot compensate for deviations caused by temperature drift and time drift during operation; (2) The calibration and initialization are too tightly coupled: There is a lack of a dynamic calibration mechanism that is independently triggered at runtime, and it is impossible to detect the slow drift of the sampling link online; (3) Fixed zero bias continues to affect the system: The sampling link inside the pre-drive chip has a non-zero output (zero bias) in the true zero current state. After this fixed error is solidified, it will continue to be superimposed on all sampling data, which seriously affects the control quality of the current loop.
[0005] Regarding the first question, the industry practice is to continuously collect N sets of sampling resistor voltages under zero-current conditions during the system power-on or pre-driver chip initialization phase, calculate their arithmetic average as a fixed zero-point reference, and store it in the chip register.
[0006] Regarding the second issue, existing technologies typically encapsulate the zero-point acquisition logic into an independent function and decouple it from the initialization process. The system calls this function during the power-on initialization phase to complete the initial calibration; during operation, when the motor is stationary or under other conditions that meet the calibration requirements, the upper-layer application can actively call this function to re-execute the zero-point acquisition, thereby providing limited compensation for slow drift.
[0007] Regarding the third question, the industry generally requires the integration of zero-bias acquisition and compensation processes during the pre-driver chip initialization phase, specifically as follows: When the system is powered on and the motor is stationary, N sets of sampling resistor voltage data are continuously acquired, and their arithmetic average is calculated as the zero-point bias value and stored; during normal operation, the original voltage value sampled in real time by the ADC is subtracted from the zero-point bias to obtain the compensated effective current data.
[0008] The above are conventional technical solutions for zero-point current calibration in traditional motor drives, but many problems still exist in actual implementation: (1) The zero-point reference is calibrated only when the power is on and cannot track the drift during operation: the calibration is only performed once during the initialization phase and the obtained reference is cold. After the motor is running, factors such as temperature rise and device aging will cause the zero-point characteristics of the sampling link to drift, and the static reference cannot be adjusted accordingly, causing the accuracy of current measurement to gradually decrease over time.
[0009] (2) The timing of calibration is not consistent, and there are blind spots in compensation: There is a lack of unified standards for judging the "stationary state" of a motor (such as speed threshold, duration, etc.). Different developers implement it in different ways, which can easily lead to incorrect zero-point sampling under non-zero current conditions due to inaccurate judgment, thus introducing greater errors. The drift of the sampling link is a continuous and slow process, while the traditional scheme only performs discrete calibration at specific times. The drift between two calibrations cannot be compensated in time, resulting in a significant compensation blind spot. The calibration action needs to be actively invoked by the upper-level application and must be performed under preset safe operating conditions such as when the motor is stationary. It cannot be automatically triggered during normal PWM modulation operation of the motor, which limits the calibration opportunities.
[0010] (3) Lack of zero-point reference validity monitoring and fault diagnosis mechanism: This scheme only completes the subtraction compensation of the zero-point bias, without real-time monitoring of the validity of the zero-point reference itself. When the sampling channel fails (such as op-amp saturation or ADC failure), the system cannot detect it and continues to use the failed zero-point bias for compensation, resulting in completely incorrect current measurement results. This design lacks the ability to perform redundant verification and fault diagnosis of the zero-point reference, making it difficult to meet the online monitoring and fault tolerance requirements of functional safety standards such as ISO 26262 for the current detection channel. Summary of the Invention
[0011] In view of this, this application provides a zero-point dynamic learning method, apparatus, computer device, and storage medium. This application utilizes the inherent zero-current characteristic of the PWM turn-off window period to replace the traditional static calibration that relies on power-on initialization, thereby realizing real-time dynamic adaptation of the zero-point reference across the entire operating range.
[0012] The first aspect of this application discloses a zero-point dynamic learning method applied to a motor drive system, the method comprising: Determine the number of pulse width modulation cycles used for zero-point dynamic learning; During the power transistor turn-off window period in each pulse width modulation cycle, a trigger signal is generated; In response to the trigger signal, the first voltage data collected by the sampling resistor during the power transistor turn-off window is acquired; The zero-point voltage estimate is calculated based on the first voltage data from multiple pulse width modulation cycles. The dynamic zero-point reference value is calculated based on the zero-point voltage estimate and the current zero-point reference value.
[0013] Furthermore, after calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the method further includes: Real-time acquisition of the second voltage data of the sampling resistor; Subtract the dynamic zero-point reference value from the second voltage data to obtain the zero-point compensated voltage value; The zero-point compensated voltage value is converted into a current value and output to the application layer.
[0014] Furthermore, the calculation of the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value includes: Assign a first weight α to the zero-point voltage estimate and a second weight 1-α to the current zero-point reference value; where α is an update coefficient greater than 0 and less than or equal to 1. Calculate the product of the zero-point voltage estimate and the first weight; Calculate the product of the current zero-point baseline value and the second weight; The two products are added together, and the result is used as the dynamic zero-point reference value.
[0015] Furthermore, the method also includes: If multiple consecutive sampled values collected within multiple consecutive power transistor turn-off windows are all within the preset threshold range, then the sampled values will be used as the current zero-point reference value. If the difference between a sampled value and the average or median of other sampled values in the same group exceeds a preset outlier threshold, then that sampled value will be discarded as an outlier.
[0016] Furthermore, based on the dual analog-to-digital conversion channel for sampling resistance acquisition, the method further includes: Calculate the difference between sampled values of the dual channels during different power transistor turn-off windows; If the difference is less than or equal to the channel threshold, the dual-channel sampling is considered reliable. If the difference is greater than the channel threshold, the channel status is determined to be abnormal and one of the following fault tolerance strategies is executed: i. Select the sampled value from one of the channels for subsequent calculations; ii. Maintain the use of static zero-point reference values.
[0017] Furthermore, after calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the method further includes: Calculate the historical benchmark trend value based on multiple historical dynamic zero-point benchmark values; Calculate the deviation between this dynamic zero-point benchmark value and the historical benchmark trend value; If the deviation is less than or equal to the trend tolerance threshold, the dynamic zero-point reference value is considered reliable.
[0018] Furthermore, after calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the method further includes: Read the static zero-point reference value; Calculate the drift between the sampled value and the static zero-point reference value; If the drift is less than or equal to the system drift threshold, then the dynamic zero-point reference value is considered reliable. Among them, the sampled value belongs to the first voltage data.
[0019] A second aspect of this application discloses a zero-point dynamic learning device applied to a motor drive system, the device comprising: The determination module is used to determine the number of pulse width modulation cycles used for zero-point dynamic learning; The generation module is used to generate a trigger signal during the power transistor turn-off window period in each pulse width modulation cycle; The acquisition module is used to acquire the first voltage data collected by the sampling resistor during the power transistor turn-off window period in response to the trigger signal. The first calculation module is used to calculate the zero-point voltage estimate based on the first voltage data of multiple pulse width modulation cycles. The second calculation module is used to calculate the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value.
[0020] A third aspect of this application discloses a computer-readable storage medium comprising a stored program, wherein the program, when running, controls the execution of the zero-point dynamic learning method of the above embodiments in the processor of the device.
[0021] A fourth aspect of this application discloses a computer device, the computer device including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed by the zero-point dynamic learning method of the above embodiments.
[0022] Compared with the prior art, the embodiments of this application have the following beneficial effects: (1) Dynamic online sampling and real-time compensation: This invention utilizes the power transistor turn-off window period within each PWM cycle to perform online dynamic sampling of the zero-point current, enabling the zero-point reference to be updated in real time with the operating conditions, thereby effectively compensating for the drift caused by temperature changes and the passage of time, and ensuring the current measurement accuracy of the motor under all operating conditions.
[0023] (2) Cycle-by-cycle synchronization with no calibration blind spot: The present invention can perform zero sampling and reference update in each PWM cycle, which is completely synchronized with the motor modulation process, realizing real-time zero compensation cycle by cycle, and fundamentally eliminating the calibration blind spot in the traditional scheme.
[0024] (3) Multiple Redundancy Verification and Fault Diagnosis: This invention introduces a verification mechanism based on time redundancy, channel redundancy, and cross-cycle data redundancy, and performs cross-verification with a static benchmark. This design can effectively distinguish between normal slow zero-point drift and sudden failures in the sampling channel, thereby significantly improving the system's operational robustness and meeting the diagnostic capability requirements of functional safety standards such as ISO 26262.
[0025] (4) Pure software implementation with zero additional cost: This invention is entirely based on software implementation. Its core lies in cleverly utilizing the power transistor turn-off window naturally present in PWM control as the sampling trigger timing. This design does not require any additional hardware circuits, nor does it occupy additional MCU computing resources, thus achieving high-precision and high-reliability dynamic zero-point calibration and online fault diagnosis without increasing system cost. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0027] Figure 1 This is a block diagram illustrating the mechanism of zero-point current detection in a motor drive system.
[0028] Figure 2This is a flowchart of a zero-point dynamic learning method. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] To eliminate the dependence on static initialization reference for zero-point current sensing, achieve real-time dynamic calibration during operation, and meet the dual constraints of lightweight code and system real-time performance, this embodiment proposes an online sampling strategy based on the synchronous shutdown window of the power transistor. This strategy utilizes the inherent gap of the current naturally returning to zero within each pulse width modulation (PWM) cycle, and continuously acquires and averages the voltage of the sampling resistor using an analog-to-digital converter (ADC), thereby dynamically updating the zero-point reference and ultimately ensuring the accuracy and consistency of current sensing under all operating conditions. The specific implementation scheme is as follows: Example 1: like Figure 2 As shown, Figure 2 This is a flowchart of a zero-point dynamic learning method. This zero-point dynamic learning method is applied to a motor drive system and includes the following steps: S101. Determine the number of pulse width modulation cycles used for zero-point dynamic learning.
[0032] The number of PWM cycles can be 8, 16, or 32. In this embodiment, zero-point dynamic learning is performed using multiple consecutive PWM cycles.
[0033] S102. Generate a trigger signal during the power transistor turn-off window period in each pulse width modulation cycle.
[0034] S103. In response to the trigger signal, acquire the first voltage data collected by the sampling resistor during the power transistor turn-off window.
[0035] The PWM module outputs a synchronization signal that triggers ADC sampling during the power transistor's turn-off window. In this embodiment, when the PWM module drives the power transistor to turn off synchronously, it generates a trigger signal and sends it to the ADC control logic; this signal precisely corresponds to the brief window period during which the current loop naturally returns to zero. The ADC then continuously samples the voltage across the sampling resistor during this window period, thereby acquiring the raw voltage data (i.e., the first voltage data) reflecting the current zero-point state of the sampling link. Thus, the sampling action is completely synchronized with the PWM cycle and can be automatically executed in each switching cycle, fundamentally eliminating the dependence on specific operating conditions or manual triggering.
[0036] Optionally, to reduce CPU (Central Processing Unit) intervention and lower system overhead, DMA (Direct Memory Access) can be used to directly transfer the raw voltage data acquired by the ADC to a designated memory buffer.
[0037] S104. Calculate the zero-point voltage estimate based on the first voltage data of multiple pulse width modulation cycles.
[0038] In this embodiment, the moving average filtering module processes the sampled values of multiple consecutive PWM cycles and calculates their arithmetic mean or weighted average to suppress the influence of transient noise such as electromagnetic interference and power transistor turn-off ringing on the sampling results, thereby obtaining a stable zero-point voltage estimate.
[0039] In another embodiment, in the voltage data of multiple PWM cycles that are continuously acquired, the maximum and minimum values are first removed, and then the average value of the remaining data is calculated to obtain a simplified zero-point voltage estimate.
[0040] S105. Calculate the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value.
[0041] In this embodiment, the zero-point voltage estimate obtained through moving average filtering is input to the dynamic zero-point reference update module. This module fuses the newly calculated zero-point estimate with the currently used zero-point reference value. The fusion process can employ first-order low-pass filtering or a gradual tracking strategy (e.g., Zero_new = α × Zero_sampled + (1-α) × Zero_old) to achieve smooth updates of the reference value and effectively suppress reference abrupt changes caused by single-sample anomalies or noise interference. Finally, the updated zero-point reference value is written into the system RAM for storage as the latest valid reference for subsequent real-time compensation calculations of the current loop.
[0042] For example, each round consists of 8 PWM cycles (cycles 1 to 8). The current zero-point reference value can be selected from the sampled value of the eighth or ninth cycle that meets the preset conditions, or the dynamic zero-point reference value of the previous round can be used.
[0043] Furthermore, after calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the following steps are also included: Step 1. Acquire the second voltage data of the sampling resistor in real time.
[0044] Step 2. Subtract the dynamic zero-point reference value from the second voltage data to obtain the zero-point compensated voltage value.
[0045] Step 3. Convert the zero-point compensated voltage value into a current value and output it to the application layer.
[0046] During normal current sampling, the ADC acquires the voltage across the sampling resistor in real time, obtaining the raw voltage value V_raw (second voltage data). The current compensation module then reads the current dynamic zero-point reference V_zero from the zero-point reference register and calculates the compensated voltage value: V_compensated = V_raw - V_zero. This compensated value is then sent to the current conversion module, converted into the actual current detection value, and output to the upper-layer application. This compensation operation is performed synchronously in each PWM cycle, ensuring the real-time performance and accuracy of current measurement.
[0047] This embodiment enables real-time dynamic tracking of the zero-point reference in response to factors such as temperature changes and device aging, fundamentally eliminating the continuous degradation of current measurement accuracy caused by zero-point drift in traditional static calibration schemes. Furthermore, this process is fully synchronized with the PWM cycle, introducing no additional scheduling overhead and not affecting the real-time operating efficiency of the motor control system.
[0048] To ensure the reliability of zero-point current detection, this embodiment also introduces a redundancy verification mechanism. Specifically, the redundancy verification mechanism in this embodiment includes the following four implementation methods: (1) Time redundancy check: The voltage of the sampling resistor is sampled multiple times during several consecutive PWM off-window periods. By comparing the results of each sampling, the validity of the zero-point sampling data is self-checked and fault-tolerant. (1-1) Consistency check: If the sampled values are within the preset threshold range for N consecutive times (N≥3), one of the sampled values or the average of multiple sampled values will be used as the current zero-point reference value, which can be used for subsequent zero-point reference update calculation.
[0049] (1-2) Outlier Removal: During the sampling process, if the difference between a sampled value and the average or median of other sampled values in the same group exceeds the preset outlier threshold, it is determined that the sample may be affected by transient electromagnetic interference or ringing shutdown, and should be discarded as an outlier and not participate in the zero-point reference update.
[0050] (2) Channel redundancy check: Different channels of the same ADC are reused to sample the voltage of the sampling resistor during different PWM shutdown windows, and the two sampling results are compared. In this embodiment, the difference between the sampled values of the two channels during different power transistor shutdown windows is calculated; if the difference is less than or equal to the channel threshold, the dual-channel sampling is determined to be reliable (i.e., both channels are working normally); if the difference is greater than the channel threshold, the channel status is determined to be abnormal and one of the following fault tolerance strategies is executed: i. Select the sampled value of one of the channels for subsequent calculations.
[0051] ii. Maintain the use of static zero-point reference values.
[0052] It should be noted that the system selects to trust one of the paths or roll back to the static baseline based on the preset strategy.
[0053] (3) Cross-cycle redundancy check: Based on multiple historical dynamic zero-point benchmark values, calculate the historical benchmark trend value (historical mean); calculate the deviation between the dynamic zero-point benchmark value and the historical benchmark trend value; if the deviation is less than or equal to the trend tolerance threshold, the dynamic zero-point benchmark value is determined to be reliable; if the deviation is greater than the trend tolerance threshold, it is determined to be an abnormal event, the zero-point benchmark update is temporarily suspended, and the number of samplings is increased for secondary confirmation.
[0054] (4) Cross-validation with static benchmark: The zero-point voltage (sampled value during PWM shutdown) dynamically acquired during operation is compared with the static zero-point reference value obtained through self-learning during the power-on initialization phase. If the drift of both is within the expected range (e.g., considering normal drift caused by temperature changes), the dynamic zero-point reference value is determined to be reliable; if the drift continues to exceed the limit and cannot be explained by combining other redundancy verification results, the sampling channel may be faulty, and the system triggers a warning or fault alarm.
[0055] The four redundancy verification methods described above can be used in combination and serially. When any verification method detects an anomaly, the system will perform corresponding actions based on the severity and duration of the anomaly, including but not limited to: discarding the abnormal sampled value, suspending the zero-point reference update, triggering a warning or fault alarm, reverting to the static zero-point reference, and shutdown protection.
[0056] By introducing a redundancy verification mechanism, this invention can effectively distinguish between normal zero-point drift (such as slow changes caused by temperature changes or device aging) and sudden faults in the sampling channel (such as operational amplifier saturation, ADC failure, resistor short circuit or open circuit), significantly improving the reliability and robustness of zero-point current detection and meeting the online diagnostic requirements of functional safety standards such as ISO 26262 for current detection channels.
[0057] Example 2: Embodiments of this application also provide a zero-point dynamic learning device applied to a motor drive system, the device comprising: The determination module is used to determine the number of pulse width modulation cycles used for zero-point dynamic learning.
[0058] The generation module is used to generate a trigger signal during the power transistor turn-off window period in each pulse width modulation cycle.
[0059] The acquisition module is used to acquire the first voltage data collected by the sampling resistor during the power transistor turn-off window period in response to the trigger signal.
[0060] The first calculation module is used to calculate the zero-point voltage estimate based on the first voltage data of multiple pulse width modulation cycles.
[0061] The second calculation module is used to calculate the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value.
[0062] Example 3: Embodiments of this application also provide a computer device, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention during runtime.
[0063] The aforementioned memory can refer to devices inside a computer used to store data and programs, including RAM, hard disks, etc. RAM can be used to temporarily store running programs and data, while hard disks can be used to store programs and data long-term. Memory enables the computer to read and write data and execute programs. The aforementioned processor is responsible for executing instructions in computer programs and performing data processing. It can also be responsible for controlling and executing various operations, including arithmetic operations, logical operations, and data transmission.
[0064] Example 4: Embodiments of this application also provide a computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of the present invention.
[0065] The aforementioned computer storage media can refer to the media used in computer memory to store certain discontinuous physical quantities. Computer storage media mainly include semiconductors, magnetic cores, magnetic drums, magnetic tapes, laser discs, etc. Computer-readable storage media include stored programs, which can be a set of instructions that a computer can recognize and execute, running on an electronic computer to meet certain information needs.
[0066] Example 5: Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of the present invention.
[0067] The aforementioned computer program products can refer to software programs that have been written, tested, and released, and can run on computers or other devices. Computer program products can include application programs, operating systems, utility software, etc., used to achieve specific functions or solve specific problems.
[0068] Example 6: Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the methods in various embodiments of the present invention.
[0069] The aforementioned non-volatile computer-readable storage medium can refer to a medium for storing data. Non-volatile computer-readable storage media can retain data without loss when power is off and can be used to store long-term data, such as operating systems, applications, and user files. Non-volatile storage media can include hard disk drives, solid-state drives, optical disks, and flash memory storage devices, etc.
[0070] Example 7: Embodiments of this application also provide a computer program that, when executed by a processor, implements the methods described in the various embodiments of the present invention.
[0071] The aforementioned computer program can refer to a set of instructions used to tell the computer to perform specific tasks or operations. Computer programs can be written by programmers using specific programming languages and can include algorithms, data structures, logic, and control flow. Computer programs can be used for a variety of purposes, including application software, operating systems, etc.
[0072] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0073] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0074] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0075] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0076] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0077] In summary, 1) This invention utilizes the inherent zero-current characteristic of the PWM turn-off window period to replace the traditional static calibration relying on power-on initialization, achieving real-time dynamic adaptation of the zero-point reference across the entire operating range. 2) This invention utilizes continuous ADC sampling and moving average processing synchronized with the PWM cycle to replace the traditional single or intermittent zero-point acquisition method, enabling zero-point updates in every switching cycle and completely eliminating time blind spots. 3) This invention utilizes a multi-dimensional redundant diagnostic system based on multi-cycle cross-calibration in the time domain, channel cross-verification, and comparison with the static reference, replacing the traditional sampling scheme based on a single channel, a single moment, and without verification, achieving accurate identification of normal drift and hardware faults, significantly enhancing the system's fault tolerance. 4) This invention utilizes a PWM window synchronous acquisition and dynamic compensation algorithm implemented entirely in embedded software to replace the traditional hardware compensation scheme relying on high-precision devices or external circuits, achieving highly reliable dynamic zero-point calibration with zero incremental hardware cost.
[0078] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A zero-point dynamic learning method, characterized in that, Applications in motor drive systems, including: Determine the number of pulse width modulation cycles used for zero-point dynamic learning; During the power transistor turn-off window period in each pulse width modulation cycle, a trigger signal is generated; In response to the trigger signal, the first voltage data collected by the sampling resistor during the power transistor turn-off window is acquired; The zero-point voltage estimate is calculated based on the first voltage data from multiple pulse width modulation cycles. The dynamic zero-point reference value is calculated based on the zero-point voltage estimate and the current zero-point reference value.
2. The zero-point dynamic learning method according to claim 1, characterized in that, After calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the method further includes: Real-time acquisition of the second voltage data of the sampling resistor; Subtract the dynamic zero-point reference value from the second voltage data to obtain the zero-point compensated voltage value; The zero-point compensated voltage value is converted into a current value and output to the application layer.
3. The zero-point dynamic learning method according to claim 1, characterized in that, The calculation of the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value includes: Assign a first weight α to the zero-point voltage estimate and a second weight 1-α to the current zero-point reference value; where α is an update coefficient greater than 0 and less than or equal to 1. Calculate the product of the zero-point voltage estimate and the first weight; Calculate the product of the current zero-point baseline value and the second weight; The two products are added together, and the result is used as the dynamic zero-point reference value.
4. The zero-point dynamic learning method according to claim 1, characterized in that, The method further includes: If multiple consecutive sampled values collected within multiple consecutive power transistor turn-off windows are all within the preset threshold range, then the sampled values will be used as the current zero-point reference value. If the difference between a sampled value and the average or median of other sampled values in the same group exceeds a preset outlier threshold, then that sampled value will be discarded as an outlier.
5. The zero-point dynamic learning method according to claim 1, characterized in that, The method for acquiring sampling resistance based on dual analog-to-digital conversion channels further includes: Calculate the difference between sampled values of the dual channels during different power transistor turn-off windows; If the difference is less than or equal to the channel threshold, the dual-channel sampling is considered reliable. If the difference is greater than the channel threshold, the channel status is determined to be abnormal and one of the following fault tolerance strategies is executed: i. Select the sampled value from one of the channels for subsequent calculations; ii. Maintain the use of static zero-point reference values.
6. The zero-point dynamic learning method according to claim 1, characterized in that, After calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the method further includes: Calculate the historical benchmark trend value based on multiple historical dynamic zero-point benchmark values; Calculate the deviation between this dynamic zero-point benchmark value and the historical benchmark trend value; If the deviation is less than or equal to the trend tolerance threshold, the dynamic zero-point reference value is considered reliable.
7. The zero-point dynamic learning method according to claim 1, characterized in that, After calculating the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value, the method further includes: Read the static zero-point reference value; Calculate the drift between the sampled value and the static zero-point reference value; If the drift is less than or equal to the system drift threshold, then the dynamic zero-point reference value is considered reliable. Among them, the sampled value belongs to the first voltage data.
8. A zero-point dynamic learning device, characterized in that, Applications in motor drive systems, including: The determination module is used to determine the number of pulse width modulation cycles used for zero-point dynamic learning; The generation module is used to generate a trigger signal during the power transistor turn-off window period in each pulse width modulation cycle; The acquisition module is used to acquire the first voltage data collected by the sampling resistor during the power transistor turn-off window period in response to the trigger signal. The first calculation module is used to calculate the zero-point voltage estimate based on the first voltage data of multiple pulse width modulation cycles. The second calculation module is used to calculate the dynamic zero-point reference value based on the zero-point voltage estimate and the current zero-point reference value.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the zero-point dynamic learning method as described in any one of claims 1 to 7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the zero-point dynamic learning method as described in any one of claims 1 to 7.