A sunroof anti-pinch force curve self-learning calibration system and method

By updating the sunroof dynamic model in real time through a self-learning calibration system and introducing multi-layer safety verification, the inaccuracy problem of the sunroof anti-pinch system caused by mechanical changes has been solved, achieving accurate anti-pinch judgment and system stability, and reducing safety risks and maintenance costs.

CN122154181APending Publication Date: 2026-06-05WUHU INST OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHU INST OF TECH
Filing Date
2026-02-10
Publication Date
2026-06-05

Smart Images

  • Figure CN122154181A_ABST
    Figure CN122154181A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of automobile sunroof control, and particularly discloses a self-learning calibration system and method for an anti-pinch force curve of an automobile sunroof. The system comprises a data acquisition and processing module, a parameter learning module, a self-adaptive curve generation module, an anti-pinch control execution module and a safety verification module. The system acquires motion data of the sunroof closing process in real time, and continuously updates internal parameters of a sunroof dynamics model by using an online recursive algorithm. After each parameter update, a self-adaptive anti-pinch force curve matched with the current mechanical state is calculated and generated according to the new parameters. Before the curve is put into use, safety verification is performed by comparing virtual simulation with historical data. The method solves the problem that a fixed anti-pinch force curve is inaccurate due to time-varying of the mechanical characteristics of the sunroof, realizes self-adaptive calibration of the anti-pinch threshold in the whole life cycle, and guarantees the reliability of the learning process through a safety verification mechanism, thereby improving the safety, accuracy and adaptability of the sunroof anti-pinch function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automotive electronic control technology, and in particular relates to a self-learning calibration system and method for the anti-pinch force curve of an automotive sunroof. Background Technology

[0002] The anti-pinch function of a car sunroof is used to ensure driving and riding safety. It identifies obstacles and triggers retraction by monitoring the output force or current of the drive motor in real time during the closing process and comparing it with a preset anti-pinch force threshold curve.

[0003] Currently, the industry generally adopts anti-pinch solutions based on fixed calibration curves. These solutions test and calibrate a fixed force-position curve under specific conditions before the vehicle leaves the factory, and then embed it in the controller. However, as a mechanical system, the sunroof's operating resistance changes over time due to factors such as aging of the guide rail lubricant, weakening of the seal elasticity, component wear, and fluctuations in ambient temperature. This causes the actual operating resistance of the sunroof to deviate from the factory calibration, resulting in inaccurate fixed anti-pinch force curves. This can lead to two risks: first, increased resistance may cause false triggering when there is no clamping, affecting the user experience; second, decreased resistance may prevent recognition when actually clamping, creating safety hazards. Existing solutions lack effective online calibration capabilities and typically rely on after-sales personnel to recalibrate using specialized equipment, a cumbersome and costly process.

[0004] Furthermore, while existing technologies have proposed anti-pinch schemes with a certain degree of adaptability, such as monitoring changes in the speed of the window motor and fine-tuning a preset threshold, these schemes are essentially still slow tracking of macroscopic statistical features and have the following limitations: The lack of an accurate physical model limits the adaptive accuracy and depth. There is also a lack of a reliable mechanism for independently verifying the self-learning results. Directly using the updated threshold for safety control poses a risk. The system lacks robustness and does not adequately consider sensor drift, long-term monitoring, and fail-safe strategies. Therefore, this invention designs a self-learning calibration system and method for the anti-pinch force curve of automotive sunroofs. Summary of the Invention

[0005] The purpose of this invention is to solve the problems in the prior art, and to propose a self-learning calibration system and method for the anti-pinch force curve of an automotive sunroof.

[0006] This invention first discloses a self-learning calibration system for the anti-pinch force curve of an automotive sunroof, comprising the following steps: Step S100: During the sunroof closing process, the current signal of the sunroof drive motor and the position encoder signal of the sunroof are collected in real time, and the position, speed, acceleration and driving force of the sunroof at each sampling time are calculated. The above parameters are stored in the parameter storage area. Step S200: Based on the data sequence corresponding to a complete, undisturbed normal closing process, the parameter vector of the preset sunroof dynamics model is updated online using the recursive least squares method to realize the parameter vector learning process and verify whether the parameter vector passes the verification. Step S300: Based on the parameter vector updated in step S200, calculate the reference driving force required for the sunroof to close at a constant speed at each position throughout the entire stroke, and superimpose a safety force value on the reference driving force to generate a new anti-pinch force judgment curve. Step S400: Using the data from the normal closing process that triggered this parameter learning and the updated parameter vector obtained in step S200, perform virtual simulation to obtain a simulated force-position curve; calculate the similarity and deviation between the simulated force-position curve and the stored force-position curve of the historical normal closing process; only when the calculation results simultaneously meet the preset correlation coefficient threshold and error threshold, the verification is deemed successful, and the new anti-pinch force judgment curve generated in step S300 is set as the effective curve; Step S500: During the subsequent closing process of the sunroof, the current sunroof position and driving force are obtained in real time. The anti-pinch force threshold corresponding to the position is obtained by querying the currently effective anti-pinch force judgment curve. Based on the comparison result, the anti-pinch judgment is performed. The anti-pinch judgment adopts the judgment logic with time delay to prevent false triggering. Step S600, perform system maintenance, including: Perform regular calibration of the system hardware; Monitor the trigger frequency, verification results, and parameter change trends of the parameter learning process, and record diagnostic results. When the system continuously detects a fault during self-testing, it enters a fault-safe mode. The fault-safe mode includes stopping the self-learning function, switching to the pre-stored conservative default anti-pinch curve, and reporting diagnostic fault information.

