Distance calculation system and method, electronic equipment, vehicle, medium and product

By processing the motor ripple current signal with a digital filter, the problem of high cost or insufficient accuracy of existing one-touch power window lifting functions is solved, achieving lower cost and higher accuracy in power window position calculation, thus improving user experience and safety.

CN121829282APending Publication Date: 2026-04-10BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BYD CO LTD
Filing Date
2025-07-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing position calculation solutions for one-touch power window operation have problems such as high cost or insufficient accuracy. In particular, the counting scheme based on Hall sensors and the hardware filtering scheme based on ripple counting without Hall sensors each have their own defects, resulting in high system cost or insufficient stability, which affects user experience and safety.

Method used

A digital filter is used to replace hardware components. The ripple current signal of the motor is obtained and filtered to generate a second ripple current signal. The distance calculation module is used to determine the movement distance of the motor-driven equipment. A low-order Butterworth filter is used for signal processing to reduce costs and improve accuracy.

Benefits of technology

Without compromising accuracy, the system application cost has been reduced, the stability and accuracy of electric window position calculation have been improved, and user experience and safety have been enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121829282A_ABST
    Figure CN121829282A_ABST
Patent Text Reader

Abstract

The invention provides a distance calculation system, a distance calculation method, electronic equipment, a vehicle, a computer readable storage medium and a computer program product. The distance calculation system comprises a digital filter and a motor, and the digital filter is connected with the motor. The digital filter is used for acquiring a first ripple current signal of the motor and filtering the first ripple current signal to generate a second ripple current signal, and the first ripple current signal is a digital signal; and the distance calculation module is connected with the digital filter and is used for determining the movement distance of equipment driven by the motor according to the second ripple current signal. According to the application, the digital filter carries out data filtering on the first ripple current signal to generate the second ripple current signal, and then the ripple number of the second ripple current signal is metered to determine the motion distance of the equipment driven by the motor. The digital filter is used for replacing a hardware component to filter the first ripple current signal, and the application cost of the system can be reduced under the condition that the precision is not affected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive electronic control technology, and in particular to a distance calculation system, distance calculation method, electronic device, vehicle, computer-readable storage medium, and computer program product. Background Technology

[0002] One-touch power windows have become a standard feature in most cars. This function enhances the driver's convenience, while design requirements also emphasize its essential safety performance. One-touch power windows require precise calculation of the window's movement distance or position. Related technologies rely on various hardware components to convert electrical signals into digital signals, and then use these digital signals to calculate the window's movement distance or position. Too many hardware components typically result in high costs. Summary of the Invention

[0003] This application provides a distance calculation system, a distance calculation method, an electronic device, a vehicle, a computer-readable storage medium, and a computer program product.

[0004] According to a first aspect of this application, a distance calculation system is provided, comprising:

[0005] A digital filter and a motor, wherein the digital filter and the motor are connected;

[0006] The digital filter is used to: acquire the first ripple current signal of the motor, and filter the first ripple current signal to generate a second ripple current signal, wherein the first ripple current signal is a digital signal;

[0007] A distance calculation module, connected to the digital filter, is used to determine the movement distance of the device driven by the motor based on the second ripple current signal.

[0008] In some embodiments, the system includes: a data sampling device connected to the motor; the data sampling device is used to acquire real-time current signals during the operation of the motor.

[0009] In some embodiments, the system includes: a data conversion module connected to the data sampling device;

[0010] The data conversion module is used to convert the real-time current signal into the first ripple current signal.

[0011] In some embodiments, the system includes: a storage module connected to the data conversion module;

[0012] The storage module is used to store the first ripple current signal.

[0013] In some embodiments, the digital filter is connected to the storage module;

[0014] The digital filter is used to read the first ripple current signal from the memory address of the storage module.

[0015] In some embodiments, the digital filter is further configured to determine the filter signal frequency coefficient and the filter sampling frequency coefficient of the digital filter based on the current signal of the motor, wherein the filter signal frequency coefficient characterizes the frequency range of the current signal, and the filter sampling frequency coefficient characterizes the sampling frequency at which the current signal is acquired.

[0016] A filtering equation is generated based on the filter signal frequency coefficients and the filter sampling frequency coefficients, and the first ripple current signal is filtered according to the filtering equation to generate the second ripple current signal.

[0017] In some embodiments, the data conversion module includes a high-frequency analog-to-digital converter.

[0018] In some embodiments, the digital filter includes a low-order Butterworth filter.

[0019] According to a second aspect of this application, a distance calculation method is provided, the method being applied to the distance calculation system provided in the first aspect of this application, the method comprising:

[0020] Acquire the first ripple current signal of the motor, wherein the first ripple current signal is a digital signal;

[0021] The first ripple current signal is filtered using a digital filter to generate the second ripple current signal.

[0022] The travel distance of the device driven by the motor is determined based on the second ripple current signal.

[0023] In some embodiments, prior to acquiring the first ripple current signal of the motor, the process includes:

[0024] The real-time current signal during the operation of the motor is acquired, and the real-time current signal is converted into the first ripple current signal.

[0025] In some embodiments, the step of filtering the first ripple current signal based on a digital filter to generate a second ripple current signal includes:

[0026] The filter signal frequency coefficient and filter sampling frequency coefficient of the digital filter are determined based on the current signal of the motor, wherein the filter signal frequency coefficient represents the frequency range of the current signal, and the filter sampling frequency coefficient represents the sampling frequency at which the current signal is acquired; a filter equation is generated based on the filter signal frequency coefficient and the filter sampling frequency coefficient; the first ripple current signal is input into the filter equation to generate the second ripple current signal.

