4-20mA current signal output circuit and output calibration method

By designing a 4-20mA current signal output circuit including a controller, a current output control circuit, a sampling circuit, an amplification circuit and an analog-to-digital conversion circuit, autonomous high-precision calibration is achieved, and the problems of strong dependence on external precision instruments in the prior art, insufficient adaptability and limited dynamic load correction capabilities are solved.

CN119828826APending Publication Date: 2025-04-15HAILIN ENERGY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411952185.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing 4-20mA interface circuit calibration method relies on external precision instruments, lack of adaptability and limited correction capabilities under dynamic load conditions.

Method used

Design a 4-20mA current signal output circuit including a controller, a current output control circuit, a sampling circuit, an amplification circuit and an analog-to-digital conversion circuit. The control parameters are dynamically adjusted through the closed-loop feedback mechanism to achieve independent high-precision calibration.

Benefits of technology

It realizes high-precision and high-stability current signal output, reduces nonlinear deviation, reduces dependence on external equipment, simplifies calibration process, and reduces cost and maintenance difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119828826A_ABST
    Figure CN119828826A_ABST
Patent Text Reader

Abstract

The invention discloses a 4-20 mA current signal output circuit and an output calibration method. The circuit comprises a controller, a current output control circuit, a sampling circuit, an amplifying circuit and an analog-to-digital conversion circuit, the input end of the current output control circuit is connected with the controller, the output end of the current output control circuit is connected with the input end of the sampling circuit, the output end of the sampling circuit is connected with the input end of the amplifying circuit, the output end of the amplifying circuit is connected with the input end of the analog-to-digital conversion circuit, and the output end of the analog-to-digital conversion circuit is connected with the controller. The calibration mechanism does not need to depend on an external precise instrument, high-precision calibration can be automatically completed, the calibration process is simplified, the cost and maintenance difficulty are reduced, a reliable solution is provided for high-precision signal output and transmission in an industrial scene, and the method is suitable for popularization and application. The problems that in the prior art, calibration precision is insufficient, dependence on external equipment is high, and dynamic load adaptability is poor are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic circuits, and in particular to a 4-20mA current signal output circuit and an output calibration method. Background Art

[0002] In the field of industrial control and measurement, 4–20mA current signal is an internationally accepted standard signal, which is widely used in signal transmission and output of various sensors and control equipment. This signal form has the advantages of strong anti-interference ability, low signal attenuation in long-distance transmission, and easy conversion into voltage signal through sampling resistor, which can meet the requirements of high reliability and high precision in industrial environments. However, since the output current needs to maintain a strict linear relationship with the measured physical quantity, the accuracy and stability of the 4–20mA signal are crucial to ensure the overall performance of the measurement and control system. Therefore, it is particularly important to accurately calibrate the output of the 4–20mA interface circuit.

[0003] The existing 4-20mA interface circuit calibration method usually relies on standard instruments to measure and compare the output signal, and corrects the output deviation by manually or automatically adjusting the calibration parameters. Although this method can improve the accuracy of the signal to a certain extent, it also has many problems. First, standard instrument calibration usually needs to be carried out in a specific laboratory environment, which cannot fully simulate the circuit load conditions and temperature environment during actual use, resulting in differences between the calibration results and actual use; secondly, the existing methods mostly rely on external precision instruments for measurement, the equipment is complex and the cost is high, and it is difficult to promote and use in ordinary industrial scenarios; in addition, since standard instrument calibration mostly uses fixed calibration points, the ability to correct nonlinear deviations is limited, especially under dynamic load conditions, which may cause the error of the output signal to be further amplified.

[0004] Therefore, in the output calibration of the 4–20mA interface circuit, the strong dependence of the calibration process on external precision instruments, the insufficient adaptability under actual load conditions, and the limited dynamic deviation correction capability have become problems that need to be solved urgently. Summary of the invention

[0005] To this end, the present application provides a 4-20mA current signal output circuit and an output calibration method to solve the problems in the prior art that the calibration process is highly dependent on external precision instruments, has insufficient adaptability under actual load conditions, and has limited dynamic deviation correction capabilities.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] In a first aspect, a 4-20mA current signal output circuit comprises: a controller, a current output control circuit, a sampling circuit, an amplifying circuit and an analog-to-digital conversion circuit;

[0008] The input end of the current output control circuit is connected to the controller, the output end of the current output control circuit is connected to the input end of the sampling circuit, the output end of the sampling circuit is connected to the input end of the amplifier circuit, the output end of the amplifier circuit is connected to the input end of the analog-to-digital conversion circuit, and the output end of the analog-to-digital conversion circuit is connected to the controller;

[0009] Wherein, the controller is used to output a control signal, and the control signal is used to instruct the current output control circuit to output a first current signal;

[0010] The current output control circuit is used to output a second current signal according to the control signal;

[0011] The sampling circuit is used to sample the second current signal and output a voltage signal corresponding to the second current signal;

[0012] The amplifier circuit is used to amplify the voltage signal to obtain an amplified voltage signal;

[0013] The analog-to-digital conversion circuit is used to perform analog-to-digital conversion on the amplified voltage signal and output the converted digital signal to the controller;

[0014] The controller adjusts a control parameter of the current output control circuit based on a deviation between the digital signal and the first current signal, so as to calibrate the second current signal output by the current output control circuit.

