Artificial intelligence-based encoder dynamic error compensation method and system

CN123028645APending Publication Date: 2026-11-03CHANGZHOU YUHAO ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610991536.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Traditional encoder dynamic error compensation methods rely on offline calibration records and preset error mapping tables, which cannot effectively adapt to changes in speed, motor temperature and power supply status in the electric drive system of new energy vehicles, resulting in deviations in angle or position measurement data.

Method used

By acquiring encoder signals, vehicle operating status, and historical calibration records, a working condition feature sequence is generated. A machine learning error compensation model is used to estimate errors and determine confidence levels, dynamically adjust the compensation amount, and call the error mapping table or the most recent effective compensation amount when necessary to form a compensation closed loop.

Benefits of technology

It achieves real-time matching between encoder angle or position measurement data and vehicle operating status, reduces deviations in drive control calculations, and improves the accuracy and stability of electric drive systems for new energy vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123028645A_ABST
    Figure CN123028645A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of machine learning, and particularly discloses an encoder dynamic error compensation method and system based on artificial intelligence, which comprises the following steps: acquiring pulse signals, sine and cosine signals, sampling time and rotation angle interval of a vehicle-grade encoder, acquiring rotation speed, motor temperature, power supply state and historical calibration records, generating a working condition characteristic sequence according to a sampling window, inputting a machine learning error compensation model to obtain an error estimation value and a compensation confidence, determining a fusion compensation value according to the error estimation value, a calibration compensation value of an error mapping table and the compensation confidence, and correcting encoder angle or position data. Through the working condition characteristic sequence, model reasoning, mapping compensation and running deviation information feedback, the compensation value is associated with the current sampling state, the error mapping table or the latest effective compensation value is called when the compensation confidence does not meet a preset condition, and abnormal compensation is limited to be transmitted to a driving control program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and more specifically to a method and system for dynamic error compensation of encoders based on artificial intelligence. Background Technology

[0002] In the field of machine learning technology, activities typically revolve around the acquisition, annotation, training, verification, deployment, and retrieval of sample data, feature variables, training models, and inference results. Sensors, controllers, memory, and processors work together according to the data flow to calculate and judge the temporal relationships, state changes, and numerical deviations in the input data. Among these, the traditional encoder dynamic error compensation method and system refers to the angle or position measurement process of automotive-grade encoders used in new energy vehicles. Based on the encoder output pulses, sine and cosine signals, speed, motor temperature, power supply status, and historical calibration records, the data is sent to the motor controller or upper-level calibration equipment via the vehicle bus or local interface. Comparison, interpolation, filtering, and compensation are performed according to the sampling time, angle range, speed range, and error mapping table. The compensated angle or position data is then transmitted to the drive control program for subsequent control calculations.

[0003] Traditional encoder dynamic error compensation relies on offline calibration records and preset error mapping tables. The compensation amount is mostly obtained by interpolation by looking up tables based on the sampling time, angle range, and speed range. The correlation between motor temperature, power supply status, and encoder original signal status within the same sampling window is limited. When the vehicle's operating conditions change, there is a matching lag between the fixed table entries and the current error status. The timing differences between different signal sources are difficult to reflect in the compensation amount call process. The compensated angle or position data will still transmit the deviation to the drive control calculation. Summary of the Invention

[0004] The purpose of this invention is to provide an encoder dynamic error compensation method and system based on artificial intelligence, which enables the dynamic error compensation process of automotive-grade encoders to correlate the encoder's original signal state, vehicle operating state, and historical calibration records within the same sampling window, and to form a compensation closed loop based on error estimation, confidence judgment, mapping compensation, and operation feedback, so as to meet the angle or position measurement compensation needs under the combined effects of speed, motor temperature, power supply status, and encoder signal changes during the operation of new energy vehicle electric drive systems.

[0005] To achieve the above objectives, this invention provides an artificial intelligence-based encoder dynamic error compensation method, comprising the following steps: acquiring the pulse signal, sine and cosine signals, sampling time, and angle interval of an automotive-grade encoder within the current sampling window, and acquiring the speed, motor temperature, power supply status, and historical calibration records provided by the motor controller; associating the pulse signal, sine and cosine signals, sampling time, angle interval, speed, motor temperature, power supply status, and historical calibration records according to the sampling window to generate a working condition feature sequence; inputting the working condition feature sequence into a machine learning error compensation model to obtain an error estimate and a compensation confidence level; determining a fusion compensation amount based on the error estimate, the calibration compensation amount corresponding to the error mapping table, and the compensation confidence level; when the compensation confidence level meets a preset condition, using the fusion compensation amount to correct the encoder angle or position data; when the compensation confidence level does not meet the preset condition, calling the error mapping table or the most recent valid compensation amount; outputting the corrected encoder angle or position data to the drive control program, and adjusting the compensation confidence level or fusion compensation amount of subsequent sampling windows according to the running deviation information returned by the drive control program.

[0006] Furthermore, the process of generating the operating condition feature sequence includes: using the sampling time as the time alignment reference, synchronously extracting the count change of the pulse signal, the amplitude state and phase state of the sine and cosine signals, and establishing a correspondence between the synchronous extraction results and the rotation angle interval; reading the speed, motor temperature and power supply status according to the same current sampling window, and selecting the operating status data that meets the preset synchronization conditions based on the encoder signal access time when the sampling times are inconsistent; reading the calibration error values ​​corresponding to the rotation angle interval and speed from the historical calibration records, and writing the synchronous extraction results, operating status data and calibration error values ​​into the operating condition feature sequence in the order of fields.

[0007] Furthermore, the selection process for operating status data whose time difference meets the preset synchronization conditions includes: calculating the time intervals between the speed sampling time, motor temperature sampling time, power supply status sampling time, and encoder signal access time respectively; when none of the time intervals exceed the allowable offset of the sampling window, the corresponding speed value, motor temperature value, and power supply status value are written into the operating condition feature sequence; when any time interval exceeds the allowable offset of the sampling window, the operating status data exceeding the allowable offset of the sampling window are discarded, and the operating status data that most recently met the preset synchronization conditions within the same vehicle operating cycle is called to participate in the generation of the operating condition feature sequence.

[0008] Furthermore, when calling the operating status data that most recently met the preset synchronization conditions within the same vehicle operating cycle to participate in the generation of the operating condition feature sequence, the corner interval corresponding to the operating status data that most recently met the preset synchronization conditions is first compared with the corner interval corresponding to the current sampling window. When the two corner intervals are consistent, the operating status data that most recently met the preset synchronization conditions is written into the operating condition feature sequence and a substitute source mark is attached. When the two corner intervals are inconsistent, the operating status data that does not exceed the allowable offset of the sampling window in the current sampling window is retained, and the data fields that exceed the allowable offset of the sampling window are written as null value marks, so that the machine learning error compensation model participates in the calculation of error estimation based on the substitute source mark or null value mark.

[0009] Furthermore, before inputting the operating condition feature sequence into the machine learning error compensation model, the operating condition feature sequence is validated. The validation includes: comparing the counting change direction corresponding to the pulse signal with the phase change direction corresponding to the sine and cosine signals; determining whether there is a correspondence between the corner interval and the calibration interval in the historical calibration record; verifying whether the power supply status is within the encoder signal acquisition allowable range; when the counting change direction, phase change direction, calibration interval correspondence, and power supply status all meet the input conditions, the operating condition feature sequence is input into the machine learning error compensation model; when any input condition is not met, the current input to the machine learning error compensation model is paused and the error mapping table is called.

[0010] Furthermore, the process of inputting the operating condition feature sequence into the machine learning error compensation model includes: reading the pulse signal field, sine and cosine signal field, angle interval field, speed field, motor temperature field, power supply status field, and calibration error field from the operating condition feature sequence according to the sampling window order; normalizing the numerical changes of the same field in adjacent sampling windows, and combining the normalization result with the field value corresponding to the current sampling window as the model input data; and having the machine learning error compensation model output the error estimate and compensation confidence based on the model input data.

[0011] Furthermore, the process of determining the compensation confidence level includes: comparing the corner interval field in the model input data with the calibration interval coverage relationship in the historical calibration records to generate the operating condition coverage status; comparing the consistency of angle changes between the pulse signal field and the sine and cosine signal fields within the same sampling window to generate the signal consistency status; and determining the compensation confidence level based on the operating condition coverage status and the signal consistency status. When the operating condition coverage status is covered and the signal consistency status meets the consistency condition, the compensation confidence level is determined to meet the preset condition. When the operating condition coverage status is uncovered or the signal consistency status does not meet the consistency condition, the compensation confidence level is determined to not meet the preset condition.

[0012] Furthermore, the process of determining the fusion compensation amount based on the error estimate, the calibration compensation amount corresponding to the error mapping table, and the compensation confidence level includes: comparing the compensation confidence level with the confidence level threshold set in the preset conditions; when the compensation confidence level reaches the confidence level threshold, the error estimate and the calibration compensation amount are weighted according to the weight ratio corresponding to the compensation confidence level to obtain the fusion compensation amount; when the compensation confidence level is lower than the confidence level threshold, the calibration compensation amount corresponding to the current turning angle range and the current rotation speed in the error mapping table is read, and the difference between the calibration compensation amount and the most recent effective compensation amount is compared. When the difference meets the limiting condition, the calibration compensation amount is used; when the difference does not meet the limiting condition, the most recent effective compensation amount is used.

[0013] Furthermore, the process of adjusting the compensation confidence level or fusion compensation amount of subsequent sampling windows based on the running deviation information returned by the drive control program includes: after the corrected encoder angle or position data is output to the drive control program, the speed estimation deviation and torque command deviation within the same vehicle running cycle are read as running deviation information; when both the speed estimation deviation and torque command deviation are within the feedback allowable range, the compensation confidence level adjustment coefficient of subsequent sampling windows is maintained; when the speed estimation deviation or torque command deviation exceeds the feedback allowable range, the compensation confidence level adjustment coefficient of subsequent sampling windows is reduced, and the fusion compensation amount is corrected according to the reduced compensation confidence level adjustment coefficient.

[0014] This invention also provides an AI-based encoder dynamic error compensation system. This system supports the aforementioned AI-based encoder dynamic error compensation method. The system includes an encoder signal access unit, a vehicle operating status access unit, a working condition feature construction unit, an error compensation inference unit, a mapping compensation storage unit, a fusion compensation calculation unit, and a feedback correction unit. The encoder signal access unit is connected to an automotive-grade encoder and outputs pulse signals, sine and cosine signals, and sampling times. The vehicle operating status access unit is connected to a motor controller, a temperature detector, and a power supply detection circuit and outputs speed, motor temperature, and power supply status. The working condition feature construction unit associates the data output by the encoder signal access unit and the vehicle operating status access unit with historical calibration records to form a working condition feature sequence. The error compensation inference unit calls a machine learning error compensation model to output an error estimate and a compensation confidence level. The fusion compensation calculation unit generates a fusion compensation amount based on the error estimate, the error mapping table in the mapping compensation storage unit, and the compensation confidence level. The feedback correction unit corrects the subsequent compensation process based on the operating deviation information returned by the drive control program.

[0015] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:

[0016] In this invention, by associating the pulse signal, sine and cosine signals, sampling time, and angle interval of the automotive-grade encoder with the rotational speed, motor temperature, power supply status, and historical calibration records according to the sampling window, the operating condition feature sequence can simultaneously characterize the signal state and the vehicle operating state. The machine learning error compensation model outputs the error estimate and compensation confidence level, and the fused compensation amount is jointly determined by the error estimate, calibration compensation amount, and compensation confidence level, so that the compensation amount generation matches the current operating condition. When the compensation confidence level does not meet the preset conditions, the error mapping table or the most recent valid compensation amount is called, and the subsequent compensation process is corrected with the operating deviation information, so that the transmission of abnormal output to drive control calculation is restricted. Attached Figure Description

[0017] Figure 1 This is the main flowchart of the encoder dynamic error compensation of the present invention;

[0018] Figure 2 This is a schematic diagram of the data association in the sampling window of the present invention;

[0019] Figure 3 This is a schematic diagram of input verification and model inference in this invention;

[0020] Figure 4 This is a schematic diagram illustrating the fusion of compensation and feedback correction in this invention;

[0021] Figure 5 This is a schematic diagram of the collaborative structure of the error compensation system modules of the present invention. Detailed Implementation

[0022] The embodiments of the present invention will be described below with reference to the accompanying drawings. Subsequent embodiments are based on the previously disclosed AI-based encoder dynamic error compensation method and system. In the following text, "automotive-grade encoder" refers to an encoder installed in the electric drive system of a new energy vehicle and used to output angle or position-related signals; "motor controller" refers to an on-board control component that receives encoder-related signals and participates in drive control calculations; and "drive control program" refers to a program that runs in the motor controller or on-board processing resources and calls the corrected encoder angle or position data. The meanings of pulse signal, sine / cosine signal, sampling time, angle range, speed, motor temperature, power supply status, historical calibration records, operating condition characteristic sequence, machine learning error compensation model, error estimate, compensation confidence level, error mapping table, calibration compensation amount, fusion compensation amount, and operating deviation information are all used as defined in the claims and the invention description. The step numbers in subsequent embodiments are only used to identify the execution order of the method. The figure numbers in the accompanying drawings are only used to illustrate the correspondence between the figures. If the component name is not assigned a numerical label, no numerical label will be added. The encoder signal access unit, vehicle operating status access unit, operating condition feature construction unit, error compensation inference unit, mapping compensation storage unit, fusion compensation calculation unit, and feedback correction unit in the system are all functional units in the claimed system subject matter, and their names are consistent with those in the claims. The preset conditions, allowable offsets, confidence thresholds, amplitude limiting conditions, and allowable feedback ranges in the embodiments are all determined by the vehicle control strategy, encoder signal acquisition rules, historical calibration records, or on-board controller configuration. They are not limited to specific values ​​in this specification, nor are the figure numbers, step numbers, or drawing numbers interpreted as quantities, parameters, sequential ranges, or performance indicators.

[0023] Please see Figures 1 to 4 This embodiment provides an AI-based dynamic error compensation method for encoders, applied to the angle or position measurement compensation process of automotive-grade encoders in electric drive systems of new energy vehicles. The method takes the correlation between encoder signals and vehicle operating status within the same sampling window as its entry point. It combines historical calibration records with the current operating conditions to form an input structure that can be called by a machine learning error compensation model. Then, through error estimation, confidence level determination, mapping compensation fusion, and operating deviation feedback, the compensation process can establish a correspondence with the current sampling state.

[0024] S1: Acquire the pulse signal, sine and cosine signals, sampling time, and angle range of the automotive-grade encoder within the current sampling window, and acquire the speed, motor temperature, power supply status, and historical calibration records provided by the motor controller. In this step, the pulse signal output by the automotive-grade encoder is used to characterize the encoder's count change within the sampling window; the sine and cosine signals are used to characterize the amplitude and phase states of the encoder as the angle changes; the sampling time is used to determine the time reference for the encoder signal entering the processing flow; and the angle range is used to determine the encoder angle position range corresponding to the current sampling window. The speed provided by the motor controller is used to characterize the current motor operating speed state; the motor temperature is used to characterize the correlation between the electric drive system's thermal state and the encoder measurement state; the power supply status is used to characterize the power supply conditions during encoder signal acquisition; and the historical calibration records are used to provide the sources of calibration errors related to the angle range and speed.

[0025] In S1, the encoder signal acquisition path is based on the signal access relationship between the automotive-grade encoder and the motor controller, while the vehicle operating status acquisition path is based on data provided by the motor controller, temperature detector, and power supply detection circuit. When the motor controller receives the aforementioned signals and statuses, it identifies the time attributes of the data entering the current sampling window, confirming the encoder signal access time, speed sampling time, motor temperature sampling time, and power supply status sampling time. These sampling times are not used to represent specific time values ​​but rather to determine whether different data can enter the same sampling window. Historical calibration records are retrieved from records generated during offline or automotive-grade encoder calibration. These records contain at least calibration error information corresponding to the angle range and speed, which can be used to generate subsequent calibration compensation values.

[0026] S2 associates the pulse signal, sine and cosine signals, sampling time, turning angle range, speed, motor temperature, power supply status, and historical calibration records according to the sampling window to generate a working condition feature sequence. This step does not simply summarize various data; instead, it establishes a window-based correspondence between the encoder's original signal, vehicle operating status, and historical calibration information, using the encoder signal access time as the alignment benchmark. The working condition feature sequence serves as the input structure for subsequent model inference and compensation fusion. The meaning, source, and order of its fields are kept consistent throughout the onboard processing program to avoid inconsistencies between the model input and the calibration mapping source.

[0027] S201 uses the sampling time as the time alignment reference to synchronously capture the count change of the pulse signal, the amplitude state of the sine and cosine signals, and the phase state, and establishes a correspondence between the synchronous capture results and the corner interval. The count change of the pulse signal is formed by the pulse count state within the current sampling window, and the amplitude and phase states of the sine and cosine signals are formed by the sine and cosine component states within the same sampling window. The correspondence between these and the corner interval is used to describe the angle or position range pointed to by the encoder's original output within the sampling window. If there is a difference in the signal entry time within the same sampling window, the encoder signal entry time is used as the window reference before synchronous capture, avoiding direct input of subsequent model inputs due to timing deviations from different signal sources.

[0028] S202: Speed, motor temperature, and power supply status are read within the same current sampling window. When sampling times are inconsistent, operating status data whose time difference meets preset synchronization conditions is selected based on the encoder signal access time. The preset synchronization conditions define the correspondence between operating status data and encoder signals in the sampling timing. For each type of operating status data, the time interval between the corresponding sampling time and the encoder signal access time is compared. When the time intervals corresponding to the speed sampling time, motor temperature sampling time, and power supply status sampling time do not exceed the allowable offset of the sampling window, the corresponding speed values, motor temperature values, and power supply status values ​​are written into the operating condition feature sequence as operating status data within the same window. When any time interval exceeds the allowable offset of the sampling window, the operating status data exceeding the allowable offset is discarded, and the most recent operating status data that meets the preset synchronization conditions within the same vehicle operating cycle is used to participate in the generation of the operating condition feature sequence.

[0029] S203: When retrieving the operating status data that most recently met the preset synchronization conditions within the same vehicle operating cycle, compare the corner interval corresponding to the most recently met preset synchronization conditions operating status data with the corner interval corresponding to the current sampling window. When the two corner intervals are consistent, write the most recently met preset synchronization conditions operating status data into the operating condition feature sequence and attach a substitution source marker. The substitution source marker indicates that the field is not data directly obtained from the current sampling window, but data that meets the synchronization conditions within the same vehicle operating cycle. The subsequent machine learning error compensation model can identify the source status of the input field based on this marker. When the two corner intervals are inconsistent, retain the operating status data within the current sampling window that does not exceed the allowable offset of the sampling window, and write the data field that exceeds the allowable offset of the sampling window as a null value marker. The null value marker indicates that the field does not have a data source that meets the synchronization conditions within the current sampling window. The subsequent model inference and input verification use the status of this field as one of the judgment criteria.

[0030] S204: Read the calibration error values ​​corresponding to the turning angle range and speed from the historical calibration records, and write the synchronous capture results, operating status data, and calibration error values ​​into the operating condition feature sequence in field order. The historical calibration record retrieval process uses the turning angle range and speed as indexes. When a correspondence exists between the current turning angle range and speed in the calibration record, the corresponding calibration error value is read. When there is no complete correspondence in the calibration record, the calibration range coverage relationship is used as the basis for input verification and confidence generation, and missing calibration error fields are not directly output as valid calibration compensation quantities. The resulting operating condition feature sequence simultaneously includes the encoder's original output status, vehicle operating status, field source status, and calibration error source status, enabling subsequent steps to distinguish between directly sampled data, substitute source data, and null value marked data.

[0031] S3, before inputting the operating condition feature sequence into the machine learning error compensation model, performs input validation on the operating condition feature sequence. Input validation is used to check the consistency of the encoder's original signal, the correspondence between calibration intervals, and the power supply status before model inference. This validation does not change the meaning of the fields in the operating condition feature sequence, but determines whether the current sampling window is allowed to enter the model inference path based on the field status.

[0032] S301 compares the direction of the count change corresponding to the pulse signal with the direction of the phase change corresponding to the sine and cosine signals. The direction of the count change is determined by the change state of the pulse count within the sampling window, and the direction of the phase change is determined by the change trend of the phase state of the sine and cosine signals within the sampling window. When the direction of the count change and the direction of the phase change correspond to each other, it indicates that the encoder's original signal satisfies the input conditions in terms of direction; when they do not correspond, it indicates that the encoder signal state is inconsistent within the current sampling window, and the current sampling window will not enter the inference path of the machine learning error compensation model.

[0033] S302, determine whether there is a correspondence between the corner interval and the calibration interval in the historical calibration record. This determination is based on the coverage status of the calibration interval in the historical calibration record, and it is not required to disclose the specific interval values ​​in the implementation. When the corner interval is within the coverage range of the calibration interval, the correspondence of the calibration interval is determined to meet the input conditions; when the corner interval is not within the coverage range of the calibration interval, the correspondence of the calibration interval is determined to not meet the input conditions, and this status is used as one of the bases for subsequent calls to the error mapping table or the most recent effective compensation amount.