[0027] In some embodiments, inputting the first ripple current signal into the filtering equation to generate the second ripple current signal includes:

[0028] The data format of the first ripple current signal is converted to reduce the computational load of the digital filter.

[0029] In some embodiments, the first ripple current signal is floating-point data, and the conversion of the data format of the first ripple current signal includes:

[0030] Determine the integer and fractional bits of the first ripple current signal, and convert the integer and fractional bits of the first ripple current signal into fixed-point format data.

[0031] In some embodiments, determining the movement distance of the motor-driven device based on the second ripple current signal includes:

[0032] The number of valid waveforms of the second ripple current signal is calculated, and the movement distance of the device is determined by the number of valid waveforms.

[0033] In some embodiments, acquiring the first ripple current signal of the motor further includes:

[0034] The first ripple current signal is read from the memory address in the storage space.

[0035] According to a third aspect of this application, a vehicle window is provided, comprising:

[0036] The distance calculation system and vehicle window glass described in the first aspect of this application;

[0037] The distance calculation system is connected to the vehicle window glass; the distance calculation system is used to determine the movement distance of the vehicle window glass.

[0038] According to a fourth aspect of this application, an electronic device is provided, characterized in that it comprises:

[0039] A memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to perform the distance calculation method described in the second aspect of the present application.

[0040] According to a fifth aspect of this application, a vehicle is provided, characterized in that it includes the electronic equipment described in the fourth aspect of this application, or includes the vehicle window described in the third aspect of this application.

[0041] According to a sixth aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that the computer program is executed by a processor using the distance calculation method described in a second aspect of this application.

[0042] According to a seventh aspect of this application, a computer program product is provided, characterized in that it includes a computer program or instructions, which are executed by a processor using the distance calculation method described in a second aspect of this application.

[0043] This application uses a digital filter to filter the first ripple current signal to generate a second ripple current signal, and then measures the number of ripples in the second ripple current signal to determine the movement distance of the equipment driven by the motor. Compared with the prior art, using a digital filter instead of hardware components to filter the first ripple current signal can reduce the system application cost without affecting the accuracy. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments 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 these drawings without creative effort.

[0045] To gain a more complete understanding of this application and its beneficial effects, the following description will be provided in conjunction with the accompanying drawings, wherein the same reference numerals in the following description denote the same parts.

[0046] Figure 1 This is a schematic diagram of a distance calculation system architecture provided in an exemplary embodiment of this application;

[0047] Figure 2 This is a schematic diagram of a distance calculation system architecture provided in another related technology in an exemplary embodiment of this application;

[0048] Figure 3 This is a schematic diagram of a distance calculation system architecture provided in one exemplary embodiment of this application;

[0049] Figure 4 This is a schematic diagram of another distance calculation system architecture provided in one exemplary embodiment of this application;

[0050] Figure 5 This is a schematic diagram comparing a second ripple current signal and a related technology input MCU ripple current signal provided in an exemplary embodiment of this application;

[0051] Figure 6 This is a schematic diagram comparing a first ripple current signal and a second ripple current signal provided in an exemplary embodiment of this application;

[0052] Figure 7 This is a schematic flowchart of a distance calculation method provided in an exemplary embodiment of this application;

[0053] Figure 8 This is a schematic diagram of spectrum analysis of a raw ripple signal provided in an exemplary embodiment of this application; Figure 9 This is a schematic diagram of an electronic device structure provided in an exemplary embodiment of this application. Detailed Implementation

[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0056] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0057] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0058] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0059] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0060] In the description of the embodiments of this application, unless otherwise expressly specified and limited, the technical terms such as "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium, or a connection through a network. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application according to the specific circumstances.

[0061] One-touch power windows have become a standard feature in most cars. This function enhances driver convenience, while design requirements also emphasize essential safety features such as anti-pinch and emergency stop functions. To achieve these functions, precise calculation and memorization of the window motor's real-time position are required. Currently, there are two mature position calculation architectures on the market: Hall sensor-based counting schemes and Hall-less ripple counting hardware filtering schemes.

[0062] Option 1: Counting scheme based on Hall sensor

[0063] This solution uses a magnetic ring and Hall effect sensor mounted on the motor shaft to detect motor pulse signals, thereby calculating the window position and rotation speed. Its architecture diagram is shown below. Figure 1The Hall sensor-based counting scheme includes a Hall sensor and a signal conditioning circuit, where the signal conditioning circuit includes hardware electronic components such as comparators and level shifters. Specifically, the Hall sensor detects changes in the magnetic field. When the motor shaft rotates, the change in the magnetic field on the motor's magnetic ring is accurately captured by the Hall sensor, generating pulse signals. Using these pulses, the microcontroller unit (MCU) can accurately calculate the motor's speed and the window's position. This scheme is technically mature, highly accurate, and has a fast response speed, but it requires a separate sensor and magnetic ring for each window, and the use of these pulses for distance calculation leads to high system costs.

[0064] Option 2: Sensorless Hardware Filtering Circuit Based on Ripple Counting

[0065] This scheme directly acquires the ripple current signal generated by the motor during brush commutation (which contains information about the motor speed and position), and uses low-pass and high-pass filters and amplification circuits to extract the effective information from the ripple signal to calculate the motor speed and position. Its architecture diagram is shown below. Figure 2 The aforementioned solution includes an active filter circuit, sampling resistors, and a low-frequency analog-to-digital converter (ADC). The active filter circuit also includes operational amplifier circuits, capacitors, comparators, and other electronic components. While this solution eliminates the need for a high-cost Hall sensor, signal processing still relies on numerous hardware voltage components and circuits. This reliance on hardware voltage components and circuits leads to stability issues, primarily because hardware circuits (such as bandpass filters and differential amplifiers) have high precision requirements for electronic components and are susceptible to temperature drift and electromagnetic interference. Furthermore, due to the non-ideal characteristics of ripple current signals, such as irregular and uneven ripple waveforms during low-speed operation and motor commutation, hardware filters may fail to extract effective ripple current signals. This can cause problems with position counting, resulting in the loss of anti-pinch and one-touch window lifting functions, reducing user experience and even posing safety hazards.