[0015] Optionally, the current output control circuit includes a sixth chip U6, and the sixth chip U6 includes a GP8212S-TC50-EW chip;

[0016] The 1st pin and the 2nd pin of the sixth chip U6 are respectively connected to the IIC pin of the controller; the 3rd pin of the sixth chip U6 is suspended, the 4th pin of the sixth chip U6 is divided into two paths, one path is connected to the +12V power supply output terminal, and the other path is grounded via the nineteenth capacitor C19; the 5th pin of the sixth chip U6 is grounded; the 6th pin and the 7th pin of the sixth chip U6 are respectively connected to the input terminal of the sampling circuit; the 8th pin of the sixth chip U6 is grounded via the twentieth capacitor C20; the 9th pin of the sixth chip U6 is grounded.

[0017] Optionally, the sampling circuit includes a second transistor Q2 and a thirty-fourth resistor R34;

[0018] The first end of the second transistor Q2 is connected to the seventh pin of the sixth chip U6, the second end of the second transistor Q2 is connected to the +12V power supply output terminal, and the third end of the second transistor Q2 is grounded via the forty-fifth resistor R45 and the twenty-fifth capacitor C25;

[0019] One end of the thirty-fourth resistor R34 is divided into two paths, one path is connected to the connection end of the forty-fifth resistor R45 and the twenty-fifth capacitor C25, and the other path is connected to the first input end of the amplifier circuit; the other end of the thirty-fourth resistor R34 is divided into three paths, one path is connected to the second input end of the amplifier circuit, another path is connected to one end of the sixth diode TVS6, and the third path is connected to the output end of the amplifier circuit via the forty-eighth resistor R48; the other end of the sixth diode TVS6 is grounded.

[0020] Optionally, the amplifier circuit includes a first amplifier circuit and a second amplifier circuit;

[0021] The input end of the first amplifier circuit is connected to the output end of the sampling circuit, the output end of the first amplifier circuit is connected to the input end of the second amplifier circuit, and the output end of the second amplifier circuit is connected to the input end of the analog-to-digital conversion circuit.

[0022] Optionally, the analog-to-digital conversion circuit includes a reference voltage output circuit and an analog-to-digital conversion module;

[0023] The output end of the reference voltage output circuit is connected to the first input end of the analog-to-digital conversion module, the second input end of the analog-to-digital conversion module is connected to the output end of the second amplifying circuit, and the output end of the analog-to-digital conversion module is connected to the controller;

[0024] Wherein, the reference voltage output circuit is used to provide a reference voltage for the module conversion module.

[0025] In a second aspect, a 4-20mA current signal output calibration method is provided, the method comprising:

[0026] The controller generates and outputs a control signal, wherein the control signal is used to instruct the current output control circuit to output a first current signal;

[0027] The current output control circuit outputs a second current signal according to the control signal;

[0028] The sampling circuit samples the second current signal to generate a voltage signal corresponding to the second current signal;

[0029] The amplifier circuit amplifies the voltage signal to obtain an amplified voltage signal;

[0030] The analog-to-digital conversion circuit performs analog-to-digital conversion on the amplified voltage signal to generate a digital signal, and sends the digital signal to the controller;

[0031] The controller adjusts a control parameter of the current output control circuit based on a deviation between the digital signal and the first current signal, so as to calibrate the second current signal output by the current output control circuit.

[0032] Optionally, the controller adjusts a control parameter of the current output control circuit based on a deviation between the digital signal and the first current signal, including:

[0033] The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal;

[0034] The controller calibrates the control parameters of the current output control circuit according to the calibration compensation parameters.

[0035] Optionally, the controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal, including:

[0036] The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal at at least two preset calibration points.

[0037] Optionally, the current values ​​of the at least two preset calibration points are 9 mA and 15 mA respectively.

[0038] Optionally, calibration compensation parameters of other current values ​​are determined based on the deviation of the at least two preset calibration points and a linear fitting method.

[0039] Compared with the prior art, this application has at least the following beneficial effects:

[0040] The 4-20mA current signal output circuit provided by the present invention can realize high-precision and high-stability current signal output through the coordinated work of the controller, the current output control circuit, the sampling circuit, the amplifying circuit and the analog-to-digital conversion circuit, and effectively solves the problems of insufficient calibration accuracy, strong dependence on external equipment and poor dynamic load adaptability in the background technology. The controller dynamically adjusts the control parameters of the current output control circuit through a closed-loop feedback mechanism, calculates the calibration compensation parameters based on the deviation between the digital signal fed back by the analog-to-digital conversion circuit and the target signal, and corrects the output signal in real time, so that the circuit can maintain the accuracy of the output signal under dynamic load conditions, and significantly reduces the nonlinear deviation. In addition, the sampling circuit and the amplifying circuit accurately sample and amplify the current signal, and the analog-to-digital conversion circuit performs high-resolution digital processing on the signal, so that the circuit adapts to changes in complex environments, such as temperature fluctuations and load changes, and ensures the stability and consistency of the output current. The calibration mechanism of the present invention does not need to rely on external precision instruments, can independently complete high-precision calibration, simplifies the calibration process, reduces costs and maintenance difficulties, and provides a reliable solution for high-precision signal output and transmission in industrial scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more intuitively illustrate the prior art and the present application, exemplary drawings are given below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing the present application; for example, those skilled in the art are capable of easily making conventional adjustments or further optimizations to the addition / reduction / attribution division, specific shapes, positional relationships, connection methods, dimensional ratios, etc. of certain units (components) based on the technical concepts and exemplary drawings disclosed in the present application.