[0007] In the above method, in step S200, the sunroof dynamics model is expressed in discrete-time form, as shown in the following formula:

[0008] In the formula: for Real-time measured driving force; This is the equivalent mass parameter of the system, characterizing inertia; for Acceleration at any moment; These are viscous damping parameters; for The speed of time; Here are the Coulomb friction parameters. It is a symbolic function; The viscous friction parameter is (N·s / m). These are the polynomial coefficients of the sealing resistance, with units of N / m, N / m², and N / m³, respectively. for Position at any given time (m); The parameter vector is composed of the above parameter combinations and is expressed as follows:

[0009] The learning process uses the parameter vector that was successfully learned and verified in the previous iteration as the initial value of the parameter vector. If this is the first run or the parameter storage area is found to be invalid, a preset nominal parameter vector is loaded. .

[0010] In the above system, step S200, which involves updating the parameter vector of the preset sunroof dynamics model online using the recursive least squares method, includes: A recursive least squares algorithm with a forgetting factor is used to iteratively calculate the prior estimation error and gain vector in the order of sampling points, and update the parameter vector estimate and covariance matrix to complete the parameter set.

[0011] In the above system, step S200 further includes: segmented learning of friction parameters, specifically: setting a velocity threshold, classifying data points with absolute velocity values ​​less than the threshold into a low-speed dataset, and independently estimating static friction parameters based on a simplified model; classifying data points with absolute velocity values ​​greater than or equal to the threshold into a high-speed dataset, and estimating Coulomb friction parameters and viscous friction parameters based on a complete dynamic model.

[0012] In the above system, step S200 further includes: receiving an ambient temperature signal and modeling the viscous damping parameter and / or friction parameter as a temperature-related function, and synchronously updating the temperature compensation coefficient during the parameter learning process.

[0013] In the above system, in step S200, the closing stroke of the sunroof is divided into multiple consecutive position intervals, and a sub-parameter vector is maintained independently for each position interval; during parameter learning, the interval to which the data point belongs is determined according to the position of the data point, and the sub-parameter vector of the corresponding interval is updated only using the data point.

[0014] In the above system, in step S300, after generating a new anti-pinch force determination curve, the system further includes performing digital filtering and smoothing on the force threshold of each discrete position point on the curve, checking the monotonicity of the smoothed curve, and correcting the non-monotonic segments.

[0015] In the above system, in step S400, the calculation of similarity and deviation between the simulated force-position curve and the stored historical force-position curve of the normal shutdown process specifically includes: calculating the Pearson correlation coefficient between the simulated curve and the average value of multiple historical curves to measure shape consistency, and calculating the normalized root mean square error to measure the overall numerical deviation.

[0016] Secondly, this invention discloses a self-learning calibration system for the anti-pinch force curve of an automotive sunroof, used to implement the above method, including: The data acquisition and processing module is used to acquire and process motor current and position encoder signals in real time during the sunroof closing process, and calculate the sunroof's position, speed, acceleration and driving force. The parameter learning module is used to update the parameter vector of the sunroof dynamics model online using the recursive least squares method based on data from a complete normal closing process. An adaptive curve generation module is used to calculate and generate a new anti-pinch force determination curve based on the latest parameter vector output by the parameter learning module. The safety verification module is used to perform virtual simulation using the shutdown process data that triggered this learning and the new parameter vector, and compare the simulation results with historical normal data for verification. The new curve is only allowed to take effect after the verification is passed. The anti-pinch control execution module is used to perform real-time clamping judgment and control based on the currently effective anti-pinch force judgment curve during the sunroof closing process.

[0017] In the above system, the security verification module specifically includes: The simulation unit is used to perform numerical integration based on the new parameter vector and the measured driving force sequence to obtain the simulated force-position curve; The historical data management unit is used to store and manage the force-position curves of the most recently verified normal shutdown processes; The analysis and decision unit is used to calculate the correlation coefficient and normalization error between the simulated curve and the historical average curve, and compare them with a preset threshold to make a decision on whether the verification is successful.

[0018] The beneficial effects of this invention are as follows: 1. By establishing a dynamic model based on physical laws and using the recursive least squares method for online parameter identification, it is possible to accurately track the time-varying mechanical characteristics of the sunroof caused by wear, lubrication, and temperature changes, fundamentally solving the problem of inaccurate fixed curves and making anti-pinch judgment more accurate.