[0066] The above solutions either use high-cost hardware and electronic components such as filtering circuits (as in Solution 1) to calculate the window position, but this is costly and space-consuming; or they use other hardware and complex electronic components such as filtering circuits (as in Solution 2) to calculate the window position, but this is not accurate enough.

[0067] Considering the MCU capabilities of mass-produced vehicles, this solution involves a lightweight software design and hardware / software adaptation that controls additional MCU costs. The hardware / software co-design scheme reduces costs while ensuring filtering performance, providing a more competitive solution for relevant application scenarios.

[0068] Specifically, this application provides a distance calculation system, including:

[0069] A digital filter and a motor, wherein the digital filter and the motor are connected;

[0070] The digital filter is used to: acquire the first ripple current signal of the motor, and filter the first ripple current signal to generate a second ripple current signal, wherein the first ripple current signal is a digital signal;

[0071] A distance calculation module, connected to the digital filter, is used to determine the movement distance of the device driven by the motor based on the second ripple current signal.

[0072] like Figure 3 As shown, the distance calculation system proposed in this application includes a digital filter 301, a motor 100, and a distance calculation module 302. The digital filter 301 is connected to both the distance calculation module 302 and the motor 100. The digital filter 301 and the distance calculation module 302 are typically located within the vehicle's MCU. The digital filter 301 is used to acquire a first ripple current signal from the motor 100 and filter the first ripple current signal to generate a second ripple current signal.

[0073] When the motor 100 is working, the carbon brushes of the motor rotate on the circumferential surface of the commutator. Due to the periodic change in the contact state between the commutator segments and the carbon brushes, the circuit resistance fluctuates, and the resulting ripple-shaped signals are the ripple current signals of the motor. A large spike in the ripple current signal represents the peak of a ripple.

[0074] The digital filter 301 needs to process the acquired first ripple current signal of the motor 100, which is a digital signal converted from the ripple current signal of the motor 100. After acquiring the first ripple current signal, the digital filter 301 filters the first ripple current signal to generate a second ripple current signal. The waveform of the second ripple current signal is basically the same as that of the first ripple current signal, except that the second ripple current signal is filtered to purify it and eliminate noise and interference.

[0075] Then, the distance calculation module 302 determines the movement distance of the device driven by the motor 100 based on the second ripple current signal.

[0076] Typically, motor 100 includes a motor rotor. The rotation of the motor rotor drives motor 100 to move the equipment. Therefore, the number of rotations of the motor rotor can represent the distance the motor 100 drives the equipment to move.

[0077] like Figure 4The figure shows a comparison between the second ripple current signal of this application and the current signal input to the distance calculation module 302 in related technologies. As can be seen from the figure, the second ripple current signal used for distance calculation in this application has a higher sampling frequency and denser ripples per unit time (with more concentrated peak and trough values), making it closer to the original ripple current signal generated by the motor. Therefore, the error value in the distance calculation process is relatively lower.

[0078] The second ripple current signal includes multiple peaks and troughs. Each peak and trough represents one revolution of the motor rotor. By counting the peaks and troughs of the second ripple current signal, the movement distance of the equipment driven by the motor 100 can be determined.

[0079] This application uses a digital filter to filter the first ripple current signal to generate a second ripple current signal, and then measures the number of ripples in the second ripple current signal to determine the movement distance of the equipment driven by the motor. Compared with the prior art, using a digital filter instead of hardware components to filter the first ripple current signal can reduce the system application cost without affecting the accuracy.

[0080] In some embodiments, the system includes: a data sampling device connected to the motor, the data sampling device being used to acquire real-time current signals during the operation of the motor.

[0081] Optional, such as Figure 5 As shown, the system of this application also includes a data sampling device 201, which is connected to the motor 100 and is used to sample the real-time current signal during the operation of the motor 100. The continuous real-time current signal can form a ripple current signal.

[0082] In some embodiments, the system includes: a data conversion module connected to a data sampling device;

[0083] The data conversion module is used to convert the real-time current signal into the first ripple current signal.

[0084] Optionally, the system of this application also includes a data conversion module 202, which is connected to the data sampling device 201 and converts the continuous real-time current signal sampled by the data sampling device 201 into a first ripple current signal.

[0085] Optionally, the data conversion module includes a high-frequency analog-to-digital converter.

[0086] Optionally, the data sampling device 201 can be a sampling resistor. After the motor 100 is powered on or receives a control command to move, the sampling resistor samples the current signal of the motor 100 line in real time to form the original ripple current signal. Then, the data conversion module 202 converts the real-time collected original ripple current signal into the first ripple current signal and stores it.

[0087] Typically, the data conversion module 202 is an analog-to-digital converter (ADC), which is a device specifically designed to convert current signals into digital signals. In this application, because the sampled current signal has a relatively high frequency, the data conversion module 202 includes a high-frequency ADC, which converts the continuous real-time current signal sampled by the data sampling device 201 into a high-frequency first ripple current signal.

