Sampling method of SAR ADC and SAR ADC
By setting the sampling rate of the SAR ADC to match the pulse characteristics, calculating and filtering the initial delay data, the problem of inaccurate sampling of the SAR ADC in a high-speed pulse output environment is solved, and accurate sampling is achieved.
Patent Information
- Application Number
- CN202211199455.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-09-29
AI Technical Summary
It is difficult for SAR-type ADCs to achieve accurate sampling in a high-speed pulse output environment. Existing technology cannot effectively filter out the delayed data in the successive approximation sampling stage under fast pulse output conditions, resulting in inaccurate sampling.
By obtaining the pulse frequency and the ratio of high and low potentials, calculate the pulse time and potential time, set the sampling rate of the ADC to be faster than the pulse rate, calculate the number of samples corresponding to each pulse time, and filter out the initial delay data to obtain effective collected data.
To achieve accurate sampling in a high-speed pulse output environment, only one delay is required to filter the subsequent data accurately, avoiding the sampling delay problem caused by the successive approximation characteristics.
Smart Images

Figure CN115499010B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ADC sampling, and in particular to a sampling method of a SAR type ADC and a SAR type ADC. Background Art
[0002] SAR ADC, whose full name is successive approximation analog-to-digital converter, has the characteristics of low power consumption, small size, and high precision. It is widely used in industrial control and data and signal acquisition and other fields. However, due to the characteristics of successive approximation, the acquisition feedback of SAR ADC will be delayed relative to the actual signal.
[0003] The conventional practice is to wait for a period of time after the output is completed to wait for the data collected by the ADC to stabilize before obtaining the ADC data, so that the data of the successive approximation sampling stage can be filtered out. However, this sampling method is not applicable in the case of fast pulse output, because the output pulse width time is relatively narrow in the high-speed pulse output environment, resulting in the inability to achieve accurate sampling under such conditions. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a sampling method of a SAR type ADC and a SAR type ADC thereof, which can achieve accurate sampling in a high-speed pulse output environment.
[0005] The sampling method of the SAR ADC according to the first aspect of the present invention comprises the following steps:
[0006] Parameter setting stage:
[0007] Get the set pulse frequency and the ratio of high and low potential of the pulse;
[0008] The pulse time is calculated according to the pulse frequency, and the high potential time and low potential time of the pulse are calculated according to the pulse time and the ratio of the high and low potential of the pulse;
[0009] The sampling rate of the ADC is set according to the high potential time and low potential time of the pulse, so that the sampling rate of the ADC is faster than the output pulse rate;
[0010] Calculate the ADC sampling time according to the set ADC sampling rate;
[0011] According to the pulse time and the sampling time of the ADC, the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time are calculated;
[0012] According to the set ADC sampling rate, the ADC delay time under the sampling rate is obtained;
[0013] Data collection phase:
[0014] According to the ADC delay time, the collected data within the corresponding delay time is filtered out to obtain the collected data without the delay;
[0015] According to the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time, effective collected data is obtained from the collected data with the delay removed.
[0016] The sampling method of the SAR ADC according to the first aspect of the present invention has at least the following beneficial effects:
[0017] The embodiment of the present invention obtains the set pulse frequency and the proportion of the high and low potentials of the pulse; calculates the pulse time according to the pulse frequency, and calculates the high potential time and low potential time of the pulse according to the proportion of the pulse time and the high and low potentials of the pulse; sets the sampling rate of the ADC according to the high potential time and low potential time of the pulse, so that the sampling rate of the ADC is faster than the output pulse rate; calculates the sampling time of the ADC according to the set ADC sampling rate; calculates the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time according to the pulse time and the sampling time of the ADC; obtains the ADC delay time under the sampling rate according to the set ADC sampling rate; filters out the collected data within the corresponding delay time according to the ADC delay time, and obtains the collected data without delay; obtains the effective collected data from the collected data without delay according to the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time. Only the first delay is needed to filter out the inaccurate sampling data of the ADC due to the successive approximation characteristics, and the subsequent collected data can be guaranteed to be accurate without delay, so that accurate sampling can be achieved in a high-speed pulse output environment.
[0018] According to some embodiments of the present invention, the pulse frequency is set to 1 Hz.
[0019] According to some embodiments of the present invention, in the proportion of high and low potentials of the pulse, the high potential accounts for 40% and the low potential accounts for 60%.
[0020] According to some embodiments of the present invention, in the step of setting the sampling rate of the ADC according to the high potential time and the low potential time of the pulse, the sampling rate of the ADC can be divided by the high potential time and the low potential time of the pulse at the same time.
[0021] According to the SAR ADC of the embodiment of the second aspect of the present invention, the SAR ADC samples the pulse output by the above method.
[0022] The SAR ADC according to the embodiment of the second aspect of the present invention has at least the following beneficial effects:
[0023] The implementation mode of the present invention obtains the set pulse frequency and the proportion of the high and low potentials of the pulse; calculates the pulse time according to the pulse frequency, and calculates the high potential time and low potential time of the pulse according to the proportion of the pulse time and the high and low potentials of the pulse; sets the sampling rate of the ADC according to the high potential time and low potential time of the pulse, so that the sampling rate of the ADC is faster than the output pulse rate; calculates the sampling time of the ADC according to the set ADC sampling rate; calculates the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time according to the pulse time and the sampling time of the ADC; obtains the ADC delay time under the sampling rate according to the set ADC sampling rate; filters out the collected data within the corresponding delay time according to the ADC delay time, and obtains the collected data without delay; obtains the effective collected data from the collected data without delay according to the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time. The present application only needs to filter out the inaccurate sampling data of the ADC due to the successive approximation characteristics during the first delay, and the subsequent collected data can be guaranteed to be accurate without delay filtering, and can achieve accurate sampling in a high-speed pulse output environment.
[0024] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:
[0026] Figure 1 It is a flow chart of the parameter setting stage in the sampling method of the SAR ADC according to an embodiment of the present invention;
[0027] Figure 2 1 is a flow chart of the data collection phase in the sampling method of the SAR ADC according to an embodiment of the present invention;
[0028] Figure 3 4 is a waveform comparison diagram of the output signal and the collected signal in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0030] In the description of the present invention, it should be understood that descriptions involving orientation, such as orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0031] In the description of the present invention, "a plurality" means more than two. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0032] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.
[0033] Reference Figure 1 and Figure 2 As shown, a sampling method of a SAR ADC includes two parts: a parameter setting stage and a data acquisition stage, which are as follows:
[0034] Parameter setting stage:
[0035] S100, obtaining the set pulse frequency and the ratio of the high and low potentials of the pulse.
[0036] Exemplarily, in the embodiment of the present invention, the pulse frequency is set to 1KHz, and the high and low potentials of the pulse account for 40% and 60% respectively, that is, the high potential accounts for 40% and the low potential accounts for 60%.
[0037] S200, calculating the pulse time according to the pulse frequency, and calculating the high potential time and low potential time of the pulse according to the pulse time and the ratio of the high potential and low potential of the pulse.
[0038] It can be understood that in the embodiment of the present invention, the pulse time T = 1 / 1000 = 0.001s = 1ms. Therefore, the high potential time TH and the low potential time TL of the pulse are respectively:
[0039] TH = 1ms*40% = 400us;
[0040] TL=1ms*60%=600us.
[0041] S300 , setting the sampling rate of the ADC according to the calculated high potential time and low potential time of the pulse, so that the sampling rate of the ADC is faster than the output pulse rate.
[0042] It should be noted that, according to the high potential time and low potential time calculated in step S200, the set ADC sampling rate must collect one data within 400us, and the ADC sampling rate can be divided by the high potential time and low potential time of the pulse at the same time to ensure that the ADC can collect data at both high and low potentials.
[0043] S400 , calculating the ADC sampling time according to the set ADC sampling rate.
[0044] For example, the ADC sampling frequency is set to 100K, and the ADC sampling time for collecting data once can be calculated as: 1s / 100000=10us.
[0045] S500 , calculating the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time according to the pulse time and the ADC sampling time.
[0046] Exemplarily, according to the high potential time YH and low potential time YL of the pulse calculated in step S200, and the sampling time of the ADC calculated in step S400, how many times the ADC can collect data at high potential and low potential can be calculated respectively, as shown below:
[0047] When the voltage is high, the number of ADC acquisitions = 400us / 10us = 40 times;
[0048] When the voltage is low, the ADC acquisition times = 600us / 10us = 60 times.
[0049] S600, obtaining the ADC delay time at the set ADC sampling rate according to the sampling rate. After the sampling rate is set, the ADC delay time at the sampling rate can be queried from the official data manual.
[0050] Data collection phase:
[0051] Start outputting the pulse signal, S700, filter out the collected data within the corresponding delay time according to the ADC delay time, that is, remove the collected data corresponding to the delay given by the official, and obtain the collected data without the delay.
[0052] Exemplary, reference Figure 3 As shown, after starting to work, the initial data is inaccurate due to the characteristics of the successive approximation of the SAR ADC. The time of the successive approximation stage of the ADC in this embodiment at a rate of 100K is 43.75us, and the ADC sampling time for collecting data once calculated according to step S400 is 10us. Therefore, the data of the first five points at the start of the work are discarded, thereby filtering out the data delay caused by the successive approximation of the ADC.
[0053] S800 , obtaining valid collected data from the collected data after delay is removed according to the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time.
[0054] Exemplary, reference Figure 3 As shown, according to the ADC acquisition times at high potential and low potential calculated in step S500, when the ADC collects the 45th data, the output switches to a low potential, when the ADC collects the 105th data, the output switches to a high potential to output the second pulse, when the ADC collects the 145th data, the output switches to the low potential of the second pulse, and so on to obtain all the valid collected data.
[0055] The present invention also relates to a SAR type ADC, which performs sampling of pulse output by the method of the above embodiment.
[0056] The implementation manner of the present invention obtains the set pulse frequency and the ratio of the high and low potentials of the pulse; calculates the pulse time according to the pulse frequency, and calculates the high potential time and the low potential time of the pulse according to the pulse time and the ratio of the high and low potentials of the pulse; sets the ADC sampling rate according to the high potential time and the low potential time of the pulse, so that the ADC sampling rate is faster than the output pulse rate; calculates the ADC sampling time according to the set ADC sampling rate; calculates the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time according to the pulse time and the ADC sampling time; obtains the ADC delay time at the sampling rate according to the set ADC sampling rate; filters out the collected data within the corresponding delay time according to the ADC delay time, and obtains the collected data without the delay; obtains the effective collected data from the collected data without the delay according to the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time. Currently, products using SAR ADCs discard a section of data after each output change to ensure data accuracy. This method cannot meet the needs when data for situations such as faster output changes needs to be collected. This application only needs the first delay to filter out the inaccurate sampling data of the ADC due to the successive approximation characteristics. The subsequent collected data does not require delay filtering to ensure accuracy, and accurate sampling can be achieved in a high-speed pulse output environment.
[0057] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A sampling method for a SAR ADC, characterized in that: The following steps are involved: Parameter setting stage: Get the set pulse frequency and the ratio of high and low potential of the pulse; The pulse time is calculated according to the pulse frequency, and the high potential time and low potential time of the pulse are calculated according to the pulse time and the ratio of the high and low potential of the pulse; The sampling rate of ADC is set according to the high potential time and low potential time of the pulse, so that the sampling rate of ADC is faster than the output pulse rate, and the sampling rate of ADC can be divided by the high potential time and low potential time of the pulse at the same time; Calculate the ADC sampling time according to the set ADC sampling rate; According to the pulse time and the sampling time of the ADC, the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time are calculated; According to the set ADC sampling rate, the ADC delay time under the sampling rate is obtained; Data collection phase: According to the ADC delay time, the collected data within the corresponding delay time is filtered out to obtain the collected data without the delay; According to the high-level ADC sampling times and the low-level ADC sampling times corresponding to each pulse time, effective collected data is obtained from the collected data with the delay removed.
2. The sampling method of the SAR ADC according to claim 1, characterized in that: The pulse frequency is set to 1 Hz.
3. The sampling method of the SAR ADC according to claim 1, characterized in that: The high potential accounts for 40% of the pulse high and low potentials, and the low potential accounts for 60%.
4. A SAR ADC, characterized in that: The SAR ADC samples the pulse output by the method described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method and device for detecting frequency of pulse signals
CN107515333A
Circuit for converting PWM signal into voltage
CN109995372A
Method, device and system for controlling echo acquisition of SAR system
CN113176569A
High-resolution pulse signal synthesis device
CN113376585A
Pulse signal parameter measuring instrument
CN206540960U
