CN113422606A - Error calibration method and device for AD converter, controller and servo driver - Google Patents

Error calibration method and device for AD converter, controller and servo driver Download PDF

Info

Publication number
CN113422606A
CN113422606A CN202110770020.7A CN202110770020A CN113422606A CN 113422606 A CN113422606 A CN 113422606A CN 202110770020 A CN202110770020 A CN 202110770020A CN 113422606 A CN113422606 A CN 113422606A
Authority
CN
China
Prior art keywords
converter
temperature
calibrated
conversion data
data
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.)
Granted
Application number
CN202110770020.7A
Other languages
Chinese (zh)
Other versions
CN113422606B (en
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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202110770020.7A priority Critical patent/CN113422606B/en
Publication of CN113422606A publication Critical patent/CN113422606A/en
Application granted granted Critical
Publication of CN113422606B publication Critical patent/CN113422606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/10Calibration or testing
    • H03M1/1009Calibration
    • H03M1/1014Calibration at one point of the transfer characteristic, i.e. by adjusting a single reference value, e.g. bias or gain error
    • H03M1/1023Offset correction
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Analogue/Digital Conversion (AREA)

Abstract

The invention discloses an error calibration method and device of an AD converter, a controller, a medium and a servo driver. The method comprises the following steps: reading conversion data output by an AD converter to be calibrated; acquiring the working temperature of an AD converter to be calibrated; determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between data of the preset input quantity after AD conversion and the temperature; and carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data. By adopting the invention, the error calibration accuracy of the AD converter is improved, and the data reading accuracy of the AD converter is higher, so that the conversion accuracy of the AD converter is improved.

Description

Error calibration method and device for AD converter, controller and servo driver
Technical Field
The invention relates to the technical field of numerical control machine tools, in particular to an error calibration method, an error calibration device, a controller, a medium and a servo driver of an AD converter.
Background
The servo driver is one of the important components of the numerical control machine tool, is used for driving the operation of a motor, and directly influences the processing precision of the numerical control machine tool due to the advantages and disadvantages of the control performance of the motor. Generally, a servo control system adopts a three-loop control architecture, wherein a current loop is an inner loop of the system, and a speed loop and a position loop are outer loops of the system; as a multi-closed loop control system, the improvement of the performance of the outer loop of the system depends on the optimization of the inner loop of the system. Therefore, the current loop is the key for improving the control precision and response speed and improving the control performance in the servo control system, and in order to achieve the more accurate and rapid control effect of the servo control system, the phase current must be ensured to be accurately and rapidly sampled.
At present, the common current sampling schemes include a hall current sensor and a sampling resistor, which convert a current signal into a voltage signal, and then convert the voltage signal into a digital signal through an AD (analog-digital) converter to perform operation of a control loop. The conversion accuracy of the AD converter directly affects the accuracy of the current sampling. The common dc error in AD converters has offset error and gain error. Misalignment errors can cause motor torque to oscillate at the stator current frequency, gain errors can cause motor torque to oscillate at twice the stator current frequency, and torque fluctuations can cause vibration, noise, and excessive wear of the machine, as well as speed fluctuations.
In conventional techniques, the user typically calibrates for offset and gain errors at room temperature. However, the servo driver may work at different environmental temperatures, and the variation of the working temperature may cause the offset error and the variation of the gain error, which results in inaccurate error calibration and reduces the conversion precision of the AD converter, thereby affecting the precision of current sampling.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: in the prior art, the error calibration accuracy of the AD converter is low, so that the conversion precision of the AD converter is low, and the precision of current sampling is low.
In order to solve the technical problem, the invention provides an error calibration method, an error calibration device, a controller, a medium and a servo driver of an AD converter.
An AD converter error calibration method, comprising:
reading conversion data output by an AD converter to be calibrated;
acquiring the working temperature of the AD converter to be calibrated;
determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between the data of the preset input quantity after AD conversion and the temperature;
and carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
In one embodiment, the obtaining the operating temperature of the AD converter to be calibrated includes:
acquiring the temperature monitored by a temperature monitoring device, wherein the temperature monitoring device is arranged in the working environment where the AD converter to be calibrated is located;
and obtaining the working temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device.
In one embodiment, the obtaining the operating temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device includes:
and calculating the sum of the temperature monitored by the temperature monitoring device and a preset relation coefficient to obtain the working temperature of the AD converter to be calibrated.
In one embodiment, before determining the compensation coefficient corresponding to the operating temperature according to the stored temperature drift curve and the ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity, the method further includes:
taking an AD converter with the same model as the AD converter to be calibrated as a prototype, and collecting output data of the prototype for AD conversion of the preset input quantity at different temperatures;
and based on the output data at different temperatures, describing a relation curve representing the change of the output data along with the temperature, and obtaining and storing a temperature drift curve.
In one embodiment, the temperature drift curve comprises an offset drift curve and a gain drift curve; the compensation coefficients comprise offset error compensation coefficients and gain error compensation coefficients; the performing error calibration on the conversion data by using the compensation coefficient to obtain calibrated conversion data includes:
performing offset error calibration on the conversion data by using the offset error compensation coefficient to obtain the conversion data after the offset error calibration;
and performing gain error calibration on the conversion data by adopting the gain error compensation coefficient to obtain the conversion data after the gain error calibration.
An AD converter error calibration apparatus comprising:
the data reading module is used for reading conversion data output by the AD converter to be calibrated;
the temperature acquisition module is used for acquiring the working temperature of the AD converter to be calibrated;
the coefficient determining module is used for determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between the data of the preset input quantity after AD conversion and the temperature;
and the error calibration module is used for carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
reading conversion data output by an AD converter to be calibrated;
acquiring the working temperature of the AD converter to be calibrated;
determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between the data of the preset input quantity after AD conversion and the temperature;
and carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
A controller comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
reading conversion data output by an AD converter to be calibrated;
acquiring the working temperature of the AD converter to be calibrated;
determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between the data of the preset input quantity after AD conversion and the temperature;
and carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
A servo driver comprises a power device, a current sampling circuit, an AD converter and the controller, wherein the AD converter is connected with the current sampling circuit and the controller, and the controller is also connected with the power device;
the current sampling circuit is used for sampling the current of the power device and outputting current sampling analog quantity to the AD converter;
the AD converter is used for AD converting the input current sampling analog quantity, outputting conversion data and sending the conversion data to the controller;
and after the controller obtains the calibrated conversion data, outputting a driving signal to the power device according to the calibrated conversion data.
In one embodiment, the servo driver further comprises a temperature monitoring device connected to the controller;
the temperature monitoring device is used for monitoring the temperature of the working environment where the AD converter is located and sending the temperature to the controller, and the controller obtains the working temperature of the AD converter according to the temperature monitored by the temperature monitoring device.
Compared with the prior art, one or more embodiments in the above scheme can have the following advantages or beneficial effects: the working temperature of the AD converter to be calibrated is monitored, the compensation coefficient under the working temperature is determined based on the working temperature, error calibration is carried out on actual conversion data of the AD converter to be calibrated under the working temperature, error calibration is realized through temperature compensation, the problem of error drift caused by the working temperature is solved, the error calibration accuracy of the AD converter is improved, the data reading accuracy of the AD converter is higher, and therefore the conversion precision of the AD converter is improved. When the AD converter is applied to a servo driver to convert a current sampling signal, the accuracy of current sampling can be improved, the servo control accuracy is further improved, the rotating speed fluctuation and the torque fluctuation of a servo system during working are reduced, and the stability of the system is improved.
Drawings
The scope of the present disclosure may be better understood by reading the following detailed description of exemplary embodiments in conjunction with the accompanying drawings. Wherein the included drawings are:
FIG. 1 is a schematic diagram illustrating an offset error and a gain error of an AD converter;
FIG. 2 is a flow chart illustrating an exemplary method for calibrating the error of the AD converter;
FIG. 3 is a logic diagram of servo drive temperature monitoring;
FIG. 4 is a flow chart illustrating an error calibration method for an AD converter according to another embodiment;
FIG. 5 is a logic diagram of the processing of the AD converter error calibration in one embodiment;
FIG. 6 is a logic diagram of a servo driver reading current values by temperature compensation;
FIG. 7 is a diagram of an offset drift curve in one embodiment;
FIG. 8 is a schematic illustration of a gain drift curve in one embodiment;
fig. 9 is a block diagram showing an example of the structure of the error calibration apparatus for an AD converter.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the following will describe in detail an implementation method of the present invention with reference to the accompanying drawings and embodiments, so that how to apply technical means to solve the technical problems and achieve the technical effects can be fully understood and implemented.
The AD converter is a device for converting analog quantity into digital quantity, and when the AD converter is applied to a servo driver, a main chip in the servo driver can read the value converted by the AD converter in real time when working. An example of an AD converter with 16-bit accuracy, an analog input voltage range of-320 mV to +320mV, and a rated operating voltage range of-250 mV to +250mV is shown in table 1.
TABLE 1
Analog input -320mV -250mV 0V +250mV +320mV
Numerical value
0 7168 32768 58368 65536
The offset error of the AD converter is a difference between an actual digital quantity and a theoretical digital quantity (a 16-bit precision corresponding value is 32768) when the input analog quantity is 0V. The gain error includes a positive span gain error and a negative span gain error. The positive span gain error is the difference between the actual digital quantity corresponding to the rated positive span voltage (16 bits of precision corresponding to +250mV) and the theoretical digital quantity (16 bits of precision corresponding to 58368); the negative span gain error is the difference between the actual digital quantity corresponding to the nominal negative span voltage (16 bits precision corresponds to-250 mV) and the theoretical digital quantity (16 bits precision corresponds to 7168).
As shown in fig. 1, the vertical axis of the transfer function of the AD converter is an analog quantity, the horizontal axis of the transfer function of the AD converter is a digital quantity, the AD converter converts the analog quantity into a corresponding digital quantity according to the straight line shown in fig. 1, and the gain can be understood as the slope of the straight line (D ═ kV + b, digital quantity D, gain k, analog quantity V, where the analog quantity refers to the voltage value and constant b).
In the prior art, users generally calibrate the errors at room temperature, but it is found through research that the actual errors deviate from the theoretical errors due to the temperature, that is, the offset error and the gain error drift with the temperature. In servo control applications, special attention needs to be paid to temperature drift of offset error and gain error, which affects the control accuracy of the system. Offset and gain errors with temperature variations are more difficult to calibrate than absolute offset and gain errors.
Based on the scheme, the invention provides a scheme for carrying out temperature compensation on the AD converter in current sampling, so that error calibration on the AD converter is realized.
In one embodiment, an AD converter error calibration method is provided, which can be applied to a controller for reading digital values of an AD converter, such as a controller that can be a main chip in a servo driver. Taking the controller as an example, as shown in fig. 2, the method for calibrating the error of the AD converter includes the following steps:
s110: the conversion data output from the AD converter to be calibrated is read.
The AD converter to be calibrated refers to an AD converter that needs to perform error calibration on digital quantities, and may be, for example, an AD converter in a finished servo driver. Specifically, the conversion data output by the AD converter refers to a digital quantity output by the AD converter after performing AD conversion on an input analog quantity; for the AD converter in the servo driver, the input analog quantity may be a current sampling analog quantity output by the current sampling circuit.
S130: the operating temperature of the AD converter to be calibrated is acquired.
S150: and determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity.
The temperature drift curve represents the relationship between data of the preset input quantity after AD conversion and the temperature; specifically, the temperature drift curve is a relationship curve between data output by the AD converter to be calibrated after AD converting the preset input amount and temperature, and may reflect data output by the AD converter after AD converting the preset input amount at different temperatures. The ideal conversion data of the AD converter to be calibrated corresponding to the preset input amount refers to data output by the AD converter after AD conversion of the preset input amount under a theoretical condition.
The preset input amount may include one or more. Specifically, the preset input amount may include 0V and a full-scale voltage of the AD converter to be calibrated, and the full-scale voltage may include a positive full-scale voltage and a negative full-scale voltage.
Specifically, the controller may find corresponding data at the operating temperature based on the temperature drift curve, and then calculate the compensation coefficient according to the deviation between the found data and the ideal conversion data. The compensation coefficient is equal to the deviation of the preset input amount between the actual data after the AD conversion and the theoretical data, that is, the deviation of the AD conversion performed by the AD converter at the time of the preset input amount.
S170: and carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
And (3) carrying out error calibration on the conversion data by adopting a compensation coefficient, namely carrying out temperature compensation on the actual conversion data of the AD converter at the working temperature by taking the deviation of AD conversion at the corresponding working temperature and the preset input quantity as a reference quantity, thereby realizing the error calibration.
In the error calibration method for the AD converter, the working temperature of the AD converter to be calibrated is monitored, the compensation coefficient at the working temperature is determined based on the working temperature, error calibration is carried out on actual conversion data of the AD converter to be calibrated at the working temperature, error calibration is realized through temperature compensation, the problem of error drift caused by the working temperature is solved, the error calibration accuracy of the AD converter is improved, the data reading accuracy of the AD converter is higher, and therefore the conversion accuracy of the AD converter is improved. When the AD converter is applied to a servo driver to convert a current sampling signal, the accuracy of current sampling can be improved, the servo control accuracy is further improved, the rotating speed fluctuation and the torque fluctuation of a servo system during working are reduced, and the stability of the system is improved.
In one embodiment, step S130 includes a first step and a second step.
The first step is as follows: collecting the temperature monitored by a temperature monitoring device; the temperature monitoring device is arranged in the working environment where the AD converter to be calibrated is located.
That is, the temperature monitoring device and the AD converter to be calibrated are in the same working environment, so that the temperature monitored by the temperature monitoring device is closer to the temperature of the AD converter to be calibrated. For example, the servo driver is generally provided with a temperature acquisition module, the operation condition of the system is monitored, and the temperature acquisition module can be used as a temperature monitoring device for temperature monitoring.
The second step is as follows: and obtaining the working temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device.
The temperature monitored by the temperature monitoring device in the same working environment as that of the AD converter to be calibrated is collected, and the working temperature of the AD converter to be calibrated is obtained according to the monitored temperature, so that the accuracy is high.
In one embodiment, the second step comprises: and calculating the sum of the temperature monitored by the temperature monitoring device and a preset relation coefficient to obtain the working temperature of the AD converter to be calibrated.
The preset relation coefficient may be specifically set according to actual conditions. For the temperature monitoring device and the AD converter belonging to the same servo driver, the temperature monitoring device is generally used for monitoring the temperature near the devices with serious heat generation, such as a power device and the like in the servo driver, and the servo driver generally has a relatively closed shell to prevent dust from entering, so the temperature of the AD converter is close to the temperature of the working environment of the power device, and the temperature monitoring device and the AD converter of each type of servo driver can be considered to have a definite relation coefficient K. As shown in fig. 3, assuming that the temperature monitored in real time is T1, the operating temperature T2 of the AD converter becomes T1+ K. Thus, the operating temperature of the AD converter to be calibrated can be obtained more accurately.
In one embodiment, referring to fig. 4, before step S150, step S101 and step S103 are further included.
S101: and taking an AD converter with the same model as that of the AD converter to be calibrated as a prototype, and acquiring output data of the prototype for AD conversion of preset input quantity at different temperatures.
Specifically, a prototype machine is used for temperature test, the prototype machine is placed in a thermostatic chamber with adjustable temperature, and the test prototype machine carries out AD conversion on preset input quantity at different temperatures to obtain output data.
S103: and based on the output data at different temperatures, a relation curve representing the change of the output data along with the temperature is described, and a temperature drift curve is obtained and stored.
The AD converter with the same model as the AD converter to be calibrated is adopted in advance for testing, and a temperature drift curve is generated and stored according to the tested data, so that the subsequent use is facilitated. Preferably, steps S101 and S103 may be executed before step S110, the temperature drift curve corresponding to the AD converter to be calibrated is determined in the product development stage, and the error calibration is performed by executing steps S110 to S170 in the product use stage.
Specifically, the number of prototypes may be plural. And a plurality of sample machines are adopted for sample data acquisition, so that the obtained data is more reliable, and the depicted temperature drift curve is more accurate.
For example, taking 10 prototypes as an example, wherein the number of the prototypes is 10, and the preset input quantity comprises 0V and full-scale voltage, 10 prototypes are taken for temperature test, and the 10 prototypes and the AD converter to be calibrated have the same model; the method comprises the following steps that 10 sample machines are placed in the same thermostatic chamber, under a temperature, the working state of a servo driver of the sample machine is set, only power is supplied, the sample machines are not started, the numerical values of the sample machines are read in real time, namely data read when input is 0V are subjected to AD conversion, the readings of the sample machines are averaged, and output data when the input is 0V under the temperature are obtained; in the test process, the temperature in the thermostatic chamber is adjusted from-20 ℃ to 100 ℃, and a relation curve is drawn according to output data at different temperatures to obtain a temperature drift curve when the preset input quantity is 0V. Similarly, at a temperature, the servo driver works in a full-scale state (including a positive full-scale state and a negative full-scale state), the numerical value of each prototype is read in real time, namely the data read when full-scale voltage is input through AD conversion is read, the readings of a plurality of prototypes are averaged, and the output data when the full-scale voltage is input at the temperature is obtained; and adjusting the temperature in the thermostatic chamber, and drawing a relation curve according to output data at different temperatures to obtain a temperature drift curve when the preset input quantity is the full-scale voltage.
In one embodiment, the temperature drift curve comprises an offset drift curve and a gain drift curve; the compensation coefficients include an offset error compensation coefficient and a gain error compensation coefficient. The offset drift curve is a temperature drift curve with the preset input quantity of 0V and represents the relationship between data obtained after AD conversion of 0V and temperature; the gain drift curve is a temperature drift curve when the preset input quantity is full-scale voltage, and represents the relationship between data obtained after AD conversion of the full-scale voltage and temperature. The offset error compensation coefficient is a compensation coefficient obtained according to an offset drift curve and ideal conversion data of which the preset input quantity is 0V and which corresponds to the AD converter to be calibrated, and the gain error compensation coefficient is a compensation coefficient obtained according to a gain drift curve and ideal conversion data of which the preset input quantity is full-scale voltage and which corresponds to the AD converter to be calibrated.
In this embodiment, step S101 includes: and taking an AD converter with the same model as the AD converter to be calibrated as a prototype, and respectively acquiring output data of the prototype for AD conversion of 0V and full-scale voltage at different temperatures to obtain 0V output data and full-scale output data.
Step S103 includes: and on the basis of 0V output data at different temperatures, describing a relation curve representing the change of the 0V output data along with the temperature, and obtaining and storing an offset drift curve. And based on the full-scale output data at different temperatures, describing a relation curve representing the change of the full-scale output data along with the temperature, and obtaining and storing a gain drift curve.
Specifically, step S170 includes: performing offset error calibration on the conversion data by adopting an offset error compensation coefficient to obtain the conversion data after the offset error calibration; and performing gain error calibration on the conversion data by adopting the gain error compensation coefficient to obtain the conversion data after the gain error calibration.
As shown in fig. 5. The offset error compensation coefficient is adopted to calibrate the offset error of the conversion error, so that the calibrated conversion data is closer to ideal conversion data corresponding to 0V (the 16-bit precision corresponding value is 32768), the gain error compensation coefficient is adopted to calibrate the gain error of the conversion data, so that the calibrated conversion data is closer to the ideal conversion data corresponding to full-scale voltage (the numerical value corresponding to 16-bit precision positive full-scale voltage is 58368, and the numerical value corresponding to 16-bit precision negative full-scale voltage is 7168), the offset error and the gain error are respectively calibrated, and the calibration precision is high.
The compensation factor may be a difference between data corresponding to the operating temperature in the temperature drift curve and ideal conversion data. Specifically, the offset error compensation coefficient may be a value obtained by subtracting ideal conversion data corresponding to 0V from data corresponding to the operating temperature in the offset drift curve; correspondingly, the misalignment error calibration may be to calculate the value of the converted data minus the misalignment error compensation coefficient. Specifically, the gain error compensation coefficient may be a value obtained by subtracting ideal conversion data corresponding to the full-scale voltage from data corresponding to the operating temperature in the gain drift curve; correspondingly, the gain error calibration may be to calculate the value of the converted data minus the gain error compensation coefficient.
For example, as shown in fig. 6, a 16-bit precision AD converter of the servo driver is taken as an example, and as shown in fig. 7, the ordinate values in the graph are AD-converted values corresponding to the voltage 0V when the AD converter operates at different temperatures. The voltage is 0V, the value of the theoretically converted output is 32768, but due to the influence of temperature drift, the value corresponding to different working temperatures has deviation from 32768, and the deviation is the offset error. If 80 c is read as 32760, the offset error is-8 and the offset error compensation factor is-8. Therefore, when the AD converter to be calibrated operates at 80 ℃, the controller reads the data after AD conversion, compensates the difference, and adds 8 to the read value, and this process is called temperature compensation, and is also offset error calibration. As shown in fig. 8, the ordinate value in the graph is an AD converted value corresponding to the positive full scale voltage 250mV at different operating temperatures of the AD converter. In the same principle, under different working temperatures, the difference between the actually read value and the ideal conversion data is compensated, and the gain error calibration is carried out.
If the AD converter works at 80 ℃ and the voltage is 0V, the read data is 32760 and the offset error is-8, if the error calibration is not performed, the controller considers that the voltage at the moment is less than 0V, and the controller performs motor control operation according to the voltage value at the moment, so that the control precision is affected. When the voltage changes, the actual data is read to be different from the theoretical data by-8. If the controller is calibrated for misalignment errors, the theoretical value is compared to the actual value by adding 8 (offset) to the value read back each time. Similarly, assuming that the AD converter is operating at 80 ℃, when the voltage is +250mV, 57780 is read, but when the controller reads 58368, the actual voltage is greater than 250mV, so the gain is reduced. If no error calibration is performed, the controller always operates with a smaller gain. When the controller reads data, the deviation value is compensated through gain error calibration, the obtained gain is correct, and the control precision is improved.
It should be understood that, although the steps in the flowcharts of fig. 2 and 4 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 and 4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or stages in other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
In one embodiment, as shown in fig. 9, an apparatus for calibrating an error of an AD converter is provided, which includes a data reading module 910, a temperature obtaining module 930, a coefficient determining module 950, and an error calibrating module 970.
The data reading module 910 is configured to read conversion data output by the AD converter to be calibrated; the temperature obtaining module 930 is configured to obtain an operating temperature of the AD converter to be calibrated; the coefficient determining module 950 is configured to determine a compensation coefficient corresponding to the operating temperature according to the stored temperature drift curve and the ideal conversion data of the AD converter to be calibrated corresponding to the preset input amount; the temperature drift curve represents the relationship between data of the preset input quantity after AD conversion and the temperature; the error calibration module 970 is configured to perform error calibration on the conversion data by using the compensation coefficient to obtain the calibrated conversion data.
Above-mentioned AD converter error calibration device, the operating temperature through the AD converter of treating the calibration of monitoring, confirm the compensation coefficient under this operating temperature based on operating temperature, treat the actual conversion data of the AD converter of calibration under this operating temperature and carry out the error calibration, realize the error calibration through temperature compensation, solve the error drift problem because of operating temperature arouses, the error calibration degree of accuracy of AD converter has been improved, the data reading degree of accuracy of AD converter is higher, thereby the conversion precision of AD converter has been promoted.
In one embodiment, the temperature obtaining module 930 collects the temperature monitored by the temperature monitoring device; and obtaining the working temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device. The temperature monitoring device is arranged in the working environment where the AD converter to be calibrated is located.
The temperature monitored by the temperature monitoring device in the same working environment as that of the AD converter to be calibrated is collected, and the working temperature of the AD converter to be calibrated is obtained according to the monitored temperature, so that the accuracy is high.
In one embodiment, the temperature obtaining module 930 obtains the operating temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device, including: and calculating the sum of the temperature monitored by the temperature monitoring device and a preset relation coefficient to obtain the working temperature of the AD converter to be calibrated.
In one embodiment, the apparatus for calibrating an AD converter error further includes a curve-drawing module, configured to, before the coefficient determining module 950 performs the corresponding function, use an AD converter of the same type as that of the AD converter to be calibrated as a prototype, and acquire output data of the prototype, which is AD-converted at different temperatures for a preset input amount; and based on the output data at different temperatures, a relation curve representing the change of the output data along with the temperature is described, and a temperature drift curve is obtained and stored.
In one embodiment, the temperature drift curve comprises an offset drift curve and a gain drift curve; the compensation coefficients include an offset error compensation coefficient and a gain error compensation coefficient. The error calibration module 970 performs offset error calibration on the conversion data by using the offset error compensation coefficient to obtain the conversion data after the offset error calibration; and performing gain error calibration on the conversion data by adopting the gain error compensation coefficient to obtain the conversion data after the gain error calibration.
For specific limitations of the AD converter error calibration apparatus, reference may be made to the above limitations of the AD converter error calibration method, which are not described herein again. The modules in the AD converter error calibration apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the controller, and can also be stored in a memory in the controller in a software form, so that the processor can call and execute operations corresponding to the modules. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method in the embodiments described above.
The computer-readable storage medium can implement the steps of the methods in the embodiments, and similarly, can improve the accuracy of error calibration and the conversion accuracy of the AD converter.
In one embodiment, a controller is provided, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiments when executing the computer program.
The controller can realize the steps of the method in each embodiment, and similarly, can improve the precision of error calibration and the conversion precision of the AD converter; when the current sampling device is applied to a servo driver, the current sampling precision can be improved, the servo control precision is further improved, the rotating speed fluctuation and the torque fluctuation when a servo system works are reduced, and the stability of the system is improved.
In one embodiment, a servo driver is provided, which includes a power device, a current sampling circuit, an AD converter and the controller, wherein the AD converter is connected with the current sampling circuit and the controller, and the controller is further connected with the power device. The current sampling circuit is used for sampling the current of the power device and outputting current sampling analog quantity to the AD converter; the AD converter is used for performing AD conversion on the input current sampling analog quantity, outputting conversion data and sending the conversion data to the controller; and after the controller obtains the calibrated conversion data, outputting a driving signal to the power device according to the calibrated conversion data.
The output current of the power device is equal to the current of the driving motor of the servo driver. The controller is used as a main chip in the servo driver, can read conversion data output by the AD converter in real time during working, obtains a current value sampled by the current sampling circuit according to the conversion data, and outputs a driving signal to the power device according to the current value, so that driving control is realized.
The servo driver adopts the controller capable of realizing the method in each embodiment, and similarly, the precision of current sampling can be improved, so that the servo control precision is improved, the rotating speed fluctuation and the torque fluctuation of a servo system during working are reduced, and the stability of the servo system is improved.
In one embodiment, the servo driver further comprises a temperature monitoring device connected to the controller; the temperature monitoring device is used for monitoring the temperature of the working environment where the AD converter is located and sending the temperature to the controller, and the controller obtains the working temperature of the AD converter according to the temperature monitored by the temperature monitoring device. Specifically, the temperature monitoring device is disposed in a working environment where the AD converter is located. For example, the servo driver comprises a closed shell, the power device, the current sampling circuit, the AD converter, the controller and the temperature monitoring device are all arranged in the shell, and the working temperature of the AD converter is close to the temperature monitored by the temperature monitoring device.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. An error calibration method for an AD converter, comprising:
reading conversion data output by an AD converter to be calibrated;
acquiring the working temperature of the AD converter to be calibrated;
determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between the data of the preset input quantity after AD conversion and the temperature;
and carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
2. The method according to claim 1, wherein the obtaining the operating temperature of the AD converter to be calibrated comprises:
acquiring the temperature monitored by a temperature monitoring device, wherein the temperature monitoring device is arranged in the working environment where the AD converter to be calibrated is located;
and obtaining the working temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device.
3. The method according to claim 2, wherein the obtaining the operating temperature of the AD converter to be calibrated according to the temperature monitored by the temperature monitoring device comprises:
and calculating the sum of the temperature monitored by the temperature monitoring device and a preset relation coefficient to obtain the working temperature of the AD converter to be calibrated.
4. The method of claim 1, wherein before determining the compensation coefficient corresponding to the operating temperature according to the stored temperature drift curve and the ideal conversion data corresponding to the preset input amount of the AD converter to be calibrated, the method further comprises:
taking an AD converter with the same model as the AD converter to be calibrated as a prototype, and collecting output data of the prototype for AD conversion of the preset input quantity at different temperatures;
and based on the output data at different temperatures, describing a relation curve representing the change of the output data along with the temperature, and obtaining and storing a temperature drift curve.
5. The method of claim 1, wherein the temperature drift curve comprises an offset drift curve and a gain drift curve; the compensation coefficients comprise offset error compensation coefficients and gain error compensation coefficients; the performing error calibration on the conversion data by using the compensation coefficient to obtain calibrated conversion data includes:
performing offset error calibration on the conversion data by using the offset error compensation coefficient to obtain the conversion data after the offset error calibration;
and performing gain error calibration on the conversion data by adopting the gain error compensation coefficient to obtain the conversion data after the gain error calibration.
6. An error calibration apparatus for an AD converter, comprising:
the data reading module is used for reading conversion data output by the AD converter to be calibrated;
the temperature acquisition module is used for acquiring the working temperature of the AD converter to be calibrated;
the coefficient determining module is used for determining a compensation coefficient corresponding to the working temperature according to the stored temperature drift curve and ideal conversion data of the AD converter to be calibrated corresponding to the preset input quantity; the temperature drift curve represents the relationship between the data of the preset input quantity after AD conversion and the temperature;
and the error calibration module is used for carrying out error calibration on the conversion data by adopting the compensation coefficient to obtain the calibrated conversion data.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
8. A controller comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 5.
9. A servo driver comprising a power device, a current sampling circuit, an AD converter and the controller of claim 8, the AD converter connecting the current sampling circuit and the controller, the controller further connecting the power device;
the current sampling circuit is used for sampling the current of the power device and outputting current sampling analog quantity to the AD converter;
the AD converter is used for AD converting the input current sampling analog quantity, outputting conversion data and sending the conversion data to the controller;
and after the controller obtains the calibrated conversion data, outputting a driving signal to the power device according to the calibrated conversion data.
10. The servo driver of claim 9, further comprising a temperature monitoring device coupled to the controller;
the temperature monitoring device is used for monitoring the temperature of the working environment where the AD converter is located and sending the temperature to the controller, and the controller obtains the working temperature of the AD converter according to the temperature monitored by the temperature monitoring device.
CN202110770020.7A 2021-07-06 2021-07-06 AD converter error calibration method, device, controller and servo driver Active CN113422606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110770020.7A CN113422606B (en) 2021-07-06 2021-07-06 AD converter error calibration method, device, controller and servo driver

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110770020.7A CN113422606B (en) 2021-07-06 2021-07-06 AD converter error calibration method, device, controller and servo driver

Publications (2)

Publication Number Publication Date
CN113422606A true CN113422606A (en) 2021-09-21
CN113422606B CN113422606B (en) 2023-08-11

Family

ID=77720542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110770020.7A Active CN113422606B (en) 2021-07-06 2021-07-06 AD converter error calibration method, device, controller and servo driver

Country Status (1)

Country Link
CN (1) CN113422606B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114440934A (en) * 2022-03-11 2022-05-06 恒玄科技(上海)股份有限公司 Method, device, equipment and storage medium for temperature compensation of measurement result

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5488368A (en) * 1993-05-28 1996-01-30 Technoview Inc. A/D converter system and method with temperature compensation
JP2006340042A (en) * 2005-06-02 2006-12-14 Mitsubishi Electric Corp Calibration device and calibration method
CN102478823A (en) * 2010-11-22 2012-05-30 大连创达技术交易市场有限公司 Novel system and method for compensating temperature of numerical control machine tool
CN206431454U (en) * 2016-12-15 2017-08-22 清能德创电气技术(北京)有限公司 A kind of servo-driver of AD correction coefficient self-correcting
WO2020255218A1 (en) * 2019-06-17 2020-12-24 三菱電機株式会社 Analog-to-digital conversion device, and control program for analog-to-digital conversion device
CN112332845A (en) * 2020-11-04 2021-02-05 南京理工大学 High-precision current frequency conversion circuit
CN112444271A (en) * 2020-11-11 2021-03-05 许继集团有限公司 Method for dynamically compensating measurement error in high-temperature and low-temperature environment
CN112583405A (en) * 2019-09-30 2021-03-30 珠海格力电器股份有限公司 ADC error automatic correction method, device, analog-to-digital conversion circuit and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5488368A (en) * 1993-05-28 1996-01-30 Technoview Inc. A/D converter system and method with temperature compensation
JP2006340042A (en) * 2005-06-02 2006-12-14 Mitsubishi Electric Corp Calibration device and calibration method
CN102478823A (en) * 2010-11-22 2012-05-30 大连创达技术交易市场有限公司 Novel system and method for compensating temperature of numerical control machine tool
CN206431454U (en) * 2016-12-15 2017-08-22 清能德创电气技术(北京)有限公司 A kind of servo-driver of AD correction coefficient self-correcting
WO2020255218A1 (en) * 2019-06-17 2020-12-24 三菱電機株式会社 Analog-to-digital conversion device, and control program for analog-to-digital conversion device
CN112583405A (en) * 2019-09-30 2021-03-30 珠海格力电器股份有限公司 ADC error automatic correction method, device, analog-to-digital conversion circuit and storage medium
CN112332845A (en) * 2020-11-04 2021-02-05 南京理工大学 High-precision current frequency conversion circuit
CN112444271A (en) * 2020-11-11 2021-03-05 许继集团有限公司 Method for dynamically compensating measurement error in high-temperature and low-temperature environment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114440934A (en) * 2022-03-11 2022-05-06 恒玄科技(上海)股份有限公司 Method, device, equipment and storage medium for temperature compensation of measurement result

Also Published As

Publication number Publication date
CN113422606B (en) 2023-08-11

Similar Documents

Publication Publication Date Title
CN108474820B (en) Reference circuit for a metrology system
US9857782B2 (en) Output value correction method for physical quantity sensor apparatus, output correction method for physical quantity sensor, physical quantity sensor apparatus and output value correction apparatus for physical quantity sensor
JP2007164865A (en) Semiconductor memory device
TWI742133B (en) Stress-impaired signal correction circuit
CN113951859B (en) Intracranial pressure sensor signal conditioning method
CN113422606A (en) Error calibration method and device for AD converter, controller and servo driver
EP3111559B1 (en) On-chip analog-to-digital converter (adc) linearity test for embedded devices
CN112688687A (en) Method and device for acquiring physical information to be tested, computer equipment and storage medium
CN117938161A (en) High-precision automatic compensation testing method
CN101753139B (en) Switching unit for generating an output voltage as a function of a digital data valve and method for calibrating the switching unit
CN112578840B (en) Method, system and storage medium for calibrating reference voltage by using temperature
CN101229813A (en) System calibrating method for improving measurement accuracy
CN115166492A (en) Chip parameter acquisition circuit
CN114675074B (en) VDDA correction device and correction method of MCU
CN111982357B (en) Algorithm and system for stabilizing temperature test value of temperature sensor
CN114509190A (en) Temperature compensation method of silicon pressure sensor
CN113985337A (en) Calibration method, device and system of resistance type current sensor and calibration method
CN112393814A (en) Wide-range temperature calculation method and system, temperature sensor and temperature measurement method
JP2018119972A (en) Physical quantity sensor device
CN110611471B (en) Control method and control device for output torque of three-phase asynchronous motor
CN116972981B (en) Readout method and readout device of thermopile sensor
CN108681275B (en) Output voltage parametric compensation method and device for voltage linear isolation conditioning circuit
JP2005005913A (en) Ad conversion method and device thereof
JPS61171226A (en) A/d converter
CN115435916A (en) Method and device for measuring temperature and temperature measuring system

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
GR01 Patent grant
GR01 Patent grant