A method for filtering a window motor ripple and a vehicle
By employing a dual-threshold filtering method for window motor ripple, the positioning error caused by the M-wave in window motor ripple counting was resolved, achieving accurate ripple counting and improving vehicle safety and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG GEELY HLDG GRP CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-06-12
AI Technical Summary
In the existing technology, the ripple counting method of car window motor has ripple positioning error when facing typical M-wave, which leads to the risk of the car window pinching and injuring passengers. The traditional mean comparison method and step code encoding method both have shortcomings.
By acquiring the current ripple of the car window motor, determining the pulse width threshold and analyzing the reference pulse width, a dual threshold filtering method is used to remove pulse jumps in the ripple, ensuring the accuracy of ripple counting.
The performance of the window ripple anti-pinch algorithm has been improved, enhancing the safety and reliability of vehicle operation and reducing the possibility of passengers being injured by the window.
Smart Images

Figure CN121602961B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle control technology, specifically to a method for filtering window motor ripple and a vehicle. Background Technology
[0002] With the rapid development of the automotive industry, power windows have become widespread. For passenger safety, power windows must have anti-pinch functionality to prevent fingers, arms, children's heads, and other body parts from being pinched during window closing. Currently, an increasing number of car models directly use the ripple signal of the DC motor current to count the cumulative number of motor rotations, thereby determining the distance from the top edge of the window glass to the top of the window. The accuracy of the DC motor waveform ripple count is one of the key performance indicators for evaluating the performance of the anti-pinch algorithm in the window motor controller.
[0003] Before counting ripple in a car window, the ripple needs to be shaped. The commonly used ripple shaping method is the mean comparison method. However, when the motor current changes drastically in certain code segments, the traditional mean comparison method cannot be adapted. Usually, direct ripple counting for these rapidly changing current code segments must be abandoned, and calibration compensation is used instead. However, calibration compensation introduces random errors, increasing the positioning error throughout the entire journey and leading to inaccurate waveform ripple counting. To address this, step code encoding can be used to shape the ripple to obtain accurate waveform ripple counting. However, if a typical M-wave exists in the ripple waveform, even after step code encoding, a pulse will be generated at the position of the M-wave. When counting the pulses, an extra pulse will be counted, resulting in ripple positioning error, which can still lead to passengers being injured by the car window. Summary of the Invention
[0004] In view of this, this application provides a method for filtering window motor ripple and a vehicle to solve the problem that related technologies use step code encoding to shape ripple, which has ripple positioning errors for typical M-waves, resulting in passengers being pinched by the window.
[0005] In a first aspect, this application provides a filtering method for ripple of a vehicle window motor, the method comprising:
[0006] The current ripple corresponding to the vehicle's window motor is obtained, wherein the current ripple has multiple code segments, and each code segment corresponds to a pulse width;
[0007] The target code segment in which the pulse transition occurs is determined from the code segment, and a first pulse width threshold and a second pulse width threshold are determined based on the pulse width, wherein the first pulse width threshold is less than the second pulse width threshold;
[0008] Obtain the reference code segment preceding the target code segment, and the reference pulse width of the reference code segment;
[0009] The relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold is analyzed, and a corresponding filtering operation is performed on the current ripple based on the relationship to obtain the filtered current ripple.
[0010] Furthermore, determining the first pulse width threshold and the second pulse width threshold based on the pulse width includes:
[0011] The K code segments preceding the target code segment are sorted in descending order of pulse width to obtain a code segment sequence, where K is an integer greater than or equal to 2;
[0012] Select any one code segment from the first L code segments in the code segment sequence as the first code segment, and obtain the code segment preceding the first code segment from the current ripple as the second code segment, where L is an integer greater than or equal to 1 and L is less than K;
[0013] Obtain the first pulse width corresponding to the first code segment and the second pulse width corresponding to the second code segment;
[0014] By comparing the first pulse width and the second pulse width, the pulse width with the smallest value is selected from the first pulse width and the second pulse width to calculate the first pulse width threshold, and the pulse width with the largest value is selected from the first pulse width and the second pulse width to calculate the second pulse width threshold.
[0015] Furthermore, the step of selecting the minimum pulse width from the first pulse width and the second pulse width to calculate the first pulse width threshold, and selecting the maximum pulse width from the first pulse width and the second pulse width to calculate the second pulse width threshold, includes:
[0016] Obtain the second coefficient and the first coefficient, wherein the second coefficient is greater than 1 and the first coefficient is less than 1;
[0017] Based on the first pulse width and the second pulse width, select the minimum pulse width and the second coefficient to calculate the first pulse width threshold;
[0018] The second pulse width threshold is calculated by selecting the largest pulse width and the first coefficient based on the first pulse width and the second pulse width.
[0019] Furthermore, obtaining the reference code segment preceding the target code segment and the reference pulse width of the reference code segment includes:
[0020] The preceding code segment of the target code segment is used as the first reference code segment, and the preceding code segment of the first reference code segment is used as the second reference code segment.
[0021] Obtain the third pulse width of the first reference code segment and the fourth pulse width of the second reference code segment.
[0022] Furthermore, the step of analyzing the magnitude relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, and performing a corresponding filtering operation on the current ripple based on the magnitude relationship to obtain the filtered current ripple, includes:
[0023] By comparing the third pulse width with the first pulse width threshold, a first comparison result is obtained;
[0024] Based on the first comparison result, perform corresponding filtering operations on the current ripple.
[0025] Furthermore, the step of performing a corresponding filtering operation on the current ripple based on the first comparison result includes:
[0026] If the first comparison result is that the third pulse width is greater than or equal to the first pulse width threshold, then the first reference code segment is retained.
[0027] Furthermore, the step of performing a corresponding filtering operation on the current ripple based on the first comparison result includes:
[0028] If the first comparison result indicates that the third pulse width is less than the first pulse width threshold, the third pulse width is added to the fourth pulse width to obtain the sum of pulse widths;
[0029] By comparing the pulse width with the second pulse width threshold, a second comparison result is obtained;
[0030] Based on the second comparison result, perform the corresponding filtering operation on the current ripple.
[0031] Furthermore, the step of performing a corresponding filtering operation on the current ripple based on the second comparison result includes:
[0032] If the second comparison result is that the sum of the pulse widths is less than the second pulse width threshold, then the first reference code segment, the second reference code segment, and the target code segment are merged to obtain the filtered current ripple.
[0033] Furthermore, the step of performing a corresponding filtering operation on the current ripple based on the second comparison result includes:
[0034] If the second comparison result is that the sum of the pulse widths is greater than or equal to the second pulse width threshold, then the first reference code segment is retained.
[0035] Secondly, this application provides a filtering device for ripple in a car window motor, the device comprising:
[0036] The first acquisition module is used to acquire the current ripple corresponding to the vehicle's window motor, wherein the current ripple has multiple code segments, and each code segment corresponds to a pulse width;
[0037] The determining module is configured to determine the target code segment in which the pulse transition occurs from the code segment, and to determine a first pulse width threshold and a second pulse width threshold based on the pulse width, wherein the first pulse width threshold is less than the second pulse width threshold;
[0038] The second acquisition module is used to acquire a reference code segment located before the target code segment, and the reference pulse width of the reference code segment;
[0039] The module is used to analyze the relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, and to perform corresponding filtering operations on the current ripple based on the relationship to obtain the filtered current ripple.
[0040] Thirdly, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the filtering method for window motor ripple described in the first aspect or any corresponding embodiment.
[0041] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the filtering method for window motor ripple described in the first aspect or any corresponding embodiment.
[0042] Fifthly, this application provides a vehicle including a controller and a window motor. The controller includes a memory and a processor, which are communicatively connected. The memory stores computer instructions, and the processor executes the computer instructions to perform the window motor ripple filtering method of the window motor according to the first aspect or any corresponding embodiment described above.
[0043] In this embodiment, the current ripple corresponding to the vehicle's window motor is obtained. Multiple code segments are defined within the current ripple, each corresponding to a pulse width. The target code segment with a pulse jump is then identified from these segments, and a first pulse width threshold and a second pulse width threshold are determined based on the pulse width. Next, a reference code segment preceding the target code segment and its reference pulse width are obtained. Based on the comparison between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, a corresponding filtering operation is performed on the target code segment in the current ripple to obtain the filtered current ripple. Thus, this embodiment, by identifying the target code segment with a pulse jump, obtaining the reference code segment preceding the target code segment and its corresponding reference pulse width, and comparing this reference pulse width with the first and second pulse width thresholds, removes the pulse-jumping code segment. Filtering the pulse-jumping code segment allows for accurate ripple counting, improving the performance of the entire window ripple anti-pinch algorithm and enhancing vehicle safety and reliability. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of the electric window structure;
[0046] Figure 2 This is a diagram illustrating the anti-pinch requirements for electric power windows;
[0047] Figure 3 It is the current ripple waveform of the car window motor;
[0048] Figure 4 It is the current ripple waveform of the start code segment of the car window motor;
[0049] Figure 5 It is the current ripple waveform of the anti-pinch code segment of the car window motor;
[0050] Figure 6 It is the current ripple waveform of the window motor lift-off segment;
[0051] Figure 7 It is a current ripple waveform formed by the mean comparison method;
[0052] Figure 8 This is a schematic diagram showing the current ripple waveform after the motor start-up code segment is shaped using step codes;
[0053] Figure 9 This is a schematic diagram showing the presence of an M-wave in the ripple waveform after step code encoding.
[0054] Figure 10 This is a flowchart of a method for filtering window motor ripple according to an embodiment of this application;
[0055] Figure 11 This is a flowchart illustrating another method for filtering window motor ripple according to an embodiment of this application;
[0056] Figure 12 This is a block diagram of a filter device for the ripple of a car window motor according to an embodiment of this application;
[0057] Figure 13 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0060] Electric car windows are now commonplace. For passenger safety reasons, electric windows must have anti-pinch features to prevent fingers, arms, children's heads, and other body parts from being pinched during the closing process.
[0061] Early car window drive motors mostly used brushed DC motors with Hall sensors. Each rotation of the motor produced two periodic pulses from the Hall sensor to determine the cumulative number of rotations and the direction of motor movement, thus determining the distance from the top edge of the window glass to the top of the window (the window position was marked as the starting position after the glass was raised into the slot). In recent years, to reduce costs, more and more car models directly use the ripple signal of the DC motor current to count the cumulative number of rotations, replacing the function of the Hall sensor.
[0062] The waveform quality of DC motor ripple is related not only to the voltage, ambient temperature, and load during motor operation, but also to factors such as the manufacturing process, material defects, and wear and aging of the motor commutator. The accuracy of ripple counting in the window controller is one of the key performance indicators for evaluating the performance of the window motor controller's ripple anti-pinch algorithm.
[0063] A schematic diagram of the electric window structure is shown below. Figure 1 As shown, the DC motor raises and lowers the car window glass through a drive mechanism consisting of a steel wire rope, a cable sleeve, and a lifting adjuster, and the glass moves up and down within the window guide channel.
[0064] A diagram illustrating the anti-pinch requirements for electric window power supplies is shown below. Figure 2 As shown, the main requirements for anti-pinch are:
[0065] (1) Anti-pinch detection distance range: 4mm-200mm;
[0066] (2) Maximum clamping force: 100N;
[0067] (3) After detecting clamping, reverse and retract;
[0068] (4) Test rod deflection: 5N / mm—20N / mm.
[0069] Based on the current ripple waveform of a single-segment actual car window motor collected from a DC motor, as shown in the example... Figure 3 As shown, a periodic ripple waveform is superimposed on the direct current.
[0070] In the ripple positioning algorithm for car windows, ripple counting is a key basic technology. The counting error directly affects the positioning result of the controller for the car window glass. When the positioning error exceeds the allowable range, it will cause false anti-pinch (causing the glass to mistakenly fall down on its own when it enters the groove and rises to the top, and it will not be able to enter the groove and rise to the top normally) and no anti-pinch (the object is in the anti-pinch zone, but the glass does not retreat in anti-pinch mode and forcibly squeezes the object).
[0071] During the three code segments—starting, anti-pinch, and slot entry / lifting stall—the motor current undergoes drastic changes, causing the superimposed ripple waveform to be stretched / compressed and deformed. For example... Figure 4 The current ripple waveform of the window motor start code segment shown is as follows: Figure 5 The current ripple waveform of the anti-pinch code segment of the car window motor shown is as follows: Figure 6 The current ripple waveform of the window motor lift segment is shown.
[0072] Therefore, the ripple needs to be shaped before counting the ripple in the car window. Traditional mean comparison methods, such as... Figure 7As shown, a current ripple waveform of a code segment is taken, and its mean value is taken as the comparison threshold value. Then, the current ripple waveform is compared with this threshold value (mean value) to make a decision. If the current ripple sample value is greater than the threshold value, it is '1', otherwise it is '0', thus obtaining the shaped waveform of the ripple. Figure 7 The rectangular waveform in the diagram is formed by superimposing the shaped waveform after threshold decision onto the mean of the current ripple, facilitating comparison and observation with the current ripple waveform. This method works relatively stably when the motor current is relatively balanced, but its effectiveness decreases when the motor current exceeds certain thresholds. Figures 4-6 When the several code segments shown change drastically (even if the average current changes within a ripple cycle), this traditional ripple shaping method is no longer suitable. Usually, the direct ripple counting of such drastically changing current code segments must be abandoned and replaced with calibration compensation. However, calibration compensation introduces random errors, which increases the positioning error throughout the journey, resulting in inaccurate waveform ripple counting and a significant increase in the possibility of passengers being injured by the car window.
[0073] Based on this, a method for determining the current ripple waveform of a car window motor based on step codes is proposed in related technologies, such as... Figure 8 As shown, from Figure 8 As can be seen, the stepped code exhibits good current fluctuation tracking. However, Figure 8 One burr caused by the concave top of the ripple was also observed (marked with S in the figure).
[0074] Furthermore, such as Figure 9 As shown, Figure 9 The diagram shows an M-wave in the ripple waveform after step code encoding. After step code encoding, the output code also generates a pulse at the position of the M-wave. If this M-wave pulse cannot be filtered correctly, an extra pulse will be counted when counting the pulses, resulting in ripple positioning error. Figures 3-9 The vertical axis represents the motor current (A), and the horizontal axis represents the time (ms).
[0075] Based on this, according to the embodiments of this application, a method embodiment for filtering ripple of a car window motor is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0076] This application provides a method for filtering window motor ripple, such as... Figure 10 As shown, Figure 10 This is a flowchart of a method for filtering window motor ripple according to an embodiment of this application. The method includes the following steps:
[0077] Step S1001: Obtain the current ripple corresponding to the vehicle's window motor. The current ripple contains multiple code segments, each corresponding to a pulse width.
[0078] In this embodiment of the application, the drive current of the window motor is collected in real time by an on-board current sensor (such as a Hall sensor connected in series in the motor power supply circuit or a DC motor) and the current ripple is separated.
[0079] The current ripple is divided into continuous code segments according to the PWM (Pulse Width Modulation) drive cycle or the motor electrical angle cycle (for example, 1 PWM drive cycle = 10μs, divided into 10 code segments, each code segment 1μs). A fixed sampling time (i.e. code segment sampling point) is set in each code segment, and the pulse width corresponding to each code segment is recorded synchronously. At this time, there is a one-to-one correspondence between the code segment and the pulse width.
[0080] Step S1002: Determine the target code segment from the code segment where the pulse transition occurs, and determine a first pulse width threshold and a second pulse width threshold based on the pulse width, wherein the first pulse width threshold is less than the second pulse width threshold.
[0081] In this embodiment, the principle of M-wave filtering is that the frequency of the ripple does not change significantly when an M-wave occurs. Therefore, the M-wave appears within half the cycle of the ripple, and the widths of the rising and falling segments of the M-wave are significantly smaller than the widths of the rising and falling segments of the nearby normal ripple. Thus, if the difference between the pulse width of a certain segment and the pulse width of adjacent segments (e.g., the preceding and following segments) exceeds a preset proportion (e.g., 30%), or deviates from the historical normal pulse width range, then the rising and falling segments of that segment are considered to be significantly smaller than the widths of the rising and falling segments of the nearby normal ripple. Such segments are considered target segments where pulse transitions occur.
[0082] Then, by using the pulse widths of multiple code segments, two pulse width thresholds are obtained: the first pulse width threshold and the second pulse width threshold. These pulse width thresholds are "evaluation criteria" and are mainly used to evaluate how to remove the target code segment that has undergone a transition.
[0083] In addition, the first pulse width threshold here should be smaller than the second pulse width threshold, so that the dual threshold-based determination method can adapt to more fault / interference scenarios.
[0084] Step S1003: Obtain the reference code segment located before the target code segment, and the reference pulse width of the reference code segment.
[0085] In this embodiment, firstly, the preset position refers to the "adjacent code segment" of the target code segment (such as the code segment corresponding to the previous 1 sampling point, the code segment corresponding to the next 1 sampling point, or the code segment corresponding to the previous 2 sampling points, etc.). Then, the reference code segments preceding the target code segment are obtained respectively, and each reference code segment corresponds to a pulse width, which is called the reference pulse width.
[0086] Step S1004: Analyze the relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, and perform corresponding filtering operations on the current ripple based on the relationship to obtain the filtered current ripple.
[0087] In the embodiments of this application, "abnormal code segment correction" is performed, and the final output is a current ripple without jump interference that can reflect the true operating conditions of the motor.
[0088] Specifically, with reference to the first pulse width threshold and the second pulse width threshold, the reference pulse width is compared with the first pulse width threshold and the second pulse width threshold, and then the comparison result is obtained. Based on the comparison result, a filtering operation to remove the target code segment of the pulse transition is performed (which may be merging the target code segment with the code segment of the previous sampling point or the code segment of the subsequent sampling point) to obtain the current ripple after removing the abnormal ripple (i.e. the target code segment).
[0089] In this embodiment, the current ripple corresponding to the vehicle's window motor is obtained. Multiple code segments are defined within the current ripple, each corresponding to a pulse width. The target code segment where a pulse transition occurs is then identified from these segments. Based on the pulse width, a first pulse width threshold and a second pulse width threshold are determined. Next, a reference code segment preceding the target code segment and its reference pulse width are obtained. Based on the comparison between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, a corresponding filtering operation is performed on the current ripple to obtain the filtered current ripple. Thus, this embodiment, by identifying the target code segment where a pulse transition occurs, obtaining the reference code segment preceding the target code segment and its corresponding reference pulse width, and comparing this reference pulse width with the first and second pulse width thresholds, removes the pulse-transition code segment. Filtering the pulse-transition code segment allows for accurate ripple counting, improving the performance of the entire window ripple anti-pinch algorithm and enhancing vehicle safety and reliability.
[0090] As an optional embodiment, step S1002 above includes:
[0091] Step S10021: Sort the K code segments preceding the target code segment in descending order of pulse width to obtain a code segment sequence, where K is an integer greater than or equal to 2.
[0092] Optionally, such as Figure 9 As shown, Figure 9 The C code segment can be used as the target code segment because it meets the typical characteristics of the M wave: First, the C code segment exhibits a transition pattern of "the previous code segment is low frequency and the current code segment is high frequency"; second, the pulse width of the rising pulse between the B and C code segments is only 8, which is significantly smaller than the pulse width of the nearby normal ripple code segments (such as A code segment 31 and P code segment 23), which is consistent with the characteristic that the width of the rising code segment of the M wave is much smaller than the width of the rising code segment of the normal ripple, so it can be used as the target code segment.
[0093] In addition, the D code segment can also be used as the target code segment because it also satisfies the characteristics of the M wave: firstly, it has a transition performance of "the previous point is high frequency and the current point is low frequency"; secondly, the pulse width of the drop between the C and D code segments is 11, which is significantly smaller than the pulse width of the nearby normal ripple code segment, which matches the characteristic that the width of the M wave drop code segment is much smaller than the width of the normal ripple drop code segment, so it can be used as the target code segment.
[0094] In this embodiment, K code segments preceding the target code segment are determined, where K is an integer greater than or equal to 2. For example, when the target code segment is C, the corresponding code segments are A, B, and P; when the target code segment is D, the corresponding code segments are A, B, C, and P. Then, the pulse width corresponding to each code segment is extracted, such as code segment A 31, code segment B 14, and code segment P 23. These code segments are arranged in descending order of pulse width value to finally obtain an ordered code segment sequence. For example, when the target code segment is C, the sequence is code segment A, code segment P, and code segment B.
[0095] Step S10022: Select any one code segment from the first L code segments in the code segment sequence as the first code segment, and obtain the code segment preceding the first code segment from the current ripple as the second code segment, where L is an integer greater than or equal to 1 and L is less than K.
[0096] In this embodiment, based on the obtained code segment sequence, the first L code segments in the sequence are selected. For example, if L is 2, the first two code segments in the sequence are selected, and then one of the first two is arbitrarily chosen as the first code segment. If the target code segment is code segment C, code segment A is selected from sequences A and P as the first code segment; then, from the code segment distribution of the current ripple, the code segment that is temporally adjacent to the first code segment is found, and it is determined as the second code segment. For example, the code segment preceding code segment A is code segment P.
[0097] It should be noted that L is an integer less than K. This is to ensure that when selecting the first code segment from the code segment sequence, the preceding code segment with the smallest pulse width is excluded, while also ensuring the effectiveness of M-wave feature verification.
[0098] Step S10023: Obtain the first pulse width corresponding to the first code segment and the second pulse width corresponding to the second code segment.
[0099] In this embodiment, the pulse width value corresponding to the determined first code segment is denoted as the first pulse width (e.g., pulse width 31 corresponding to code segment A); at the same time, the pulse width value corresponding to the second code segment is extracted and denoted as the second pulse width (e.g., pulse width 23 corresponding to code segment P).
[0100] Step S10024: Compare the first pulse width and the second pulse width, select the smallest pulse width from the first pulse width and the second pulse width to calculate the first pulse width threshold, and select the largest pulse width from the first pulse width and the second pulse width to calculate the second pulse width threshold.
[0101] Optionally, the first pulse width threshold can be calculated based on the first pulse width using the rotational speed mapping method: the first pulse width of the window motor has a fixed mapping relationship with the motor speed, and the first pulse width threshold can be calculated through a mapping table or model of "rotational speed → theoretical pulse width lower limit";
[0102] Alternatively, the first pulse width threshold can be calculated based on the first pulse width using the sliding window statistical method: using the "most recent N code segments" as the sliding window (e.g., N=20), the minimum value or kth percentile of the first pulse width within the window is calculated in real time and used as the current first pulse width threshold.
[0103] The second pulse width threshold is calculated in the same way.
[0104] In one embodiment of this application, step S10023 includes:
[0105] Step a1: Obtain the first coefficient and the second coefficient, wherein the first coefficient is less than 1 and the second coefficient is greater than 1.
[0106] Step a2: Based on the first pulse width and the second pulse width, select the minimum pulse width and the first coefficient to calculate the first pulse width threshold.
[0107] Step a3: Based on the first pulse width and the second pulse width, select the largest pulse width and the second coefficient to calculate the second pulse width threshold.
[0108] Optionally, in this embodiment, a second coefficient and a first coefficient can be pre-set to participate in the numerical limitation of the first pulse width and the second pulse width, thereby realizing the determination of the first pulse width threshold and the second pulse width threshold.
[0109] The first coefficient can be set to a value less than 1 to tighten the threshold for the smaller pulse widths already present in the normal ripple step code. Since the rising and falling code widths of the M-wave are significantly smaller than those of the normal ripple, multiplying the smaller normal pulse width by this coefficient yields a more stringent minimum pulse width threshold. This ensures that only M-wave signals with pulse widths significantly shorter than those of the normal ripple can be accurately identified and filtered out, avoiding interference from the smaller pulse width of the normal ripple in the determination of the M-wave and ensuring the targeted nature of the filtering.
[0110] The second coefficient can be set to a value greater than 1 to broaden the threshold for larger pulse widths in normal ripple step codes. Considering that normal ripples may have small pulse width fluctuations, directly using this larger pulse width as the maximum threshold could easily lead to some normal signals being misjudged as M-waves due to fluctuations. By multiplying by a coefficient greater than 1 to expand the threshold range, reasonable fluctuations in normal ripples can be fully accommodated, excluding only abnormal signals with pulse widths far exceeding the normal range. This avoids the erroneous rejection of normal ripples during filtering and ensures the accuracy of signal processing.
[0111] Taking the target code segment as C as an example, first determine the corresponding first pulse width (31 for A code segment) and second pulse width (23 for P code segment). Select the smaller value, 23, and calculate it using a preset first coefficient of 0.8, resulting in a first pulse width threshold of 23 × 0.8 = 18.4, which is rounded to 18. Simultaneously, select the larger value, 31, and calculate it using a preset second coefficient of 1.2, resulting in a second pulse width threshold of 31 × 1.2 = 37.2, which is rounded to 37. If the target code segment is D code segment, the calculation result can be the same.
[0112] In the above embodiments, the rounding logic is to directly take the integer part of the calculated result of the pulse width threshold (such as 18.4, 37.2) to obtain the corresponding integer.
[0113] This embodiment provides a filtering method for window motor ripple. Figure 11 This is a flowchart illustrating another method for filtering window motor ripple according to an embodiment of this application. The preset position includes a first preset position and a second preset position; the reference code segment includes a first code segment and a second code segment; and the reference pulse width includes a third pulse width and a fourth pulse width. Figure 11 As shown, the process includes the following steps:
[0114] Step S1101: Obtain the current ripple corresponding to the vehicle's window motor. The current ripple contains multiple code segments, each corresponding to a pulse width. For details, please refer to [link to relevant documentation]. Figure 10 Step S1001 of the illustrated embodiment will not be described again here.
[0115] Step S1102: Determine the target code segment from the code segment where the pulse transition occurs, and determine a first pulse width threshold and a second pulse width threshold based on the pulse width, wherein the first pulse width threshold is less than the second pulse width threshold. For details, please refer to [link to relevant documentation]. Figure 10 Step S1002 of the illustrated embodiment will not be described again here.
[0116] Step S1103: Obtain the reference code segment preceding the target code segment and the reference pulse width of the reference code segment.
[0117] In one embodiment of this application, step S1103 includes:
[0118] Step S11031: The preceding code segment of the target code segment is used as the first reference code segment, and the preceding code segment of the first reference code segment is used as the second reference code segment.
[0119] like Figure 9 As shown, when the target code segment is code segment C, the code segment preceding code segment B in time (i.e., code segment B) is taken as the first reference code segment; then the code segment preceding code segment A in time (i.e., code segment B) is found and taken as the second reference code segment; if the target code segment is code segment D, then the code segment preceding code segment C (code segment D) is taken as the first reference code segment, and the code segment preceding code segment B (code segment C) is taken as the second reference code segment.
[0120] S11032, obtain the third pulse width of the first reference code segment and the fourth pulse width of the second reference code segment.
[0121] Specifically, taking the target code segment as the C code segment as an example, from Figure 9 In the code segment information, the pulse width value 14 corresponding to the first reference code segment (B code segment) is extracted and determined as the third pulse width; at the same time, the pulse width value 31 corresponding to the second reference code segment (A code segment) is extracted and determined as the fourth pulse width; if the target code segment is the D code segment, the pulse width 8 of the first reference code segment (C code segment) is extracted as the third pulse width, and the pulse width 14 of the second reference code segment (B code segment) is extracted as the fourth pulse width.
[0122] Step S1104: Analyze the relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, and perform corresponding filtering operations on the current ripple based on this relationship to obtain the filtered current ripple. For details, please refer to [link to relevant documentation]. Figure 10 Step S1004 of the illustrated embodiment will not be described again here.
[0123] In one embodiment of this application, step S1104 includes:
[0124] Step S11041: Compare the third pulse width with the first pulse width threshold to obtain the first comparison result.
[0125] If the target code segment is the C code segment, first retrieve the third pulse width (i.e., the pulse width 14 corresponding to the first reference code segment B code segment), and at the same time retrieve the first pulse width threshold (e.g., 18) previously calculated for the C code segment.
[0126] If the target code segment is the D code segment, then the third pulse width (i.e., the pulse width 8 corresponding to the first reference code segment C code segment) and the first pulse width threshold (e.g., 18) are retrieved. Subsequently, the third pulse width and the first pulse width threshold are precisely compared at the numerical level to determine their magnitude relationship.
[0127] Taking the C code segment as an example, comparing 14 and 18, we find that the width of the third pulse is less than the threshold of the first pulse width. Taking the D code segment as an example, comparing 8 and 18, we find the same relationship. Finally, this relationship is recorded as the first comparison result, providing a basis for subsequent filtering operations.
[0128] Step S11042: Perform corresponding filtering operations on the current ripple based on the first comparison result.
[0129] In one embodiment of this application, a corresponding filtering operation is performed on the current ripple based on the first comparison result, including: if the first comparison result is that the third pulse width is greater than or equal to the first pulse width threshold, then the first reference code segment is retained.
[0130] If the first comparison result is that the width of the third pulse is greater than or equal to the threshold of the first pulse width, then the original state of the first reference code segment in the current ripple data is maintained, and no deletion, merging or modification operations are performed to ensure that the corresponding ripple information is completely preserved.
[0131] In one embodiment of this application, a corresponding filtering operation is performed on the current ripple based on the first comparison result, including the following steps A1-A3:
[0132] Step A1: If the first comparison result is that the third pulse width is less than the first pulse width threshold, add the third pulse width to the fourth pulse width to obtain the pulse width sum.
[0133] The first comparison result is that when the third pulse width is less than the first pulse width threshold, if the target code segment is a C code segment, the third pulse width (i.e., 14 corresponding to the first reference code segment B) and the fourth pulse width (i.e., 31 corresponding to the second reference code segment A) are retrieved. If the target code segment is a D code segment, the third pulse width (8 corresponding to the first reference code segment C) and the fourth pulse width (14 corresponding to the second reference code segment B) are retrieved. Then, these two pulse widths are added together.
[0134] Taking the C code segment as an example, calculate 14+31=45; taking the D code segment as an example, calculate 8+14=22. The final result is the pulse width sum, which will be used as the basis for subsequent judgment on whether the code segments should be merged.
[0135] Step A2: Compare the pulse width with the second pulse width threshold to obtain the second comparison result.
[0136] After obtaining the pulse width, the second pulse width threshold calculated for the corresponding target code segment is retrieved first. Taking the target code segment as C code segment as an example, the second pulse width threshold is 37 (rounded down) obtained by multiplying the larger value (31) of A code segment 31 and P code segment 23 by the first coefficient 1.2. If the target code segment is D code segment, the same set of thresholds (such as 37) is usually used or the second pulse width threshold is recalculated based on its corresponding reference code segment.
[0137] Subsequently, the obtained pulse width sum is compared with the second pulse width threshold: taking the C code segment as an example, comparing 45 and 37, the result is that the pulse width sum is greater than the second pulse width threshold; taking the D code segment as an example, comparing 22 and 37, the result is that the pulse width sum is less than the second pulse width threshold. Finally, this size relationship is recorded as the second comparison result.
[0138] Step A3: Perform the corresponding filtering operation on the current ripple based on the second comparison result.
[0139] ① Perform corresponding filtering operations on the current ripple according to the second comparison result, including: if the second comparison result is a pulse width that is less than the second pulse width threshold, then merge the first reference code segment, the second reference code segment and the target code segment to obtain the filtered current ripple.
[0140] When the second comparison result is a pulse width that is less than the second pulse width threshold, the merging process of the first reference code segment, the second reference code segment and the target code segment in the current ripple is initiated. By integrating continuous and same-level code segments, the ripple interference caused by the abnormal target code segment is eliminated.
[0141] Taking the scenario where the target code segment is the D code segment as an example, the pulse width sum is the pulse width of the C code segment (8) plus the pulse width of the B code segment (14), resulting in 22. The pulse width sum (22) is less than the second pulse width threshold (37).
[0142] At this point, a phased merging operation is performed: First, the second reference code segment (B code segment) and the first reference code segment (C code segment) are integrated in terms of time interval and pulse width. The start time of the B code segment is used as the start time of the merged BC code segment, and the end time of the C code segment is used as the end time of the BC code segment. The pulse width is accumulated to obtain 22. Then, the merged BC code segment is further integrated with the target code segment (D code segment), continuing the continuous connection logic of the time interval. The start time of the BC code segment is used as the reference, and the end time of the D code segment is used as the endpoint. The pulse width is accumulated to obtain 33 (22+11), forming a brand new "BCD low level code segment".
[0143] After merging, the pulse width 33 is checked to see if it falls within the preset threshold range. It is confirmed that it is less than the second pulse width threshold 38 and greater than the first pulse width threshold 18, meeting the criteria for normal pulse width and ensuring that the merged code segment accurately reflects the true ripple state. Through this continuous merging operation, the originally independent B, C, and D code segments are integrated into a single effective code segment. This not only eliminates the fragmentation interference caused by the target code segment D and the associated abnormal code segment C, but also outputs a high-quality current ripple count after filtering.
[0144] ② Perform corresponding filtering operations on the current ripple based on the second comparison result, including: if the second comparison result is a pulse width sum greater than or equal to the second pulse width threshold, then retain the first reference code segment.
[0145] If the second comparison result is that the sum of pulse widths is greater than or equal to the second pulse width threshold, then the original state of the first reference code segment (B code segment) in the current ripple data is maintained, no merging operation is performed, and only the independent information of the code segment is retained. Taking the target code segment as C code segment as an example, if the sum of pulse widths (45) is greater than or equal to the second pulse width threshold (37), then the first reference code segment, i.e., the B code segment, is retained.
[0146] By using these two different processing methods, we can effectively filter out abnormal code segments in current ripple and accurately retain normal code segments.
[0147] This embodiment provides a filtering device for the ripple of a car window motor, such as... Figure 12 As shown, it includes:
[0148] The first acquisition module 1201 is used to acquire the current ripple corresponding to the vehicle's window motor. The current ripple has multiple code segments, and each code segment corresponds to a pulse width.
[0149] The determining module 1202 is used to determine the target code segment in which the pulse transition occurs from the code segment, and to determine a first pulse width threshold and a second pulse width threshold based on the pulse width, wherein the first pulse width threshold is less than the second pulse width threshold.
[0150] The second acquisition module 1203 is used to acquire the reference code segment located before the target code segment, and the reference pulse width of the reference code segment;
[0151] Module 1204 is obtained, which is used to analyze the relationship between the reference pulse width, the first pulse width threshold and the second pulse width threshold, and to perform corresponding filtering operations on the current ripple based on the relationship to obtain the filtered current ripple.
[0152] In this embodiment, the current ripple corresponding to the vehicle's window motor is obtained. Multiple code segments are defined within the current ripple, each corresponding to a pulse width. The target code segment with a pulse jump is then identified from these segments, and a first pulse width threshold and a second pulse width threshold are determined based on the pulse width. Next, a reference code segment preceding the target code segment and its reference pulse width are obtained. Based on the comparison between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, a corresponding filtering operation is performed on the target code segment in the current ripple to obtain the filtered current ripple. Thus, this embodiment, by identifying the target code segment with a pulse jump, obtaining the reference code segment preceding the target code segment and its corresponding reference pulse width, and comparing this reference pulse width with the first and second pulse width thresholds, removes the pulse-jumping code segment. Filtering the pulse-jumping code segment allows for accurate ripple counting, improving the performance of the entire window ripple anti-pinch algorithm and enhancing vehicle safety and reliability.
[0153] In this embodiment, the determining module 1202 is specifically used to sort multiple code segments preceding the target code segment according to their pulse widths from largest to smallest to obtain a code segment sequence; select any one code segment from the first N code segments in the code segment sequence as the first code segment, and obtain the code segment preceding the first code segment from the current ripple as the second code segment; obtain the first pulse width corresponding to the first code segment and the second pulse width corresponding to the second code segment; compare the first pulse width and the second pulse width, select the smallest pulse width from the first pulse width and the second pulse width to calculate the first pulse width threshold, and select the largest pulse width from the first pulse width and the second pulse width to calculate the second pulse width threshold.
[0154] In this embodiment of the application, the determining module 1202 is specifically used to obtain a second coefficient and a first coefficient, wherein the second coefficient is greater than 1 and the first coefficient is less than 1; to select the minimum pulse width and the second coefficient based on the first pulse width and the second pulse width, and to calculate a first pulse width threshold; and to select the maximum pulse width and the first coefficient based on the first pulse width and the second pulse width, and to calculate a second pulse width threshold.
[0155] In this embodiment of the application, the second acquisition module 1203 is specifically used to take the preceding code segment of the target code segment as the first reference code segment and the preceding code segment of the first reference code segment as the second reference code segment; and to acquire the third pulse width of the first reference code segment and the fourth pulse width of the second reference code segment.
[0156] In this embodiment, module 1204 is specifically used to compare the third pulse width with the first pulse width threshold to obtain a first comparison result; and to perform corresponding filtering operations on the current ripple based on the first comparison result.
[0157] In this embodiment of the application, module 1204 is specifically used to retain the first reference code segment if the first comparison result is that the third pulse width is greater than or equal to the first pulse width threshold.
[0158] In this embodiment of the application, module 1204 is specifically used to add the third pulse width and the fourth pulse width to obtain a pulse width sum if the first comparison result is that the third pulse width is less than the first pulse width threshold; compare the pulse width sum with the second pulse width threshold to obtain a second comparison result; and perform corresponding filtering operations on the current ripple according to the second comparison result.
[0159] In this embodiment of the application, module 1204 is specifically used to merge the first reference code segment, the second reference code segment and the target code segment if the second comparison result is that the pulse width is less than the second pulse width threshold, so as to obtain the filtered current ripple.
[0160] In this embodiment of the application, module 1204 is specifically used to retain the first reference code segment if the second comparison result is a pulse width that is greater than or equal to the second pulse width threshold.
[0161] In this embodiment, the filtering device for the ripple of the car window motor is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0162] This application also provides a computer device having the above-described features. Figure 12 The image shows a filter for the ripple of the car window motor.
[0163] Please see Figure 13 , Figure 13 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 13As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 13 Take a processor 10 as an example.
[0164] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0165] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0166] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0167] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0168] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0169] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0170] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A filtering method for ripple in a car window motor, characterized in that, The method includes: The current ripple corresponding to the vehicle's window motor is obtained, wherein the current ripple has multiple code segments, and each code segment corresponds to a pulse width; The target code segment in which the pulse transition occurs is determined from the code segment, and a first pulse width threshold and a second pulse width threshold are determined based on the pulse width, wherein the first pulse width threshold is less than the second pulse width threshold; Obtain a reference code segment preceding the target code segment, and a reference pulse width of the reference code segment, wherein the reference code segment includes a first reference code segment and a second reference code segment, the first reference code segment being the code segment preceding the target code segment, and the second reference code segment being the code segment preceding the first reference code segment; The relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold is analyzed, and a corresponding filtering operation is performed on the current ripple based on the relationship to obtain the filtered current ripple. Wherein, when the pulse width of the first reference code segment is greater than or equal to the first pulse width threshold, the first reference code segment is retained; When the pulse width of the first reference code segment is less than the first pulse width threshold, if the sum of the pulse widths of the first reference code segment and the second reference code segment is less than the second pulse width threshold, then the first reference code segment, the second reference code segment, and the target code segment are merged; or, if the sum of the pulse widths is greater than or equal to the second pulse width threshold, then the first reference code segment is retained.
2. The method according to claim 1, characterized in that, Determining the first pulse width threshold and the second pulse width threshold based on the pulse width includes: The K code segments preceding the target code segment are sorted in descending order of pulse width to obtain a code segment sequence, where K is an integer greater than or equal to 2; Select any one code segment from the first L code segments in the code segment sequence as the first code segment, and obtain the code segment preceding the first code segment from the current ripple as the second code segment, where L is an integer greater than or equal to 1 and L is less than K; Obtain the first pulse width corresponding to the first code segment and the second pulse width corresponding to the second code segment; By comparing the first pulse width and the second pulse width, the pulse width with the smallest value is selected from the first pulse width and the second pulse width to calculate the first pulse width threshold, and the pulse width with the largest value is selected from the first pulse width and the second pulse width to calculate the second pulse width threshold.
3. The method according to claim 2, characterized in that, The step of selecting the minimum pulse width from the first pulse width and the second pulse width to calculate the first pulse width threshold, and selecting the maximum pulse width from the first pulse width and the second pulse width to calculate the second pulse width threshold, includes: Obtain a first coefficient and a second coefficient, wherein the first coefficient is less than 1 and the second coefficient is greater than 1; Based on the first pulse width and the second pulse width, the minimum pulse width and the first coefficient are selected to calculate the first pulse width threshold; The second pulse width threshold is calculated by selecting the largest pulse width and the second coefficient based on the first pulse width and the second pulse width.
4. The method according to claim 1, characterized in that, The step of obtaining the reference code segment preceding the target code segment and the reference pulse width of the reference code segment includes: The preceding code segment of the target code segment is used as the first reference code segment, and the preceding code segment of the first reference code segment is used as the second reference code segment. Obtain the third pulse width of the first reference code segment and the fourth pulse width of the second reference code segment.
5. The method according to claim 4, characterized in that, The process of analyzing the relationship between the reference pulse width, the first pulse width threshold, and the second pulse width threshold, and performing corresponding filtering operations on the current ripple based on the relationship to obtain the filtered current ripple, includes: By comparing the third pulse width with the first pulse width threshold, a first comparison result is obtained; Based on the first comparison result, perform corresponding filtering operations on the current ripple.
6. The method according to claim 5, characterized in that, The step of performing a corresponding filtering operation on the current ripple based on the first comparison result includes: If the first comparison result is that the third pulse width is greater than or equal to the first pulse width threshold, then the first reference code segment is retained.
7. The method according to claim 5, characterized in that, The step of performing a corresponding filtering operation on the current ripple based on the first comparison result includes: If the first comparison result indicates that the third pulse width is less than the first pulse width threshold, the third pulse width is added to the fourth pulse width to obtain the sum of pulse widths; By comparing the pulse width with the second pulse width threshold, a second comparison result is obtained; Based on the second comparison result, perform the corresponding filtering operation on the current ripple.
8. The method according to claim 7, characterized in that, The step of performing a corresponding filtering operation on the current ripple based on the second comparison result includes: If the second comparison result is that the sum of the pulse widths is less than the second pulse width threshold, then the first reference code segment, the second reference code segment, and the target code segment are merged to obtain the filtered current ripple.
9. The method according to claim 7, characterized in that, The step of performing a corresponding filtering operation on the current ripple based on the second comparison result includes: If the second comparison result is that the sum of the pulse widths is greater than or equal to the second pulse width threshold, then the first reference code segment is retained.
10. A vehicle, characterized in that, The device includes a controller and a window motor. The controller includes a memory and a processor, which are communicatively connected. The memory stores computer instructions, and the processor executes the computer instructions to perform the method of any one of claims 1 to 9.
Citation Information
Patent Citations
Motor rotating speed value determination method, vehicle window ripple wave anti-pinch method, vehicle and medium
CN115538879A
Servo controller with current ripple detection
JP1999187687A