An analog signal acquisition circuit and method for automatically identifying the interface type of a signal source
By designing an analog signal acquisition circuit that automatically recognizes the type of signal source interface, and using logic controllers and auxiliary ADC modules to achieve automatic configuration and detection, the measurement inaccuracy and equipment damage caused by manual matching errors in the prior art are solved, and the accuracy of the acquisition results and the reliability of the equipment are improved.
Patent Information
- Application Number
- CN202510457294.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-04-14
AI Technical Summary
In the prior art, the circuit needs to be matched according to the type of the signal source interface during the acquisition of sensor signals. Misoperated operations or cognitive problems may easily lead to matching failure, resulting in inaccurate measurement results or damage to the equipment.
Design an analog signal acquisition circuit that automatically identifies the type of signal source interface, including input interface, voltage source module, current source module, program-controlled resistor module, auxiliary ADC module, logic controller and common acquisition circuit. The logic controller automatically configures circuit parameters and assists the detection of the signal source interface type to realize automatic judgment.
Automatic identification and matching of different types of signal source interfaces is realized, errors caused by manual operation are avoided, accuracy of acquisition results and reliability of equipment are improved, and equipment damage is prevented.
Smart Images

Figure CN119986221B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sensor signal acquisition, and relates to an analog signal acquisition circuit and method for automatically identifying the type of signal source interface. Background Art
[0002] During the process of sensor signal acquisition, it is usually necessary to match the corresponding analog signal acquisition circuit according to the type of signal source interface. If the matching fails, it will lead to incorrect acquisition results or even equipment damage.
[0003] Currently, for general signal acquisition boards on the market, some match with specific signal sources by providing adapters and manually adjusting the matching circuit. For some other products, although they can be compatible with multiple types of signal source interfaces, usually, operators need to judge the type of signal source interface by themselves and then select the corresponding matching mode in the software, which requires a relatively high technical level of the operators. Due to the operation errors or cognitive problems of the operators, it is easy to cause the mismatch between the analog signal acquisition circuit and the type of signal source interface, which will not only make the measurement results inaccurate, but also may damage expensive high-precision data acquisition equipment or high-precision sensors, thus causing huge losses.
[0004] Based on this, there is an urgent need to propose an analog signal acquisition circuit for automatically identifying the type of signal source interface to solve the above technical problems existing in the prior art. Summary of the Invention
[0005] The purpose of the present invention is to propose an analog signal acquisition circuit for automatically identifying the type of signal source interface. This acquisition circuit can automatically detect the type of signal source interface and then automatically configure a matching analog signal acquisition circuit according to the judgment result of the type of signal source interface, and can realize the acquisition of analog signals of different types of signal source interfaces.
[0006] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0007] An analog signal acquisition circuit for automatically identifying the type of signal source interface includes an input interface, a voltage source module, a current source module, a programmable resistor module, an auxiliary ADC module, a logic controller, and a common acquisition circuit;
[0008] The voltage source module includes a programmable voltage source, a first programmable resistor, and a first switch. The output end of the programmable voltage source is connected to the first programmable resistor, the first programmable resistor is connected to one end of the first switch, and the other end of the first switch is connected to the input interface;
[0009] The current source module includes a programmable current source, a voltage-current measurement unit, and a second switch. The output end of the programmable current source is connected to the voltage-current measurement unit, which is used to monitor the working state of the programmable current source. One end of the second switch is connected to the voltage-current measurement unit, and the other end of the second switch is connected to the input interface;
[0010] The programmable resistor module includes a second programmable resistor and a third switch. The second programmable resistor is connected to the signal ground. One end of the third switch is connected to the second programmable resistor, and the other end of the third switch is connected to the input interface;
[0011] The auxiliary ADC module includes a first analog-to-digital converter and a fourth switch. One end of the fourth switch is connected to the first analog-to-digital converter, and the other end of the fourth switch is connected to the input interface;
[0012] A fifth switch, an amplification and filtering circuit, and a second analog-to-digital converter are arranged on the common acquisition circuit. One end of the fifth switch is connected to the input interface, and the other end of the fifth switch is connected to the second analog-to-digital converter through the amplification and filtering circuit.
[0013] In addition, the present invention also provides an analog signal acquisition method for automatically identifying the signal source interface type, which is implemented based on the above analog signal acquisition circuit. Before acquiring the signal, first identify the signal source interface type, and then according to different signal source interface types, acquire the analog signals of different types of signal source interfaces.
[0014] In order to achieve the above object, the present invention adopts the following technical solutions:
[0015] An analog signal acquisition method for automatically identifying the signal source interface type includes the following steps:
[0016] Step 1. First, judge the signal source interface type of the analog signal acquisition circuit;
[0017] In the judgment of the signal source interface type, the judgment results of the signal source interface type include a current source output type interface, a voltage source output type interface, a resistor source output type interface, and a current source input type interface;
[0018] Automatically configure a matching analog signal acquisition circuit according to the judgment result of the signal source interface type;
[0019] Step 2. Use the analog signal acquisition circuit in Step 1 to achieve the acquisition of the signal source analog signal.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] As described above, the present invention relates to an analog signal acquisition circuit for automatically identifying the type of signal source interface, and an analog signal acquisition method for automatically identifying the type of signal source interface based on the analog signal acquisition circuit. The analog signal acquisition circuit of the present invention can adapt to different types of signal source interfaces, automatically configure the output voltage value of the voltage source module, the output current value of the current source module, and the resistance value of the programmable resistor module through a logic controller, and cooperate with the auxiliary ADC module for detection to achieve automatic judgment of the signal source interface type. In addition, switches are used for control in the analog signal acquisition circuit of the present invention, which will not cause loss of the quality of the analog input signal of the sensor. In the analog signal acquisition circuit of the present invention, the first switch to the fifth switch all adopt blocking switches, ensuring that in the case of excessive current or short circuit, the power supply can be quickly cut off, improving the reliability of the acquisition circuit and preventing damage to the sensor or the acquisition circuit due to misoperation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.
[0023] Figure 1 FIG. is a schematic structural diagram of the analog signal acquisition circuit for automatically identifying the type of signal source interface of the present invention;
[0024] Among them, 11 - programmable voltage source, 12 - first programmable resistor, 13 - first switch, 21 - programmable current source, 22 - voltage and current measurement unit, 23 - second switch, 31 - second programmable resistor, 32 - third switch;
[0025] 41 - first analog-to-digital converter, 42 - fourth switch, 51 - fifth switch, 52 - amplifier and filter circuit, 53 - second analog-to-digital converter, 6 - logic controller, 7 - input interface, 8 - post-stage circuit protection module. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.
[0027] All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0028] It should be noted that all directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the relative positional relationship and movement conditions between components in a certain specific posture (as shown in the attached drawings). If this specific posture changes, the directional indications will also change accordingly.
[0029] In addition, in the present invention, descriptions such as "first" and "second" are only for descriptive purposes and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0030] In the present invention, unless otherwise clearly specified and limited, terms such as "connection" and "fixation" should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be the communication inside two elements or the interaction relationship between two elements, unless otherwise clearly limited. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0031] In addition, the technical solutions between various embodiments of the present invention can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present invention.
[0032] Embodiment 1
[0033] The present invention provides an analog signal acquisition circuit and method for automatically identifying the signal source interface type, so as to achieve the purpose of identifying the signal source interface type, automatically configure a matching analog signal acquisition circuit according to different signal source interface types, and perform analog signal acquisition.
[0034] Before introducing the analog signal acquisition circuit for automatically identifying the signal source interface type in the present invention, it is first necessary to explain the signal source interface type. The signal source interface type in this embodiment is divided into a voltage source output type interface, a current source output type interface, a resistance source output type interface, and a current source input type interface according to the signal source output signal characteristics and circuit characteristics.
[0035] Specifically, the output characteristic of the voltage source output type interface is that the output signal is a voltage signal, which remains basically unchanged with the change of the load impedance. The output characteristic of the current source output type interface is that the output signal is a current signal, which changes with the change of the load impedance and maintains a linear relationship. The output signal of the resistance source output type interface needs to be measured in cooperation with the voltage source, and the output signal changes linearly with the change of the voltage source. The current source input type interface needs to be measured in cooperation with the current source, and its output signal has nothing to do with the change of the current magnitude of the current source.
[0036] As Figure 1 shown, in this embodiment, the analog signal acquisition circuit for automatically identifying the signal source interface type includes an input interface 7, a voltage source module, a current source module, a programmable resistor module, an auxiliary ADC module, a logic controller 6, and a common acquisition circuit.
[0037] The voltage source module includes a programmable voltage source 11, a first programmable resistor 12, and a first switch 13. The output end of the programmable voltage source 11 is connected to the first programmable resistor 12. The first programmable resistor 12 is connected to one end of the first switch 13, and the other end of the first switch 13 is connected to the input interface 7. The logic controller 6 controls the output voltage magnitude of the programmable voltage source 11, the resistance value of the first programmable resistor 12, and the on / off state of the first switch 13 respectively. In this embodiment, the logic controller 6 can control the output voltage magnitude of the programmable voltage source 11 through software, and can also control the resistance of the first programmable resistor 12 and the connection or disconnection of the first switch 13 through software.
[0038] Specifically, in this embodiment, the programmable voltage source 11 includes a first power chip and a first digital potentiometer. The logic controller controls the resistance of the first digital potentiometer through a Serial Peripheral Interface (SPI). The first digital potentiometer serves as the feedback resistor of the first power chip. By adjusting the resistance value of the first power chip, the output voltage of the programmable voltage source 11 is changed. The first power chip is preferably a DCDC chip of the LM5170 type, and the first digital potentiometer is preferably a digital potentiometer of the TPL0501-100 type. The maximum resistance value of the TPL0501-100 type digital potentiometer is 100KΩ.
[0039] The current source module includes a programmable current source 21, a voltage-current measurement unit 22, and a second switch 23. The output terminal of the programmable current source 21 is connected to the voltage-current measurement unit 22, and the voltage-current measurement unit 22 is used to monitor the working state of the programmable current source 21. One end of the second switch 23 is connected to the voltage-current measurement unit 22, and the other end of the second switch 23 is connected to the input interface 7. The logic controller 6 controls the output current magnitude of the programmable current source 21, the working state of the voltage-current measurement unit 22, and the on-off state of the second switch 23 respectively. In this embodiment, the logic controller 6 can control the output current magnitude of the programmable current source 21 and the connection or disconnection of the second switch 23 through software, and read the voltage and current values in the voltage-current measurement unit 22 through software to monitor the working state of the programmable current source 21. The voltage-current measurement unit 22 in this embodiment preferably uses the INA226 model, which supports the alarm function and can achieve ultra-high-precision bidirectional measurement.
[0040] Specifically, in this embodiment, the programmable current source 21 includes a second power chip and a second digital potentiometer. The logic controller 6 controls the resistance of the second digital potentiometer through the SPI interface. The second digital potentiometer serves as the feedback resistance of the second power chip. By adjusting the resistance value of the second power chip, the output current of the second programmable current source 21 is changed. The second power chip preferably uses the LM334 type chip, and the second digital potentiometer preferably uses the TPL0501-100 type digital potentiometer.
[0041] The programmable resistor module includes a second programmable resistor 31 and a third switch 32. The second programmable resistor 31 is connected to the signal ground. One end of the third switch 32 is connected to the second programmable resistor 31, and the other end of the third switch 32 is connected to the input interface 7. The logic controller 6 controls the resistance value of the second programmable resistor 31 and the on-off state of the third switch 32 respectively. In this embodiment, the logic controller 6 can control the resistance value of the second programmable resistor 31 and the connection or disconnection of the third switch 32 through software.
[0042] The auxiliary ADC module includes a first analog-to-digital converter 41 and a fourth switch 42. One end of the fourth switch 42 is connected to the first analog-to-digital converter 41, and the other end of the fourth switch 42 is connected to the input interface 7. The logic controller 6 controls the signal acquisition of the first analog-to-digital converter 41 and the on-off state of the fourth switch 42 respectively. In this embodiment, the logic controller 6 controls the opening and closing of the fourth switch 42 and the acquisition of the first analog-to-digital converter 41 to detect the signal voltage at the analog input interface 7.
[0043] A fifth switch 51, an amplifying and filtering circuit 52, and a second analog-to-digital converter 53 are provided on the common acquisition circuit. One end of the fifth switch 51 is connected to the input interface 7, and the other end of the fifth switch 51 is connected to the second analog-to-digital converter 53 through the amplifying and filtering circuit 52. The logic controller 6 controls the signal acquisition of the second analog-to-digital converter 53 and the on / off state of the fifth switch 51 respectively.
[0044] In this embodiment, the analog signal acquisition circuit further includes a post-stage circuit protection module 8, and the post-stage circuit protection module 8 is connected to the first switch 13, the second switch 23, the third switch 32, the fourth switch 42, the fifth switch 51, and the input interface 7 respectively.
[0045] In addition, the logic controller 6 of this embodiment preferably uses an STM32F207 type logic controller. The first analog-to-digital converter 41 and the second analog-to-digital converter 53 preferably use an ADS8319 type analog-to-digital converter. The ADS8319 type analog-to-digital converter is a 16-bit SAR analog-to-digital converter, with a maximum sampling rate of 500 ksps, and the digital interface is an SPI interface. The logic controller 6 controls the first analog-to-digital converter 41 and the second analog-to-digital converter 53 through the SPI interface and reads the data after analog-to-digital conversion. Of course, the logic controller 6 is not limited to the devices preferably used in this embodiment, and other devices with signal processing and logic control functions such as DSP, FPGA, ARM can also be selected.
[0046] The first switch 13, the second switch 23, the third switch 32, the fourth switch 42, and the fifth switch 51 of this embodiment preferably use an AQY221R2S type switch. The on-resistance of the AQY221R2S type switch is 0.8 Ω, and the output capacitance is 13 pF.
[0047] It should be noted that the above models are only preferred in this embodiment, and the logic controller 6 and switches in the analog signal acquisition circuit of the present invention are not limited to the selection in this embodiment.
[0048] The analog signal acquisition circuit of the present invention can adapt to the signal source interface type by detecting the impedance characteristics of the input analog signal source and the current-voltage adaptation situation, automatically configure each module through the logic controller 6, use the auxiliary ADC for detection, and automatically determine the interface type. The logic controller 6 controls the voltage source module, current source module, and programmable resistor module to change the voltage, current, and matching resistor at the input interface 7, and uses the auxiliary ADC module for signal acquisition, so as to judge the signal attributes and circuit characteristics of the input signal source. At the same time, it can detect whether the signal at the input interface 7 is abnormal, including open circuit, voltage overload, current overload, etc., which can improve the reliability of the analog signal acquisition circuit and prevent the sensor or acquisition circuit from being damaged due to misoperation. Specifically, when the collected voltage value is greater than the preset threshold, it is determined as voltage overload, and when the collected current value is greater than the preset threshold, it is determined as current overload.
[0049] Embodiment 2
[0050] This Embodiment 2 describes an analog signal acquisition method for automatically identifying the signal source interface type, which is based on the analog signal acquisition circuit for automatically identifying the signal source interface type in the above Embodiment 1.
[0051] The analog signal acquisition method for automatically identifying the signal source interface type includes the following steps:
[0052] Step 1. First, judge the signal source interface type of the analog signal acquisition circuit.
[0053] In the judgment of the signal source interface type, the judgment results of the signal source interface type include current source output type interface, voltage source output type interface, resistance source output type interface, and current source input type interface. The matching analog signal acquisition circuit is automatically configured according to the judgment results of the signal source interface type.
[0054] Step 1.1. The auxiliary ADC module and the programmable resistor module are used in cooperation to detect whether the signal source interface type is a current source output type interface or a voltage source output type interface.
[0055] The minimum resistance of the second programmable resistor 31 is 100Ω, and the maximum resistance is 100KΩ.
[0056] Under the control of the logic controller 6, the resistance value of the second programmable resistor 31 is set to the maximum value R1. In this embodiment, R1 is 100KΩ, that is, the resistance of the second programmable resistor 31 is set to the maximum value of 100KΩ. Close the third switch 32 and the fourth switch 42, and keep the first switch 13, the second switch, and the fifth switch 51 in the open state.
[0057] Control the first analog-to-digital converter 41 to convert the acquired analog signal into a digital signal to obtain a conversion value A1; set the resistance value reduced by the second programmable resistor each time as r1. In this embodiment, r1 is 10 KΩ, that is, each time the resistance value of the second programmable resistor 31 is reduced by 10 KΩ; reduce the resistance value of the second programmable resistor 31 for the first time, and control the first analog-to-digital converter 41 to convert the acquired analog signal into a digital signal to obtain a conversion value A2; reduce the resistance value of the second programmable resistor 31 for the second time, and control the first analog-to-digital converter 41 to convert the acquired analog signal into a digital signal to obtain a conversion value A3; reduce the resistance value of the second programmable resistor 31 for the third time, and control the first analog-to-digital converter 41 to convert the acquired analog signal into a digital signal to obtain a conversion value A4.
[0058] If the values of A2, A3, and A4 are not zero, and the ratios of A1 to A2, A2 to A3, and A3 to A4 are all less than a preset threshold , in this embodiment is 95%, that is, the ratio of the data collected at point A1 to the data collected at A2, the data collected at point A2 to the data collected at A3, and the data collected at point A3 to the data collected at A4 is less than 95%, then it is determined that the signal source interface type is a current source output type interface, and go to step 1.5.
[0059] If the values of A2, A3, and A4 are not zero, and the ratios of A1 to A2, A2 to A3, and A3 to A4 are all greater than or equal to a preset threshold , that is, the ratios of A1 to A2, A2 to A3, and A3 to A4 are greater than or equal to 95%, then it is considered that the differences between A1 and A2, A2 and A3, and A3 and A4 are small or basically the same, and it is determined that the signal source interface type is a voltage source output type interface, and go to step 1.5.
[0060] If the above judgment conditions for the signal source interface type are not met, go to step 1.2 to further judge the signal source interface type.
[0061] Step 1.2. The auxiliary ADC module is used in cooperation with the voltage source module to further detect whether the signal source interface type is a voltage source output type interface.
[0062] In this embodiment, the maximum output voltage of the programmable voltage source 11 is 24 V, the minimum output voltage is 1 V, the programmable voltage source 11 has an overcurrent protection function, and its maximum output current is 100 mA. The maximum resistance value of the first programmable resistor 12 is 100 KΩ, and the minimum resistance is 100 Ω.
[0063] Under the control of the logic controller 6, set the output voltage value of the programmable voltage source 11 to the minimum value Umin , in this embodiment, U min is 1V, set the resistance value of the first programmable resistor 12 to the maximum value R2, in this embodiment, R2 is 100KΩ, that is, set the output voltage value of the programmable voltage source 11 to the minimum value 1V, and the resistance of the first programmable resistor 12 is the maximum value 100KΩ. Close the first switch 13 and the fourth switch 42, and keep the second switch, the third switch 32 and the fifth switch 51 in the open state.
[0064] Control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B1; then preset the increment value of the output voltage value of the programmable voltage source 11. In this embodiment, the output voltage value of the programmable voltage source 11 is increased by 10%; for the first time, increase the output voltage value of the programmable voltage source 11 according to the preset magnitude, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B2; for the second time, increase the output voltage value of the programmable voltage source 11 according to the preset magnitude, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B3; for the third time, increase the output voltage value of the programmable voltage source 11 according to the preset magnitude, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B4.
[0065] If , , are all less than the preset threshold, in this embodiment is set to 10%, that is, it satisfies <10%, <10%, <10%, then it is considered that the values of B1, B2, B3, and B4 basically remain unchanged, determine that the signal source interface type is a voltage source output type interface, and go to step 1.5.
[0066] If the above judgment conditions for the signal source interface type are not met, it will go to step 1.3 to further judge the signal source interface type.
[0067] Step 1.3. The auxiliary ADC module is used in conjunction with the programmable resistor module to detect whether the signal source interface type is a resistor source output type interface.
[0068] Under the control of the logic controller 6, set the output voltage value of the programmable voltage source 11 to the minimum value U min , in this embodiment, U minThe voltage of the first programmable voltage source 11 is 1V, and the resistance value of the second programmable resistor 31 is set to the maximum value R1. In this embodiment, R1 is 100 KΩ. That is, the output voltage value of the programmable voltage source 11 is set to the minimum value 1V, and the resistance value of the second programmable resistor 31 is set to the maximum value 100 KΩ. Close the third switch 32 and the fourth switch 42, and keep the first switch 13, the second switch, and the fifth switch 51 in the open state.
[0069] Control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal, and obtain the conversion value B3. Set the resistance value reduced by the second programmable resistor 31 each time as r2. In this embodiment, the resistance value of the second programmable resistor 31 is reduced by 10% each time. Reduce the resistance value of the second programmable resistor 31 for the first time, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal, and obtain the conversion value B4. Reduce the resistance value of the second programmable resistor 31 for the second time, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal, and obtain the conversion value B5. Reduce the resistance value of the second programmable resistor 31 for the third time, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal, and obtain the conversion value B6.
[0070] If the differences between B4 and B3, B5 and B4, and B6 and B5 are all linearly related to the reduced resistance value r2, that is, the values of B3 and B4, B5 and B4, and B6 and B5 change with the change of the resistance of the second programmable resistor 31, then the signal source interface type can be deduced as a resistor-type interface through B3 and B4, B5 and B4, and B6 and B5, and the resistance value of the input signal source can be deduced through Ohm's law, determine that the signal source interface type is a resistor source output type interface, and go to step 1.5.
[0071] If the above judgment conditions for the signal source interface type are not met, go to step 1.4 to further judge the signal source interface type.
[0072] Step 1.4. The auxiliary ADC module is used in cooperation with the current source module to detect whether the input signal source interface type is a current source input type interface.
[0073] In this embodiment, the maximum output current of the programmable current source 21 is 10 mA, the minimum output current is 100 μA, and the maximum output voltage is 24V. The voltage and current measurement unit 22 mainly measures the output current value and output voltage value of the programmable current source 21.
[0074] Under the control of the logic controller 6, set the output current value of the programmable current source 21 to the minimum value I min , in this embodiment, I minIt is 100 μA, that is, the output current value of the programmable current source 21 is set to the minimum value of 100 μA. Close the second switch and the fourth switch 42, and keep the first switch 13, the third switch 32, and the fifth switch 51 in the open state.
[0075] Control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B5; set the current value increased by the programmable current source 21 each time to i1. In this embodiment, i1 is 100 μA, that is, the output current of the programmable current source 21 increases by 100 μA each time; increase the output current value of the programmable current source 21 for the first time, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B8; increase the output current value of the programmable current source 21 for the second time, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B9; increase the output current value of the programmable current source 21 for the third time, control the first analog-to-digital converter 41 to convert the collected analog signal into a digital signal to obtain the conversion value B 10 .
[0076] If the difference between B8 and B7, the difference between B9 and B8, and the difference between B 10 and B9 are all linearly related to the increased current value a1, then according to Ohm's law, it is determined that the signal source interface type is a resistor source output type interface, and go to step 1.5; if B8 and B7, B9 and B8, B 10 and B9 are all non-linear relationships, and when the current source increases to the preset value I * after , , the values of are all less than the preset threshold . In this embodiment is 5%, that is , , the values of are all less than 5%, then it indicates that the signal source interface type is a current source input type interface, and go to step 1.5.
[0077] If all characteristics do not conform, that is, the judgment conditions of all signal source interface types in steps 1.1 to 1.4 are not met, then it is determined as an abnormal situation, report the abnormality and suspend the execution of the subsequent steps.
[0078] Step 1.5. Configure an analog signal acquisition circuit that matches the signal source interface type.
[0079] If the signal source interface type is a voltage source output type interface, disconnect the first switch 13, the second switch, the third switch 32, and the fourth switch 42, and close the fifth switch 51.
[0080] If the signal source interface type is a resistor source output type interface, disconnect the second switch, the third switch 32 and the fourth switch 42, and close the first switch 13 and the fifth switch 51.
[0081] If the signal source interface type is a current source output type interface, disconnect the first switch 13, the second switch and the fourth switch 42, and close the third switch 32 and the fifth switch 51.
[0082] If the signal source interface type is a current source input type interface, disconnect the first switch 13, the third switch 32 and the fourth switch 42, and close the second switch and the fifth switch 51.
[0083] According to Step 1.1, it is possible to determine whether the signal source interface type is a voltage source output type interface or a current source output type interface. According to Step 1.2, it is possible to determine whether the signal source interface type is a voltage source output type interface or other interfaces other than the voltage source output type interface. According to Step 1.3, it is possible to determine whether the signal source interface type is a resistor source output type interface or other interfaces other than the resistor source output type interface. According to Step 1.4, it is possible to determine whether the signal source interface type is a resistor source output type interface or a current source input type interface.
[0084] Step 2. Use the analog signal acquisition circuit in Step 1 to implement the acquisition of the analog signal of the signal source.
[0085] Specifically, set the output current of the programmable current source 21 to 1 mA, set the output voltage of the programmable voltage source 11 to 5 V, set the resistance of the programmable resistor source, that is, the resistance of the second programmable resistor 31, to 1 kΩ, and use the configured analog signal acquisition circuit to implement the acquisition of the analog signal of the signal source.
[0086] So far, this embodiment has been described in detail with reference to the accompanying drawings. Based on the above description, those skilled in the art should have a clear understanding of the analog signal acquisition circuit and method for automatically identifying the signal source interface type of the present invention. Of course, the above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structural transformation made under the inventive concept of the present invention, or direct / indirect application in other related technical fields, is included in the patent protection scope of the present invention and should be protected by the present invention.
Claims
1. A method for collecting analog signals for automatically identifying the type of signal source interface, characterized in that: The analog signal acquisition method for automatically identifying the type of signal source interface is implemented based on an analog signal acquisition circuit for automatically identifying the type of signal source interface. The analog signal acquisition circuit based on automatically identifying the type of signal source interface includes an input interface, a voltage source module, a current source module, a programmable resistor module, an auxiliary ADC module, a logic controller and a common acquisition circuit. The voltage source module includes a programmable voltage source, a first programmable resistor and a first switch, the output end of the programmable voltage source is connected to the first programmable resistor, the first programmable resistor is connected to one end of the first switch, and the other end of the first switch is connected to the input interface; The current source module includes a programmable current source, a voltage and current measuring unit and a second switch, the output end of the programmable current source is connected to the voltage and current measuring unit, the voltage and current measuring unit is used to monitor the working state of the programmable current source, one end of the second switch is connected to the voltage and current measuring unit, and the other end of the second switch is connected to the input interface; The programmable resistor module includes a second programmable resistor and a third switch, the second programmable resistor is connected to the signal ground, one end of the third switch is connected to the second programmable resistor, and the other end of the third switch is connected to the input interface; The auxiliary ADC module includes a first analog-to-digital converter and a fourth switch, one end of the fourth switch is connected to the first analog-to-digital converter, and the other end of the fourth switch is connected to the input interface; The common acquisition circuit is provided with a fifth switch, an amplifying and filtering circuit, and a second analog-to-digital converter, one end of the fifth switch is connected to the input interface, and the other end of the fifth switch is connected to the second analog-to-digital converter through the amplifying and filtering circuit; The analog signal acquisition method for automatically identifying the signal source interface type comprises the following steps: Step 1. First determine the signal source interface type of the analog signal acquisition circuit; In the signal source interface type determination, the signal source interface type determination result includes a current source output type interface, a voltage source output type interface, a resistance source output type interface, and a current source input type interface; Automatically configure a matching analog signal acquisition circuit according to the judgment result of the signal source interface type; Step 2. Using the analog signal acquisition circuit of step 1, the analog signal of the signal source is acquired; The step 1 is specifically as follows: Step 1.
1. The auxiliary ADC module is used in conjunction with the programmable resistor module to detect whether the signal source interface type is a current source output type interface or a voltage source output type interface; Step 1.
2. The auxiliary ADC module is used in conjunction with the voltage source module to detect whether the signal source interface type is a voltage source output interface; Step 1.
3. The auxiliary ADC module is used in conjunction with the programmable resistor module to detect whether the signal source interface type is a resistance source output type interface; Step 1.
4. The auxiliary ADC module is used in conjunction with the current source module to detect whether the input signal source interface type is a resistance source output type interface or a current source input type interface; Step 1.
5. Configure the analog signal acquisition circuit that matches the signal source interface type; The step 1.3 is specifically as follows: Under the control of the logic controller, the output voltage value of the programmable voltage source is set to the minimum value U min , the resistance value of the second programmable resistor is set to a maximum value R1, the third switch and the fourth switch are closed, and the first switch, the second switch and the fifth switch are kept in an open circuit state; Controlling the first analog-to-digital converter to convert the collected analog signal into a digital signal to obtain a conversion value B3; The resistance value of the second programmable resistor that is reduced each time is set to r2, and the resistance value of the second programmable resistor is reduced for the first time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B4; The resistance value of the second programmable resistor is reduced for the second time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B5; The resistance value of the second programmable resistor is reduced for the third time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B6; If the difference between B4 and B3, the difference between B5 and B4, and the difference between B6 and B5 are all linearly related to the reduced resistance value r2, then the signal source interface type is determined to be a resistance source output type interface, and go to step 1.
5.
2. The analog signal acquisition method for automatically identifying the signal source interface type according to claim 1, characterized in that: The program-controlled voltage source includes a first power chip and a first digital potentiometer; The logic controller controls the resistance of the first digital potentiometer through the SPI interface, and the first digital potentiometer serves as a feedback resistor of the first power chip and is used to change the output voltage of the programmable voltage source; The program-controlled current source includes a second power chip and a second digital potentiometer; The logic controller controls the resistance of the second digital potentiometer through the SPI interface, and the second digital potentiometer serves as a feedback resistor of the second power chip to change the output current of the second programmable current source; The output voltage of the programmable voltage source, the resistance value of the first programmable resistor, and the on / off state of the first switch are all controlled by the logic controller respectively; The output current of the programmable current source, the working state of the voltage and current measuring unit, and the on-off state of the second switch are all controlled by the logic controller respectively; The resistance value of the second programmable resistor and the on / off state of the third switch are respectively controlled by the logic controller; The signal acquisition of the first analog-to-digital converter and the on-off state of the fourth switch are respectively controlled by the logic controller; The signal acquisition of the second analog-to-digital converter and the on-off state of the fifth switch are respectively controlled by the logic controller; If the signal source interface type is determined to be a voltage source output type interface, the first switch, the second switch, the third switch and the fourth switch are disconnected, and the fifth switch is closed; If the signal source interface type is determined to be a resistance source output type interface, the second switch, the third switch and the fourth switch are disconnected, and the first switch and the fifth switch are closed; If the signal source interface type is determined to be a current source output type interface, the first switch, the second switch and the fourth switch are disconnected, and the third switch and the fifth switch are closed; If the signal source interface type is determined to be a current source input type interface, the first switch, the third switch and the fourth switch are disconnected, and the second switch and the fifth switch are closed; The step 1.1 is specifically as follows: Under the control of the logic controller, the resistance value of the second programmable resistor is set to a maximum value R1, the third switch and the fourth switch are closed, and the first switch, the second switch and the fifth switch are kept in an open circuit state; Controlling the first analog-to-digital converter to convert the collected analog signal into a digital signal to obtain a conversion value A1; The resistance value of the second programmable resistor that is reduced each time is set to r1, and the resistance value of the second programmable resistor is reduced for the first time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value A2; The resistance value of the second programmable resistor is reduced for the second time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value A3; The resistance value of the second programmable resistor is reduced for the third time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value A4; If the values of A2, A3, and A4 are not zero, and the ratio of A1 to A2, the ratio of A2 to A3, and the ratio of A3 to A4 are all less than the preset threshold α, then the signal source interface type is determined to be a current source output type interface, and go to step 1.5; If the values of A2, A3, and A4 are not zero, and the ratio of A1 to A2, the ratio of A2 to A3, and the ratio of A3 to A4 are all greater than or equal to the preset threshold α, then the signal source interface type is determined to be a voltage source output interface, and go to step 1.5; The step 1.2 is specifically as follows: Under the control of the logic controller, the output voltage of the programmable voltage source is set to the minimum value U min , setting the resistance value of the first programmable resistor to a maximum value R2, closing the first switch and the fourth switch, and keeping the second switch, the third switch and the fifth switch in an open circuit state; Controlling the first analog-to-digital converter to convert the collected analog signal into a digital signal to obtain a conversion value B1; For the first time, the output voltage value of the programmable voltage source is increased according to a preset value, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B2; The output voltage value of the programmable voltage source is increased by a preset value for the second time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B3; The output voltage value of the programmable voltage source is increased for the third time according to a preset value, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B4; If the values of (B2-B1) / B1, (B3-B2) / B2, and (B4-B3) / B3 are all less than the preset threshold β, the signal source interface type is determined to be a voltage source output interface, and go to step 1.
5.
3. The analog signal acquisition method for automatically identifying the signal source interface type according to claim 2, characterized in that: The step 1.4 is specifically as follows: Under the control of the logic controller, the output current value of the programmable current source is set to the minimum value I min , close the second switch and the fourth switch, and keep the first switch, the third switch and the fifth switch in an open circuit state; Controlling the first analog-to-digital converter to convert the collected analog signal into a digital signal to obtain a conversion value B7; The current value increased each time by the programmable current source is set as i1, and the output current value of the programmable current source is increased for the first time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B8; The output current value of the programmable current source is increased for the second time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B9; The output current value of the programmable current source is increased for the third time, and the first analog-to-digital converter is controlled to convert the collected analog signal into a digital signal to obtain a conversion value B 10 ; If the difference between B8 and B7, the difference between B9 and B8, B 10 The difference between B9 and B9 is linearly related to the increased current value a1. According to Ohm's law, the signal source interface type is determined to be a resistance source output interface, and go to step 1.5; If B8 and B7, B9 and B8, B 10 The relationship between the current source and B9 is nonlinear, and when the current source increases to the preset value I * After that, (B8-B7) / B7, (B9-B8) / B8, (B 10 -B9) / B 10 If the values of are all less than the preset threshold γ, it is determined that the signal source interface type is a current source input interface, and go to step 1.5; If the judgment conditions of all signal source interface types are not met, it is determined to be an abnormal situation.
4. The analog signal acquisition method for automatically identifying the signal source interface type according to claim 3, characterized in that: The step 2 is specifically as follows: The output current value of the programmable current source is set to 1mA, the output voltage value of the programmable voltage source is set to 5V, and the resistance value of the programmable resistance source, i.e., the resistance value of the second programmable resistor, is set to 1KΩ; The configured analog signal acquisition circuit is used to acquire the analog signal from the signal source.
Citation Information
Patent Citations
Security system having detector sensing and identification
US4524349A
Sensor interface circuit and sensor module
WO2022249346A1