CN115694493A - Gain error calibration method, device, computer equipment and medium - Google Patents

Gain error calibration method, device, computer equipment and medium Download PDF

Info

Publication number
CN115694493A
CN115694493A CN202211444575.3A CN202211444575A CN115694493A CN 115694493 A CN115694493 A CN 115694493A CN 202211444575 A CN202211444575 A CN 202211444575A CN 115694493 A CN115694493 A CN 115694493A
Authority
CN
China
Prior art keywords
target
gain error
value
gain
error
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211444575.3A
Other languages
Chinese (zh)
Inventor
历广绪
张俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Analog Semiconductor Technology Co ltd
Original Assignee
Shanghai Analog Semiconductor Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Analog Semiconductor Technology Co ltd filed Critical Shanghai Analog Semiconductor Technology Co ltd
Priority to CN202211444575.3A priority Critical patent/CN115694493A/en
Publication of CN115694493A publication Critical patent/CN115694493A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)

Abstract

The embodiment of the application provides a method, a device, computer equipment and a medium for calibrating a gain error, wherein the method comprises the following steps: obtaining at least two gain errors, each gain error corresponding to one of the at least two analog-to-digital converter ADC channels; determining a target correction value and a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the corresponding relation between the gain errors and the target correction values is many-to-one; and writing the target correction value corresponding to each gain error and the target correction direction into the nonvolatile memory. In the embodiment, a plurality of gain errors can share one target correction value, so that the storage capacity of the nonvolatile memory is reduced, and the chip area overhead is reduced.

Description