[0088] This application uses a high-frequency analog-to-digital converter combined with a digital filter 301 to reduce the need for excessive hardware or electronic components in the distance calculation system to filter the real-time current signal of the motor 100. Excessive hardware or electronic components have higher costs, and this application can reduce application costs by reducing the number of costly hardware or electronic components.

[0089] In some embodiments, the system includes: a storage module connected to the data conversion module; the storage module is used to store the first ripple current signal.

[0090] Optionally, the system of this application also includes a storage module 203, which is connected to the data conversion module 202. The data conversion module 202 generates a first ripple current signal, which is usually stored in the storage module 203.

[0091] In some embodiments, the digital filter is connected to the storage module; the digital filter is used to read the first ripple current signal from the memory address of the storage module.

[0092] Optionally, the digital filter 301 is connected to the storage module 203, and the digital filter 301 obtains the first ripple current signal from the storage module 203.

[0093] Preferably, the storage module 203 is a register. To improve the data transmission efficiency of the distance calculation system, the storage module 203 is preferably configured as a register. After the data conversion module 202 generates the first ripple current signal, it directly writes the first ripple current signal into the register. Simultaneously, the digital filter 301 directly reads the first ripple current signal by accessing the memory address of the register. This zero-copy data transmission method for the first ripple current signal, where the digital filter 301 directly accesses the memory address of the register to read the first ripple current signal, saves data transmission time and memory.

[0094] However, the risk of this approach lies in certain scenarios. After the data conversion module 202 converts the original ripple current signal into a first ripple current signal, the digital filter 301 must immediately read the first ripple current signal from the memory address of the register. If the processing cycle is exceeded, the newly generated data will overwrite the unprocessed data. However, in low-to-medium speed applications such as window position detection, this approach will not affect the calculation accuracy.

[0095] In some embodiments, the digital filter is further configured to determine the filter signal frequency coefficient and the filter sampling frequency coefficient of the digital filter based on the current signal of the motor, wherein the filter signal frequency coefficient represents the frequency range of the current signal, and the filter sampling frequency coefficient represents the sampling frequency at which the current signal is acquired; generate a filtering equation based on the filter signal frequency coefficient and the filter sampling frequency coefficient, and filter the first ripple current signal according to the filtering equation to generate the second ripple current signal.

[0096] Optionally, before using the digital filter 301, it is necessary to determine the filter signal frequency coefficient and the filter sampling frequency coefficient of the digital filter 301. The filter signal frequency coefficient and the filter sampling frequency coefficient of the digital filter 301 are obtained through experiments or machine learning by analyzing the signal sampling frequency of the original ripple current of the motor 100 to be used.

[0097] Typically, the frequency range and sampling frequency of the current signal from motor 100 represent the motion parameters of motor 100. Therefore, different motors 100 have different frequency ranges, and the sampling frequency of the motor 100's current signal also affects the data accuracy of the sampled ripple current signal to some extent. Thus, for different motors 100, the filter signal frequency coefficients and filter sampling frequency coefficients of the filtering equation of digital filter 301 are different. Similarly, in the process of filtering the first ripple current signal through the filtering equation, by acquiring the ripple current signals of multiple motors and performing differential processing calculations, and combining the filter signal frequency coefficients and filter sampling frequency coefficients, the ripple current signal in the experimental process of motor 100 can be differentially processed to determine the filter's ripple signal coefficients. These ripple signal coefficients can be used as reference calculation coefficients for the first ripple current signal during the filtering process.

[0098] The digital filter 301 generates a filtering equation using the filter signal frequency coefficient and the filter sampling frequency coefficient. After the digital filter 301 acquires the first ripple current signal, it inputs the first ripple current signal into the filtering equation to generate the second ripple current signal.

[0099] Compared with hardware filters, digital filter 301 has the advantages of fast response speed, low cost, fast calculation speed, and can be adjusted according to the basic characteristics of motor 100 (such as the number of coil turns and the number of magnetic poles), making it suitable for processing the second ripple current signal.

[0100] Optionally, the digital filter includes a low-order Butterworth filter.

[0101] Digital filter 301 preferentially uses a low-order Butterworth filter. Low-order Butterworth filters have the maximum flatness in the passband, and the frequency response curve remains almost horizontal with no fluctuations. They are especially suitable for application scenarios such as those in this application that require preserving the original ripple current signal characteristics as much as possible. At the same time, low-order Butterworth filters have design flexibility. Especially in digital signal processing, low-order Butterworth filters require less computational resources and have a faster response speed. In addition, low-order Butterworth filters have less impact on system bandwidth and phase distortion, making them suitable for scenarios such as those in this application that require real-time processing of ripple current signals.

[0102] like Figure 6The diagram shows a comparison of the first and second ripple current signals at different stages of this application. Specifically, the first ripple signal is the first ripple current signal during the motor 100 startup phase; the second ripple signal is the second ripple current signal generated after filtering the first ripple current signal during the motor 100 startup phase using digital filter 301; the third ripple signal is the first ripple current signal during the motor 100 operation phase; the fourth ripple signal is the second ripple current signal generated after filtering the first ripple current signal during the motor 100 operation phase using digital filter 301; the fifth ripple signal is the first ripple current signal during the motor 100 stop phase; and the sixth ripple signal is the second ripple current signal generated after filtering the first ripple current signal during the motor 100 stop phase using digital filter 301.

[0103] As can be seen from the figure, the first ripple current signal is a waveform with spikes and a large fluctuation range. The second ripple current signal after being filtered by digital filter 301 is a smooth waveform with a small fluctuation range. The smooth ripple can be used to determine the peak of the effective waveform through the waveform judgment algorithm.

[0104] This application also provides a distance calculation method, which is applied to the aforementioned distance calculation system, such as... Figure 7 As shown, the method includes:

[0105] S701: Acquire the first ripple current signal of the motor, wherein the first ripple current signal is a digital signal;

[0106] When calculating the movement distance of the device driven by motor 100, it is first necessary to obtain the first ripple current signal of motor 100, which is a digital signal converted from the ripple current signal of motor 100.

[0107] In some embodiments, prior to acquiring the first ripple current signal of the motor, the process includes:

[0108] The real-time current signal during the operation of the motor is acquired, and the real-time current signal is converted into the first ripple current signal.

[0109] Before acquiring the first ripple current signal of motor 100, it is necessary to acquire the real-time current signal during the operation of motor 100. When motor 100 is working, the carbon brushes of the motor rotate on the circumferential surface of the commutator. Due to the periodic change in the contact state between the commutator segments and the carbon brushes, the circuit resistance fluctuates, generating ripple-shaped signals, which are the ripple current signals of motor 100. A large spike in the ripple current signal represents the peak of a ripple. During the operation of the device driven by motor 100, a real-time current signal is generated, which then needs to be converted into the first ripple current signal.

[0110] Typically, the real-time current signal during the operation of the motor 100 is acquired by the data sampling device 201, and then the real-time current signal is converted into a first ripple current signal by the data conversion module 202.

[0111] Optionally, the data sampling device 201 preferably uses a sampling resistor, which can accurately sample the real-time current signal of the motor 100 in real time.

[0112] Optionally, the data conversion module 202 employs a high-frequency analog-to-digital converter (ADC). Because the sampled current signal has a relatively high frequency, the data conversion module 202 includes a high-frequency ADC, which converts the continuous real-time current signal sampled by the data sampling device 201 into a high-frequency first ripple current signal.

[0113] In some embodiments, acquiring the first ripple current signal of the motor further includes: reading the first ripple current signal from the memory address of the storage module.

[0114] After the data conversion module 202 converts the real-time current signal into a first ripple current signal, it stores the first ripple current signal in the storage module 203. To improve the data transmission efficiency of the distance calculation system, the storage module 203 is preferably configured as a register. After generating the first ripple current signal, the data conversion module 202 directly writes the first ripple current signal into the register. Simultaneously, the digital filter 301 directly obtains the first ripple current signal by reading the memory address of the register. This zero-copy data transmission method for the first ripple current signal—that is, the digital filter 301 directly accesses the memory address of the register to read the first ripple current signal—saves data transmission time and memory, thereby improving data transmission efficiency.

[0115] S702: The first ripple current signal is filtered by digital filter 301 to generate a second ripple current signal;

[0116] After acquiring the first ripple current signal, the digital filter 301 filters the first ripple current signal to generate the second ripple current signal. The digital filter 301 typically purifies the first ripple current signal by inputting it into a filtering equation, eliminating noise and spurious signals to generate the second ripple current signal. Because the second ripple current signal, after conversion from the first ripple current signal, can more accurately determine the number of rotations of the motor rotor during the operation of the motor 100, the error in the distance calculation process is relatively lower, resulting in higher data accuracy.

[0117] In some embodiments, the step of filtering the first ripple current signal based on the digital filter 301 to generate the second ripple current signal includes:

[0118] The filter signal frequency coefficient and filter sampling frequency coefficient of the digital filter are determined based on the current signal of the motor, wherein the filter signal frequency coefficient represents the frequency range of the current signal, and the filter sampling frequency coefficient represents the sampling frequency at which the current signal is acquired; a filter equation is generated based on the filter signal frequency coefficient and the filter sampling frequency coefficient; the first ripple current signal is input into the filter equation to generate the second ripple current signal.

[0119] In digital filter 301, it is usually necessary to input the first ripple current signal into the filtering equation to generate the second ripple current signal, so the filtering equation of digital filter 301 needs to be determined.

[0120] The filtering equation of digital filter 301 includes filter signal frequency coefficients and filter sampling frequency coefficients. For different motors 100, the filter signal frequency coefficients and filter sampling frequency coefficients differ because the frequency range of the current signal and the sampling frequency of the first ripple current signal sampled by digital filter 301 vary. Therefore, the filter signal frequency coefficients and filter sampling frequency coefficients of the digital filter 301 corresponding to the motor 100 to be used are usually generated in advance based on the current signal of the motor 100 through pre-training or experimentation.

[0121] The filter signal frequency coefficient represents the frequency range of the current signal of the motor 100 to be used, and the filter sampling frequency coefficient represents the sampling frequency at which the digital filter 301 acquires the motor current signal. After the digital filter 301 generates a filtering equation based on the filter signal frequency coefficient and the filter sampling frequency coefficient, it can be used directly. Then, the first ripple current signal is input into the filtering equation to generate the second ripple current signal.

[0122] Optionally, the digital filter 301 preferably uses a low-order Butterworth filter. The low-order Butterworth filter has a frequency response curve that is as flat as possible within the passband, without ripple or fluctuations, ensuring that the current signal is transmitted without distortion and guaranteeing the authenticity of the second ripple current signal.

[0123] The design of parameters for determining the filtering equation of digital filter 301 based on the circuit signal of motor 100 adopts well-known and mature methods in the field, which have been applied in many projects.

[0124] Taking a low-order Butterworth filter as an example, the filter signal frequency coefficients and filter sampling frequency coefficients of the low-order Butterworth filter are generated based on the original current signal of motor 100 as follows:

[0125] First, the raw ripple current signal of motor 100 needs to be acquired for spectrum analysis, using software or an oscilloscope at a sampling frequency f. s The original ripple signal of motor 100 was acquired, where the sampling frequency f s The frequency is typically greater than or equal to twice the frequency of the original ripple current signal. Then, frequency analysis of the acquired original ripple current signal from the motor 100 yields the current spectrum.

[0126] Based on the spectrum, the required cutoff frequency f for the low-order Butterworth filter can be roughly determined. c1 with f c2 To minimize computational complexity, this scheme uses the lowest order, second-order. The transfer function H(s) of a second-order bandpass low-order Butterworth filter can be expressed as:

[0127]

[0128] Where: ω0=2πf0 is the center angular frequency. The center frequency is Q, which is the quality factor of the low-order Butterworth filter. Q describes the bandwidth characteristics of the low-order Butterworth filter; the larger Q is, the narrower the bandwidth. In this scheme, Q is set to [value missing]. in It refers to bandwidth.

[0129] This configuration is designed to ensure that the low-order Butterworth filter can still effectively select for valid signals. The reasoning is that Q is directly proportional to the center frequency f0; a higher center frequency means the low-order Butterworth filter has stronger selectivity for higher frequency signals. Conversely, Q is inversely proportional to the bandwidth Δf; a narrower bandwidth means the low-order Butterworth filter has stronger selectivity for the center frequency, allowing only signals closer to f0 to pass through. The final amplitude response of the designed low-order Butterworth filter is as follows: Figure 8 As shown.

[0130] Its two cutoff frequencies f c1 with f c2 The frequency components are preserved as much as possible within the range, while the remaining components are attenuated. Next, the analog filter H(s) of the continuous system needs to be converted into the digital filter 301H(z) of the discrete system. This scheme uses bilinear transform mapping, a theoretically mature and widely used mapping method that can most realistically preserve the response characteristics of the continuous domain. Its formula 1 is as follows:

[0131] in

[0132] Substituting s into H(s) and simplifying, we can obtain H(z), as shown in Formula 2:

[0133]

[0134] The filter signal frequency coefficients b0, b1, b2 and the filter sampling frequency coefficients a1, a2 of a low-order Butterworth filter can be obtained through basic algebraic operations.

[0135] In a low-order Butterworth filter, the standard form of the difference equation is shown in Equation 3:

[0136] y[n]=b0×x[n]+b1×x[n-1]+b2×x[n-2]-a1×y[n-1]-a2

[0137] ×y[n-2]

[0138] Where x[n] represents the original ripple current signal (with noise) acquired by N at the current time, x[n-1] and x[n-2] represent the original ripple current signals at the previous 1 and 2 time points, respectively, y[n] represents the filtered clean signal calculated by N at the current time, and y[n-1] and y[n-2] represent the filtered clean signals at the previous 1 and 2 time points, respectively. In the above formula, x[n-1], x[n-2], y[n-1], and y[n-2] are the ripple signal coefficients of the low-order Butterworth filter that need to be determined.

[0139] For the discrete-domain digital filter 301, the output of the digital filter 301 can be represented by a difference equation as a linear combination of the current input and past outputs, replacing x[n] with Input, y[n] with Output, and y[n-1] with V. n-1 ,y[n-2] is replaced with V n-2 Then, the filtering calculation formula for the low-order Butterworth filter can be obtained, which is shown in Formula 4:

[0140] V n =Input+(a1*V n-1 )+(a2*V n-2 )

[0141] Output = (b0 * V) n )+(b1*V n-1 )+(b2*V n-2 )

[0142] In the above formula, Output and Input represent the input (first ripple current signal) and output (second ripple current signal) of the low-order Butterworth filter, respectively, where V n V n-1 V n-2 These are the ripple signal coefficients of the low-order Butterworth filter, b0, b1, b2 are the filter signal frequency coefficients of the low-order Butterworth filter, and a1, a2 are the filter sampling frequency coefficients of the low-order Butterworth filter.

[0143] In digital filter 301, the first ripple current signal is filtered and calculated using preset filter data to obtain the second ripple current signal. Specifically, as shown in Formula 4 above, the second ripple current signal can be calculated using the first ripple current signal, the filter signal frequency coefficient, the filter sampling frequency coefficient, and the filter ripple signal coefficient. The detailed parameter calculation process will not be elaborated here. In Formula 4, Ioutput is the first ripple current signal, and Output is the filtered second ripple current signal.

[0144] At this point, the first ripple current signal with spikes and a large fluctuation range can be processed by the digital filter 301 to generate a smooth second ripple current signal with a small fluctuation range. The smooth second ripple current signal can then be used to determine the peak of the effective waveform through a waveform judgment algorithm.

[0145] In some embodiments, inputting the first ripple current signal into the filtering equation to generate the second ripple current signal includes:

[0146] The data format of the first ripple current signal is converted to reduce the computational load of the digital filter.

[0147] When the first ripple current signal is input into the filtering equation through the digital filter 301 to generate the second ripple current signal, the high sampling frequency and large data volume of the first ripple current signal result in a large computational load on the digital filter 301, affecting the computational efficiency and the final calculation result. Therefore, it is necessary to convert the data format of the first ripple current signal to reduce the computational load of the digital filter 301, improve the computational efficiency, and ensure the calculation result.

[0148] In some embodiments, the first ripple current signal is floating-point data, and the conversion of the data format of the first ripple current signal includes:

[0149] Determine the integer and fractional bits of the first ripple current signal, and convert the integer and fractional bits of the first ripple current signal into fixed-point format data.