[0042] Figure 1 A circuit principle block diagram of a 4-20mA current signal output circuit provided in an embodiment of the present application;

[0043] Figure 2 A circuit schematic diagram of a 4-20mA current signal output circuit provided in an embodiment of the present application;

[0044] Figure 3 A current output calibration compensation parameter value calculation curve for any point provided in the embodiment of the present application. DETAILED DESCRIPTION

[0045] The present application is further described below in detail through specific embodiments in conjunction with the accompanying drawings.

[0046] In the description of this application: unless otherwise specified, the meaning of "plurality" is two or more. The terms "first", "second", "third", etc. in this application are intended to distinguish the objects referred to, and do not have special meanings in terms of technical connotations (for example, they should not be understood as emphasizing the importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).

[0047] The terms such as "upper", "lower", "left", "right", "middle", etc. cited in this application are usually used to indicate the general relative position relationship for the purpose of intuitive understanding by referring to the drawings, and are not absolute limitations on the position relationship in the actual product.

[0048] 4-20mA current signal is a standard current signal widely used in industrial control and measurement. Its current range is 4mA to 20mA, where 4mA is usually used to represent the zero value detected by the sensor or instrument, and 20mA represents the full-scale value. The advantages of this signal include strong anti-noise ability, small signal attenuation during long-distance transmission, and the ability to be converted into a voltage signal through a simple resistor.

[0049] In the prior art, due to the error of electronic components, the output signal of the 4-20mA interface is usually biased. In order to make the 4-20mA output more accurate, the present invention provides a 4-20mA current signal output circuit and an output calibration method to solve the deviation problem of the existing 4-20mA current signal output.

[0050] In the prior art, a standard instrument is usually used to measure the output of the 4-20mA interface, and the deviation between the actual output and the measurement result of the standard instrument is found and the deviation is corrected. The existing method relies on the input circuit of the 4-20mA sampling device selected when the standard instrument is calibrated, which cannot fully represent the actual use situation. It may be very accurate during calibration, but the deviation in actual use is greater than the deviation during calibration.

[0051] The present application provides a 4-20mA current signal output circuit and an output calibration method, which are not dependent on the input circuit of a certain 4-20mA sampling device and have universal applicability.

[0052] like Figure 1 As shown, a 4-20mA current signal output circuit includes a controller, a current output control circuit, a sampling circuit, an amplifying circuit and an analog-to-digital conversion circuit.

[0053] The input end of the current output control circuit is connected to the controller, the output end of the current output control circuit is connected to the input end of the sampling circuit, the output end of the sampling circuit is connected to the input end of the amplifier circuit, the output end of the amplifier circuit is connected to the input end of the analog-to-digital conversion circuit, and the output end of the analog-to-digital conversion circuit is connected to the controller.

[0054] Among them, the controller is used to output a control signal, and the control signal is used to instruct the current output control circuit to output a first current signal; the current output control circuit is used to output a second current signal according to the control signal; the sampling circuit is used to sample the second current signal and output a voltage signal corresponding to the second current signal; the amplification circuit is used to amplify the voltage signal to obtain an amplified voltage signal; the analog-to-digital conversion circuit is used to perform analog-to-digital conversion on the amplified voltage signal and output the converted digital signal to the controller; the controller adjusts the control parameters of the current output control circuit based on the deviation between the digital signal and the first current signal to calibrate the second current signal output by the current output control circuit.

[0055] It should be noted that the controller uses I 2 The C communication interface is connected to the current output control circuit, and is used to send a control signal and receive a digital signal output by the analog-to-digital conversion circuit. The current output control circuit generates a second current signal according to the control signal. The output second current signal passes through the sampling circuit, and the current signal is converted into a voltage signal through a high-precision sampling resistor, and the voltage signal is sent to the amplifier circuit. The amplifier circuit is composed of a first amplifier circuit and a second amplifier circuit. The first amplifier circuit preliminarily amplifies the sampled voltage signal, and the second amplifier circuit further amplifies the signal to improve the signal amplitude and accuracy. Finally, the amplified voltage signal is transmitted to the analog-to-digital conversion circuit (ADC), and a digital signal is generated after analog-to-digital conversion, and the digital signal is fed back to the controller.

[0056] The first current signal generated by the controller is the target current value (such as any value in the range of 4mA to 20mA), and instructs the current output control circuit to output the second current signal. The second current signal is converted into a corresponding voltage signal through a sampling resistor in the sampling circuit (such as a 2Ω high-precision resistor). The amplifier circuit amplifies the sampled voltage signal and converts it into a digital signal for the controller to read through an analog-to-digital conversion circuit. The controller compares the read digital signal with the preset first current signal (target value) and calculates the deviation between the two. Based on the deviation, the controller dynamically adjusts the control parameters of the current output control circuit to correct the output of the second current signal.

[0057] In order to ensure the accurate output of the circuit under complex working conditions (such as dynamic load, temperature change, etc.), the present invention designs a closed-loop calibration mechanism. The calibration mechanism relies on real-time feedback from the controller, uses the deviation between the actual signal collected by the analog-to-digital conversion circuit and the target value, and dynamically adjusts the control signal of the current output control circuit by calculating the calibration compensation parameter. The calibration process can adaptively correct the error during operation, thereby ensuring high consistency between the output signal and the target value.

[0058] The present invention performs real-time sampling and amplification processing on the output current signal through a sampling circuit and an amplifier circuit, and combines the high-precision digitization of the signal by an analog-to-digital conversion circuit, so that the controller can accurately calibrate the output signal in real time. Compared with the limitation of the traditional calibration method relying on fixed calibration points, the dynamic calibration mechanism of the present invention can effectively reduce the nonlinear deviation under dynamic load conditions, thereby significantly improving the accuracy of the signal output. Traditional methods often need to be calibrated under laboratory conditions and cannot adapt to temperature fluctuations and load changes in the actual operating environment. The present invention can monitor and correct the signal output deviation in real time through a closed-loop feedback mechanism, reduce the signal misalignment problem caused by environmental changes, and make the circuit have higher environmental adaptability and stability in industrial scenarios. In addition, the traditional calibration method relies on high-precision standard instruments to measure the output signal, and requires manual or automatic adjustment of parameters. The present invention independently realizes signal acquisition, deviation calculation and calibration control through a built-in analog-to-digital conversion circuit and controller, significantly reduces the dependence on external equipment, simplifies the calibration process, and reduces the overall cost.

[0059] Under dynamic load conditions, the traditional calibration method cannot track the deviation of the output signal in real time due to the fixed calibration point, which leads to further amplification of the calibration error. The present invention can respond to load changes in real time through the dynamic adjustment mechanism of the controller, and quickly correct the signal output by adjusting the calibration compensation parameters, thereby significantly improving the dynamic response capability of the circuit.

[0060] The present invention realizes a fully automatic calibration process by introducing the real-time computing capability of the analog-to-digital conversion circuit and the controller, and can complete signal correction in operation without manual intervention. This not only improves the calibration efficiency, but also reduces the operational difficulty and time cost in the manual calibration process.

[0061] By dynamically adjusting the calibration compensation parameters, the present invention can adapt to current signals in different output ranges (such as 4-20mA) and different working environments, and ensure the linearity and stability of the signal output.

[0062] The 4-20mA current signal output circuit provided by the present invention can realize high-precision and high-stability current signal output through the coordinated work of the controller, the current output control circuit, the sampling circuit, the amplifying circuit and the analog-to-digital conversion circuit, and effectively solves the problems of insufficient calibration accuracy, strong dependence on external equipment and poor dynamic load adaptability in the background technology. The controller dynamically adjusts the control parameters of the current output control circuit through a closed-loop feedback mechanism, calculates the calibration compensation parameters based on the deviation between the digital signal fed back by the analog-to-digital conversion circuit and the target signal, and corrects the output signal in real time, so that the circuit can maintain the accuracy of the output signal under dynamic load conditions, and significantly reduces the nonlinear deviation. In addition, the sampling circuit and the amplifying circuit accurately sample and amplify the current signal, and the analog-to-digital conversion circuit performs high-resolution digital processing on the signal, so that the circuit adapts to changes in complex environments, such as temperature fluctuations and load changes, and ensures the stability and consistency of the output current. The calibration mechanism of the present invention does not need to rely on external precision instruments, can independently complete high-precision calibration, simplifies the calibration process, reduces costs and maintenance difficulties, and provides a reliable solution for high-precision signal output and transmission in industrial scenarios.

[0063] like Figure 2 As shown, in a possible implementation manner, the current output control circuit includes a sixth chip U6, and the sixth chip U6 includes a GP8212S-TC50-EW chip;

[0064] The 1st pin and the 2nd pin of the sixth chip U6 are respectively connected to the IIC pin of the controller; the 3rd pin of the sixth chip U6 is suspended, the 4th pin of the sixth chip U6 is divided into two paths, one path is connected to the +12V power supply output terminal, and the other path is grounded via the nineteenth capacitor C19; the 5th pin of the sixth chip U6 is grounded; the 6th pin and the 7th pin of the sixth chip U6 are respectively connected to the input terminal of the sampling circuit; the 8th pin of the sixth chip U6 is grounded via the twentieth capacitor C20; the 9th pin of the sixth chip U6 is grounded.

[0065] It should be noted that the current output control circuit is implemented by the sixth chip U6 (GP8212S-TC50-EW chip), which is implemented by I 2The C interface is connected to the controller, wherein the 1st and 2nd pins are respectively connected to the IIC interface pins of the controller for receiving control signals; the 4th pin is connected to the +12V power supply and grounded through the 19th capacitor C19 to provide a stable working power supply for the chip; the 6th and 7th pins are respectively connected to the input end of the sampling circuit for outputting accurate current signals; the 8th pin is grounded through the 20th capacitor C20 to enhance the anti-interference ability of the chip; the 3rd pin is suspended, and the 5th and 9th pins are grounded to provide a reasonable electrical connection structure for the chip to ensure stable operation of the chip. Through this design, the sixth chip U6 can output a stable 4-20mA current signal according to the instructions of the controller, and has a high dynamic response capability.

