Spectrometer and method for determining dynamic range of output analog signal
By setting the initial resistance equal in the spectrometer and iteratively determining the bias voltage of the photoelectric sensor, adjusting the resistance value and operational amplification ratio k, the interference problem of the bias voltage of the photoelectric sensor to the range range is solved, and the accuracy of the dynamic range of the analog signal output by the spectrometer is achieved Determination and effective utilization.
Patent Information
- Application Number
- CN202411002390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-26
AI Technical Summary
During the design process of the spectrometer, the bias voltage of the photoelectric sensor interferes with the range range, which is difficult to effectively avoid.
By setting a spectrometer with equal initial resistance, the main control circuit is used to iterate the bias voltage of the photoelectric sensor in a completely black light-free environment, and adjust the resistance value according to the bias voltage, design a reasonable operational amplification factor k to ensure the maximum range Effective use.
It realizes accurate measurement of the dynamic range of the analog signal output by the spectrometer, which is simple and convenient, effectively avoids interference from the bias voltage of the photoelectric sensor to the range range, and ensures the accuracy and efficiency of measurement.
Smart Images

Figure CN119023073A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of optoelectronic technology, and in particular to a spectrometer and a method for determining a dynamic range of an output analog signal thereof. Background Art
[0002] Spectrometer is the main component of optical instruments. Due to its advantages of high detection accuracy and fast speed, it has become an important measuring instrument used in spectroscopy and is widely used in agriculture, biology, chemistry, geology, food safety, color calculation, environmental testing, medicine and health, LED testing, semiconductor industry, petrochemical industry and other fields.
[0003] In the design process of the spectrometer, how to prevent the bias voltage of the photoelectric sensor from interfering with the measurement range becomes a technical difficulty. Summary of the invention
[0004] The present invention aims to disclose a spectrometer and a method for determining the dynamic range of an output analog signal thereof, so as to avoid interference of the bias voltage of a photoelectric sensor on the measuring range.
[0005] To achieve the above object, the spectrometer of the present invention comprises:
[0006] An operational amplifier, wherein the output end is connected to the input end of the analog-to-digital converter, the output end is connected to the reverse input end via a second resistor, the reverse input end is connected to the output end of the digital-to-analog converter via a first resistor, the in-phase input end is connected to the output end of the photoelectric sensor via a third resistor, and the in-phase input end is grounded via a fourth resistor.
[0007] A main control circuit establishes communication connections with the digital-to-analog converter, the analog-to-digital converter and the photoelectric sensor respectively.
[0008] The method for determining the dynamic range of the output analog signal by the spectrometer includes:
[0009] Step S1, setting the initial resistance values of the first resistor, the second resistor, the third resistor and the fourth resistor to be equal, placing the photoelectric sensor in a completely dark environment, and controlling the photoelectric sensor to perform photoelectric conversion normally, while controlling the digital voltage DAC at the input end of the digital-to-analog converter IN In order from 0, DAC IN2 The transition is to iterate incrementally according to the step size until the digital voltage ADC at the output of the analog-to-digital converter is OUT Less than or equal to the minimum value of the range, and the DAC IN2 =ADC OUT1 ; Among them, ADC OUT1 For DAC IN = 0 when ADC OUT The value of .
[0010] Step S2: DAC when the iteration is terminated in step S1 IN The value of is used as the bias voltage of the photoelectric sensor, the maximum value of the range is determined according to the number of bits of the analog-to-digital converter and the digital-to-analog converter, and the amplification factor k of the digital-to-analog converter when the bias voltage is used as input is calculated according to the maximum value and the maximum output voltage of the photoelectric sensor, and then the final resistance value of the second resistor is adjusted to k times the resistance value of the first resistor, and the final resistance value of the fourth resistor is adjusted to k times the resistance value of the third resistor before factory packaging; wherein the final resistance value of the second resistor is equal to the final resistance value of the fourth resistor, and the final resistance values of the third resistor and the first resistor are equal to the initial resistance value.
[0011] To achieve the above object, the present invention further discloses a method for determining the dynamic range of an output analog signal of a spectrometer, comprising:
[0012] Step S0, deploying an operational amplifier, connecting the output end to the input end of the analog-to-digital converter, connecting the output end to the reverse input end via a second resistor, connecting the reverse input end to the output end of the digital-to-analog converter via a first resistor, connecting the in-phase input end to the output end of the photoelectric sensor via a third resistor, and grounding the in-phase input end via a fourth resistor; and establishing communication connections between the main control circuit and the digital-to-analog converter, the analog-to-digital converter and the photoelectric sensor, respectively.
[0013] Step S1, setting the initial resistance values of the first resistor, the second resistor, the third resistor and the fourth resistor to be equal, placing the photoelectric sensor in a completely dark environment, and controlling the photoelectric sensor to perform photoelectric conversion normally, while controlling the digital voltage DAC at the input end of the digital-to-analog converter IN In order from 0, DAC IN2 The transition is to iterate incrementally according to the step size until the digital voltage ADC at the output of the analog-to-digital converter is OUT Less than or equal to the minimum value of the range, and the DAC IN2 =ADC OUT1 ; Among them, ADC OUT1 For DAC IN = 0 when ADC OUT The value of .
[0014] Step S2: DAC when the iteration is terminated in step S1 INThe value of is used as the bias voltage of the photoelectric sensor, the maximum value of the range is determined according to the number of bits of the analog-to-digital converter and the digital-to-analog converter, and the amplification factor k of the digital-to-analog converter when the bias voltage is used as input is calculated according to the maximum value and the maximum output voltage of the photoelectric sensor, and then the final resistance value of the second resistor is adjusted to k times the resistance value of the first resistor, and the final resistance value of the fourth resistor is adjusted to k times the resistance value of the third resistor before factory packaging; wherein the final resistance value of the second resistor is equal to the final resistance value of the fourth resistor, and the final resistance values of the third resistor and the first resistor are equal to the initial resistance value.
[0015] Based on the above-mentioned spectrometer and the method for determining the dynamic range of the output analog signal thereof, when the bit numbers of the analog-to-digital converter and the digital-to-analog converter are both 16 bits, the maximum value of the range is 65535; preferably, the minimum value of the range can be 100.
[0016] The present invention has the following beneficial effects:
[0017] 1. In the process of iteratively determining the bias voltage of the photoelectric sensor, as the digital voltage at the input end of the digital-to-analog converter increases, the voltage at the output end of the analog-to-digital converter decreases until it reaches the minimum value of the range.
[0018] 2. Without affecting the minimum value of the range, the maximum value of the range can be effectively utilized by reasonably designing the amplification factor k of the operational amplifier.
[0019] 3. The spectrometer is simple, convenient, accurate and efficient in determining the dynamic range of the output analog signal, effectively avoiding the interference of the bias voltage of the photoelectric sensor on the measuring range.
[0020] The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 It is a schematic diagram of the structure of a spectrometer disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The embodiments of the present invention are described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.
[0024] Example 1
[0025] This embodiment discloses a spectrometer. Figure 1 As shown, it includes: an operational amplifier, whose output end is connected to the input end of an analog-to-digital converter (ADC), the output end is connected to the reverse input end via a second resistor (R2), the reverse input end is connected to the output end of a digital-to-analog converter (DAC) via a first resistor (R1), the in-phase input end is connected to the output end of a photoelectric sensor via a third resistor (R3), and the in-phase input end is grounded via a fourth resistor (R4); and also includes a main control circuit that establishes communication connections with the digital-to-analog converter, the analog-to-digital converter and the photoelectric sensor respectively; the host computer of the main control circuit is the computer in the figure.
[0026] Among them, the photoelectric sensor is a sensor that can convert light signals into analog voltage signals. Generally speaking, the stronger the light signal, the larger the corresponding output analog signal voltage value. Figure 1 V VIDEO_OUT The photoelectric conversion operation of the photoelectric sensor is generally performed under the control of the main control circuit. In this figure, it is performed by the main control circuit through the communication line 1.
[0027] Referring to Formula 1, the analog voltage signal V output by the photoelectric sensor is VIDEO_OUT It is composed of two voltages added together, V VIDEO_BIAS and V VIDEO_SIG .
[0028] V VIDEO_OUT = V VIDEO_BIAS + V VIDEO_SIG (Formula 1)
[0029] V VIDEO_BIAS The bias voltage is a fixed voltage. VIDEO_SIG This part of the voltage changes positively with the light intensity. When there is no light, the value is close to 0.
[0030] The circuit and algorithm of this embodiment can automatically measure V VIDEO_BIAS and adjust V VIDEO_SIG The part is amplified k times so that its amplified value is as close to V as possible. ADC_IN_MAX (i.e. the maximum analog voltage value allowed by the ADC), thereby improving the dynamic range of the analog signal.
[0031] The whole operation is divided into two steps.
[0032] The first step: Circuit and algorithm for automatically removing the fixed bias voltage VVIDEO_BIAS in the analog voltage signal output by the photoelectric sensor:
[0033] Step 1: Place the photoelectric sensor in a completely dark environment, and the computer sends a command to measure the bias voltage to the main control circuit.
[0034] Step 2: After the main control circuit receives the command, through the communication line 2, DACIN1 = 0, then the DAC will have a corresponding voltage output, recorded as V REF1 , satisfying the following formula 2.
[0035] V REF =(DAC IN *DAC REF ) / (2 N )(Formula 2).
[0036] Among them, DAC REF is the reference voltage of the DAC, which is a fixed known value when the circuit is set up; N is the number of bits of resolution of the DAC, which is a fixed known value, generally 16.
[0037] Among them, when DAC IN1 = 0, there is V REF1 = 0. It is worth noting that: Figure 1 The last digit in the parameter subscript shown in represents the number of iterations, which will not be described in detail later.
[0038] Step 3: The main control circuit controls the photoelectric sensor to perform photoelectric conversion through communication line 1 and outputs an analog voltage signal, which is recorded as V VIDEO_OUT1 , according to the circuit principle, V ADC_IN 、V VIDEO_OUT1 and V REF1 The three satisfy the following formula 3.
[0039] Let R1=R3=R2=R4=R, then: V ADC_IN =V VIDEO_OUT1 -V REF1 (Formula 3).
[0040] Step 4: The main control circuit controls the ADC to perform digital-to-analog conversion through communication 3 to obtain the analog voltage V ADC_IN The corresponding digital value is recorded as ADC OUT1 , satisfying the following formula 4.
[0041] ADC OUT1 =(V ADC_IN / V ADC_REF )*2 N (Formula 4).
[0042] ADCREF is the reference voltage of the ADC, which is a fixed known value when the circuit is set up; N is the number of bits of resolution of the ADC, which is a fixed known value, generally 16.
[0043] Step 5: Master Control Circuit Gets ADC OUT1 After that, the value is processed according to the following formula, and the processed value is recorded as DAC IN2 . Let R1=R3=R2=R4=R, then: DAC IN2 =ADC OUT1 (Formula 5).
[0044] Step 6: Connect the DAC to the IN2 passed to the DAC.
[0045] The main control circuit controls the photoelectric sensor to perform photoelectric conversion through communication 1 again, and then controls the ADC to complete analog-to-digital conversion through communication 3 to obtain the digital value ADC corresponding to the analog voltage. OUT2 .
[0046] Step 7: ADC OUT2 With the preset value DATA PRESET (known determined value, i.e. the minimum value of the range) comparison, including the following situations:
[0047] A. When ADC OUT2 <=DATA PRESET ≈100, it is determined that the fixed offset voltage value in the analog voltage signal has been successfully removed, and the DAC IN2 The value is stored in the main control board memory as a fixed parameter and is automatically written to the DAC each time the system is started. This step is completed.
[0048] B. When ADC OUT2 >DATA PRESET When , it is processed according to the following formula 6:
[0049] DAC IN3 =DAC IN2 +DAC STEP (Formula 6).
[0050] DAC STEP (The known determined value is the step size used for subsequent loop iteration adjustment), and then repeat steps 6 and 7 until the new ADC OUT The first criterion of step 7 is met and the loop ends.
[0051] Through the first link, automatic measurement of V VIDEO_BIAS At the same time, the analog voltage signal V ADC_IN Remove the fixed offset voltage V from the analog voltage signal VIDEO_BIAS function of the value, making the ADC OUT The minimum value can be close to 100 or even smaller.
[0052] It is worth noting that the reference standard for determining the maximum value of the spectrometer range in this embodiment is calibrated with the maximum value that can be counted by the number of bits of the analog-to-digital converter and the digital-to-analog converter, and the minimum value can theoretically be zero, but it cannot be zero under actual working conditions, so it can be flexibly set according to usage requirements, and is not limited to the above minimum value of 100.
[0053] The second part: Circuit solution for increasing analog signal voltage that can be adjusted according to needs:
[0054] Step 9: Let R1 = R3 = R, R2 = R4 = kR, and calculate the k value according to the following formula 7:
[0055] k=V ADC_IN_MAX / (V VIDEO_OUT_MAX -V REF )(Formula 7).
[0056] Among them, V ADC_IN_MAX , V VIDEO_OUT_MAX are all fixed known values, V REF The digital value DAC in the first item of step 7 IN The corresponding analog voltage value (that is, when the digital-to-analog converter uses the bias voltage as input) can be calculated according to Formula 2.
[0057] Step 10: Replace R1 and R3 in the circuit with resistors of the same resistance value, ranging from 100 ohms to 1K. Replace R2 and R4 in the circuit with resistors of the same resistance value, and the resistance value satisfies the following formula:
[0058] R2=R4=kR1=kR3 (Formula 8).
[0059] Through the second link, the analog signal voltage V ADC_IN The effect of amplifying k times, when N in formula 4 = 16, can finally make ADC OUT The maximum value can reach 65535.
[0060] Example 2
[0061] Corresponding to the embodiment, this embodiment discloses a method for determining the dynamic range of an output analog signal by a spectrometer, comprising:
[0062] Step S0, deploying an operational amplifier, connecting the output end to the input end of the analog-to-digital converter, connecting the output end to the reverse input end via the second resistor, connecting the reverse input end to the output end of the digital-to-analog converter via the first resistor, connecting the in-phase input end to the output end of the photoelectric sensor via the third resistor, and grounding the in-phase input end via the fourth resistor; and establishing communication connections between the main control circuit and the digital-to-analog converter, the analog-to-digital converter and the photoelectric sensor respectively.
[0063] Step S1, the initial resistance values of the first resistor, the second resistor, the third resistor and the fourth resistor are set to be equal, and after the photoelectric sensor is placed in a completely dark environment, the main control circuit controls the photoelectric sensor to perform photoelectric conversion normally, and at the same time controls the digital voltage DAC at the input end of the digital-to-analog converter IN In order from 0, DAC IN2 The transition is to iterate incrementally according to the step size until the digital voltage ADC at the output of the analog-to-digital converter is OUT Less than or equal to the minimum value of the range, and the DAC IN2 =ADC OUT1 ; Among them, ADC OUT1 For DAC IN = 0 when ADC OUT The value of .
[0064] Step S2: DAC when the iteration is terminated in step S1 IN The value is used as the bias voltage of the photoelectric sensor (and the photoelectric sensor is still placed in a completely dark environment), the maximum value of the range is determined according to the number of bits of the analog-to-digital converter and the digital-to-analog converter, and the amplification factor k of the digital-to-analog converter when the bias voltage is used as input is calculated according to the maximum value and the maximum output voltage of the photoelectric sensor, and then the final resistance value of the second resistor is adjusted to k times the resistance value of the first resistor, and the final resistance value of the fourth resistor is adjusted to k times the resistance value of the third resistor before factory packaging; wherein the final resistance value of the second resistor is equal to the final resistance value of the fourth resistor, and the final resistance values of the third resistor and the first resistor are equal to the initial resistance value.
[0065] Referring to Example 1, the fully automated debiasing can be performed by the first link 6, where the main control circuit fully automatically determines the fixed bias V in the analog signal output by the photoelectric converter. VIDEO_BIAS and remove V through the circuit VIDEO_BIAS , realize ADC OUT Output the minimum value. The principle is as follows:
[0066] In step 1, when executed under no light conditions, VVIDEO_SIG≈0, according to formula 1:
[0067] V VIDEO_OUT ≈V VIDEO_BIAS (Formula 9).
[0068] According to Figure 1 The principle of the circuit in the figure, the input and output satisfy the following formula:
[0069] V ADC_IN =V VIDEO_OUT -V REF (Formula 10).
[0070] When the first criterion of step 7 is met, ADC OUT2 <=DATA PRESET According to formula 4, the analog voltage V corresponding to the input of ADC is ADC_IN is also a very small value. According to formula 10, we have:
[0071] V VIDEO_OUT ≈V REF (Formula 11).
[0072] According to formula 9, we can get:
[0073] V VIDEO_BIAS ≈V REF (Formula 12).
[0074] Therefore, repeat steps 6 and 7 to compare ADC OUT With DATA PRESET The value of V VIDEO_BIAS Is it close to V REF , while V REF Again, the DAC is written according to formula 1 IN To decide, this DAC IN The value is known to the system, so it is equivalent to obtaining the fixed bias voltage V in the voltage signal. VIDEO_BIAS size.
[0075] By using successive comparison ADC OUT With DATA PRESET The value of the DAC is adjusted according to Formula 6. IN Numeric value.
[0076] According to formula 3 and formula 10, V ADC_IN It will continue to decrease until it is close to 0. According to Formula 5, we know that ADC OUT It also keeps getting smaller until it is close to DATA PRESET , that is, the ADC can OUT The output reaches a preset minimum value, about 100.
[0077] Furthermore, through the steps of the second link, the resistors R1, R2, R3 and R4 can be adjusted in a quantitative manner to achieve the function of signal amplification, thereby achieving adjustable gain: making the ADC OUT The maximum output reaches 65535. The principle is as follows:
[0078] After executing step 10, according to the circuit principle, the following calculation formula can be obtained:
[0079] V ADC_IN =(V VIDEO_OUT -VREF )*k=(V VIDEO_BIAS +V VIDEO_SIG -V REF )*k(Formula 13).
[0080] According to formula 12, we can get:
[0081] V ADC_IN =(V VIDEO_SIG )*k(Formula 14)
[0082] According to the characteristics of the photoelectric sensor and formula 1, when V VIDEO_OUT Take the maximum value V VIDEO_OUT_MAX When V VIDEO_SIG Take the maximum value.
[0083] According to Formula 7 and Formula 13, at this time:
[0084] V VADC_IN =V ADC_IN_MAX (Formula 15).
[0085] According to formula 4, at this time, ADC OUT The maximum value is also obtained. When N=16 in Formula 4, according to Formula 4, it can be known that the ADC at this time OUT ≈65535.
[0086] The two links are implemented together to remove the fixed bias part of the analog signal output by the photoelectric sensor, which ultimately makes the ADC OUT Achieve a dynamic range from 100 to 65535.
[0087] In summary, the spectrometer and the method for determining the dynamic range of the output analog signal disclosed in the embodiments of the present invention respectively have at least the following beneficial effects:
[0088] 1. In the process of iteratively determining the bias voltage of the photoelectric sensor, as the digital voltage at the input end of the digital-to-analog converter increases, the voltage at the output end of the analog-to-digital converter decreases until it reaches the minimum value of the range.
[0089] 2. Without affecting the minimum value of the range, the maximum value of the range can be effectively utilized by reasonably designing the amplification factor k of the operational amplifier.
[0090] 3. The spectrometer is simple, convenient, accurate and efficient in determining the dynamic range of the output analog signal, effectively avoiding the interference of the bias voltage of the photoelectric sensor on the measuring range.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A spectrometer, characterized in that: include: An operational amplifier, wherein the output end is connected to the input end of the analog-to-digital converter, the output end is connected to the reverse input end via a second resistor, the reverse input end is connected to the output end of the digital-to-analog converter via a first resistor, the in-phase input end is connected to the output end of the photoelectric sensor via a third resistor, and the in-phase input end is grounded via a fourth resistor; A main control circuit that establishes communication connections with the digital-to-analog converter, the analog-to-digital converter, and the photoelectric sensor respectively; The method for determining the dynamic range of the output analog signal by the spectrometer includes: Step S1, setting the initial resistance values of the first resistor, the second resistor, the third resistor and the fourth resistor to be equal, placing the photoelectric sensor in a completely dark environment, and controlling the photoelectric sensor to perform photoelectric conversion normally, while controlling the digital voltage DAC at the input end of the digital-to-analog converter IN In order from 0, DAC IN2 The transition is to iterate incrementally according to the step size until the digital voltage ADC at the output of the analog-to-digital converter is OUT Less than or equal to the minimum value of the range, and the DAC IN2 =ADC OUT1 ; Among them, ADC OUT1 For DAC IN = 0 when ADC OUT The value of Step S2: DAC when the iteration is terminated in step S1 IN The value of is used as the bias voltage of the photoelectric sensor, the maximum value of the range is determined according to the number of bits of the analog-to-digital converter and the digital-to-analog converter, and the amplification factor k of the digital-to-analog converter when the bias voltage is used as input is calculated according to the maximum value and the maximum output voltage of the photoelectric sensor, and then the final resistance value of the second resistor is adjusted to k times the resistance value of the first resistor, and the final resistance value of the fourth resistor is adjusted to k times the resistance value of the third resistor before factory packaging; wherein the final resistance value of the second resistor is equal to the final resistance value of the fourth resistor, and the final resistance values of the third resistor and the first resistor are equal to the initial resistance value.
2. The spectrometer according to claim 1, characterized in that The number of bits of the analog-to-digital converter and the digital-to-analog converter is both 16 bits, and the maximum range is 65535.
3. The spectrometer according to claim 2, characterized in that The minimum range value is 100.
4. A method for determining the dynamic range of an output analog signal of a spectrometer, characterized in that: include: Step S0, deploying an operational amplifier, connecting the output end to the input end of the analog-to-digital converter, connecting the output end to the reverse input end via a second resistor, connecting the reverse input end to the output end of the digital-to-analog converter via a first resistor, connecting the in-phase input end to the output end of the photoelectric sensor via a third resistor, and grounding the in-phase input end via a fourth resistor; and establishing communication connections between the main control circuit and the digital-to-analog converter, the analog-to-digital converter and the photoelectric sensor respectively; Step S1, setting the initial resistance values of the first resistor, the second resistor, the third resistor and the fourth resistor to be equal, placing the photoelectric sensor in a completely dark environment, and controlling the photoelectric sensor to perform photoelectric conversion normally, while controlling the digital voltage DAC at the input end of the digital-to-analog converter IN In order from 0, DAC IN2 The transition is to iterate incrementally according to the step size until the digital voltage ADC at the output of the analog-to-digital converter is OUT Less than or equal to the minimum value of the range, and the DAC IN2 =ADC OUT1 ; Among them, ADC OUT1 For DAC IN = 0 when ADC OUT The value of Step S2: DAC when the iteration is terminated in step S1 IN The value of is used as the bias voltage of the photoelectric sensor, the maximum value of the range is determined according to the number of bits of the analog-to-digital converter and the digital-to-analog converter, and the amplification factor k of the digital-to-analog converter when the bias voltage is used as input is calculated according to the maximum value and the maximum output voltage of the photoelectric sensor, and then the final resistance value of the second resistor is adjusted to k times the resistance value of the first resistor, and the final resistance value of the fourth resistor is adjusted to k times the resistance value of the third resistor before factory packaging; wherein the final resistance value of the second resistor is equal to the final resistance value of the fourth resistor, and the final resistance values of the third resistor and the first resistor are equal to the initial resistance value.
5. The method according to claim 4, characterized in that The number of bits of the analog-to-digital converter and the digital-to-analog converter is both 16 bits, and the maximum range is 65535.
6. The method according to claim 5, characterized in that The minimum range value is 100.