[0034] S303, verify whether the power supply status is within the encoder signal acquisition allowable range. The power supply status acquisition allowable range is determined by the signal acquisition conditions of the automotive-grade encoder and the configuration of the vehicle controller, and is not limited to a specific value in this embodiment. When the power supply status is within the encoder signal acquisition allowable range, the power supply status meets the input conditions; when the power supply status is not within the encoder signal acquisition allowable range, the power supply status does not meet the input conditions, and the current sampling window pauses to enter the machine learning error compensation model inference path.

[0035] S304: When the direction of count change, direction of phase change, correspondence of calibration intervals, and power supply status all meet the input conditions, the operating condition feature sequence is input into the machine learning error compensation model. When any input condition is not met, the current input to the machine learning error compensation model is paused, and the error mapping table is called. This branch is mutually exclusive; it enters the model inference path when the input conditions are met, and enters the mapping back-off path when the input conditions are not met. The mapping back-off path reads the calibration compensation amount corresponding to the current angle interval and current speed from the error mapping table, or selects a compensation source that can enter the compensation output after comparing the calibration compensation amount with the most recent effective compensation amount.

[0036] S4, the working condition feature sequence, which has passed input validation and is allowed to enter the inference path, is input into the machine learning error compensation model to obtain the error estimate and compensation confidence. The machine learning error compensation model is not limited to a specific network type, a specific number of layers, or a specific training epoch. Its technical role in this embodiment is to receive a working condition feature sequence with a defined field source and window correspondence, and output the error estimate corresponding to the current sampling state based on the correlation between the working condition features. The model input does not use a single angle or speed index, but simultaneously includes encoder signal fields, vehicle operating state fields, calibration error fields, and field source states, thereby enabling the model inference to reflect the correspondence between multiple technical objects within the current sampling window.

[0037] S401 reads the pulse signal field, sine / cosine signal field, angle interval field, speed field, motor temperature field, power supply status field, and calibration error field from the operating condition feature sequence according to the sampling window order. The pulse signal field is derived from the count change state of the pulse signal; the sine / cosine signal field is derived from the amplitude and phase states of the sine / cosine signal; the angle interval field is derived from the angle position range corresponding to the encoder's calculation or calibration; the speed, motor temperature, and power supply status fields are derived from the motor controller and its connected detection components; and the calibration error field is derived from historical calibration records. The field reading order is consistent with the field writing order of the operating condition feature sequence, ensuring that the field positions and meanings in the model input data correspond.

[0038] S402, normalizes the numerical changes of the same field within adjacent sampling windows, and combines the normalized result with the field value corresponding to the current sampling window as the model input data. The normalization process does not disclose specific calculation formulas; instead, it converts the field change states between adjacent sampling windows into relative change states that the model can recognize. For pulse signal fields and sine / cosine signal fields, normalization reflects the direction and amplitude of the encoder's original signal change within adjacent sampling windows; for speed, motor temperature, and power supply status fields, normalization reflects the trend of vehicle operating status change within adjacent sampling windows; for calibration error fields, normalization reflects the correspondence between the current calibration error source and the calibration error sources in adjacent windows. The normalized result, combined with the field value of the current sampling window, forms the model input data, which then enters the inference process of the machine learning error compensation model.

[0039] S403, the machine learning error compensation model generates an error estimate and a compensation confidence score based on the model input data. The error estimate represents the error state corresponding to the encoder angle or position measurement within the current sampling window, and the compensation confidence score represents the reliability of the model output for the current operating condition. The compensation confidence score is not based on a single field, but rather combines at least the operating condition coverage state and the signal consistency state. The operating condition coverage state is determined by the coverage relationship between the angle interval field in the model input data and the calibration interval in the historical calibration record. The signal consistency state is determined by the consistency of angle changes between the pulse signal field and the sine and cosine signal fields within the same sampling window. When the operating condition coverage state is covered and the signal consistency state meets the consistency condition, the compensation confidence score is determined to meet the preset condition; when the operating condition coverage state is uncovered or the signal consistency state does not meet the consistency condition, the compensation confidence score is determined to not meet the preset condition.

[0040] S5. Determine the fusion compensation amount based on the error estimate, the calibration compensation amount corresponding to the error mapping table, and the compensation confidence level. The fusion compensation amount is not directly taken from the model output, nor is it directly taken from a fixed lookup table. Instead, a selection and limiting relationship is established between the model inference results, the calibration mapping results, and the confidence level. This step ensures that the compensation output path corresponds to the operating condition coverage state and signal consistency state of the current sampling window.

[0041] S501, compare the compensation confidence level with the confidence threshold set in the preset conditions. The confidence threshold is determined by the compensation strategy in the vehicle controller and is not disclosed as a specific value. When the compensation confidence level reaches the confidence threshold, the model inference path is determined to participate in the compensation output; when the compensation confidence level is lower than the confidence threshold, the model inference path is determined not to be the main source of compensation output this time, and the process is switched to the error mapping table or the rollback of the most recent effective compensation amount.

[0042] S502, when the compensation confidence level reaches the confidence level threshold, the error estimate and the calibration compensation amount are weighted according to the weight ratio corresponding to the compensation confidence level to obtain the fused compensation amount. The weight ratio is not disclosed as a specific value, but its engineering meaning is: when the matching degree between the model output and the current operating condition increases, the proportion of the error estimate in the fused compensation increases; when the matching degree between the model output and the current operating condition decreases, the proportion of the calibration compensation amount in the fused compensation increases. The output of the weighting process is the fused compensation amount corresponding to the current sampling window, which is used to correct the encoder angle or position data.