Gain error calibration method, device, computer equipment and medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for calibrating gain errors, computer equipment and a medium.
Background
In the actual development process of the chip, due to the limitation of the simulator and the production process deviation, a gain error exists on an Analog-to-Digital Converter (ADC) channel, and the accuracy of signal output is limited.
In the related art, a correction value is selected for a gain error of each channel to perform error calibration, for example, a value opposite to a value of the gain error to be corrected is selected to perform error calibration, wherein a correction value corresponding to the gain error of each channel exists, and after calibration is completed, the correction value is stored in a nonvolatile memory in a chip, so that error calibration is performed after the chip is powered on.
However, with the above method, the storage capacity of the nonvolatile memory is large, and the chip area overhead is increased.
Disclosure of Invention
In view of the foregoing, embodiments of the present application provide a method, an apparatus, a computer device, and a medium for calibrating a gain error, which overcome the above-mentioned problem that a large storage amount of a nonvolatile memory increases chip area overhead.
In a first aspect, a method for calibrating a gain error is provided, including:
obtaining at least two gain errors, each gain error corresponding to one of at least two analog-to-digital converter (ADC) channels;
determining a target correction value and a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the corresponding relation between the gain errors and the target correction values is many-to-one;
and writing the target correction value and the target correction direction corresponding to each gain error into a nonvolatile memory, so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
In an alternative mode, the determining, according to at least two gain errors and a preset calibration reference value, a target correction value corresponding to each gain error includes:
when a first target gain error is smaller than a preset calibration reference value, determining a target correction value corresponding to the first target gain error according to an absolute value of the sum of the first target gain error and a target adjustment parameter;
and when the second target gain error is larger than the preset calibration reference value, determining a target correction value corresponding to the second target gain error according to the absolute value of the difference between the second target gain error and the target adjusting parameter.
In an alternative mode, the determining a target correction value corresponding to the first target gain error according to an absolute value of a sum of the first target gain error and a target adjustment parameter includes:
judging whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the sum when the absolute value of the sum is smaller than the preset distance variable value;
updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the sum of the first target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value;
and determining a target correction value corresponding to the first target gain error as a previous target adjusting parameter of the updated target adjusting parameters.
In an alternative mode, the determining, according to an absolute value of a difference between the second target gain error and a target adjustment parameter, a target correction value corresponding to the second target gain error includes:
judging whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the difference when the absolute value of the difference is less than a preset distance variable value;
updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the difference between the second target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value;
and determining the target correction value corresponding to the second target gain error as the previous target adjusting parameter of the updated target adjusting parameters.
In an alternative mode, the determining, according to at least two gain errors and a preset calibration reference value, a target correction direction corresponding to each gain error includes:
when a first target gain error is smaller than a preset calibration reference value, determining that a target correction direction corresponding to the first target gain error is a first direction, wherein the first direction is used for describing that the target correction value is a positive number.
In an optional manner, the determining, according to at least two gain errors and a preset calibration reference value, a target correction direction corresponding to each gain error includes:
and when a second target gain error is larger than the preset calibration reference value, determining that a target correction direction corresponding to the second target gain error is a second direction, wherein the second direction is used for describing that the target correction value is a negative number.
In an optional manner, the method further includes:
obtaining a maximum gain error and a minimum gain error of at least two gain errors;
and determining a target adjusting parameter from an error adjusting array according to the average value of the absolute values of the maximum gain error and the minimum gain error, wherein the error adjusting array is determined based on the adjusting precision of the gain error and the maximum gain error.
In a second aspect, there is provided a calibration apparatus for gain error, comprising:
an obtaining module, configured to obtain at least two gain errors, where each gain error corresponds to one of at least two ADC channels of an analog-to-digital converter;
the determining module is used for determining a target correction value and a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the corresponding relation between the gain errors and the target correction values is many-to-one;
and the writing module is used for writing the target correction value and the target correction direction corresponding to each gain error into a nonvolatile memory so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
In an alternative, the determining module includes: a first determination unit and a second determination unit;
the first determining unit is used for determining a target correction value corresponding to a first target gain error according to an absolute value of a sum of the first target gain error and a target adjusting parameter when the first target gain error is smaller than a preset calibration reference value;
and the second determining unit is used for determining a target correction value corresponding to a second target gain error according to the absolute value of the difference between the second target gain error and a target adjusting parameter when the second target gain error is larger than the preset calibration reference value.
In an optional manner, the first determining unit is specifically configured to:
judging whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the sum when the absolute value of the sum is smaller than the preset distance variable value;
updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the sum of the first target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value;
and determining the target correction value corresponding to the first target gain error as the previous target adjusting parameter of the updated target adjusting parameters.
In an optional manner, the second determining unit is specifically configured to:
judging whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the difference when the absolute value of the difference is less than a preset distance variable value;
updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the difference between the second target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value;
and determining the target correction value corresponding to the second target gain error as the previous target adjusting parameter of the updated target adjusting parameters.
In an optional manner, the first determining unit is specifically configured to:
when a first target gain error is smaller than a preset calibration reference value, determining that a target correction direction corresponding to the first target gain error is a first direction, wherein the first direction is used for describing that the target correction value is a positive number.
In an optional manner, the second determining unit is specifically configured to:
and when a second target gain error is larger than a preset calibration reference value, determining that a target correction direction corresponding to the second target gain error is a second direction, wherein the second direction is used for describing that the target correction value is a negative number.
In an optional manner, the obtaining module is further configured to obtain a maximum gain error and a minimum gain error of at least two gain errors;
the determining module is further used for determining a target adjusting parameter from an error adjusting array according to the average value of the absolute values of the maximum gain error and the minimum gain error, and the error adjusting array is determined based on the adjusting precision of the gain error and the maximum gain error.
In a third aspect, there is provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method for calibrating gain error as in any one of the above embodiments when executing the computer program.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the method for calibrating the gain error as in any one of the above embodiments.
According to the gain error calibration method provided in the embodiment of the application, the target correction value and the target correction direction corresponding to each gain error can be determined through the obtained at least two gain errors and the preset calibration reference value, and the target correction value and the target correction direction corresponding to each gain error are written into the nonvolatile memory, so that the gain errors can be calibrated conveniently according to the target correction value and the target correction direction corresponding to each gain error. The corresponding relation between the gain errors and the target correction values is many-to-one, so that a plurality of gain errors can share one target correction value, and therefore the storage capacity of the nonvolatile memory is reduced, and the chip area overhead is reduced.
The foregoing description is only an overview of the technical solutions of the embodiments of the present application, and in order that the technical means of the embodiments of the present application can be clearly understood, the embodiments of the present application are specifically described below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present application more clearly understandable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for calibrating a gain error according to the present embodiment;
FIG. 2A is a diagram of an error distribution provided in the present embodiment;
FIG. 2B is a schematic diagram illustrating a gain error calibration provided in the present embodiment;
fig. 3 is a schematic structural diagram of a calibration apparatus for gain error provided in this embodiment;
fig. 4 is a schematic structural diagram of a computer device provided in this embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Unless defined otherwise, 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 in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof in the description and claims of this application and the description of the figures are intended to cover a non-exclusive inclusion.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase "an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The term "and/or" herein is merely an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: there are three cases of A, A and B, and B. In addition, the character "/" herein generally indicates that the former and latter associated objects are in an "or" relationship.
Furthermore, the terms "first," "second," and the like in the description and claims of this application or in the foregoing drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential order, either explicitly or implicitly, including one or more of the features.
In the description of the present application, unless otherwise specified, "plurality" means two or more (including two), and similarly, "plural groups" means two or more (including two).
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
At present, for the storage amount of the nonvolatile memory required by the gain error calibration, the bit number of the nonvolatile memory is mainly determined by determining the maximum absolute value MAX and the minimum positive scale Step of trimming through simulation and process deviation.
For example, if the number of bits Num required is determined by MAX/Step and the gain error needs to be corrected by considering both positive and negative deviations, the last number of bits N = ([ log2 (Num) ] + 1) bits for one ADC channel, and for a multi-channel ADC, the total number of bits required for the non-volatile memory is C × Nbit when the number of ADC channels is C.
In the implementation manner, each ADC channel correspondingly stores one correction value in the nonvolatile memory, so that the storage capacity of the nonvolatile memory is increased, and the chip area overhead is increased.
In order to solve the above problem, this embodiment provides a method for calibrating a gain error, so that a plurality of ADC channels share one correction value, and the problem of large storage capacity of a nonvolatile memory is effectively solved, thereby reducing chip area overhead. As shown in fig. 1.
Fig. 1 is a schematic flowchart of a method for calibrating a gain error according to an embodiment, where the method for calibrating a gain error may include the following steps.
And S110, acquiring at least two gain errors.
Each gain error corresponds to one of the at least two ADC channels, i.e., the ADC channel corresponds to one gain error, and one ADC channel corresponds to one gain error.
The gain errors of the multiple ADC channels may be measured separately by Automatic Test Equipment (ATE). For example, when the number of ADC channels is C, the gain errors of channels 1 to C can be measured by ATE.
And S120, determining a target correction value and a target correction direction corresponding to each gain error according to the at least two gain errors and a preset calibration reference value.
The preset calibration reference value is an ideal value obtained after the preset gain error calibration, for example, the calibration reference value may be set to 0, and it can be understood that, in an ideal state, the gain error of each ADC channel is calibrated to 0 as much as possible, so as to ensure the accuracy of the output signal of the ADC channel.
The target correction direction may be used to characterize the sign of the target correction value. Specifically, the target correction direction may include a positive direction and a negative direction, and the positive direction may be used to indicate that the ADC channel corresponding to the target correction value needs to calibrate a value corresponding to the target correction value in the positive direction; the inverse direction may be used to indicate that the ADC channel corresponding to the target correction value requires calibration of the value corresponding to the target correction value in the inverse direction. Wherein, the positive direction and the negative direction are two opposite directions.
The corresponding relation between the gain error and the target correction value is many-to-one, and in the gain errors corresponding to a plurality of ADC channels, at least two target correction values corresponding to the gain error have the same value, namely the target correction values corresponding to at least two gain errors are equal.
And S130, writing the target correction value corresponding to each gain error and the target correction direction into the nonvolatile memory.
When the target correction values corresponding to at least two gain errors are equal, the writing process of the nonvolatile memory can only write one target correction value, so that the storage capacity of the nonvolatile memory can be effectively reduced.
And writing the target correction value and the target correction direction corresponding to each gain error into the nonvolatile memory, so that the gain errors can be calibrated according to the target correction value and the target correction direction corresponding to each gain error after a chip comprising the nonvolatile memory is electrified.
For example, when the first gain error corresponding to one ADC channel is-1.0, the target correction value is 0.5, and the target correction direction is a positive direction, calibrating the first gain error such that-1.0 is corrected to the positive direction by 0.5, and after correction, obtaining a correction result of the first gain error of-0.5; and when the second gain error corresponding to the other ADC channel is 0.7, the target correction value is 0.3, and the target correction direction is the reverse direction, calibrating the second gain error to 0.3 by correcting 0.7 in the reverse direction, and obtaining a correction result of the second gain error after correction is finished, wherein the correction result is 0.4.
In this embodiment, a target correction value and a target correction direction corresponding to each gain error can be determined by obtaining at least two gain errors and a preset calibration reference value, and the target correction value and the target correction direction corresponding to each gain error are written into the nonvolatile memory, so that the gain errors can be calibrated conveniently according to the target correction value and the target correction direction corresponding to each gain error. The corresponding relation between the gain errors and the target correction value is many-to-one, so that a plurality of gain errors can share one target correction value, thereby reducing the number of nonvolatile memories and reducing the chip area expense.
Based on the description of the above embodiments, this embodiment may further determine an updated target adjustment parameter as the error adjustment parameter corresponding to the plurality of gain errors.
The method of the embodiment further comprises the following steps:
obtaining a maximum gain error and a minimum gain error in the at least two gain errors; and determining a target adjusting parameter from an error adjusting array according to the average value of the absolute values of the maximum gain error and the minimum gain error, wherein the error adjusting array is determined based on the adjusting precision of the gain error and the maximum gain error.
Wherein determining the target tuning parameter from an error tuning array based on the average of the absolute values of the maximum gain error and the minimum gain error, the error tuning array being determined based on the tuning accuracy of the gain error may include: and finding out the average value of the absolute values of the maximum gain error and the minimum gain error from the error adjusting array, and taking the closest adjusting value as the target adjusting parameter.
The error adjusting array may be determined by the adjusting accuracy of the gain error and the maximum gain error, and the adjusting accuracy of the gain error may be set according to an actual adjusting requirement, which is not specifically limited in this disclosure.
For example, setting the adjustment precision S =4 of the gain error, setting the maximum gain error GE =1, and setting the error adjustment ARRAY TRIM _ ARRAY [ j [ ] of the error adjustment ARRAY TRIM _ ARRAY](j=0,...,(2 S -1))=TRIM_ARRAY[j]=GE*((j+1)/(2 S ) TRIM _ ARRAY [ j ])](j=0,...,15)=(j+1)/(2 4 ) Wherein, in the process,
Figure BDA0003949612830000091
Figure BDA0003949612830000092
when the maximum gain error Max (GE described above) is 1 and the minimum gain error Min is-0.5, the average of the absolute values of the maximum gain error Max and the minimum gain error Min [ abs (Max) + abs (Min) ]]/2=0.75, error adjusting ARRAY TRIM _ ARRAY [ j%](j=0,...,15)=(j+1)/(2 4 ) In the adjustment value closest to 0.75 is
Figure BDA0003949612830000093
Then will be
Figure BDA0003949612830000094
Determined as the target tuning parameter (i.e., NS _ TRIM [0]])。
It should be noted that the target adjustment parameter determined here is the initial parameter that is not updated, in the pairWhen the target adjusting parameter is updated for the first time, the target adjusting parameter is updated
Figure BDA0003949612830000101
And updating, wherein the later parameter updating is carried out on the basis of the current target adjusting parameter.
Therefore, an error adjusting array is determined according to the adjusting precision of the gain error and the maximum gain error and is used as a target adjusting parameter for correcting the gain error so as to effectively correct the gain error.
After the target adjustment parameter is determined, a target correction value of the gain error may be determined in combination with a magnitude relationship between the target adjustment parameter and the gain error.
In some embodiments, determining the target correction value corresponding to each gain error according to the at least two gain errors and the preset calibration reference value may include:
when the first target gain error is smaller than a preset calibration reference value, determining a target correction value corresponding to the first target gain error according to the absolute value of the sum of the first target gain error and the target adjustment parameter; and when the second target gain error is larger than the preset calibration reference value, determining a target correction value corresponding to the second target gain error according to the absolute value of the difference between the second target gain error and the target adjusting parameter.
Wherein, at least two gain errors can be recorded by an array GO [ i ] (i =0. (C-1)), and C is the number of ADC channels.
The first target gain error may be any one of the at least two gain errors GO [ i ], and the second target gain error may be any one of the at least two gain errors GO [ i ].
The target correction values can be respectively determined according to the magnitude relation between the gain errors and the preset calibration reference values, so that the target correction values matched with the gain errors can be conveniently determined.
Determining a target correction value corresponding to the first target gain error according to the absolute value of the sum of the first target gain error and the target adjustment parameter may include:
judging whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not; updating the distance variable value based on the absolute value of the sum when the absolute value of the sum is smaller than a preset distance variable value; updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than the preset distance variable value or not until the absolute value of the sum of the first target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value; and determining the target correction value corresponding to the first target gain error as the previous target adjusting parameter of the updated target adjusting parameter. Therefore, the target adjusting parameter corresponding to the first target gain error can be determined accurately.
For example, the process of determining the target correction value corresponding to the first target gain error is as follows.
Figure BDA0003949612830000111
Wherein dis _ zero _ tmp is a preset distance variable value, which is a preset variable value for performing a first comparison, and the preset distance variable value may be a maximum gain value GE.
In the case of updating the range variable value, the absolute value abs (GO [ i ] + NS _ TRIM [ k ] of the sum of the first target gain error and the target adjustment parameter may be assigned to the range variable value dis _ zero _ tmp, dis _ zero _ tmp = abs (GO [ i ] + NS _ TRIM [ k ]), where, when the preset range variable value is not updated, the parameter k =0, and, in combination with the above example, when the first target gain error is the first gain error GO [0], dis _ zero _ tmp = abs (GO [0] + NS _ TRIM [0 ]).
When the target adjustment parameter is updated, the target adjustment parameter can be updated according to the ratio of the current target adjustment parameter to the preset value, for example, the target adjustment parameter is updated according to the ratio of the current target adjustment parameter to the preset value, such as the target adjustment parameter is updated according to the ratio of the current target adjustment parameter to the preset value, for example, the target adjustment parameter is updated according to the ratio of the current target adjustment parameter to the preset value, such as the target adjustment parameter to the NS _ TRIM [0]]After updating, the updated target adjusting parameter NS _ TRIM [1] is obtained],NS_TRIM[1]=NS_TRIM[0]/2, in combination with the above examples, in
Figure BDA0003949612830000112
When the temperature of the water is higher than the set temperature,
Figure BDA0003949612830000113
similarly, NS _ TRIM [2^ (M-1)]=NS_TRIM[2^(M)]And/2, M is a correction bit of the target regulating value.
The target correction value GOGE [ i ] = NS _ TRIM [ get _ near _ zero ], k is a variation factor of the target adjustment parameter, and as if (abs (GO [ i ] + NS _ TRIM [ k ]) < dis _ zero _ tmp) holds, k = k +1, get _near _ zero is the previous value k [ m-1] of the currently traversed parameter k [ m ].
Determining a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the method comprises the following steps:
and when the first target gain error is smaller than a preset calibration reference value, determining that a target correction direction corresponding to the first target gain error is a first direction, wherein the first direction is used for describing that the target correction value is a positive number.
When the first target gain error is smaller than the preset calibration reference value, the calibration reference value 0 indicates that the first target gain error needs to be corrected in the positive direction to be closer to 0, so that accurate correction of the gain error is facilitated.
For example, when the first target gain error GO [ i ] is smaller than the calibration reference value 0, the target correction direction corresponding to the first target gain error is determined as follows.
Figure BDA0003949612830000121
TRIM _ DR [ i ] =0 indicates that the target correction direction is a positive direction.
Determining a target correction value corresponding to the second target gain error according to an absolute value of a difference between the second target gain error and the target adjustment parameter may include:
judging whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the difference when the absolute value of the difference is smaller than a preset distance variable value; updating the target adjustment parameter, and returning to execute the judgment whether the absolute value of the difference between the second target gain error and the target adjustment parameter is smaller than the preset distance variable value or not until the absolute value of the difference between the second target gain error and the updated target adjustment parameter is larger than or equal to the updated distance variable value; and determining the target correction value corresponding to the second target gain error as the previous target adjusting parameter of the updated target adjusting parameter. Therefore, the target adjusting parameter corresponding to the second target gain error can be conveniently and accurately determined.
For example, the process of determining the target correction value corresponding to the second target gain error is as follows.
Figure BDA0003949612830000122
Figure BDA0003949612830000131
The dis _ zero _ tmp is a preset distance variable value, the preset distance variable value is a preset variable value used for performing first comparison, and the preset distance variable value can be a maximum gain value GE.
In the case of updating the distance variable value, the absolute value abs (GO [ i ] -NS _ TRIM [ k ]) of the difference between the second target gain error and the target adjustment parameter may be assigned to the distance variable value dis _ zero _ tmp, dis _ zero _ tmp = abs (GO [ i ] -NS _ TRIM [ k ]).
When the target adjustment parameter is updated, the target adjustment parameter can be updated according to the ratio of the current target adjustment parameter to the preset value, for example, the target adjustment parameter is updated according to the ratio of the current target adjustment parameter to the preset value, such as the target adjustment parameter is updated according to the ratio of the current target adjustment parameter to the preset value, for example, the target adjustment parameter is updated according to the ratio of the current target adjustment parameter to the preset value, such as the target adjustment parameter to the NS _ TRIM [0]]After updating, the updated target adjusting parameter NS _ TRIM [1] is obtained],NS_TRIM[1]=NS_TRIM[0]/2, in combination with the above examples, in
Figure BDA0003949612830000132
When the utility model is used, the water is discharged,
Figure BDA0003949612830000133
similarly, NS _ TRIM [2^ (M-1)]=NS_TRIM[2^(M)]And/2, M is a correction bit of the target regulating value.
The target correction value GOGE [ i ] = NS _ TRIM [ get _ near _ zero ], k being the change factor of the target manipulated variable, k = k +1, and get _near _ zero being the previous value k [ m-1] of the currently traversed parameter k [ m ], with one if (abs (GO [ i ] -NS _ TRIM [ k ]) < dis _ zero _ tmp).
Determining a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the method comprises the following steps:
and when the second target gain error is larger than the preset calibration reference value, determining that the target correction direction corresponding to the second target gain error is a second direction, wherein the second direction is used for describing that the target correction value is a negative number.
When the second target gain error is greater than the preset calibration reference value, the calibration reference value 0 indicates that the second target gain error needs to be corrected in the opposite direction, and the second target gain error can be closer to 0, so that accurate correction of the gain error is facilitated.
For example, when the second target gain error GO [ i ] is greater than the calibration reference value 0, the target correction direction corresponding to the second target gain error is determined as follows.
Figure BDA0003949612830000141
TRIM _ DR [ i ] =1 indicates that the target correction direction is the reverse direction.
As shown in fig. 2A, the multi-channel gain error distribution can be represented by an error distribution 1, an error distribution 2, an error distribution 3, an error distribution 4, an error distribution 5, and an error distribution 6, wherein the error distribution 1 is taken as an example for determining the target correction value and the target correction direction.
Assuming that the number of channels C =5, the maximum gain value GE =1, and the gain error is adjustedSegment precision S =4, error adjustment ARRAY TRIM _ ARRAY [ j [ ]](j=0,...,15)=(j+1)/(2 4 ),GO[i](i=0,1,2,3,4)=[-1.0,-0.8,-0.5,0.8,1.0]Based on the above determination process.
Figure BDA0003949612830000142
GH 0 is the gain error after GO 0 calibration, GH 1 is the gain error after GO 1 calibration, GH 2 is the gain error after GO 2 calibration, GH 3 is the gain error after GO 3 calibration, and GH 4 is the gain error after GO 4 calibration.
The plurality of gain errors shown in error profile 1 are calibrated, and the calibrated error profile is shown in fig. 2B.
Compared with the storage amount C × Nbit of the nonvolatile memory in the prior art, in practical application, S is less than or equal to N, M < N, and assuming that S is the maximum N, (C-1)/C > = M/N is obtained, and as the number of channels C increases, M has more solutions, thereby obtaining that the storage amount of the nonvolatile memory in the present embodiment can be significantly reduced as the number of channels increases.
Fig. 3 is a schematic structural diagram of a calibration apparatus for gain error according to this embodiment, where the calibration apparatus for gain error includes: an acquisition module 310, a determination module 320, and a write module 330.
An obtaining module 310 is configured to obtain at least two gain errors, where each gain error corresponds to one of the at least two analog-to-digital converter ADC channels.
The determining module 320 is configured to determine, according to at least two gain errors and a preset calibration reference value, a target correction value and a target correction direction corresponding to each gain error, where a correspondence between the gain error and the target correction value is many-to-one.
A writing module 330, configured to write the target correction value and the target correction direction corresponding to each gain error into a nonvolatile memory, so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
In some embodiments, optionally, the determining module 320 includes: a first determination unit and a second determination unit.
And the first determining unit is used for determining a target correction value corresponding to a first target gain error according to the absolute value of the sum of the first target gain error and a target adjusting parameter when the first target gain error is smaller than the preset calibration reference value.
And the second determining unit is used for determining a target correction value corresponding to a second target gain error according to the absolute value of the difference between the second target gain error and a target adjusting parameter when the second target gain error is larger than the preset calibration reference value.
In some embodiments, optionally, the first determining unit is specifically configured to:
judging whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not; updating the distance variable value based on the absolute value of the sum when the absolute value of the sum is smaller than the preset distance variable value; updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the sum of the first target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value; and determining a target correction value corresponding to the first target gain error as a previous target adjusting parameter of the updated target adjusting parameters.
In some embodiments, optionally, the second determining unit is specifically configured to:
judging whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not; updating the distance variable value based on the absolute value of the difference when the absolute value of the difference is less than a preset distance variable value; updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the difference between the second target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value; and determining the target correction value corresponding to the second target gain error as the previous target adjusting parameter of the updated target adjusting parameters.
In some embodiments, optionally, the first determining unit is specifically configured to:
when a first target gain error is smaller than a preset calibration reference value, determining that a target correction direction corresponding to the first target gain error is a first direction, wherein the first direction is used for describing that the target correction value is a positive number.
In some embodiments, optionally, the second determining unit is specifically configured to:
and when a second target gain error is larger than the preset calibration reference value, determining that a target correction direction corresponding to the second target gain error is a second direction, wherein the second direction is used for describing that the target correction value is a negative number.
In some embodiments, optionally, the obtaining module is further configured to obtain a maximum gain error and a minimum gain error of at least two gain errors; the determining module is further used for determining a target adjusting parameter from an error adjusting array according to the average value of the absolute values of the maximum gain error and the minimum gain error, and the error adjusting array is determined based on the adjusting precision of the gain error and the maximum gain error.
The calibration device for gain errors provided in this embodiment can determine, through the obtained at least two gain errors and the preset calibration reference value, a target correction value and a target correction direction corresponding to each gain error, and write the target correction value and the target correction direction corresponding to each gain error into the nonvolatile memory, so as to calibrate the gain errors according to the target correction value and the target correction direction corresponding to each gain error. The corresponding relation between the gain errors and the target correction values is many-to-one, so that a plurality of gain errors can share one target correction value, and therefore the storage capacity of the nonvolatile memory is reduced, and the chip area overhead is reduced.
The embodiment of the application further provides the computer equipment. Referring to fig. 4 in particular, fig. 4 is a block diagram of a basic structure of a computer device according to the embodiment.
The computer device includes a memory 410 and a processor 420 communicatively connected to each other by a system bus. It is noted that only a computer device having components 410-420 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 410 includes at least one type of readable storage medium including a non-volatile memory (non-volatile memory) or a volatile memory, for example, a flash memory (flash memory), a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a PROM, a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the storage 410 may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the memory 410 may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, or a Flash memory Card (Flash Card) provided on the computer device. Of course, the memory 410 may also include both internal and external storage units of the computer device. In this embodiment, the memory 410 is generally used for storing an operating system and various application software installed on the computer device, such as the program codes of the above-mentioned methods. In addition, the memory 410 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 420 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 410 is used for storing program codes or instructions, the program codes including computer operation instructions, and the processor 420 is used for executing the program codes or instructions stored in the memory 410 or processing data, such as program codes for executing the above-mentioned methods.
Herein, the bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus system may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
Another embodiment of the present application also provides a computer readable medium, which may be a computer readable signal medium or a computer readable medium. A processor in the computer reads the computer readable program code stored in the computer readable medium, so that the processor can execute the functional actions specified in each step, or the combination of the steps, in the above method; and means for generating a block diagram that implements the functional operation specified in each block or a combination of blocks.
A computer readable medium includes, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing, the memory storing program code or instructions, the program code including computer-executable instructions, and the processor executing the program code or instructions of the above-described method stored by the memory.
The definitions of the memory and the processor can refer to the description of the foregoing embodiments of the computer device, and are not repeated here.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is only one type of logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Each functional unit or module in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" as used herein does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of first, second, third, etc. does not denote any order, and the words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present application.