[0066] In this embodiment, by using the sixth chip U6 as the current output control unit, the present invention can accurately respond to the I2C command of the controller and output a stable 4-20mA current signal, solving the problems of slow response speed and poor stability in traditional current output control units. 2 The C interface directly communicates with the controller, which simplifies the signal transmission path and improves the real-time execution of instructions. At the same time, the capacitor grounding design of pin 4 can effectively filter out power supply noise and enhance the anti-interference performance of the system. The grounding capacitor design of pin 8 further improves the stability of chip operation and the accuracy of signal output, thereby meeting the needs of high-precision current signal output in industrial scenarios.

[0067] like Figure 2 As shown, in a possible implementation manner, the sampling circuit includes a second transistor Q2 and a thirty-fourth resistor R34;

[0068] The first end of the second transistor Q2 is connected to the seventh pin of the sixth chip U6, the second end of the second transistor Q2 is connected to the +12V power supply output terminal, and the third end of the second transistor Q2 is grounded via the forty-fifth resistor R45 and the twenty-fifth capacitor C25;

[0069] One end of the thirty-fourth resistor R34 is divided into two paths, one path is connected to the connection end of the forty-fifth resistor R45 and the twenty-fifth capacitor C25, and the other path is connected to the first input end of the amplifier circuit; the other end of the thirty-fourth resistor R34 is divided into three paths, one path is connected to the second input end of the amplifier circuit, another path is connected to one end of the sixth diode TVS6, and the third path is connected to the output end of the amplifier circuit via the forty-eighth resistor R48; the other end of the sixth diode TVS6 is grounded.

[0070] It should be noted that the structure of the sampling circuit includes a second transistor Q2 and a thirty-fourth resistor R34, which are used to convert the current signal into a voltage signal and provide a high-precision, low-noise signal output for subsequent amplification and processing. Among them, the second transistor Q2 is a core component for current signal transmission, and its first end is connected to the seventh pin of the sixth chip U6 to receive the current signal output by the sixth chip; the second end is directly connected to the +12V power supply output end to provide a stable current flow path; the third end is grounded through the forty-fifth resistor R45 and the twenty-fifth capacitor C25 to form a stable voltage divider network, and at the same time, the high-frequency interference signal is filtered through the capacitor to ensure the purity and stability of the sampling signal.

[0071] The thirty-fourth resistor R34 is a key component in the sampling circuit, and its resistance is used to accurately convert the current signal into a voltage signal. One end of R34 is divided into two paths, one of which is connected to the connection end of the forty-fifth resistor R45 and the twenty-fifth capacitor C25 to provide a stable ground signal; the other is directly connected to the first input end of the amplifier circuit to transfer the sampled voltage signal to the subsequent amplifier. The other end of R34 is divided into three paths, one of which is connected to the second input end of the amplifier circuit to form a differential input structure; the other is connected to the ground through the sixth diode TVS6 to protect the circuit from sudden high voltage shocks; the third is connected to the output end of the amplifier circuit through the forty-eighth resistor R48 to form a feedback loop to enhance the stability of the circuit.

[0072] Through such a design, the sampling circuit can maintain a high linearity and low noise voltage output signal in a complex electromagnetic environment. At the same time, through the protection and filtering design of diodes and capacitors, the system's anti-interference ability and operation stability are improved.

[0073] The sampling circuit in the present invention can effectively achieve high-precision sampling of 4-20mA current signals through the cooperation of the second transistor Q2 and the thirty-fourth resistor R34, and convert it into a stable voltage signal output to meet the needs of subsequent amplification and analog-to-digital conversion. The grounding circuit of the second transistor Q2 combined with the voltage division and filtering functions of the resistor R45 and the capacitor C25 significantly reduces the high-frequency interference in the sampling signal, and at the same time provides a stable signal transmission path, so that the sampling signal can still maintain high quality in a complex industrial electromagnetic environment.

[0074] like Figure 2 As shown, in a possible implementation manner, the amplifier circuit includes a first amplifier circuit and a second amplifier circuit;

[0075] The input end of the first amplifier circuit is connected to the output end of the sampling circuit, the output end of the first amplifier circuit is connected to the input end of the second amplifier circuit, and the output end of the second amplifier circuit is connected to the input end of the analog-to-digital conversion circuit.

[0076] The first amplifier circuit includes a seventh chip U7, and the second amplifier circuit includes a ninth chip U9.

[0077] It should be noted that the amplifier circuit includes a first amplifier circuit and a second amplifier circuit, which are designed as a two-stage amplifier structure to achieve step-by-step amplification of the sampled voltage signal, thereby meeting the requirements of the subsequent analog-to-digital conversion circuit for signal amplitude and quality. The input end of the first amplifier circuit is connected to the output end of the sampling circuit, and is used to receive the low voltage signal generated by the sampling circuit (such as a voltage signal converted from a 4-20mA current signal through a sampling resistor). The first amplifier circuit uses a high-gain low-noise operational amplifier, and its main function is to preliminarily amplify the input weak voltage signal, increase the amplitude of the signal to a range suitable for further processing, and reduce the influence of external noise on the signal. The output end of the first amplifier circuit is connected to the input end of the second amplifier circuit, and the second amplifier circuit further amplifies the signal after primary processing. The second amplifier circuit optimizes the gain setting and filtering design to ensure that the signal has a higher amplitude and signal-to-noise ratio after two-stage amplification, thereby adapting to the input requirements of the analog-to-digital conversion circuit. Finally, the output end of the second amplifier circuit is connected to the input end of the analog-to-digital conversion circuit to transmit the amplified signal to the analog-to-digital conversion circuit.