[0150] Typically, the first ripple current signal is floating-point data. It's necessary to determine the integer and fractional bits of the first ripple current signal, converting them to fixed-point format data for calculation, thus improving the computational efficiency of the microcontroller unit (MCU). Fixed-point format data is a numerical representation method in computers, its core characteristic being that the decimal point position is pre-fixed and remains unchanged during calculation; all numerical operations are based on this fixed decimal point.

[0151] Specifically, the amplitude range of the first ripple current signal of motor 100 is usually predicted, ranging from zero to the stall current, which is typically around 10A. Therefore, the required number of decimal and integer digits can be determined based on the amplitude range of the first ripple current signal. Then, the decimal places of the first ripple current signal are converted to fixed-point format, and rules for fixed-point multiplication and overflow protection (data overflow may occur in fixed-point arithmetic) are set. Finally, real-time calculation is performed. The core idea of ​​fixed-point arithmetic is to simulate decimal arithmetic using integer variables, fixing the decimal point at a fixed position in the value, and using shift operations instead of floating-point arithmetic. Compared to floating-point arithmetic, this has a shorter execution cycle and can achieve higher efficiency at the hardware level. Fixed-point arithmetic does not require special hardware modifications; only code adjustments are needed, making the method widely applicable.

[0152] S703: Determine the movement distance of the device driven by the motor based on the second ripple current signal.

[0153] After obtaining the second ripple current signal, the distance calculation module 302 calculates the number of valid waveforms of the second ripple current signal, and then determines the movement distance of the device driven by the motor 100 based on the number of valid waveforms.

[0154] The second ripple current signal is a smooth waveform with a small fluctuation range. The smooth ripple allows the waveform identification algorithm to determine the peaks or troughs of the valid waveform. Two adjacent peaks or troughs represent one circumference of the motor rotor. Taking the maximum value identification algorithm as an example, this algorithm analyzes the second ripple current signal, collecting peak and trough values ​​to generate a data set for calculating the motor's travel distance. If the distance is calculated using peak values, the entire dataset is a set of peak values; if it's calculated using trough values, the entire dataset is a set of trough values.

[0155] The distance calculation module 302 calculates the running distance of the motor 100 using the peak value set of the second ripple current signal, including directly using the number of maximum values ​​in the peak value set as the distance. For example, if the peak value set of the second ripple current signal shows 1300 maximum values, the running distance of the motor 100 can be represented as 1300 ripples. Typically, two adjacent ripples represent one revolution of the motor rotor. Optionally, it can also be calculated using the number of ripples and the circumference of the motor rotor. If the circumference of the motor rotor is D, then the running distance of the motor 100 is (1300-1)*D. In different systems, the running distance of the motor 100 is usually recorded using different methods. These methods of recording the running distance of the motor 100 can all be accurately calculated in the system program.

[0156] This application uses a digital filter to filter a first ripple current signal to generate a second ripple current signal. Then, the number of ripples in the second ripple current signal is measured to determine the movement distance of the motor-driven equipment. Compared to existing technologies, using a digital filter instead of hardware components to filter the first ripple current signal reduces system application costs without affecting accuracy. A third aspect of this application provides a vehicle window, including:

[0157] A distance calculation system and a vehicle window glass are provided in a first aspect embodiment; the distance calculation system and the vehicle window glass are connected; the distance calculation system is used to determine the movement distance of the vehicle window glass.

[0158] By calculating the distance of the motor 100's coil movement using the distance calculation method, the lifting distance of the car window during the lifting process can be accurately determined. Based on this lifting distance, the window's position can be determined. For example, if the coil movement distance of the car window motor 100 is 500 ripples, the lifting distance of the car window is 500 ripples. Then, based on 500 ripples and the window's dimensions, the vehicle's lifting position can be accurately determined, thus accurately determining the anti-pinch function and one-touch window lifting function.

[0159] The vehicle window of this application eliminates costly and space-consuming hardware and other electronic components in the distance calculation system of the vehicle window. By leveraging the high performance of the vehicle MCU and setting a digital filter 301, the original ripple current signal of the motor 100 is processed and calculated to determine the lifting position of the vehicle. This reduces the cost of the vehicle window without affecting the calculation accuracy.

[0160] This application embodiment also provides an electronic device, the electronic device comprising:

[0161] Memory and processor;

[0162] The memory stores a computer program, and the processor is used to run the computer program in the memory to execute the distance calculation method of the present application embodiment.

[0163] Figure 9 This is a structural block diagram of an electronic device according to an embodiment of the present invention.

[0164] like Figure 9 As shown, the electronic device 900 includes a processor 901 and a memory 904. The processor 901 and the memory 904 are connected, for example, via a bus 902. Optionally, the electronic device 900 may also include a transceiver 804. It should be noted that in practical applications, the transceiver 804 is not limited to one type, and the structure of this electronic device 900 does not constitute a limitation on the embodiments of the present invention.

[0165] Processor 901 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 901 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0166] Bus 902 may include a pathway for transmitting information between the aforementioned components. Bus 902 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 902 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0167] The memory 904 stores a computer program corresponding to the data processing method of the above embodiments of the present invention, which is executed by the processor 901. The processor 901 executes the computer program stored in the memory 904 to implement the content shown in the foregoing method embodiments.

[0168] Among them, electronic devices 900 include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device 900 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0169] The electronic device of this application uses a digital filter 301 to filter the first ripple current signal to generate a second ripple current signal, and then measures the number of ripples in the second ripple current signal. Compared with the prior art, using a digital filter instead of hardware components to filter the first ripple current signal can reduce the system application cost without affecting the accuracy.

[0170] This application also provides a vehicle, which includes the electronic equipment of this application embodiment or the vehicle window of this application embodiment.