[0043] S503: When the compensation confidence level is lower than the confidence threshold, the calibrated compensation amount corresponding to the current steering angle range and current speed is read from the error mapping table, and the difference between the calibrated compensation amount and the most recent effective compensation amount is compared. If the difference meets the limiting condition, the calibrated compensation amount is used; otherwise, the most recent effective compensation amount is used. The limiting condition is determined by the onboard controller's compensation strategy and is used to restrict changes in the compensation amount between adjacent sampling windows that do not correspond to the current sampling state. If the most recent effective compensation amount has not yet been formed, the calibrated compensation amount that can be read from the error mapping table is used as the backoff compensation source. When using the most recent effective compensation amount, it should originate from a compensation amount that has been output and received by the drive control program within the same vehicle operating cycle, to ensure that the backoff compensation source has clear time and operating state boundaries.

[0044] S6: The encoder angle or position data is corrected using a fused compensation amount, and the corrected encoder angle or position data is output to the drive control program. When the compensation confidence level meets the preset conditions, the encoder angle or position data is corrected using the fused compensation amount obtained according to S502; when the compensation confidence level does not meet the preset conditions, the encoder angle or position data is corrected using the calibration compensation amount or the most recent effective compensation amount determined in S503. The corrected encoder angle or position data is provided to the drive control program by the motor controller for use in angle or position-related calculations during motor control. After receiving the corrected encoder angle or position data, the drive control program does not change the source identifier of the compensation amount, so that subsequent feedback corrections can distinguish whether the current compensation amount comes from the fused compensation path, the calibration compensation path, or the most recent effective compensation path.

[0045] S7. Adjust the compensation confidence level or fusion compensation amount of subsequent sampling windows based on the operating deviation information returned by the drive control program. The operating deviation information comes from the operating status feedback after the corrected encoder angle or position data enters the drive control program. In this embodiment, the operating deviation information includes speed estimation deviation and torque command deviation within the same vehicle operating cycle. The speed estimation deviation is used to characterize the deviation state formed after the encoder's corrected angle or position data participates in speed estimation, and the torque command deviation is used to characterize the command deviation state formed after the encoder's corrected angle or position data participates in torque control. The operating deviation information only serves as the basis for adjusting the compensation confidence level or correcting the fusion compensation amount of subsequent sampling windows, and does not directly change the current correction result already output to the drive control program.

[0046] S701, after the corrected encoder angle or position data is output to the drive control program, reads the speed estimation deviation and torque command deviation within the same vehicle operating cycle as operating deviation information. This reading process uses the operating feedback of the drive control program as its source, and the feedback object has a corresponding relationship with the already output corrected encoder angle or position data within the same vehicle operating cycle. If the feedback timing is inconsistent with the current sampling window, the operating deviation information enters the adjustment process of the subsequent sampling window, without writing back the already output compensation result.

[0047] S702: When both speed estimation deviation and torque command deviation are within the feedback allowable range, the compensation confidence adjustment coefficient for subsequent sampling windows is maintained. The feedback allowable range is determined by the motor controller configuration and is not limited to a specific value. Maintaining the compensation confidence adjustment coefficient means that subsequent sampling windows still determine the compensation confidence and fusion compensation amount according to the current compensation strategy, and continue to complete subsequent processing based on input verification, model inference, and the fusion compensation path.

[0048] S703: When the speed estimation deviation or torque command deviation exceeds the allowable feedback range, the compensation confidence adjustment coefficient of the subsequent sampling window is reduced, and the fused compensation amount is corrected according to the reduced compensation confidence adjustment coefficient. The purpose of reducing the compensation confidence adjustment coefficient is to limit the proportion of model inference results participating in the compensation output in the subsequent sampling window, and to ensure that the error mapping table or the most recent effective compensation amount plays a corresponding role in the subsequent compensation process. This feedback correction forms a closed loop from the driving control program's operating deviation to the subsequent sampling window compensation strategy, ensuring that the compensation process not only depends on the current sampling window input but also absorbs the operating status feedback after driving control.

[0049] During the implementation of the above method, if the input validation fails to meet the input conditions, the compensation confidence level fails to meet the preset conditions, or the difference between the calibrated compensation amount and the most recent valid compensation amount fails to meet the limiting conditions, a fallback processing path matching the corresponding judgment conditions will be entered. The fallback processing path does not form a separate new compensation main line, but rather serves as a safety constraint in the fusion compensation process: the machine learning error compensation model is not invoked when the input fails to meet the conditions; the error mapping table or the most recent valid compensation amount is read first when the confidence level fails to meet the conditions; and the most recent valid compensation amount is used when the difference does not meet the limiting conditions. Each of the above judgment branches is bounded by a clearly defined comparison object and execution result, preventing data without a source or a receiving result from entering the drive control program.

[0050] Please see Figure 5 This embodiment provides an AI-based encoder dynamic error compensation system. This system supports the aforementioned AI-based encoder dynamic error compensation method and forms a collaborative relationship with the automotive-grade encoder, motor controller, temperature detector, power supply detection circuit, and drive control program for data access, feature construction, model inference, compensation fusion, and feedback correction.

[0051] The system includes an encoder signal access unit, a vehicle operating status access unit, a condition feature construction unit, an error compensation inference unit, a mapping compensation storage unit, a fusion compensation calculation unit, and a feedback correction unit. The encoder signal access unit connects to an automotive-grade encoder, receiving pulse signals, sine and cosine signals, and sampling times, and providing the original encoder signals and their arrival times to the condition feature construction unit. The vehicle operating status access unit connects to the motor controller, temperature detector, and power supply detection circuit, receiving speed, motor temperature, and power supply status, and providing the operating status data and their sampling times to the condition feature construction unit. The condition feature construction unit receives data output from the encoder signal access unit and the vehicle operating status access unit, retrieves historical calibration records, and generates a condition feature sequence according to the sampling window association rules.

[0052] The error compensation inference unit calls the machine learning error compensation model, receives the operating condition feature sequence that has passed input verification and is allowed to enter the inference path, and outputs the error estimate and compensation confidence level. The mapping compensation storage unit stores the error mapping table and historical calibration records, provides the calibration error field to the operating condition feature construction unit, and provides the calibration compensation amount to the fusion compensation calculation unit. The fusion compensation calculation unit receives the error estimate, compensation confidence level, and calibration compensation amount. When the compensation confidence level meets the preset conditions, it generates the fusion compensation amount. When the compensation confidence level does not meet the preset conditions, it calls the error mapping table or the most recent valid compensation amount and outputs the compensation amount used to correct the encoder angle or position data to the drive control program. The feedback correction unit receives the running deviation information returned by the drive control program and, based on whether the speed estimation deviation and torque command deviation are within the feedback allowable range, provides the fusion compensation calculation unit or the error compensation inference unit with the basis for adjusting the compensation confidence level of the subsequent sampling window.

[0053] There is a correspondence between the system implementation and the method implementation: the encoder signal access unit corresponds to the encoder signal acquisition process in the method; the vehicle operating status access unit corresponds to the operating status acquisition process in the method; the operating condition feature construction unit corresponds to the operating condition feature sequence generation process in the method; the error compensation inference unit corresponds to the model inference process in the method; the mapping compensation storage unit corresponds to the historical calibration record reading and error mapping table calling process in the method; the fusion compensation calculation unit corresponds to the fusion compensation amount determination and backoff compensation determination process in the method; and the feedback correction unit corresponds to the operating deviation information feedback correction process in the method. The data direction between each unit of the system is consistent with the input, processing, intermediate result, and output destinations in the aforementioned method steps, and the full content of each method step will not be repeated.

[0054] The above embodiments describe the sampling window association, input verification, machine learning error inference, mapping compensation fusion, rollback processing, and operational deviation information feedback in the dynamic error compensation process of automotive-grade encoders. The processes, field states, judgment conditions, parameter sources, model input-output relationships, module responsibilities, and data transfer relationships listed in the embodiments are used to explain the possible implementations of the present invention and should not be limited to the specific embodiments described above. Without departing from the scope of the claims and the original disclosure, any equivalent substitutions, equivalent modifications, equivalent combinations, order adjustments, module correspondence replacements, equivalent transformations of field names, equivalent acceptance of the executing entity, or equivalent changes in the carrier form that can be conceived by those skilled in the art should fall within the scope of protection of this patent; however, they should not be extended to unclaimed topics, nor should the substantive correspondence of the technical objects be changed by resetting labels or changing names.

Claims

1. An encoder dynamic error compensation method based on artificial intelligence, characterized in that, Acquire the pulse signal, sine and cosine signals, sampling time, and rotation angle range of the automotive-grade encoder within the current sampling window, and acquire the speed, motor temperature, power supply status, and historical calibration records provided by the motor controller; The pulse signal, sine and cosine signals, sampling time, rotation angle interval, speed, motor temperature, power supply status and historical calibration records are associated according to the sampling window to generate a working condition feature sequence. Input the operating condition feature sequence into the machine learning error compensation model to obtain the error estimate and compensation confidence. The fusion compensation amount is determined based on the error estimate, the calibration compensation amount corresponding to the error mapping table, and the compensation confidence level. When the compensation confidence level meets the preset conditions, the fusion compensation amount is used to correct the encoder angle or position data. When the compensation confidence level does not meet the preset conditions, the error mapping table or the most recent valid compensation amount is called. The corrected encoder angle or position data is output to the drive control program, and the compensation confidence or fusion compensation amount of the subsequent sampling window is adjusted according to the running deviation information returned by the drive control program.

2. The encoder dynamic error compensation method based on artificial intelligence according to claim 1, characterized in that, The process of generating the operating condition feature sequence includes: Using the sampling time as the time alignment reference, the count change of the pulse signal, the amplitude state and phase state of the sine and cosine signals are synchronously truncated, and the synchronous truncation results are established in correspondence with the turning angle interval; The rotational speed, motor temperature and power supply status are read according to the same current sampling window. When the sampling times are inconsistent, the operating status data that meets the preset synchronization conditions is selected based on the encoder signal access time. The calibration error values ​​corresponding to the angle range and speed are read from the historical calibration records, and the synchronous capture results, operating status data and calibration error values ​​are written into the operating condition feature sequence in the order of the fields.

3. The encoder dynamic error compensation method based on artificial intelligence according to claim 2, characterized in that, The process of selecting operational status data whose time difference meets the preset synchronization conditions includes: Calculate the time intervals between the speed sampling time, motor temperature sampling time, power supply status sampling time, and encoder signal access time, respectively. When the time interval does not exceed the allowable offset of the sampling window, the corresponding speed value, motor temperature value and power supply status value are written into the operating condition feature sequence; When any time interval exceeds the allowable offset of the sampling window, the running status data exceeding the allowable offset of the sampling window is discarded, and the running status data that most recently met the preset synchronization conditions within the same vehicle running cycle is called to participate in the generation of the operating condition feature sequence.