Claims (10)

1. A method for calibrating a gain error, comprising:
obtaining at least two gain errors, each gain error corresponding to one of at least two analog-to-digital converter (ADC) channels;
determining a target correction value and a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the corresponding relation between the gain errors and the target correction values is many-to-one;
and writing the target correction value and the target correction direction corresponding to each gain error into a nonvolatile memory, so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
2. The method according to claim 1, wherein determining a target correction value corresponding to each of the gain errors according to at least two of the gain errors and a preset calibration reference value comprises:
when a first target gain error is smaller than a preset calibration reference value, determining a target correction value corresponding to the first target gain error according to an absolute value of a sum of the first target gain error and a target adjusting parameter;
and when a second target gain error is larger than the preset calibration reference value, determining a target correction value corresponding to the second target gain error according to the absolute value of the difference between the second target gain error and the target adjusting parameter.
3. The method of claim 2, wherein determining the target correction value for the first target gain error based on the absolute value of the sum of the first target gain error and the target adjustment parameter comprises:
judging whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the sum when the absolute value of the sum is smaller than the preset distance variable value;
updating the target adjusting parameter, and returning to execute judgment whether the absolute value of the sum of the first target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the sum of the first target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value;
and determining the target correction value corresponding to the first target gain error as the previous target adjusting parameter of the updated target adjusting parameters.
4. The method of claim 2, wherein determining the target correction value corresponding to the second target gain error based on the absolute value of the difference between the second target gain error and the target adjustment parameter comprises:
judging whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not;
updating the distance variable value based on the absolute value of the difference when the absolute value of the difference is less than a preset distance variable value;
updating the target adjusting parameter, and returning to execute the judgment of whether the absolute value of the difference between the second target gain error and the target adjusting parameter is smaller than a preset distance variable value or not until the absolute value of the difference between the second target gain error and the updated target adjusting parameter is larger than or equal to the updated distance variable value;
and determining the target correction value corresponding to the second target gain error as the previous target adjusting parameter of the updated target adjusting parameters.
5. The method according to claim 1, wherein the determining a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value comprises:
when a first target gain error is smaller than a preset calibration reference value, determining that a target correction direction corresponding to the first target gain error is a first direction, wherein the first direction is used for describing that the target correction value is a positive number.
6. The method according to claim 1, wherein the determining a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value comprises:
and when a second target gain error is larger than the preset calibration reference value, determining that a target correction direction corresponding to the second target gain error is a second direction, wherein the second direction is used for describing that the target correction value is a negative number.
7. The method of claim 2, further comprising:
obtaining a maximum gain error and a minimum gain error of at least two gain errors;
and determining a target adjusting parameter from an error adjusting array according to the average value of the absolute values of the maximum gain error and the minimum gain error, wherein the error adjusting array is determined based on the adjusting precision of the gain error and the maximum gain error.
8. A device for calibrating gain error, comprising:
an obtaining module, configured to obtain at least two gain errors, where each gain error corresponds to one of at least two ADC channels of an analog-to-digital converter;
the determining module is used for determining a target correction value and a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value, wherein the corresponding relation between the gain errors and the target correction values is many-to-one;
and the writing module is used for writing the target correction value and the target correction direction corresponding to each gain error into a nonvolatile memory so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
9. A computer device, characterized in that it comprises a memory in which a computer program is stored and a processor which, when executing said computer program, carries out the steps of a method for calibrating a gain error according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the calibration method of gain error according to any one of claims 1 to 7.
CN202211444575.3A 2022-11-18 2022-11-18 Gain error calibration method, device, computer equipment and medium Pending CN115694493A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211444575.3A CN115694493A (en) 2022-11-18 2022-11-18 Gain error calibration method, device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211444575.3A CN115694493A (en) 2022-11-18 2022-11-18 Gain error calibration method, device, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN115694493A true CN115694493A (en) 2023-02-03