[0078] In this embodiment, the first amplifier circuit and the second amplifier circuit respectively use amplifier modules with adjustable gain, and the user can flexibly set the gain value according to the actual application scenario to meet the amplification requirements of signals with different amplitudes. In addition, the second amplifier circuit integrates an active filtering function, which can further eliminate high-frequency noise and low-frequency interference in the signal, ensuring the quality and stability of the output signal.

[0079] like Figure 2 As shown, in a possible implementation manner, the analog-to-digital conversion circuit includes a reference voltage output circuit and an analog-to-digital conversion module;

[0080] The output end of the reference voltage output circuit is connected to the first input end of the analog-to-digital conversion module, the second input end of the analog-to-digital conversion module is connected to the output end of the second amplifying circuit, and the output end of the analog-to-digital conversion module is connected to the controller;

[0081] Wherein, the reference voltage output circuit is used to provide a reference voltage for the module conversion module.

[0082] It should be noted that the analog-to-digital conversion circuit includes a reference voltage output circuit and an analog-to-digital conversion module, which work together to achieve high-precision analog-to-digital conversion of the sampled voltage signal. The output end of the reference voltage output circuit is connected to the first input end of the analog-to-digital conversion module to provide a stable reference voltage signal, while the second input end of the analog-to-digital conversion module is connected to the output end of the second amplifier circuit to receive the sampled voltage signal after two-stage amplification. The analog-to-digital conversion module converts the analog signal into a high-resolution digital signal proportional to its amplitude by comparing the amplified analog voltage signal with the reference voltage signal, and outputs the digital signal to the controller.

[0083] The reference voltage output circuit is the core supporting unit of the analog-to-digital conversion module. Its design uses a high-precision reference voltage source chip to output a stable reference voltage (such as 2.5V or other adaptation values) to ensure that the analog-to-digital conversion module has a consistent reference benchmark throughout the entire working process. This design can not only eliminate the impact of ambient temperature fluctuations on the reference voltage, but also avoid the interference of power supply voltage fluctuations on the accuracy of analog-to-digital conversion. The reference voltage output circuit further optimizes the purity of the output signal through appropriate filtering circuits (such as capacitor filtering and voltage stabilization circuits), reduces voltage ripple and noise, and ensures the stability of the reference voltage.

[0084] The design of the analog-to-digital conversion module uses a high-resolution (such as 12-bit or 16-bit) ADC (Analog-to-Digital Converter) chip to accurately convert the input analog signal into a digital signal. The analog-to-digital conversion module compares the stable reference voltage provided by the reference voltage output circuit with the input voltage signal provided by the second amplifier circuit to determine the amplitude of the input signal and generate an accurate digital signal. The output end of the analog-to-digital conversion module is connected to the controller through I 2 C, SPI or other digital communication interfaces transmit digital signals to the controller.

[0085] In order to adapt to different signal amplitude ranges and application scenarios, the analog-to-digital conversion module of this embodiment supports a programmable gain function. Users can select the appropriate gain value according to the input signal amplitude to maximize the dynamic range and conversion accuracy of the signal. In addition, the analog-to-digital conversion module integrates an anti-interference design. Through differential input and built-in filters, it can effectively resist common-mode interference and high-frequency noise, thereby improving the accuracy of analog-to-digital conversion.

[0086] The entire analog-to-digital conversion circuit further improves accuracy through a combination of software and hardware. In terms of hardware, the linearity and consistency of signal conversion are ensured through high-precision reference voltage sources, filter circuits, and high-resolution analog-to-digital conversion modules; in terms of software, the accuracy and stability of the signal are further optimized through the calibration and compensation of the digital signal by the controller.

[0087] like Figure 2 At any time, in the above embodiment, U6 is an integrated circuit type 4-20mA output control chip, and its external components are very few, and AO2 is a 4-20mA output terminal. R34 is used as an output sampling resistor on the output terminal, and its resistance is set to R. By measuring the voltage UR34 across R34, the output current I on the AO2 terminal can be calculated, as shown in Formula 1.

[0088]

[0089] UR34 is amplified by U9 and connected to ADC chip U10 for measurement.

[0090] The communication interface of U6 and U10 is IIC interface, which is connected to MCU. MCU runs the program to control the 4-20mA output of U6 and controls U10 to measure the actual output result of 4-20mA.

[0091] The present application also provides a 4-20mA current signal output calibration method, the method comprising:

[0092] The controller generates and outputs a control signal, wherein the control signal is used to instruct the current output control circuit to output a first current signal;

[0093] The current output control circuit outputs a second current signal according to the control signal;

[0094] The sampling circuit samples the second current signal to generate a voltage signal corresponding to the second current signal;

[0095] The amplifier circuit amplifies the voltage signal to obtain an amplified voltage signal;

[0096] The analog-to-digital conversion circuit performs analog-to-digital conversion on the amplified voltage signal to generate a digital signal, and sends the digital signal to the controller;

[0097] The controller adjusts a control parameter of the current output control circuit based on a deviation between the digital signal and the first current signal, so as to calibrate the second current signal output by the current output control circuit.

[0098] In a possible implementation manner, the controller adjusts the control parameters of the current output control circuit based on the deviation between the digital signal and the first current signal, including:

[0099] The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal;

[0100] The controller calibrates the control parameters of the current output control circuit according to the calibration compensation parameters.

[0101] In a possible implementation manner, the controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal, including:

[0102] The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal at at least two preset calibration points.

[0103] In a possible implementation manner, the current values ​​of the at least two preset calibration points are 9 mA and 15 mA, respectively.

[0104] In a possible implementation, the method further includes:

[0105] Based on the deviation of the at least two preset calibration points and a linear fitting method, calibration compensation parameters of other current values ​​are determined.

[0106] In the above embodiment, it should be noted that two representative points 9mA and 15mA are selected within the full range of 4-20mA, and the output and feedback of these two points are calibrated to find the correction value. For other points within the full range of 4-20mA, the calibration compensation value parameters of the output and feedback are calculated using the approximate straight line fitting method, and then the correction value is calculated.

[0107] Calibrate the first calibration point to 9mA.

[0108] Connect the high-precision ammeter to the 4-20mA output terminal and measure the output current. Set the calibration compensation value parameter of the first calibration point to the default value of 10000. Set the first calibration point of the 4-20mA output to 9000uA and set it as Is. Wait for the high-precision ammeter display value to stabilize. Read the high-precision ammeter display value I. Compare I with Is to obtain the deviation Id. Then calculate the calibration compensation parameter value Cip. Calculate the current value Ic after calibration compensation based on Cip and output it. After calibration, the high-precision ammeter display value should be an accurate 9000uA.

[0109] Calibrate the second calibration point to 15mA.

[0110] Connect the high-precision ammeter to the 4-20mA output terminal and measure the output current. Set the calibration compensation value of the second calibration point to the default value of 10000. Set the 4-20mA output second calibration point to 15000uA and set it to Is. Wait for the high-precision ammeter display value to stabilize. Read the high-precision ammeter display value I. Compare I with Is to obtain the deviation Id. Then calculate the calibration compensation parameter value Cip. Calculate the current value Ic after calibration compensation based on Cip and output it. After calibration, the high-precision ammeter display value should be an accurate 15000uA.

[0111] The calculation formulas are shown in Formula 2, Formula 3, and Formula 4.

[0112] Id=Is-I Formula 2;

[0113] Cip=Id+10000 formula 3;

[0114] Ic=I+(Cip-10000) Formula 4;

[0115] Among them, the unit of I, Is, Id, Cip and Ic is uA.

[0116] Calibrate the feedback value corresponding to the first calibration point 9mA.

[0117] Make the 4-20mA output the first calibration point 9000uA, and calibrate the output according to the method described in 2.1, and keep the output state. Set the parameter of the calibration compensation value of the feedback first calibration point to the default value 10000. Read the feedback value Ib. Read the high-precision ammeter display value Ibs. Compare Ib with Ibs to get the deviation Ibd. Then calculate the calibration compensation parameter value Cibp. According to Cibp, the current value Ibc after calibration compensation is calculated. After calibration, the feedback value should be the same as the high-precision ammeter display value, which is an accurate 9000uA.

[0118] Calibrate the feedback value corresponding to the second calibration point 15mA.

[0119] Set the 4-20mA output to the second calibration point of 15000uA, and calibrate the output according to the method described in 2.1, and keep the output state. Set the parameter of the calibration compensation value of the feedback point 2 to the default value of 10000. Read the feedback value Ib. Read the high-precision ammeter display value Ibs. Compare Ib with Ibs to obtain the deviation Ibd. Then calculate the calibration compensation parameter value Cibp. According to Cibp, the current value Ibc after calibration compensation is calculated. After calibration, the feedback value should be the same as the high-precision ammeter display value, which is an accurate 15000uA.

[0120] The calculation formulas are shown in Formula 5, Formula 6, and Formula 7.

[0121] Ibd=Ibs-Ib Formula 5;

[0122] Cibp=Ibd+10000 Formula 6;

[0123] Ibc=Ib+(Cibp-10000) Formula 7;

[0124] Note: The unit of Ib, Ibs, Ibd, Cibp and Ibc is uA.

[0125] Feedback regulates output;

[0126] When the current at any point in the 4-20mA range is output, the calibration compensation parameter value Cip at any point is calculated using the approximate straight line fitting method. First, the calibration compensation parameter values ​​Cip9 and Cip15 at the 9mA and 15mA points are calculated. Next, a straight line is drawn with the current as the horizontal axis and the calibration compensation value as the vertical axis, such as Figure 3 shown.

[0127] The coordinates of the two points are (9, Cip9) and (15, Cip15). Calculate the equation of the line from the two points.

[0128] Assume that the equation of the straight line is y=kx+b, wherein the calculation formula of k is as shown in Formula 8, and the calculation formula of b is as shown in Formula 9.

[0129]

[0130] b=Cip9-9k Formula 9;

[0131] Substituting into the linear equation, the calibration compensation parameter value Cip for any point in the 4-20mA range can be calculated. Then, the current value after calibration compensation can be calculated using formula 4.

[0132] For any feedback value within the range of 4-20mA, the calibration compensation parameter value Cibp can be calculated using the above method, and then the current feedback value after calibration compensation can be calculated using formula 7.

[0133] According to the deviation between the feedback value of the current and the expected output value, the actual output result is adjusted.