4. The encoder dynamic error compensation method based on artificial intelligence according to claim 3, characterized in that: When calling the operating status data that most recently met the preset synchronization conditions within the same vehicle operating cycle to participate in the generation of the operating condition feature sequence, the corner interval corresponding to the operating status data that most recently met the preset synchronization conditions is first compared with the corner interval corresponding to the current sampling window. When the two corner intervals are consistent, the operating status data that most recently met the preset synchronization conditions will be written into the operating condition feature sequence and a replacement source marker will be attached. When the two corner intervals are inconsistent, the running status data within the current sampling window that does not exceed the allowed offset of the sampling window is retained, and the data fields that exceed the allowed offset of the sampling window are written as null values, so that the machine learning error compensation model can participate in the error estimation calculation based on the alternative source label or the null value label.

5. The encoder dynamic error compensation method based on artificial intelligence according to claim 1, characterized in that, Before inputting the operating condition feature sequence into the machine learning error compensation model, the operating condition feature sequence is subjected to input validation, which includes: Compare the direction of the count change corresponding to the pulse signal with the direction of the phase change corresponding to the sine and cosine signals; Determine if there is a correspondence between the corner interval and the calibration interval in the historical calibration record; verify whether the power supply status is within the allowable range for encoder signal acquisition; When the direction of count change, the direction of phase change, the correspondence of calibration intervals, and the power supply status all meet the input conditions, the operating condition feature sequence is input into the machine learning error compensation model. When any input condition is not met, the current input to the machine learning error compensation model is paused and the error mapping table is called.

6. The encoder dynamic error compensation method based on artificial intelligence according to claim 1, characterized in that, The process of inputting the operating condition feature sequence into the machine learning error compensation model includes: Read the pulse signal field, sine and cosine signal field, rotation angle range field, speed field, motor temperature field, power supply status field, and calibration error field from the operating condition characteristic sequence according to the sampling window order; The numerical changes of the same field in adjacent sampling windows are normalized, and the normalization result is combined with the field value corresponding to the current sampling window to form the model input data. The machine learning error compensation model outputs the error estimate and the compensation confidence level based on the model input data.

7. The encoder dynamic error compensation method based on artificial intelligence according to claim 6, characterized in that, The process of determining the compensation confidence level includes: Compare the corner interval field in the model input data with the calibration interval coverage relationship in the historical calibration records to generate the working condition coverage status; Compare the consistency of angle changes between the pulse signal field and the sine and cosine signal fields within the same sampling window to generate a signal consistency state; The compensation confidence level is determined based on the operating condition coverage status and signal consistency status. When the operating condition coverage status is covered and the signal consistency status meets the consistency condition, the compensation confidence level is determined to meet the preset condition. When the operating condition coverage status is not covered or the signal consistency status does not meet the consistency condition, the compensation confidence level is determined to not meet the preset condition.

8. The encoder dynamic error compensation method based on artificial intelligence according to claim 1, characterized in that, The process of determining the fusion compensation amount based on the error estimate, the calibration compensation amount corresponding to the error mapping table, and the compensation confidence level includes: Compare the compensated confidence level with the confidence threshold set in the preset conditions; When the compensation confidence level reaches the confidence threshold, the error estimate and the calibration compensation amount are weighted according to the weight ratio corresponding to the compensation confidence level to obtain the fusion compensation amount; When the compensation confidence level is lower than the confidence level threshold, the calibrated compensation amount corresponding to the current angle range and the current speed in the error mapping table is read, and the difference between the calibrated compensation amount and the most recent effective compensation amount is compared. When the difference meets the limiting condition, the calibrated compensation amount is used; when the difference does not meet the limiting condition, the most recent effective compensation amount is used.

9. The encoder dynamic error compensation method based on artificial intelligence according to claim 8, characterized in that, The process of adjusting the compensation confidence or fusion compensation amount of subsequent sampling windows based on the running deviation information returned by the drive control program includes: After the corrected encoder angle or position data is output to the drive control program, the speed estimation deviation and torque command deviation within the same vehicle operating cycle are read as operating deviation information. When both speed estimation deviation and torque command deviation are within the allowable feedback range, the compensation confidence adjustment coefficient of the subsequent sampling window is maintained. When the speed estimation deviation or torque command deviation exceeds the allowable range of feedback, the compensation confidence adjustment coefficient of the subsequent sampling window is reduced, and the fusion compensation amount is corrected according to the reduced compensation confidence adjustment coefficient.

10. An AI-based encoder dynamic error compensation system, used to support the AI-based encoder dynamic error compensation method according to any one of claims 1 to 9, characterized in that, It includes an encoder signal access unit, a vehicle operating status access unit, a working condition feature construction unit, an error compensation inference unit, a mapping compensation storage unit, a fusion compensation calculation unit, and a feedback correction unit; The encoder signal input unit is connected to the automotive-grade encoder and outputs pulse signals, sine and cosine signals and sampling time. The vehicle running status input unit is connected to the motor controller, temperature detector and power supply detection circuit and outputs speed, motor temperature and power supply status. The working condition feature construction unit associates the data output by the encoder signal access unit and the vehicle operating status access unit with historical calibration records to form a working condition feature sequence; The error compensation inference unit calls the machine learning error compensation model to output the error estimate and compensation confidence. The fusion compensation calculation unit generates the fusion compensation amount based on the error estimate, the error mapping table in the mapping compensation storage unit, and the compensation confidence. The feedback correction unit corrects the subsequent compensation process based on the running deviation information returned by the drive control program.