Family

ID=85053751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211444575.3A Pending CN115694493A (en) 2022-11-18 2022-11-18 Gain error calibration method, device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN115694493A (en)

Similar Documents

Publication Publication Date Title
KR101557389B1 (en) Data storage device and error correction method thereof
CN106873703A (en) Circuit and method for producing reference voltage based on temperature coefficient
US10628082B2 (en) Data reading method and storage controller
WO2020086213A1 (en) Dynamic temperature compensation in a memory component
CN110465815B (en) Tooth form code identification method and device and terminal equipment
CN114708412B (en) Indoor setting method, device and system based on VR
CN112165328B (en) ADC digital-to-analog conversion error correction method, device and medium
Chen et al. Semiparametric estimation of a bivariate Tobit model
CN103051339A (en) Correcting method and system of AD (Analogue to Digital) sampling value
CN111383684A (en) Reference voltage determining method and device and storage medium
CN114676825A (en) Neural network model quantification method, system, device and medium
CN115694493A (en) Gain error calibration method, device, computer equipment and medium
CN116467896B (en) Orthodontic treatment effect simulation system and method
CN117331377A (en) Configuration method, configuration device, electronic equipment and storage medium
CN112508308A (en) Data processing method, device and equipment and readable storage medium
CN108761170B (en) NAND reference voltage measuring method, system, device and storage medium
CN114566201A (en) Optimal reading voltage determination method and device and electronic equipment
TW201933366A (en) Method and device for adjusting a plurality of the threshold voltages of a non-volatile memory device
CN113625935B (en) Method, apparatus, device and storage medium for reducing read disturb effect
CN113779926A (en) Circuit detection method and device, electronic equipment and readable storage medium
CN115842875B (en) Method, device, computer equipment and medium for determining similar data frames
CN117708000B (en) Random writing method and device of data, electronic equipment and storage medium
CN110350529B (en) Small interference stabilizing method, device, equipment and storage medium for power system
EP2820548A1 (en) Versioned memories using a multi-level cell
US20140149823A1 (en) Memory with guard value dependent error correction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination