Grating scanning angle detection method and system based on photodiode
By using photodiode conversion and signal processing, a signal acquisition waveform curve is generated, and the peak is found to calculate the grating scanning angle. This solves the problem of accuracy and reliability in grating scanning angle detection, and realizes precise control and stability of the grating scanning micromirror.
Patent Information
- Application Number
- CN202310580863.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-05-22
AI Technical Summary
In the existing technology, it is challenging to accurately and reliably detect the grating scanning angle in instruments that detect the spectral properties of materials by grating scanning, especially since it is difficult to achieve accurate photodiode grating scanning angle feedback under the influence of temperature.
By acquiring optical signals, converting them into electrical signals using photodiodes, filtering and clamping the signal amplitude, performing analog-to-digital conversion and digital signal acquisition, generating signal acquisition waveform curves, finding peaks and calculating grating scanning angles, and verifying the results by combining closed-loop control and step response.
It achieves precise control of grating scanning micromirrors, maintains accuracy and reliability under complex working conditions, avoids the influence of temperature, and adapts to various working conditions.
Smart Images

Figure CN116625279B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of instrument detection, in particular to a grating scanning angle detection method and system based on a photodiode. BACKGROUND
[0002] In the detection instrument for detecting the characteristics spectrum of a substance by grating scanning, in order to avoid the influence of temperature on the driving of the scanning angle of the grating, a photodiode is usually used to indirectly feedback the scanning angle of the grating. When light is incident on a micromirror, a first-order, second-order diffraction and other reflection effects occur. Therefore, in order to accurately detect the intensity of light, photoelectric conversion can be realized by using a photodiode.
[0003] However, in the control system of the scanning angle of the micromirror, how to accurately and reliably detect the periodic scanning angle of the grating is a major problem currently faced. SUMMARY
[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide a grating scanning angle detection method and system based on a photodiode, which is used to solve the technical problems existing in the prior art.
[0005] To achieve the above-mentioned purpose and other related purposes, the present application provides a grating scanning angle detection method based on a photodiode, comprising the following steps:
[0006] Obtaining a to-be-detected light signal, and converting the to-be-detected light signal by using a photodiode to obtain a corresponding electrical signal;
[0007] Filtering the electrical signal, and clamping the signal amplitude of the filtered electrical signal by using a voltage stabilizing diode;
[0008] Converting the electrical signal with clamped signal amplitude into a digital signal and collecting the digital signal to obtain a digital signal code value of the photodiode;
[0009] Generating a signal collection waveform curve based on the digital signal code value, finding any two consecutive adjacent wave peaks in the same period and greater than a preset threshold value from the signal collection waveform curve, and calculating the scanning angle of the grating when the micromirror diffracts based on the interval time of the two found wave peaks.
[0010] In an embodiment of the present application, the process of finding any two consecutive adjacent wave peak values in the same period and greater than a preset threshold value from the signal collection waveform curve comprises:
[0011] Obtaining an upper limit value th_one and a lower limit value th_two of the maximum value finding interval in the two periods which are set in advance or in real time;
[0012] Based on the upper limit value th_one and the lower limit value th_two of the maximum value searching interval, nine maximum value points located in two periods are sequentially and circularly searched from the signal acquisition waveform curve, and the nine maximum value points searched are sorted based on a quick sort function;
[0013] The maximum value in the nine maximum value points is added by a first value to obtain a peak searching upper limit value th_valone, and the maximum value in the nine maximum value points is subtracted by the first value to obtain a peak searching lower limit value th_valtwo; wherein the peak searching upper limit value th_valone and the peak searching lower limit value th_valtwo are located in the same period, and the peak searching lower limit value th_valtwo is greater than the preset threshold value;
[0014] Four first extreme value points located at the peak searching upper limit value th_valone and the peak searching lower limit value th_valtwo are searched from the signal acquisition waveform curve, and are recorded as max_tst, max_one, max_two and max_thr respectively;
[0015] Four second extreme value points located at the peak searching upper limit value th_valone and the peak searching lower limit value th_valtwo are searched again from the signal acquisition waveform curve, and the second extreme value points with the values equal to the first extreme value points max_one, max_two and max_thr are screened out as the horizontal coordinates corresponding to the wave peaks in the signal acquisition waveform curve, to obtain three continuous adjacent wave peaks;
[0016] Any two continuous adjacent wave peaks are selected from the three continuous adjacent wave peaks, and the interval time of the selected two adjacent wave peaks is calculated.
[0017] In an embodiment of the present application, based on the interval time of the two wave peak values searched, the process of calculating the grating scanning angle when the micro mirror diffracts includes:
[0018] The three continuous adjacent wave peak values are divided into two groups of wave peaks, and the interval time of one group of wave peaks is recorded as t1, and the interval time of the other group is recorded as t2; wherein each group of wave peaks contains two continuous adjacent wave peaks;
[0019] The interval times t1 and t2 are respectively input into a grating scanning angle calculation formula to calculate the grating scanning angle when the micro mirror diffracts; wherein the grating scanning angle calculation formula is as follows:
[0020]
[0021] In the formula, θ max represents the grating scanning angle when the micro mirror diffracts;
[0022] θA a specific value representing a wave crest;
[0023] t1 and t2 represent the interval time of two adjacent wave crests, and t1+t2=T; T is the period.
[0024] In an embodiment of the present application, after the grating scanning angle when the micro-mirror diffracts is calculated, the method further comprises:
[0025] proportional-integral-derivative closed-loop control is performed on the grating scanning angle, and a closed-loop control curve is generated in combination with the control times; and
[0026] a step response is performed on the electrical signal output by the photodiode, and a step response curve is generated in combination with the sampling points;
[0027] According to the closed-loop control curve and the step response curve, the found wave crest is verified.
[0028] In an embodiment of the present application, the generation process of the to-be-measured optical signal comprises: irradiating the micro-mirror with incident light, and after the micro-mirror diffracts the incident light, the optical signal generated by the diffraction is taken as the to-be-measured optical signal.
[0029] In an embodiment of the present application, when the electrical signal is filtered, the electrical signal is filtered by intermediate frequency filtering and high frequency filtering.
[0030] The present application also provides a grating scanning angle detection system based on a photodiode, which comprises:
[0031] an optical signal acquisition module, configured to acquire a to-be-measured optical signal;
[0032] an optical signal conversion module, configured to convert the to-be-measured optical signal by using a photodiode to obtain a corresponding electrical signal;
[0033] a filtering module, configured to filter the electrical signal;
[0034] a clamping module, configured to clamp the signal amplitude of the electrical signal after filtering by using a zener diode;
[0035] an electrical signal conversion module, configured to perform analog-digital conversion and digital signal acquisition on the electrical signal after signal amplitude clamping to obtain a digital signal code value of the photodiode;
[0036] a grating scanning angle detection module, configured to generate a signal acquisition waveform curve according to the digital signal code value, find any two continuous adjacent wave crests in the same period and greater than a preset threshold from the signal acquisition waveform curve, and calculate the grating scanning angle when the micro-mirror diffracts based on the interval time of the found two wave crests.
[0037] In an embodiment of the present application, the process of finding, from the signal acquisition waveform curve, any two consecutive adjacent peak values in the same period and greater than a preset threshold by the grating scanning angle detection module includes:
[0038] obtaining an upper limit value th_one and a lower limit value th_two of a maximum value finding interval in two periods set in advance or in real time;
[0039] based on the upper limit value th_one and the lower limit value th_two of the maximum value finding interval, sequentially and circularly finding nine maximum value points in two periods from the signal acquisition waveform curve, and performing data sorting on the nine maximum value points based on a quick sorting function;
[0040] adding a first value to the maximum value in the nine maximum value points to obtain a peak finding upper limit value th_valone, and subtracting the first value from the maximum value in the nine maximum value points to obtain a peak finding lower limit value th_valtwo; wherein the peak finding upper limit value th_valone and the peak finding lower limit value th_valtwo are in the same period, and the peak finding lower limit value th_valtwo is greater than the preset threshold;
[0041] finding four first extreme value points in the peak finding upper limit value th_valone and the peak finding lower limit value th_valtwo from the signal acquisition waveform curve, and recording them as max_tst, max_one, max_two and max_thr respectively;
[0042] again finding four second extreme value points in the peak finding upper limit value th_valone and the peak finding lower limit value th_valtwo from the signal acquisition waveform curve, and screening out second extreme value points with values equal to the first extreme value points max_one, max_two and max_thr as horizontal coordinates corresponding to the peaks in the signal acquisition waveform curve to obtain three consecutive adjacent peaks;
[0043] selecting any two consecutive adjacent peaks from the three consecutive adjacent peaks and calculating the interval time of the selected two adjacent peaks.
[0044] In an embodiment of the present application, the process of calculating the grating scanning angle when the micro mirror diffracts based on the interval time of the two peak values found by the grating scanning angle detection module includes:
[0045] dividing the three consecutive adjacent peak values into two groups of peaks, and recording the interval time of one group of peaks as t1 and the interval time of the other group of peaks as t2; wherein each group of peaks contains two consecutive adjacent peaks;
[0046] The interval time t1 and t2 are respectively input into a grating scanning angle calculation formula to calculate the grating scanning angle when the micro mirror diffracts; wherein the grating scanning angle calculation formula is as follows:
[0047]
[0048] In the formula, θ max represents the grating scanning angle when the micro mirror diffracts;
[0049] θ A represents the specific value of the wave peak;
[0050] t1 and t2 represent the interval time of two adjacent wave peaks, and t1+2=T; T is the period.
[0051] In an embodiment of the present application, the system further comprises a verification module, which is configured to, after the grating scanning angle detection module calculates the grating scanning angle when the micro mirror diffracts, perform proportional-integral-derivative closed-loop control on the grating scanning angle, and generate a closed-loop control curve in combination with the control number; and perform step response on the electrical signal output by the photodiode, and generate a step response curve in combination with the sampling point number; and verify the found wave peak according to the closed-loop control curve and the step response curve.
[0052] As described above, the present application provides a grating scanning angle detection method and system based on a photodiode, which has the following beneficial effects: the present application first converts the optical signal generated after the micro mirror diffracts into a digital electrical signal, then performs peak detection in the signal acquisition waveform curve of the digital electrical signal, and then calculates the grating scanning angle when the micro mirror diffracts according to the peak detection result, so as to accurately judge the scanning angle in the scanning period of the grating scanning micro mirror, so that the present application can realize accurate control of the entire grating scanning micro mirror; and can also avoid the influence caused by temperature, so that the present application can adapt to various complex working conditions, and has good accuracy, reliability and stability. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 A flowchart of the grating scanning angle detection method based on a photodiode provided in an embodiment of the present application is shown;
[0054] Figure 2 A signal acquisition waveform curve diagram provided in an embodiment of the present application is shown;
[0055] Figure 3 A diagram for defining a period signal provided in an embodiment of the present application is shown;
[0056] Figure 4A closed-loop control curve diagram provided by an embodiment of the present application;
[0057] Figure 5 A closed-loop step response curve diagram provided by an embodiment of the present application;
[0058] Figure 6 A hardware connection diagram when collecting the digital signal code value of the photodiode provided by an embodiment of the present application;
[0059] Figure 7 A hardware structure diagram of a grating scanning angle detection system based on a photodiode provided by an embodiment of the present application. DETAILED DESCRIPTION
[0060] The present application also can be implemented or applied through other different specific embodiments, and various modifications or changes can be made to the details of the present application based on different views and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0061] It should be noted that the diagrams provided in the embodiments only schematically illustrate the basic concept of the present application, and the diagrams only show the components related to the present application, not the number, shape and size of the components in actual implementation. The shape, number and proportion of the components in actual implementation can be randomly changed, and the layout pattern of the components can be more complex.
[0062] Referring to Figure 1 The present embodiment provides a grating scanning angle detection method based on a photodiode, including the following steps:
[0063] S110, obtaining a to-be-measured light signal, and converting the to-be-measured light signal by using a photodiode to obtain a corresponding electrical signal. As an example, in the present embodiment, the generation process of the to-be-measured light signal includes: irradiating a micromirror by using incident light, and after the micromirror diffracts the incident light, taking the light signal generated by the diffraction as the to-be-measured light signal.
[0064] S120, filtering the electrical signal, and clamping the signal amplitude of the electrical signal that has completed the filtering by using a voltage stabilizing diode. As an example, in the present embodiment, when filtering the electrical signal, the electrical signal can be subjected to intermediate frequency filtering and high frequency filtering.
[0065] S130, performing analog-to-digital conversion and digital signal collection on the electrical signal that has completed the signal amplitude clamping to obtain a digital signal code value of the photodiode;
[0066] In S140, a signal acquisition waveform curve is generated based on the digital signal code values, and any two continuous adjacent wave crests in the same period and greater than a preset threshold are found from the signal acquisition waveform curve, and a grating scanning angle when the micro mirror diffracts is calculated based on the interval time of the two found wave crests.
[0067] Specifically, Figure 6 A hardware connection schematic diagram when collecting the digital signal code values of the photodiode is shown. As Figure 6 shown, when collecting the digital signal code values of the photodiode, an analog signal acquisition hardware circuit of the photodiode based on a TMS320F28335 master control unit can be built, so as to convert the optical signal generated after the micro mirror diffracts into an analog electrical signal; then the analog electrical signal is filtered by RC filtering to filter intermediate frequency and high frequency, and then the voltage signal amplitude is clamped, and the analog electrical signal after the amplitude clamping is input to the analog-digital conversion function pin of the DSP (Digital Signal Processing, Digital Signal Processor, DSP for short), so as to realize the photodiode analog signal acquisition on the hardware circuit. The corresponding hardware implementation principle block diagram is shown in Figure 6 When the DSP collects the photodiode analog signal, a data storage buffer array can be defined to temporarily store the photodiode digital signal code values collected by the DSP analog-digital conversion function unit. Finally, a signal acquisition waveform curve is generated based on the digital signal code values, and any two continuous adjacent wave crests in the same period and greater than a preset threshold are found from the signal acquisition waveform curve, and the grating scanning angle when the micro mirror diffracts is calculated according to the interval time of the two found wave crests.
[0068] According to the above description, in an exemplary embodiment, the process of S140 generating a signal acquisition waveform curve based on the digital signal code values, finding any two continuous adjacent wave crests in the same period and greater than a preset threshold from the signal acquisition waveform curve, and calculating the grating scanning angle when the micro mirror diffracts based on the interval time of the two found wave crests includes:
[0069] Obtaining the upper limit value th_one and the lower limit value th_two of the maximum value finding interval in the two periods which are set in advance or in real time;
[0070] Based on the upper limit value th_one and the lower limit value th_two of the maximum value finding interval, nine maximum value points in the two periods are sequentially and circularly found from the signal acquisition waveform curve, and the nine found maximum value points are sorted based on a quick sort function;
[0071] The maximum value of the nine maximum value points is added to the first value to obtain a peak searching upper limit value th_valone, and the maximum value of the nine maximum value points is subtracted from the first value to obtain a peak searching lower limit value th_valtwo; wherein the peak searching upper limit value th_valone and the peak searching lower limit value th_valtwo are in the same period, and the peak searching lower limit value th_valtwo is greater than a preset threshold value;
[0072] Four first extreme points located at the peak searching upper limit value th_valone and the peak searching lower limit value th_valtwo are found from the signal acquisition waveform curve, and are denoted as max_tst, max_one, max_two and max_thr, respectively;
[0073] Four second extreme points located at the peak searching upper limit value th_valone and the peak searching lower limit value th_valtwo are found again from the signal acquisition waveform curve, and the second extreme points with values equal to the first extreme points max_one, max_two and max_thr are selected as the horizontal coordinates corresponding to the wave peaks in the signal acquisition waveform curve, to obtain three consecutive adjacent wave peaks;
[0074] Any two consecutive adjacent wave peaks are selected from the three consecutive adjacent wave peaks, and the interval time of the selected two adjacent wave peaks is calculated.
[0075] In addition, based on the interval time of the two found wave peaks, the process of calculating the grating scanning angle when the micro mirror diffracts includes:
[0076] The three consecutive adjacent wave peak values are divided into two groups of wave peaks, and the interval time of one group of wave peaks is denoted as t1, and the interval time of the other group is denoted as t2; wherein each group of wave peaks includes two consecutive adjacent wave peaks;
[0077] The interval times t1 and t2 are respectively input into a grating scanning angle calculation formula to calculate the grating scanning angle when the micro mirror diffracts; wherein the grating scanning angle calculation formula is as follows:
[0078]
[0079] In the formula, θ max represents the grating scanning angle when the micro mirror diffracts; θ A represents the specific value of the wave peak; t1 and t2 represent the interval time of two adjacent wave peaks, and t1+2=; T is a period.
[0080] Specifically, as Figure 2 and Figure 3As shown, the analog signal of the photodiode signal is processed by hardware circuit, and then converted into digital signal by the ADC of the DSP, and then the code value of the photodiode digital signal is acquired by software, and then the waveform curve is drawn as Figure 2 As shown, the corresponding periodic signal definition is as shown in Figure 3 The number of ADC code values collected between the high peaks generated by the first-order diffraction is found, and the peak-to-peak values t1 and t2 (the period T is fixed) can be determined. It should be noted that the ADC of the DSP is a 12-bit ADC, so the range of the ADC output code value in this embodiment is 0-4095.
[0081] In a closed-loop PID (Proportion Integration Differentiation, Proportion-Integration-Differentiation) control system, it is crucial to find the interval between the peak-to-peak values of the zero-order diffraction light, which determines the correctness and accuracy of the entire closed-loop control system. The corresponding peak finding algorithm steps are as follows:
[0082] (1) First, the ADC of the DSP is used to collect 2T grating scanning period photodiode data and store it in the defined array.
[0083] (2) Set the upper and lower limit values th_one and th_two of the maximum value finding interval in 2T periods; then find nine maximum value points in 2T periods by for loop and save them to the array for later use.
[0084] (3) After finding the nine maximum values, use the quicksort function to sort the data from large to small, and use the maximum value ± 150 of the nine data as the upper limit th_valone and the lower limit th_valtwo of the next peak finding.
[0085] (4) Find the extreme points in the interval th_valone and th_valtwo by for loop, that is, the points with the maximum value and the next value, respectively recorded as max_tst, max_one, max_two, max_thr; Since the selected data points are fixed, the first extreme point max_tst needs to be discarded, and max_one, max_two, max_thr are useful data values.
[0086] (5) Again, call the for loop to find the extreme points in the interval th_valone and th_valtwo, and the three points equal to max_one, max_two, and max_thr are the horizontal coordinates of the three high peaks, and the variables are defined to record the number of points that satisfy the three high peaks.
[0087] (6) The abscissa found by the above steps is the peak-to-peak value t1 and t2 by subtraction, and when there are multiple points in the same peak that satisfy the point in step (5), an average processing is needed.
[0088] It can be seen that the embodiment first converts the light signal generated after the diffraction of the micro-mirror into a digital electrical signal, then performs peak detection in the signal acquisition waveform curve of the digital electrical signal, and calculates the grating scanning angle when the micro-mirror diffracts according to the peak detection result, so as to accurately determine the scanning angle in the grating scanning micro-mirror period, thereby enabling the embodiment to realize accurate control of the entire grating scanning micro-mirror; and can also avoid the influence caused by temperature, so that the embodiment can adapt to various complex working conditions, and has good accuracy, reliability and stability.
[0089] In an exemplary embodiment, after the grating scanning angle when the micro-mirror diffracts is calculated, the embodiment can further include: performing proportional-integral-derivative closed-loop control on the grating scanning angle, and generating a closed-loop control curve in combination with the control number; and performing step response on the electrical signal output by the photodiode, and generating a step response curve in combination with the sampling point number; verifying the found wave peak according to the closed-loop control curve and the step response curve. Specifically, as shown in Figure 4 and Figure 5 The embodiment can apply the designed micro-mirror scanning angle algorithm to specific test instruments, thereby verifying the accuracy, feasibility and reliability of the invented algorithm. Therefore, in order to avoid the change of the micro-mirror scanning angle caused by temperature, the embodiment introduces incremental PID + fuzzy control. In order to verify the overall function of the software, i.e. the closed-loop control effect, the overall method is downloaded to the hardware circuit board to realize real-time control, and the corresponding closed-loop control effect is as shown in Figure 4 and Figure 5 From Figure 4 the following conclusions can be drawn: based on the grating scanning angle detection method described in the embodiment, the method has the advantages of fast response speed, no overshoot and small steady-state fluctuation, thereby verifying the accuracy and correctness of the method. From Figure 5 the following conclusions can be drawn: based on the grating scanning angle detection method described in the embodiment, the method can realize good following of the reference quantity, has the advantages of fast response speed, no over-modulation, etc., thereby verifying the reliability and stability of the method.
[0090] In summary, the application provides a grating scanning angle detection method based on a photodiode, which first converts the light signal generated after diffraction of a micro mirror into a digital electrical signal, then performs peak detection in the signal acquisition waveform curve of the digital electrical signal, and then calculates the grating scanning angle when the micro mirror is diffracted according to the peak detection result, so as to accurately determine the scanning angle in the scanning cycle of the grating scanning micro mirror, so that the application can realize accurate control of the entire grating scanning micro mirror. Moreover, the influence of temperature can be avoided, so that the application can adapt to various complex working conditions and has good accuracy, reliability and stability.
[0091] As shown in Figure 7 The application also provides a grating scanning angle detection system based on a photodiode, which comprises:
[0092] The light signal acquisition module 710 is configured to acquire a to-be-detected light signal. For example, in the embodiment, the generation process of the to-be-detected light signal comprises: irradiating a micro mirror with incident light, and after the micro mirror diffracts the incident light, the light signal generated by the diffraction is taken as the to-be-detected light signal.
[0093] The light signal conversion module 720 is configured to convert the to-be-detected light signal by using a photodiode to obtain a corresponding electrical signal.
[0094] The filtering module 730 is configured to filter the electrical signal. For example, in the embodiment, the electrical signal can be filtered by intermediate frequency filtering and high frequency filtering.
[0095] The clamping module 740 is configured to clamp the signal amplitude of the electrical signal that has completed filtering by using a zener diode.
[0096] The electrical signal conversion module 750 is configured to perform analog-digital conversion and digital signal acquisition on the electrical signal that has completed signal amplitude clamping to obtain a digital signal code value of the photodiode.
[0097] The grating scanning angle detection module 760 is configured to generate a signal acquisition waveform curve according to the digital signal code value, find any two continuous adjacent wave peaks in the same cycle and greater than a preset threshold from the signal acquisition waveform curve, and calculate the grating scanning angle when the micro mirror is diffracted based on the interval time of the two found wave peaks.
[0098] Specifically, Figure 6 A hardware connection schematic diagram when collecting the digital signal code value of the photodiode is shown. As Figure 6As shown, in the collection of photodiode digital signal code value, the embodiment can build a photodiode analog signal collection hardware circuit based on the TMS320F28335 master unit, so as to convert the light signal generated after the diffraction of the micro-mirror into an analog electrical signal; then the analog electrical signal is filtered by RC filter for intermediate frequency and high frequency filtering, then the voltage signal amplitude is clamped, and the analog electrical signal after amplitude clamping is input to the analog-digital conversion function pin of the DSP (Digital Signal Processing, Digital Signal Processor, DSP for short), so as to realize the photodiode analog signal collection on the hardware circuit. The corresponding hardware implementation principle diagram is shown in Figure 6 As shown. When the DSP collects the photodiode analog signal, a data storage buffer array can be defined to temporarily store the photodiode digital signal code value collected by the DSP analog-digital conversion function unit. Finally, based on the digital signal code value, a signal collection waveform curve is generated, and from the signal collection waveform curve, any two consecutive adjacent wave peaks in the same period and greater than the preset threshold are found, and according to the interval time of the two found wave peaks, the grating scanning angle when the micro-mirror diffracts is calculated.
[0099] According to the above description, in an exemplary embodiment, the grating scanning angle detection module generates a signal collection waveform curve according to the digital signal code value, and from the signal collection waveform curve, any two consecutive adjacent wave peaks in the same period and greater than the preset threshold are found, and based on the interval time of the two found wave peaks, the grating scanning angle when the micro-mirror diffracts is calculated. The process includes:
[0100] Obtain the upper limit value th_one and the lower limit value th_two of the maximum value finding interval in the two periods which are set in advance or in real time;
[0101] Based on the upper limit value th_one and the lower limit value th_two of the maximum value finding interval, nine maximum value points in the two periods are sequentially and circularly found from the signal collection waveform curve, and the nine maximum value points are sorted based on the quicksort function;
[0102] The maximum value in the nine maximum value points is added by a first value to obtain a peak finding upper limit value th_valone, and the maximum value in the nine maximum value points is subtracted by the first value to obtain a peak finding lower limit value th_valtwo; wherein the peak finding upper limit value th_valone and the peak finding lower limit value th_valtwo are in the same period, and the peak finding lower limit value th_valtwo is greater than the preset threshold;
[0103] Four first extreme points located at the upper limit value th_valone and the lower limit value th_valtwo of the peak searching are found from the signal acquisition waveform curve, and are recorded as max_tst, max_one, max_two and max_thr respectively;
[0104] Again, four second extreme points located at the upper limit value th_valone and the lower limit value th_valtwo of the peak searching are found from the signal acquisition waveform curve, and the second extreme points with the same values as the first extreme points max_one, max_two and max_thr are selected as the horizontal coordinates corresponding to the wave peaks in the signal acquisition waveform curve, so as to obtain three continuous adjacent wave peaks;
[0105] Any two continuous adjacent wave peaks are selected from the three continuous adjacent wave peaks, and the interval time of the selected two adjacent wave peaks is calculated.
[0106] In addition, based on the interval time of the two found wave peak values, the process of calculating the grating scanning angle when the micro mirror diffracts includes:
[0107] The three continuous adjacent wave peak values are divided into two groups of wave peaks, and the interval time of one group of wave peaks is recorded as t1, and the interval time of the other group is recorded as t2; wherein each group of wave peaks contains two continuous adjacent wave peaks;
[0108] The interval times t1 and t2 are respectively input into the grating scanning angle calculation formula to calculate the grating scanning angle when the micro mirror diffracts; wherein the grating scanning angle calculation formula is as follows:
[0109]
[0110] In the formula, θ max represents the grating scanning angle when the micro mirror diffracts; θ A represents the specific value of the wave peak; t1 and t2 represent the interval time of two adjacent wave peaks, and t1+2=; T is the period.
[0111] Specifically, as shown in Figure 2 and Figure 3 , the analog signal of the photodiode signal is processed by the hardware circuit, and then the photodiode digital signal code value obtained after the ADC analog-digital conversion of the DSP is acquired, and then the waveform curve is drawn as shown in Figure 2 , and the corresponding periodic signal definition is as shown in Figure 3 . By finding the number of ADC code values collected between the high peaks generated by 1st order diffraction, the peak-to-peak values t1 and t2 (the period T is fixed) can be determined. It should be noted that, since the ADC of the DSP is a 12-bit ADC, the ADC output code value range in this embodiment is 0-4095.
[0112] In the closed loop PID (Proportion Integration Differentiation) control system, it is very important to find the interval between the peak-to-peak values of the 0th order diffraction light, which determines the correctness and accuracy of the whole closed loop control system. The corresponding peak finding algorithm steps are as follows:
[0113] (1) First, use the ADC of DSP to collect 2T grating scanning period photodiode data and store them in the defined array.
[0114] (2) Set the upper and lower limit values th_one and th_two of the interval for finding the maximum value in 2T periods. Then find nine maximum value points in 2T periods through for loop and save them in the array for later use.
[0115] (3) After finding the nine maximum values, use the quicksort function to sort the data from large to small, and use the maximum value ± 150 of the nine data as the upper limit th_valone and the lower limit th_valtwo of the next peak finding.
[0116] (4) Through the for loop, find the extreme points in the interval th_valone and th_valtwo, that is, the points with the maximum upper and lower values, and record them as max_tst, max_one, max_two and max_thr. Since the selected data points are fixed, the first extreme point max_tst needs to be discarded, and max_one, max_two and max_thr are useful data values.
[0117] (5) Again, call the for loop to find the extreme points in the interval th_valone and th_valtwo, and the three points equal to max_one, max_two and max_thr are the horizontal coordinates corresponding to the three peaks. At the same time, define variables to record the number of points that meet the three peaks.
[0118] (6) The horizontal coordinates found through the above steps are the peak-to-peak values t1 and t2. At the same time, when the same peak has multiple points that meet step (5), average processing is needed.
[0119] Therefore, the embodiment can realize accurate judgment of the scanning angle in the scanning period of the grating scanning micromirror, so that the embodiment can realize accurate control of the entire grating scanning micromirror, and can also avoid the influence caused by temperature, so that the embodiment can adapt to various complex working conditions and has good accuracy, reliability and stability.
[0120] In an exemplary embodiment, the grating scanning angle detection system further comprises a verification module, configured to, after the grating scanning angle detection module calculates the grating scanning angle when the micromirror diffracts, perform proportional-integral-derivative closed-loop control on the grating scanning angle, and generate a closed-loop control curve in combination with the control number; and perform step response on the electrical signal output by the photodiode, and generate a step response curve in combination with the sampling point number; and verify the found wave peak according to the closed-loop control curve and the step response curve. Specifically, as shown in Figure 4 and Figure 5 The embodiment can apply the designed micromirror scanning angle algorithm to specific test instruments, so as to verify the accuracy, feasibility and reliability of the invented algorithm. Therefore, in order to avoid the change of the micromirror scanning angle caused by temperature, the embodiment introduces incremental PID + fuzzy control. In order to verify the overall function of the software, that is, the closed-loop control effect, the overall method is downloaded to the hardware circuit board to realize real-time control, and the corresponding closed-loop control effect is as shown in Figure 4 and Figure 5 From Figure 4 the following conclusions can be drawn: based on the grating scanning angle detection method described in the embodiment, the method has the advantages of fast response speed, no overshoot and small steady-state fluctuation, thereby verifying the accuracy and correctness of the method. From Figure 5 the following conclusions can be drawn: based on the grating scanning angle detection method described in the embodiment, the method can realize good following of the reference quantity, has the advantages of fast response speed, no over-modulation, and the like, thereby verifying the reliability and stability of the method.
[0121] In summary, the application provides a grating scanning angle detection system based on a photodiode. First, the light signal generated by the diffraction of the micro-mirror is converted into a digital electrical signal. Then, peak detection is performed in the signal acquisition waveform curve of the digital electrical signal. The grating scanning angle when the micro-mirror is diffracted is calculated according to the peak detection result. The scanning angle in the scanning cycle of the grating scanning micro-mirror can be accurately determined. The application can realize accurate control of the entire grating scanning micro-mirror. Moreover, the influence of temperature can be avoided, so that the application can adapt to various complex working conditions and has good accuracy, reliability and stability.
[0122] It should be noted that the grating scanning angle detection system based on a photodiode provided in the above embodiment and the grating scanning angle detection method based on a photodiode provided in the above embodiment belong to the same concept. The specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, which will not be described here. The grating scanning angle detection system based on a photodiode provided in the above embodiment can be completed by different functional modules according to the needs in actual application, that is, the internal structure of the system is divided into different functional modules to complete all or part of the functions described above. This is not limited here. Therefore, the application effectively overcomes the shortcomings in the prior art and has high industrial utilization value.
[0123] The above embodiments only exemplarily illustrate the principles and effects of the application, and are not used to limit the application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical concept disclosed in the application should be covered by the claims of the application.
[0124] The structures, proportions, sizes, etc. shown in the drawings in the specification are only used to cooperate with the content disclosed in the specification, to enable those skilled in the art to understand and read, and are not used to limit the conditions for implementing the application. Therefore, any modification of the structure, change of the proportion relationship or adjustment of the size, which does not affect the effects and purposes that can be achieved by the application, should still be covered by the technical content disclosed in the application. At the same time, the terms such as "upper", "lower", "left", "right", "middle" and "one" used in the specification are only for the convenience of clear understanding of the description, and are not used to limit the scope of the application. The change or adjustment of the relative relationship, without substantially changing the technical content, is also considered as the scope of the application.
[0125] It should be understood that, although the terms first, second, third, etc. can be adopted in the embodiments of the present application to describe the preset ranges, etc., the preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from each other. For example, the first preset range can also be referred to as the second preset range, and similarly, the second preset range can also be referred to as the first preset range without departing from the scope of the embodiments of the present application.
Claims
1. A grating scanning angle detection method based on a photodiode, characterized in that, The method includes the following steps: The optical signal to be tested is acquired, and the optical signal to be tested is converted by a photodiode to obtain the corresponding electrical signal; The electrical signal is filtered, and the amplitude of the filtered electrical signal is clamped using a Zener diode. The electrical signal with amplitude clamping is subjected to analog-to-digital conversion and digital signal acquisition to obtain the digital signal code value of the photodiode; A signal acquisition waveform curve is generated based on the digital signal code value, and any two consecutive adjacent peaks located in the same period and greater than a preset threshold are found from the signal acquisition waveform curve. Based on the time interval between the two peaks found, the grating scanning angle when the micromirror diffracts is calculated. The process of finding any two consecutive adjacent peak values that are within the same period and exceed a preset threshold from the acquired signal waveform curve includes: Find the upper limit value th_one and the lower limit value th_two of the interval by obtaining the maximum value within two pre-set or real-time periods; Based on the upper limit th_one and lower limit th_two of the maximum value search interval, nine maximum value points located within two cycles are sequentially searched from the signal acquisition waveform curve, and the nine maximum value points are sorted according to the quicksort function. Add the first value to the maximum value among the nine maximum value points to obtain the peak finding upper limit value th_valone; and subtract the first value from the maximum value among the nine maximum value points to obtain the peak finding lower limit value th_valtwo; wherein the peak finding upper limit value th_valone and the peak finding lower limit value th_valtwo are located in the same period, and the peak finding lower limit value th_valtwo is greater than the preset threshold. Find the four first extreme points located at the upper limit of peak search th_valone and the lower limit of peak search th_valtwo from the signal acquisition waveform curve, and denot them as max_tst, max_one, max_two and max_thr respectively; Find four second extreme points located at the upper limit of peak search th_valone and the lower limit of peak search th_valtwo from the signal acquisition waveform curve again, and filter out the second extreme points whose values are equal to the first extreme points max_one, max_two and max_thr, respectively, and use them as the horizontal coordinates corresponding to the peaks in the signal acquisition waveform curve to obtain three consecutive adjacent peaks. Select any two consecutive adjacent peaks from three consecutive adjacent peaks, and calculate the time interval between the two selected adjacent peaks.
2. The grating scanning angle detection method based on photodiode according to claim 1, characterized in that, The process of calculating the grating scanning angle during micromirror diffraction, based on the time interval between the two peak values, includes: Three consecutive adjacent peaks are divided into two groups of peaks, and the time interval between the peaks in one group is denoted as t1, and the time interval between the peaks in the other group is denoted as t2; each group of peaks contains two consecutive adjacent peaks. The intervals t1 and t2 are input into the formula for calculating the grating scanning angle to calculate the grating scanning angle when diffraction occurs in the micromirror; wherein the formula for calculating the grating scanning angle is as follows: In the formula, θ max This indicates the grating scanning angle during micromirror diffraction; θ A Indicates the specific numerical value of the peak; t1 and t2 represent the time interval between two adjacent peaks, and t1 + t2 = T; T is the period.
3. The grating scanning angle detection method based on a photodiode according to claim 1 or 2, characterized in that, After calculating the grating scanning angle when the micromirror diffracts, the method further includes: The grating scanning angle is subjected to proportional-integral-derivative closed-loop control, and a closed-loop control curve is generated by combining the number of control operations; and, A step response is generated for the electrical signal output by the photodiode, and a step response curve is generated by combining the number of sampling points. The identified peaks are verified based on the closed-loop control curve and the step response curve.
4. The grating scanning angle detection method based on photodiode according to claim 1, characterized in that, The process of generating the optical signal to be measured includes: illuminating a micromirror with incident light, and after the micromirror diffracts the incident light, using the diffracted optical signal as the optical signal to be measured.
5. The grating scanning angle detection method based on photodiode according to claim 1, characterized in that, Filtering the electrical signal includes performing intermediate frequency filtering and high frequency filtering.
6. A grating scanning angle detection system based on a photodiode, characterized in that, The system includes: The optical signal acquisition module is used to acquire the optical signal to be measured. The optical signal conversion module is used to convert the optical signal to be measured using a photodiode to obtain a corresponding electrical signal; A filtering module is used to filter the electrical signal; The clamping module is used to clamp the amplitude of the filtered electrical signal using a Zener diode. The electrical signal conversion module is used to perform analog-to-digital conversion and digital signal acquisition on the electrical signal that has completed signal amplitude clamping, so as to obtain the digital signal code value of the photodiode; The grating scanning angle detection module is used to generate a signal acquisition waveform curve based on the digital signal code value, and to find any two consecutive adjacent peaks located in the same period and greater than a preset threshold from the signal acquisition waveform curve, and to calculate the grating scanning angle when the micromirror diffracts based on the time interval between the two peaks found. The process by which the grating scanning angle detection module finds any two consecutive adjacent peak values within the same period and greater than a preset threshold from the signal acquisition waveform curve includes: Find the upper limit value th_one and the lower limit value th_two of the interval by obtaining the maximum value within two pre-set or real-time periods; Based on the upper limit th_one and lower limit th_two of the maximum value search interval, nine maximum value points located within two cycles are sequentially searched from the signal acquisition waveform curve, and the nine maximum value points are sorted according to the quicksort function. Add the first value to the maximum value among the nine maximum value points to obtain the peak finding upper limit value th_valone; and subtract the first value from the maximum value among the nine maximum value points to obtain the peak finding lower limit value th_valtwo; wherein the peak finding upper limit value th_valone and the peak finding lower limit value th_valtwo are located in the same period, and the peak finding lower limit value th_valtwo is greater than the preset threshold. Find the four first extreme points located at the upper limit of peak search th_valone and the lower limit of peak search th_valtwo from the signal acquisition waveform curve, and denot them as max_tst, max_one, max_two and max_thr respectively; Find four second extreme points located at the upper limit of peak search th_valone and the lower limit of peak search th_valtwo from the signal acquisition waveform curve again, and filter out the second extreme points whose values are equal to the first extreme points max_one, max_two and max_thr, respectively, and use them as the horizontal coordinates corresponding to the peaks in the signal acquisition waveform curve to obtain three consecutive adjacent peaks. Select any two consecutive adjacent peaks from three consecutive adjacent peaks, and calculate the time interval between the two selected adjacent peaks.
7. The photodiode-based grating scanning angle detection system according to claim 6, characterized in that, The process by which the grating scanning angle detection module calculates the grating scanning angle during micromirror diffraction based on the time interval between two identified peak values includes: Three consecutive adjacent peaks are divided into two groups of peaks, and the time interval between the peaks in one group is denoted as t1, and the time interval between the peaks in the other group is denoted as t2; each group of peaks contains two consecutive adjacent peaks. The intervals t1 and t2 are input into the formula for calculating the grating scanning angle to calculate the grating scanning angle when diffraction occurs in the micromirror; wherein the formula for calculating the grating scanning angle is as follows: In the formula, θ max This indicates the grating scanning angle during micromirror diffraction; θ A Indicates the specific numerical value of the peak; t1 and t2 represent the time interval between two adjacent peaks, and t1 + t2 = T; T is the period.
8. The photodiode-based grating scanning angle detection system according to claim 6 or 7, characterized in that, The system further includes a verification module, which is used to perform proportional-integral-derivative closed-loop control on the grating scanning angle after the grating scanning angle detection module calculates the grating scanning angle when the micromirror diffracts, and generate a closed-loop control curve by combining the number of control operations; and to perform a step response on the electrical signal output by the photodiode, and generate a step response curve by combining the number of sampling points; and to verify the found peak based on the closed-loop control curve and the step response curve.
Citation Information
Patent Citations
Light intensity calibration method and system based on scanning grating micromirror spectrometer and spectrometer
CN113820014A
Variable-speed jigger self-adaptive full-angle throw measuring device and variable-speed jigger self-adaptive full-angle throw measuring method
CN114251998A