[0134] The above-mentioned technical features can be combined arbitrarily (as long as there is no contradiction in the combination of these technical features). In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described; these embodiments that are not explicitly written should also be considered to be within the scope of this specification.

Claims

1. A 4-20mA current signal output circuit, characterized in that: The circuit comprises: a controller, a current output control circuit, a sampling circuit, an amplifying circuit and an analog-to-digital conversion circuit; The input end of the current output control circuit is connected to the controller, the output end of the current output control circuit is connected to the input end of the sampling circuit, the output end of the sampling circuit is connected to the input end of the amplifier circuit, the output end of the amplifier circuit is connected to the input end of the analog-to-digital conversion circuit, and the output end of the analog-to-digital conversion circuit is connected to the controller; Wherein, the controller is used to output a control signal, and the control signal is used to instruct the current output control circuit to output a first current signal; The current output control circuit is used to output a second current signal according to the control signal; The sampling circuit is used to sample the second current signal and output a voltage signal corresponding to the second current signal; The amplifier circuit is used to amplify the voltage signal to obtain an amplified voltage signal; The analog-to-digital conversion circuit is used to perform analog-to-digital conversion on the amplified voltage signal and output the converted digital signal to the controller; The controller adjusts a control parameter of the current output control circuit based on a deviation between the digital signal and the first current signal, so as to calibrate the second current signal output by the current output control circuit.

2. The circuit according to claim 1, characterized in that The current output control circuit includes a sixth chip U6, and the sixth chip U6 includes a GP8212S-TC50-EW chip; The 1st pin and the 2nd pin of the sixth chip U6 are respectively connected to the IIC pin of the controller; the 3rd pin of the sixth chip U6 is suspended, the 4th pin of the sixth chip U6 is divided into two paths, one path is connected to the +12V power supply output terminal, and the other path is grounded via the nineteenth capacitor C19; the 5th pin of the sixth chip U6 is grounded; the 6th pin and the 7th pin of the sixth chip U6 are respectively connected to the input terminal of the sampling circuit; the 8th pin of the sixth chip U6 is grounded via the twentieth capacitor C20; the 9th pin of the sixth chip U6 is grounded.

3. The circuit according to claim 2, characterized in that The sampling circuit includes a second transistor Q2 and a thirty-fourth resistor R34; The first end of the second transistor Q2 is connected to the seventh pin of the sixth chip U6, the second end of the second transistor Q2 is connected to the +12V power supply output terminal, and the third end of the second transistor Q2 is grounded via the forty-fifth resistor R45 and the twenty-fifth capacitor C25; One end of the thirty-fourth resistor R34 is divided into two paths, one path is connected to the connection end of the forty-fifth resistor R45 and the twenty-fifth capacitor C25, and the other path is connected to the first input end of the amplifier circuit; the other end of the thirty-fourth resistor R34 is divided into three paths, one path is connected to the second input end of the amplifier circuit, another path is connected to one end of the sixth diode TVS6, and the third path is connected to the output end of the amplifier circuit via the forty-eighth resistor R48; the other end of the sixth diode TVS6 is grounded.

4. The circuit according to claim 1, characterized in that The amplifier circuit includes a first amplifier circuit and a second amplifier circuit; The input end of the first amplifier circuit is connected to the output end of the sampling circuit, the output end of the first amplifier circuit is connected to the input end of the second amplifier circuit, and the output end of the second amplifier circuit is connected to the input end of the analog-to-digital conversion circuit.

5. The circuit according to claim 2, characterized in that The analog-to-digital conversion circuit includes a reference voltage output circuit and an analog-to-digital conversion module; The output end of the reference voltage output circuit is connected to the first input end of the analog-to-digital conversion module, the second input end of the analog-to-digital conversion module is connected to the output end of the second amplification circuit, and the output end of the analog-to-digital conversion module is connected to the controller; Wherein, the reference voltage output circuit is used to provide a reference voltage for the module conversion module.

6. A 4-20mA current signal output calibration method, using the 4-20mA current signal output circuit according to any one of claims 1 to 5, characterized in that: The method comprises: The controller generates and outputs a control signal, wherein the control signal is used to instruct the current output control circuit to output a first current signal; The current output control circuit outputs a second current signal according to the control signal; The sampling circuit samples the second current signal to generate a voltage signal corresponding to the second current signal; The amplifier circuit amplifies the voltage signal to obtain an amplified voltage signal; The analog-to-digital conversion circuit performs analog-to-digital conversion on the amplified voltage signal to generate a digital signal, and sends the digital signal to the controller; The controller adjusts a control parameter of the current output control circuit based on a deviation between the digital signal and the first current signal, so as to calibrate the second current signal output by the current output control circuit.

7. The method according to claim 6, characterized in that The controller adjusts the control parameters of the current output control circuit based on the deviation between the digital signal and the first current signal, including: The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal; The controller calibrates the control parameters of the current output control circuit according to the calibration compensation parameters.

8. The method according to claim 7, characterized in that The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal, including: The controller calculates a calibration compensation parameter based on a deviation between the digital signal and the first current signal at at least two preset calibration points.

9. The method according to claim 8, characterized in that The current values ​​of the at least two preset calibration points are 9 mA and 15 mA respectively.

10. The method according to claim 8, characterized in that The method further comprises: Based on the deviation of the at least two preset calibration points and a linear fitting method, calibration compensation parameters of other current values ​​are determined.