[0171] The vehicle can be a gasoline-powered vehicle, a plug-in hybrid electric vehicle, or a new energy vehicle, etc., and this application does not make any specific restrictions on this.

[0172] The vehicle window distance calculation system of this application eliminates costly and space-consuming hardware and other electronic components. By leveraging the high performance of the vehicle MCU and setting a digital filter, it processes and calculates the vehicle's lifting position by more closely resembling the original ripple current signal of the motor. This reduces the cost of the window without affecting accuracy.

[0173] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The vehicle's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the vehicle to perform the distance calculation method provided in the various optional implementations described above.

[0174] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0175] According to one aspect of this application, a computer-readable storage medium is provided that stores instructions that, when executed by a processor, configure the processor to perform the distance calculation method described above.

[0176] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.

[0177] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0178] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0179] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0180] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0181] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash random access memory (flash RAM). Memory is an example of computer-readable media.

[0182] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this article, computer-readable media do not include transient media, such as modulated communication signals and carrier waves.

[0183] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0184] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0185] The embodiments, implementation methods, and related technical features of this application can be combined and substituted for each other without conflict.

[0186] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of this application without departing from the technical solution of this application shall still fall within the scope of the technical solution of this application.

Claims

1. A distance calculation system, characterized in that, include: A digital filter and a motor, wherein the digital filter and the motor are connected; The digital filter is used to: acquire the first ripple current signal of the motor, and filter the first ripple current signal to generate a second ripple current signal, wherein the first ripple current signal is a digital signal; A distance calculation module, connected to the digital filter, is used to determine the movement distance of the device driven by the motor based on the second ripple current signal.

2. The system according to claim 1, characterized in that, include: A data sampling device, wherein the data sampling device is connected to the motor; The data sampling device is used to acquire the real-time current signal during the operation of the motor.

3. The system according to claim 2, characterized in that, include: A data conversion module is connected to the data sampling device; The data conversion module is used to convert the real-time current signal into the first ripple current signal.

4. The system according to claim 3, characterized in that, include: A storage module, which is connected to the data conversion module; The storage module is used to store the first ripple current signal.

5. The system according to claim 4, characterized in that, The digital filter is connected to the storage module; The digital filter is used to read the first ripple current signal from the memory address of the storage module.

6. The system according to claim 5, characterized in that, The digital filter is further used to determine the filter signal frequency coefficient and the filter sampling frequency coefficient of the digital filter based on the current signal of the motor, wherein the filter signal frequency coefficient represents the frequency range of the current signal, and the filter sampling frequency coefficient represents the sampling frequency at which the current signal is acquired. A filtering equation is generated based on the filter signal frequency coefficients and the filter sampling frequency coefficients, and the first ripple current signal is filtered according to the filtering equation to generate the second ripple current signal.

7. The system according to claim 3, characterized in that, The data conversion module includes a high-frequency analog-to-digital converter.

8. The system according to any one of claims 1 to 7, characterized in that, The digital filter includes a low-order Butterworth filter.

9. A distance calculation method, characterized in that, The method includes: Acquire the first ripple current signal of the motor, wherein the first ripple current signal is a digital signal; The first ripple current signal is filtered using a digital filter to generate the second ripple current signal. The travel distance of the device driven by the motor is determined based on the second ripple current signal.

10. The method according to claim 9, characterized in that, Before acquiring the first ripple current signal of the motor, the following steps are included: The real-time current signal during the operation of the motor is acquired, and the real-time current signal is converted into the first ripple current signal.

11. The method according to claim 9, characterized in that, The step of filtering the first ripple current signal using a digital filter to generate the second ripple current signal includes: The filter signal frequency coefficient and filter sampling frequency coefficient of the digital filter are determined based on the current signal of the motor, wherein the filter signal frequency coefficient represents the frequency range of the current signal, and the filter sampling frequency coefficient represents the sampling frequency at which the current signal is acquired; a filter equation is generated based on the filter signal frequency coefficient and the filter sampling frequency coefficient; the first ripple current signal is input into the filter equation to generate the second ripple current signal.

12. The method according to claim 11, characterized in that, The step of inputting the first ripple current signal into the filtering equation to generate the second ripple current signal includes: The data format of the first ripple current signal is converted to reduce the computational load of the digital filter.

13. The method according to claim 12, characterized in that, The first ripple current signal is floating-point data. The step of converting the data format of the first ripple current signal includes: Determine the integer and fractional bits of the first ripple current signal, and convert the integer and fractional bits of the first ripple current signal into fixed-point format data.

14. The method according to claim 9, characterized in that, Determining the movement distance of the motor-driven device based on the second ripple current signal includes: The number of valid waveforms of the second ripple current signal is calculated, and the movement distance of the device is determined by the number of valid waveforms.

15. The method according to claim 9, characterized in that, The process of acquiring the first ripple current signal of the motor further includes: The first ripple current signal is read from the memory address in the storage space.

16. A vehicle window, characterized in that, include: The distance calculation system and vehicle window glass according to any one of claims 1 to 8; The distance calculation system is connected to the vehicle window glass; The distance calculation system is used to determine the movement distance of the vehicle window glass.

17. An electronic device, characterized in that, include: Memory and processor; The memory stores a computer program, and the processor is used to run the computer program in the memory to perform the distance calculation method according to any one of claims 9 to 15.

18. A vehicle, characterized in that, It includes the electronic device of claim 17, or the vehicle window of claim 16.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor using the distance calculation method according to any one of claims 9 to 15.

20. A computer program product, characterized in that, It includes a computer program or instructions, which are executed by a processor using the distance calculation method according to any one of claims 9 to 15.