[0019] 2. A multi-layered security verification mechanism, including virtual simulation and historical data comparison, is introduced to conduct an independent and quantitative security assessment before the new curve takes effect. This effectively intercepts unreliable learning results caused by abnormal data or algorithm fluctuations, greatly improving the security and robustness of the self-learning process. This is the core advancement compared to existing adaptive solutions.

[0020] 3. It integrates optimization strategies such as friction segmentation identification, temperature compensation, stroke partitioning learning, and curve smoothing, making the model closer to complex physical realities. The added periodic sensor calibration, condition monitoring and diagnostics, and comprehensive fault-tolerant strategies ensure long-term stable and reliable operation of the system throughout its entire lifecycle, reducing maintenance costs and safety risks. Attached Figure Description

[0021] Figure 1 This is a flowchart of a self-learning calibration system for the anti-pinch force curve of an automotive sunroof, as disclosed in this invention.

[0022] Figure 2 This is a schematic diagram illustrating the operation of a self-learning calibration method for the anti-pinch force curve of an automobile sunroof disclosed in this invention. Detailed Implementation

[0023] To facilitate understanding of this application and to make the aforementioned objectives, features, and advantages of this application more apparent, a detailed description of specific embodiments of this application is provided below in conjunction with the accompanying drawings. Numerous specific details are set forth in the following description to provide a thorough understanding of this application, and preferred embodiments are shown in the accompanying drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application. This application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below. Furthermore, 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 indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. In the description of this application, "several" means at least one, such as one, two, etc., unless otherwise explicitly specified. It should be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementations. 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 belongs. The terminology used herein is only for describing particular implementations and is not intended to limit the scope of this application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0024] refer to Figures 1-2 This invention discloses a self-learning calibration method for the anti-pinch force curve of an automotive sunroof, comprising the following steps: S100: During the sunroof closing process, the current signal of the sunroof drive motor and the position encoder signal of the sunroof are collected in real time, and the position, speed, acceleration and driving force of the sunroof at each sampling time are calculated. The above parameters are stored in the parameter storage area. This stage involves real-time acquisition and processing of sensor signals during the sunroof closing process to obtain physical quantity data of its motion state. This stage is conducted in each control cycle. implement, The time is 10ms, and step S100 specifically includes the following steps: S101: Sensor Signal Acquisition and Digitization The sunroof drive motor's operating current is supplied through a resistor. The detection is performed using a 5mΩ sampling resistor. The voltage drop across the sampling resistor is passed through a gain converter. It is amplified by a 50-volt differential amplifier to output an analog voltage signal from 0 to 5V.

[0025] This voltage signal is connected to the microprocessor's ADC input channel, the ADC is configured for 12-bit resolution, and the reference voltage is... The voltage is 3.3V, so the output digital value range is 0 to 4095.

[0026] At the beginning of each control cycle, an ADC conversion is triggered once. After the conversion is completed, the result is read and recorded as the current sample value. ,in This is the sampling sequence number.

[0027] The position of the sunroof is detected by an incremental photoelectric encoder. The encoder outputs square wave signals with a 90-degree phase difference between phases A and B, which are connected to the two input channels of the microprocessor timer.

[0028] The timer is configured in encoder interface mode, counting both the rising and falling edges of phases A and B to achieve a 4x frequency multiplication. At the beginning of each control cycle, the current value of the timer counter is read and recorded as the position pulse count value. Then the counter is reset to zero.

[0029] S102: Calculation and Conversion of Physical Quantities Calculations are performed on the acquired digital signals.

[0030] Conversion of electric current to driving force: First, calculate the physical value of the electric current. (Unit: A): (1) In the formula, This is the zero-point offset voltage (unit: V) of the amplifier circuit, which is calibrated and determined at the factory.

[0031] driving force The formula for calculating (unit: N) is: (2) Force conversion coefficient (Unit: N / A) is determined by the following formula: (3) in, This is the motor torque constant (unit: N·m / A). The mechanical efficiency of the transmission system (dimensionless). The reduction ratio of the gearbox is dimensionless.

[0032] Position calculation: The actual linear displacement corresponding to each encoder count is determined by the mechanical design and is denoted as the encoder resolution. (Unit: m / time, for example) m / time). Absolute position of the sunroof. (Unit: m) The result is obtained through cumulative calculation: (4) The known starting position after the sunroof is initialized.

[0033] Velocity calculation: Instantaneous velocity is calculated using the central difference method. (Unit: m / s): (5) For the start of the sequence ( The forward or backward difference method is used to determine the starting and ending points.

[0034] Acceleration calculation: Instantaneous acceleration is calculated using the central difference method as well. (Unit: m / s²): (6) S103: Data Caching and Management After the calculation is complete, the quadruple data will be... Store the data in a pre-allocated circular buffer. The length of this buffer is sufficient to store all data points for a complete shutdown process.

[0035] The buffer management structure contains fields such as timestamp and process identifier. It also records the starting sampling index of this shutdown process. and end sampling index .

[0036] S200: Based on the data sequence corresponding to a complete, undisturbed normal closing process, the parameter vector of the preset sunroof dynamics model is updated online using the recursive least squares method. This realizes the parameter vector learning process and verifies whether the parameter vector passes the verification. In this stage, the data from this process is used to update the set of dynamics model parameters characterizing the mechanical properties of the sunroof. Specifically, it includes the following steps: S201: Parameter Learning Trigger Condition Determination The system checks whether the data from this shutdown process can be used for parameter learning, and the determination is based on the following conditions: 1. Command Source Verification: Parse the CAN bus message and check the command identifier that triggered this shutdown. The command source is considered legitimate only if the identifier matches a preset normal user operation command code. Diagnostic commands or internal system calibration commands do not trigger learning.

[0037] 2. Process integrity check: Check the anti-pinch interruption flag to confirm that the current closing process was not interrupted by the anti-pinch reversal, and calculate the stroke completion rate.

[0038] in The total travel distance of the sunroof is expressed in meters. At that time, the trip was deemed complete.

[0039] 3. Data rationality analysis: Analysis of the velocity sequence of this process. and acceleration sequence Perform the analysis. Require the speed standard deviation. Maximum acceleration less than a set threshold (e.g., 0.01 m / s²) The speed is less than a set threshold (e.g., 0.5 m / s²), and the speed profile generally follows a trend of first increasing and then decreasing. These thresholds are determined based on the characteristics of the motor and mechanical system and can be stored in a configurable memory area.

[0040] When all the above conditions are met, the system determines that the data from this shutdown process is valid and initiates the parameter learning process. This multi-condition determination constitutes a preliminary screening step in the parameter learning process.

[0041] S202: Dynamic Model Establishment and Parameter Initialization A parametric dynamic model is used to describe the sunroof motion. This model operates at discrete time points. The expression form is:

[0042] In the formula: for The measured driving force (N) at any given time.

[0043] The equivalent mass parameter (kg) of the system characterizes inertia.

[0044] for Acceleration at time (m / s²).

[0045] The value is the viscous damping parameter (N·s / m).

[0046] for Velocity at any given time (m / s).

[0047] Let N be the Coulomb friction parameter. For symbolic functions, Take 1 at time. The value is -1 when |v| is less than the minimum threshold, and 0 when |v| is less than the minimum threshold.

[0048] The value represents the viscous friction parameter (N·s / m).

[0049] These are the polynomial coefficients for sealing resistance (units are N / m, N / m², and N / m³, respectively).

[0050] for Position at any given time (m).

[0051] All parameters to be learned constitute a vector. At the start of the learning process, the parameter vector that was successfully learned and validated in the last iteration is read from non-volatile memory as the initial value. .

[0052] If this is the first run or an invalid parameter storage area is detected, a set of factory-preset nominal parameter values ​​are loaded from the read-only memory (ROM). .

[0053] These parameter values ​​are statistical averages obtained during the product manufacturing phase by conducting multiple standard operating condition closure tests on sunroof samples of the same model, and applying the aforementioned learning algorithm. Simultaneously, the covariance matrix of the recursive least squares method is initialized. For example, a diagonal matrix , It is a 7th order identity matrix.

[0054] S203: Parameter Update Based on Recursive Least Squares Rewrite the dynamic model in linear regression form:

[0055] Among them, the regression vector .

[0056] Using a forgetting factor Online parameter estimation using recursive least squares method. The value is 0.98. For each sampling point in this valid data sequence. ( From 1 to The recursive algorithm performs the following calculations in sequence: prior estimation error Calculation of gain vector Calculation, parameter vector Update and covariance matrix The update is as follows: 1. Calculate the prior estimation error: .

[0057] 2. Calculate the gain vector: .

[0058] 3. Update parameter estimates: .

[0059] 4. Update the covariance matrix: .

[0060] To avoid covariance matrix After long-term operation, the parameter tracking capability is lost due to convergence to an excessively small value; the system monitors its trajectory. If... ( For small positive numbers, such as ), then Reset to the initial diagonal matrix .

[0061] After the learning process is complete, the updated parameter vector is obtained. Output Used for subsequent curve generation and security verification.

[0062] S204: Segmented learning processing of friction parameters, specifically: setting a velocity threshold, data points with absolute velocity values ​​less than the threshold are classified into the low-speed dataset, and static friction parameters are independently estimated based on a simplified model; data points with absolute velocity values ​​greater than or equal to the threshold are classified into the high-speed dataset, and Coulomb friction parameters and viscous friction parameters are estimated based on a complete dynamic model. Specifically: Set a small speed threshold (For example, 0.002 m / s). Divide the data points into two groups. For The data points were grouped into the low-speed dataset and a simplified model was used. Independent estimation of static friction parameters .

[0063] for The data points are grouped into a high-speed dataset, and the complete recursive least squares method in S203 is used to learn and estimate the Coulomb friction parameters. With viscous friction coefficient After completing the learning, and After merging (e.g., taking the arithmetic mean), update the parameter vector. middle.

[0064] S205: Parameter learning including temperature compensation. Further, as a preferred embodiment, the system receives the ambient temperature signal and models the viscous damping parameter and / or friction parameter as a temperature-related function, and updates the temperature compensation coefficient synchronously during the parameter learning process.

[0065] Specifically, the system reads the average ambient temperature during this shutdown process. (Unit: °C). The damping coefficient is modeled as... ,in For reference temperature (e.g., 25°C). and The temperature compensation coefficient to be learned.

[0066] In a single learning process, use The temperature compensation factor is calculated, and the effective damping parameters at the current temperature are updated. The system integrates learning results from multiple studies at different temperatures to improve its performance. and Long-term estimates and updates are conducted.

[0067] Coulomb friction parameters can be modeled using a similar linear temperature compensation model. The temperature signal can be acquired directly from a temperature sensor connected to the ADC, or received periodically from the body controller via the CAN bus.

[0068] S206: Parameter Learning for Segmented Journeys Furthermore, as a preferred implementation, the system divides the sunroof closing stroke into multiple consecutive position intervals and maintains an independent sub-parameter vector for each position interval. During parameter learning, the system determines the interval to which a data point belongs based on its position and updates the sub-parameter vector of the corresponding interval using only that data point. Specifically, this is implemented by: dividing the total sunroof stroke... Divided into 1 consecutive interval. For each interval... Maintain independent parameter vectors Covariance Matrix .

[0069] When processing data points, based on their location Determine the relevant interval and update the corresponding interval using only that data point. and The update algorithm is the same as S203. For data in the overlapping area of ​​the interval boundary, it can be used to update the parameters of adjacent intervals and assign weights according to distance.

[0070] After completing the course, you will receive Group updated sub-parameter set This method is used to more accurately describe the spatial non-uniformity of sunroof drag throughout its entire travel.

[0071] S300: Generation of anti-pinch force determination curve based on updated parameters. After generating the new anti-pinch force determination curve, the method further includes digital filtering and smoothing of the force threshold at each discrete position point on the curve, checking the monotonicity of the smoothed curve, and correcting non-monotonic segments. This includes the following steps: S301: Calculation of Reference Force Curve Assuming the sunroof travels at a constant standard speed If the circuit closes at a constant speed (e.g., 0.05 m / s), the acceleration is zero. This is based on the updated parameter set. Calculate the points at each location along the entire journey. The expected benchmark driving force required above :

[0072] Among them, location From the fully open sunroof position ( Start the calculation.

[0073] S302: Anti-pinch threshold curve generation In reference force On top of this, a preset fixed safety force value is added. (e.g., 10N), to obtain the anti-pinch trigger force threshold curve. :

[0074] The curve defines the position of the sunroof. If the real-time driving force exceeds The system will then determine that an obstacle has been encountered.

[0075] S303: Curve Discretization and Storage Continuous travel positions Discretize into points (e.g.) ), , , .

[0076] Calculate each discrete location point Corresponding anti-pinch threshold , to pair the numerical values ​​into a sequence The newly generated anti-pinch force determination curve is stored in non-volatile memory in the form of a lookup table.

[0077] The system employs a wear leveling strategy to manage write operations to this storage area, which dynamically maps logical curve storage addresses to different physical storage units to avoid frequent erasing and writing of fixed areas of non-volatile memory and extend its lifespan.

[0078] S304: Post-processing for curve smoothing Furthermore, as a preferred embodiment, after generating a new anti-pinch force determination curve, the curve generation module also performs digital filtering on the force threshold of each discrete point on the curve to eliminate non-monotonic jumps or local noise on the curve and ensure that the curve is smooth overall.

[0079] Specifically, the implementation involves: processing discrete sequences Smoothing filtering is performed using a five-point quadratic Savitzky-Golay filter, for internal points... ( ), smoothed value The calculation is as follows:

[0080] Boundary processing is applied to both ends of the sequence. The monotonicity of the smoothed curve is then checked. If detected... ( If the tolerance is small (e.g., 0.05N), it is determined to be a non-monotonic segment, and linear interpolation is performed on the segment to force it to monotonically increase.

[0081] The processed sequence is stored as the final anti-pinch force determination curve. This processing can suppress local irregularities in the curve caused by data noise or parameter identification fluctuations.

[0082] S305: Curve Synthesis Based on Piecewise Parameters For the S206 segmented learning approach, curve generation requires segmented calculation. For each travel interval... Use the parameter set of this range Calculate the anti-pinch threshold within the interval .

[0083] At the junctions of intervals, by setting overlapping areas and linear weighted averages, the generated curve is ensured to transition smoothly.

[0084] S400: Security Verification of Newly Generated Anti-Pinch Curve This stage verifies the safety and rationality of the new anti-pinch force judgment curve generated by S300. Only after successful verification can it be implemented in actual control. The main approach is to calculate the similarity and deviation between the simulated force-position curve and the stored historical force-position curves of the normal closing process. Specifically, this includes calculating the Pearson correlation coefficient between the simulated curve and the average of multiple historical curves to measure shape consistency, and calculating the normalized root mean square error to measure overall numerical deviation. The specific steps are as follows: S401: Virtual Simulation Based on New Parameters Using the data from the normal shutdown process that triggered this learning process, along with the new parameter set. Simulation verification was performed.

[0085] 1. Determine the initial state of this process: Initial position initial velocity .

[0086] 2. Utilize and measured driving force sequence Numerical integration simulation was performed using the Euler method (step size). ): ; ;

[0087] in and in accordance with calculate.

[0088] 3. The simulation ran to obtain the position sequence. ,Will and Pair and resample to standard location points using linear interpolation The simulated force-position curve was obtained. .

[0089] S402: Acquisition and Normalization Preprocessing of Historical Reference Curves Retrieve the most recent data from the historical database of nonvolatile memory. The force-position curves corresponding to the previously verified normal shutdown process are used as a reference curve set. .

[0090] Furthermore, as a preferred embodiment, before the safety verification module performs the comparison, the retrieved historical actual force-position curves are first normalized to eliminate systematic measurement differences caused by sensor zero-point drift or gain changes.

[0091] Specifically, the implementation involves recording the sensor gain associated with the acquisition time when storing each historical curve. and zero point (corresponding to equation (1) In formula (3) (The combined effects).

[0092] Before verification, based on the current gain of the system and zero point For each force value in the historical curve Recalibrate: This process eliminates the effects of long-term sensor drift, ensuring that all historical data are compared against the same benchmark.

[0093] S403: Calculation of Similarity and Deviation Indicators Simulation curve Compare with the preprocessed historical reference curve set.

[0094] 1. Calculate the average curve of the historical reference curve. : .

[0095] 2. Calculation and Pearson correlation coefficient This measures the consistency of shape trends.

[0096]

[0097] in This is the sequence mean.

[0098] 3. Calculate the normalized root mean square error (NRMSE) to measure the overall numerical deviation.

[0099]

[0100] in and for The maximum and minimum forces in the sequence.

[0101] S404: Verification Threshold Determination and Arbitration Preset threshold condition for successful verification: correlation coefficient (e.g., 0.85), and (e.g., 0.15).

[0102] The system determines the calculated Do NRMSE and NRMSE both meet the conditions?

[0103] If the verification passes, the new anti-pinch curve will be marked as "valid" and made effective, replacing the old curve. Simultaneously, the characteristic data of this process (such as...) will be... The processed actual curve is stored in the historical database.

[0104] If the verification fails, the new curve is discarded, and the original curve remains in effect. Each failed learning verification event is recorded, and a consecutive failure counter is incremented.

[0105] If the counter exceeds the set threshold, the system suspends the self-learning function, sends a diagnostic fault code conforming to the UDS (Unified Diagnostic Services) protocol (e.g., 0xU1A23, indicating "Sunroof anti-pinch control module self-learning function malfunction") via the CAN bus, and illuminates the fault indicator light. The suspension state can continue until the next vehicle power key cycle or is cleared by a diagnostic tool.

[0106] S405: Queue Management for Historical Databases Furthermore, as a preferred embodiment, the historical normal shutdown process data stored in the memory is managed in a queue manner, retaining only the latest record a fixed number of times; Whenever new shutdown process data is verified by the security verification module and used to update the parameter set, the data is added to the queue, and the oldest data in the queue is removed.

[0107] Specifically, this is implemented by allocating a fixed-capacity memory space in the non-volatile memory. A circular buffer is used as a historical database. A write pointer is maintained. When new data is stored, write The location it points to, and then If the buffer is full, the oldest record is overwritten.

[0108] When reading, always from Read position sequentially This mechanism ensures that the historical reference dataset used for security verification always consists of the most recent data.

[0109] S500: Real-time anti-pinch control based on the effective anti-pinch curve During this stage, as the sunroof closes, real-time clamping judgment and control are performed based on the currently effective anti-pinch force judgment curve.

[0110] S501: Real-time Status Awareness Within each control cycle: 1. Execute S101 to collect current data. and .

[0111] 2. Execute S102 to calculate the current sunroof position. and current driving force .

[0112] S502: Real-time Anti-pinch Threshold Query according to A linear interpolation lookup is performed in the currently active anti-pinch curve lookup table to obtain the current threshold. :

[0113] in and To look up the table with Two adjacent points.

[0114] S503: Clamping Event Judgment Logic A decision logic with time hysteresis is employed to prevent false triggering. To avoid misjudgment caused by the motor starting current surge, a time hysteresis is used in the initial phase after the shutdown command is issued (such as the first...). Within milliseconds, the anti-pinch detection can be temporarily disabled or relaxed.

[0115] 1. When At that time, start or increment a software counter. .

[0116] 2. If Persistently greater than The number of cycles exceeds the threshold (corresponding time) For example, 30ms, that is If the event is valid, it is considered a valid clamping event.

[0117] 3. If during the counting period Then clear to zero. .

[0118] S504: Anti-pinch action executed Once a valid clamp is determined: 1. Immediately send a reverse command to the motor driver (e.g., set the target speed to be...). ,in (This is the preset reversal speed).

[0119] 2. Preset retraction distance for controlling the sunroof's reverse movement. (e.g., 0.1m).

[0120] 3. After the action is completed, the system enters standby mode and sets the anti-pinch event flag.

[0121] If the anti-pinch function is not triggered throughout the process, the sunroof will close normally to the end.

[0122] S600: System Auxiliary Functions and Maintenance This phase provides support for the long-term stable operation of the system.

[0123] S601: Periodic sensor calibration Zero-point calibration: When the sunroof is stationary, control the motor to reduce the output force to zero, and collect data for a period of time. Value, calculate median Then the new zero-point offset .

[0124] Gain calibration: At the midpoint of the stroke, a calibration force is applied by an external tool. (e.g., 50N), record the force value calculated by the system at this time. Calculate the new total gain correction factor. During the actual update, it can be corrected. or To compensate for gain error.

[0125] S602: Learning Status Monitoring and Diagnosis Record learning triggers, verification results, and key parameters (such as...) , , The system collects historical trend data and sets monitoring thresholds. When parameter changes abnormally (such as excessively large short-term fluctuations), diagnostic information is sent via the CAN bus for potential fault warnings.

[0126] S603: Fail-Safe Strategy When the system detects multiple consecutive learning and verification failures, persistent abnormal sensor signals, or critical parameters severely exceeding limits, it determines that the system has entered fail-safe mode. In this mode: (1) Stop the self-learning function; (2) A pre-stored, conservative default anti-pinch curve is used. (3) Send a clear diagnostic fault code (such as 0xU1A23) via the CAN bus and illuminate the fault indicator light on the instrument panel; (4) Store detailed fault snapshot information to non-volatile memory for after-sales diagnosis.

[0127] Secondly, this invention discloses a self-learning calibration system for the anti-pinch force curve of a car sunroof, used to implement the above method. The system includes a car sunroof electronic control unit (ECU), which comprises a microprocessor, non-volatile memory such as EEPROM or Flash, an analog-to-digital converter (ADC), a digital input / output interface, and a controller area network (CAN) bus controller. The system also includes the following components: The data acquisition and processing module is used to acquire and process motor current and position encoder signals in real time during the sunroof closing process, and calculate the sunroof's position, speed, acceleration and driving force. The parameter learning module is used to update the parameter vector of the sunroof dynamics model online using the recursive least squares method based on data from a complete normal closing process. An adaptive curve generation module is used to calculate and generate a new anti-pinch force determination curve based on the latest parameter vector output by the parameter learning module. The anti-pinch control execution module is used to perform real-time clamping judgment and control based on the currently effective anti-pinch force judgment curve during the sunroof closing process.

[0128] The safety verification module is used to perform virtual simulation using the shutdown process data that triggered this learning and the new parameter vector, and compares the simulation results with historical normal data for verification. The new curve is only allowed to take effect after the verification is passed. The safety verification module specifically includes: The simulation unit is used to perform numerical integration based on the new parameter vector and the measured driving force sequence to obtain the simulated force-position curve; The historical data management unit is used to store and manage the force-position curves of the most recently verified normal shutdown processes; The analysis and decision unit is used to calculate the correlation coefficient and normalization error between the simulated curve and the historical average curve, and compare them with a preset threshold to make a decision on whether the verification is successful.

[0129] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative and not exhaustive. All modifications within the scope of this invention or its equivalents are included in this invention.

Claims

1. A self-learning calibration method for the anti-pinch force curve of an automotive sunroof, characterized in that, Includes the following steps: Step S100: During the sunroof closing process, the current signal of the sunroof drive motor and the position encoder signal of the sunroof are collected in real time, and the position, speed, acceleration and driving force of the sunroof at each sampling time are calculated. The above parameters are stored in the parameter storage area. Step S200: Based on the data sequence corresponding to a complete, undisturbed normal closing process, the parameter vector of the preset sunroof dynamics model is updated online using the recursive least squares method to realize the parameter vector learning process and verify whether the parameter vector passes the verification. Step S300: Based on the parameter vector updated in step S200, calculate the reference driving force required for the sunroof to close at a constant speed at each position throughout the entire stroke, and superimpose a safety force value on the reference driving force to generate a new anti-pinch force judgment curve. Step S400: Using the data from the normal closing process that triggered this parameter learning and the updated parameter vector obtained in step S200, perform virtual simulation to obtain the simulated force-position curve; The similarity and deviation of the simulated force-position curve and the stored force-position curve of the historical normal closing process are calculated. Only when the calculation result meets the preset correlation coefficient threshold and error threshold is the verification determined to be successful, and the new anti-pinch force determination curve generated in step S300 is set as the effective curve. Step S500: During the subsequent closing process of the sunroof, the current sunroof position and driving force are obtained in real time. The anti-pinch force threshold corresponding to the position is obtained by querying the currently effective anti-pinch force judgment curve. Based on the comparison result, the anti-pinch judgment is performed. The anti-pinch judgment adopts the judgment logic with time delay to prevent false triggering. Step S600, perform system maintenance, including: Perform regular calibration of the system hardware; Monitor the trigger frequency, verification results, and parameter change trends of the parameter learning process, and record diagnostic results. When the system continuously detects a fault during self-testing, it enters a fault-safe mode. The fault-safe mode includes stopping the self-learning function, switching to the pre-stored conservative default anti-pinch curve, and reporting diagnostic fault information.

2. The self-learning calibration method according to claim 1, characterized in that, In step S200, the sunroof dynamics model is expressed in discrete-time form, as shown in the following formula: In the formula: for Real-time measured driving force; This is the equivalent mass parameter of the system, characterizing inertia; for Acceleration at any moment; These are viscous damping parameters; for The speed of time; Here are the Coulomb friction parameters. It is a symbolic function; The viscous friction parameter is (N·s / m). These are the polynomial coefficients of the sealing resistance, with units of N / m, N / m², and N / m³, respectively. for Position at any given time (m); The parameter vector is composed of the above parameter combinations and is expressed as follows: The learning process uses the parameter vector that was successfully learned and verified in the previous iteration as the initial value of the parameter vector. If this is the first run or the parameter storage area is found to be invalid, a preset nominal parameter vector is loaded. .

3. The self-learning calibration method according to claim 2, characterized in that, In step S200, the online updating of the parameter vector of the preset sunroof dynamics model using the recursive least squares method includes: A recursive least squares algorithm with a forgetting factor is used to iteratively calculate the prior estimation error and gain vector in the order of sampling points, and update the parameter vector estimate and covariance matrix to complete the parameter set.

4. The self-learning calibration method according to claim 2 or 3, characterized in that, Step S200 further includes: segmented learning of friction parameters, specifically: setting a velocity threshold, classifying data points with absolute velocity values ​​less than the threshold into a low-speed dataset, and independently estimating static friction parameters based on a simplified model; classifying data points with absolute velocity values ​​greater than or equal to the threshold into a high-speed dataset, and estimating Coulomb friction parameters and viscous friction parameters based on a complete dynamic model.

5. The self-learning calibration method according to claim 2 or 3, characterized in that, Step S200 further includes: receiving an ambient temperature signal and modeling the viscous damping parameter and / or friction parameter as a temperature-related function, and synchronously updating the temperature compensation coefficient during the parameter learning process.

6. The self-learning calibration method according to claim 1, characterized in that, In step S200, the closing stroke of the sunroof is divided into multiple consecutive position intervals, and a sub-parameter vector is maintained independently for each position interval. During parameter learning, the interval to which a data point belongs is determined based on the position of the data point, and the sub-parameter vector of the corresponding interval is updated using only the data point.

7. The self-learning calibration method according to claim 1, characterized in that, In step S300, after generating a new anti-pinch force determination curve, the method further includes performing digital filtering and smoothing on the force threshold of each discrete position point on the curve, checking the monotonicity of the smoothed curve, and correcting the non-monotonic segments.

8. The self-learning calibration method according to claim 1, characterized in that, In step S400, the similarity and deviation calculation of the simulated force-position curve and the stored historical force-position curve of the normal shutdown process specifically includes: calculating the Pearson correlation coefficient between the simulated curve and the average value of multiple historical curves to measure shape consistency, and calculating the normalized root mean square error to measure the overall numerical deviation.

9. A self-learning calibration system for the anti-pinch force curve of an automotive sunroof, comprising an automotive sunroof electronic control unit (ECU), used to implement the method according to any one of claims 1 to 8, characterized in that, The electronic control unit (ECU) for a car sunroof includes a microprocessor, non-volatile memory, and a controller. The system also includes: The data acquisition and processing module is used to acquire and process motor current and position encoder signals in real time during the sunroof closing process, and calculate the sunroof's position, speed, acceleration and driving force. The parameter learning module is used to update the parameter vector of the sunroof dynamics model online using the recursive least squares method based on data from a complete normal closing process. An adaptive curve generation module is used to calculate and generate a new anti-pinch force determination curve based on the latest parameter vector output by the parameter learning module. The safety verification module is used to perform virtual simulation using the shutdown process data that triggered this learning and the new parameter vector, and compare the simulation results with historical normal data for verification. The new curve is only allowed to take effect after the verification is passed. The anti-pinch control execution module is used to perform real-time clamping judgment and control based on the currently effective anti-pinch force judgment curve during the sunroof closing process.

10. The self-learning calibration system according to claim 9, characterized in that, The security verification module specifically includes: The simulation unit is used to perform numerical integration based on the new parameter vector and the measured driving force sequence to obtain the simulated force-position curve; The historical data management unit is used to store and manage the force-position curves of the most recently verified normal shutdown processes; The analysis and decision unit is used to calculate the correlation coefficient and normalization error between the simulated curve and the historical average curve, and compare them with a preset threshold to make a decision on whether the verification is successful.