Alternating current and direct current universal transmitting circuit and transmitting output method
By designing a general AC-DC transmission circuit and a transmission output method, general measurement and transmission output of AC-DC signals are realized, complex operation and accuracy reduction in the existing technology are solved, and high-precision and convenient AC-DC signal measurement and transmission output are realized.
Patent Information
- Application Number
- CN202510061382.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-15
AI Technical Summary
When existing voltage and current transmitters realize the general measurement and transmission output of AC and DC signals, there are problems of separate calibration, multiple calibrations and complex operations. After the signal measurement range is expanded, the measurement accuracy is seriously reduced, and true universality is not achieved.
A universal AC and DC transmission circuit is designed. Through hardware circuit design and software output method design, the input and output ends are controlled to realize the "one way in, one way out" universal AC and DC measurement and transmission output scheme of all input and output types, and through software offset compensation, the error caused by linear defects of the PWM output module itself is eliminated.
It realizes general measurement and transmission output of AC and DC signals, solves problems such as sampling and calibration of different signals, wiring classification, output classification, etc., ensures that the overall accuracy reaches one thousandth, and improves user convenience and measurement accuracy.
Smart Images

Figure CN119881430A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric quantity measurement, and in particular to an AC / DC universal transmission circuit and a transmission output method. Background Art
[0002] Due to different needs in different occasions, the voltage and current transmitters (sensors) on the current market vary in size and range, and have a wide variety of specifications, just from the input range. According to the input type, there are those that measure AC signals, DC signals, voltage, current, large signals, and small signals; according to the output range, there are 0-20mA, 4-20mA, 0-5V, 1-5V, 0-10V, 2-10V, etc. There are many types.
[0003] Transmitters with single or incomplete functions have limited application occasions, and users need to know the usage scenarios clearly when purchasing. Of course, there are also universal sensors that integrate and improve the above functions. However, the existing universal transmitters simply integrate all types into one product, and still cannot avoid complex operations such as separate calibration, multiple calibrations, and artificially changing the usage type by changing the wiring and terminal blocks. In addition, once the signal measurement range is expanded, there will be serious problems with measurement accuracy, and true universality has not been fully achieved. Summary of the invention
[0004] Aiming at the limitations, diversity and complexity of voltage and current transmitters on the market, the present invention designs a new universal measurement scheme and universal transmission output scheme for AC and DC signals. Through hardware circuit design and software output method design, the input and output are controlled, and all input and output types are truly realized. Regardless of the size of the signal, a universal AC and DC measurement and transmission output scheme of "one way in, one way out" is achieved. Through software offset compensation, the error caused by the linear defects of the PWM (pulse width modulation) output module itself is eliminated, ensuring that the overall accuracy can reach one thousandth, solving the problems of different signal sampling and calibration, wiring classification, output classification, etc.
[0005] To achieve the above-mentioned purpose, the present invention designs an AC / DC universal transmission circuit, the transmission circuit includes a control unit, a current signal acquisition unit, a voltage signal sampling unit, a current output switching unit, and a voltage output switching unit, the output end of the current signal acquisition unit is respectively connected to the sampling input port of the control unit, the output end of the voltage signal sampling unit is respectively connected to the sampling input port of the control unit, the current control end of the current output switching unit and the voltage control end of the voltage output switching unit are respectively connected to the output port of the control unit; the current signal acquisition unit and the voltage signal sampling unit share an external input terminal, and the current output and voltage output of the transmission circuit share an external output terminal; The current signal acquisition unit includes a first interference suppression circuit, and an isolated direct current to alternating current circuit and an isolated alternating current to direct current circuit connected in parallel therewith, wherein the isolated direct current to alternating current circuit includes a second resistor, a sixth capacitor, a twelfth capacitor and a sixth resistor, which are sequentially connected in series and have a time constant of less than 0.1 ms, and the two capacitors are grounded in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; the isolated alternating current to direct current circuit includes an eighth resistor, a twenty-first capacitor, a twenty-third capacitor and a thirteenth resistor, which are sequentially connected in series and have a time constant of greater than 100 ms, and the two capacitors are grounded in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; The voltage signal sampling unit comprises a second interference suppression circuit, a signal amplifying circuit (U1), an AC signal pickup circuit and a DC signal pickup circuit (similar to the isolated DC-to-AC circuit and the isolated AC-to-DC circuit of the current signal acquisition unit, and different names are used here to show the difference in function), the output of the second interference suppression circuit is respectively connected to the input (VINP, VINN) of the signal amplifying circuit, and the output (VOUTP, VOUTN) of the signal amplifying circuit is respectively connected to the input of the AC signal pickup circuit and the DC signal pickup circuit after being divided by at least two resistors in series; the AC signal pickup circuit comprises a 1st resistor, a 29th capacitor, an 18th capacitor and a 28th resistor which are sequentially connected in series and have a time constant of less than 0.1ms, and the two capacitors are connected to the ground in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; the DC signal pickup circuit comprises a 5th resistor, a 3rd capacitor, an 11th capacitor and a 15th resistor which are sequentially connected in series and have a time constant of greater than 100ms, and the two capacitors are connected to the ground in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; The circuit forms of the current output switching unit and the voltage output switching unit are consistent. The current control end of the control unit is connected to the 6th photoelectric coupling amplifier after current limiting by the 22nd resistor, and the voltage control end is connected to the 4th photoelectric coupling amplifier after current limiting by the 69th resistor.
[0006] Furthermore, the first interference suppression circuit at least includes a second transient voltage suppression diode (TVS tube), a second electrostatic discharge diode (ESD tube, dual small signal switch diode) and a plurality of bypass resistors (playing a shunt role) connected in parallel.
[0007] Furthermore, the input end (IN-UA, IN-UN) of the second interference suppression circuit is connected in parallel with the 24th transient voltage suppression diode, the 3rd electrostatic discharge diode (dual small signal switching diode) and the filtering circuit after passing through a plurality of series-connected current limiting resistors (R10, R11, R12, R13, R39, R45, R46, R47), and the output of the filtering circuit is the output of the second interference suppression circuit.
[0008] Furthermore, the transmission circuit also includes a PWM output unit, which is respectively connected to the current output switching unit, the voltage output switching unit and the output signal terminal, and the PWM output unit includes a PWM current module, a PWM voltage module and a PWM common output module.
[0009] Furthermore, the PWM current module includes a two-stage operational amplifier (IC2A, IC3B) series amplifier circuit and a two-stage triode (Q1, Q2) series amplifier circuit connected to the output of the final operational amplifier, and the two-stage operational amplifier is connected in series via a field effect tube (Q6, MOS tube); the PWM voltage module includes a first-stage operational amplifier (IC3A) circuit.
[0010] Furthermore, the PWM common output module includes a unidirectional conduction 16th diode (D16), the power signal output (S2) of the current output switching unit is connected to the positive electrode of the 16th diode, the power signal output (S5) of the voltage output switching unit is connected to the negative electrode of the 16th diode, the negative electrode of the 16th diode is connected to one end of the interconnection of the 4th inductor (L4) and the 63rd capacitor (C63), the other end of the 4th inductor (L4) is connected to the 62nd capacitor (C62) and then continues to be connected in series with the 5th inductor (L5), and then connected to the other end of the 63rd capacitor (C63) and grounded, forming a dual-capacitor inductor filter network; the 62nd capacitor (C62) is connected in parallel with the 3rd transient voltage suppression diode (D3), The connection point of the 62nd capacitor (C62) and the 4th inductor (L4) is simultaneously connected to the interconnection pin (pin 3) of the 17th electrostatic discharge diode (D17), and the independent pins (pins 1 and 2) of the 17th electrostatic discharge diode (D17) are respectively connected to the negative power supply and the positive power supply.
[0011] On the other hand, an AC / DC universal transmission and output method is provided, for a transmission device or system constructed by any one of the above-mentioned AC / DC universal transmission circuits and its preferred solutions, the transmission and output method includes an input signal sampling and calibration method, and the input signal sampling and calibration method includes the following steps: A1. Reset state function check, including read and write, working mode switching and chip reset, etc. If the check result is normal, the main state is set to reset state and the reset check is ended, otherwise the reset check is ended and waiting for processing. The read and write functions include whether the chip ID is read successfully and whether the write enable is successful, etc. A2. Parameter setting check, including whether the channel setting parameters are successful, verification and calculation. After the check is completed normally, the main state is set to the normal operation state and the check is ended. Otherwise, it is set to the reset state and the parameter setting check is ended. A3. Normal operation check, including judging whether the checksum is successful. If successful, obtain the sampling value, calculate the input signal value, and run in a loop. If the checksum is unsuccessful, add 1 to the unsuccessful count. If the unsuccessful count is greater than 3, the main state is set to the reset state and the operation is terminated. If the unsuccessful count is less than or equal to 3, the operation is terminated directly or continued. A4. Perform basic circuit input calibration: A41, input zero signal, record the sampled conversion signal as b; A42, input the first signal x a , record the sampled conversion signal as Y a ; A43, input second signal x b , record the sampled conversion signal as Y b ; where x b >x a ; Establish the theoretical linear relationship between input value x and sample conversion value Y: Y=kx+b (Formula 1) Where k=(Y b -Y a ) / ( x b -x a ); A44, calibration completed; The system can calculate the theoretical output value based on the above input-output theoretical linear relationship and the actual input signal value, thereby realizing the universal transmission of AC and DC signals.
[0012] There is no order of precedence for the above steps A41, A42, and A43.
[0013] Furthermore, the input signal sampling calibration method further includes: A5. The main state is set to reset state and the program ends.
[0014] Furthermore, considering the nonlinearity of PWM, the transmission output method also includes a compensation calibration method and an output signal compensation method. The compensation calibration method includes setting the minimum output value y1 and the maximum output value y2 within the output range. n At least one more compensation point output signal value y should be calibrated i , the corresponding control unit outputs are marked as z1, z n and z i , a corresponding monotonic conversion relationship is established between the two, i=1,2,…n, n is the number of output signal calibration points; The control unit successively inputs calibration points z to the PWM i , with the corresponding measured output value y i And the theoretical output value yi0 , then the calibration point compensation is recorded as Δy i =y i -y i0 According to the monotonic conversion relationship between PWM input and output, the corresponding Δz can be obtained i ; The output signal compensation method comprises: For any output demand y, the calculation method of the compensation amount Δy includes the linear interpolation method of the compensation amounts of adjacent calibration points or the comprehensive interpolation method of the compensation amounts of all calibration points; then the actual output value of the control unit z=z0-Δz, where z0 is the theoretical output value of the control unit corresponding to the PWM output y, that is, the corresponding compensation amount is pre-deducted when the control unit actually outputs, so that the final output can still basically maintain the original linear relationship after PWM power amplification; The linear interpolation method of adjacent calibration point compensation includes finding the minimum calibration value y greater than y i+1 and less than the maximum calibration value y of y i , then the compensation amount Δy=(y-y i ) ( Δy i+1 - Δy i ) / ( y i+1 -y i )+ Δy i ; Obtain Δz based on the monotonic transformation relationship between y and z; The comprehensive interpolation method for compensation amounts of all calibration points includes a polynomial difference method, a Newton interpolation method, a Lagrange interpolation method, and the like.
[0015] Furthermore, the transmission output method also includes a PWM calibration and output process, and the PWM calibration and output process includes: B1. Determine whether there is a calibration mark. If not, it means no calibration is required and go to step B2. If yes, go to the PWM calibration procedure, including: B11, boundary value calibration, the control unit outputs the minimum value z1 and the maximum value z n , adjust PWM so that the output corresponds to y1 and y n , here the maximum and minimum value calibration has no order; B12, set compensation point z i or i , get the corresponding compensation value Δy i , i=2, 3, …, n-1; B13, store calibration parameters, and the calibration is completed; B2. Obtain input signal type and input signal value, i.e., voltage or current sampling; B3, enter the PWM output program; B31. Determine the output type according to the input signal type, and calculate the theoretical output value according to the input signal value; B32, obtain calibration compensation parameters to calculate compensation amount; B33, calculating the control unit output value according to the theoretical output value and the corresponding compensation amount; B34. Control the on and off of the logic circuit according to the output type and execute the transmission output.
[0016] The advantages and beneficial effects of the present invention are: 1. Low cost and high cost performance. Costs are controlled in many aspects. Only one interface is needed for input and output, saving incoming and outgoing lines and wiring terminals. Sampling is Hall direct sampling, and no transformer is required. Many functions are integrated, and the overall layout area is greatly reduced. Calibration is convenient and done in one step, without repeatedly disconnecting the line, which improves production efficiency and indirectly reduces costs.
[0017] 2. Convenient for users. Since the present invention is generally applicable to the measurement of AC, DC, voltage, current, large signal, and small signal, and supports various types of output, users do not need to know too much about the parameters of the use site, and do not need to use them in a classified manner. All conventional parameters are supported. One in and one out, wiring and operation are very convenient.
[0018] 3. High measurement and output accuracy. The present invention has dual control accuracy from hardware filtering and software algorithm, and both input and output are strictly calculated. After compensation, the overall accuracy reaches one thousandth, which is ahead of most power transmitters on the market.
[0019] 4. High safety. The transmitter designed by the method of the present invention includes common alarm detection, such as overvoltage, undervoltage, overcurrent, undercurrent, etc. The alarm response is timely and the characteristics are obvious. It supports user-customized alarm schemes. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a principle block diagram of the AC / DC universal transmission circuit of the present invention; Figure 2 This is the circuit schematic diagram of the current signal acquisition unit; Figure 3 It is the circuit schematic diagram of the voltage signal acquisition unit; Figure 4 It is the circuit schematic diagram of the current output switching unit and the voltage output switching unit; Figure 5 This is the schematic diagram of the PWM current module circuit; Figure 6 This is the circuit schematic diagram of the PWM voltage module; Figure 7 This is the circuit schematic diagram of the PWM common output module; Figure 8 It is the input signal sampling calibration flow chart; Fig. 9 It is the flow chart of PWM calibration and output. DETAILED DESCRIPTION
[0021] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0022] Embodiment 1: A universal AC / DC transmission circuit, such as Figure 1 , Figure 2 , Figure 3 , Figure 4 As shown, the transmitter circuit includes a control unit, a current signal acquisition unit, a voltage signal sampling unit, a current output switching unit, and a voltage output switching unit. The output terminals (I1+, I1-, I2+, I2-) of the current signal acquisition unit are respectively connected to the sampling input port of the control unit, the output terminals (UAP1, UAN1, UAP2, UAN2) of the voltage signal sampling unit are respectively connected to the sampling input port of the control unit, the current control terminal Ctr1 of the current output switching unit and the voltage control terminal Ctr2 of the voltage output switching unit are respectively connected to the output port of the control unit; the current signal acquisition unit and the voltage signal sampling unit share an external input terminal, and the current output and voltage output of the transmitter circuit share an external output terminal; The common input terminal includes a current input signal IN-IA and a voltage input signal IN-UA sharing a wiring terminal, and a current input signal IN-IN and a voltage input signal IN-UN sharing a wiring terminal; the common output terminal includes a current output signal end and a voltage output signal end sharing a wiring terminal, and the other end of the current output signal and the other end of the voltage output signal share another wiring terminal. In other words, the same group of input terminals samples both current signals and voltage signals. Of course, there can only be one type of signal at the same time. The specific type of signal can be determined based on the sampling results, or the sampling type can be manually pre-set to the control unit, or the same port can input voltage or current signals in a time-sharing manner, and the input is controlled by a switching switch to be sampled by the current signal acquisition unit or the voltage signal acquisition unit; the same group of output terminals can output both current signals and voltage signals. The specific output signal is determined by the input signal and is controlled by the control unit; of course, the two types of signals can also share wiring terminals after isolation or power amplification; the control unit described in this embodiment uses a single-chip microcomputer as the main control chip, and directly uses the I / O port of the single-chip microcomputer as the sampling and output control port. The input port collects the input signal and performs analog-to-digital conversion to obtain the input signal value.
[0023] For the single-chip microcomputer, no matter the input is voltage or current, it samples the voltage value and completes the value conversion internally. Therefore, the current and voltage sampling can be connected to different I / O ports of the single-chip microcomputer, or to the same group of ports, that is, I1+, I1-, I2+, and I2- can share 4 sampling ports with UAP1, UAN1, UAP2, and UAN2 respectively (I1+ and UAP1 share one port, and so on. Generally, it is necessary to ensure that AC current detection is shared with AC voltage detection, and DC current detection is shared with DC voltage detection). This embodiment adopts a circuit method with 4 sampling ports.
[0024] like Figure 2 As shown, the current signal acquisition unit includes a first interference suppression circuit, and an isolated DC-to-AC circuit and an isolated AC-to-DC circuit connected in parallel therewith, wherein the isolated DC-to-AC circuit includes a second resistor (R2), a sixth capacitor (C6), a twelfth capacitor (C12) and a sixth resistor (R6) having a time constant of less than 0.1ms, which are sequentially connected in series, and the two capacitors are grounded in the middle, the two resistors have the same resistance value, and the two capacitors have the same value. In this embodiment, the time constant is set to 1k*33nF=0.033ms, and the connection point between the second resistor (R2) and the sixth capacitor (C6), the connection point between the twelfth capacitor (C12) and the sixth resistor (C6) The connection point of the resistor (R6) is the output point of the AC current signal; the isolated AC to DC circuit includes an 8th resistor (R8), a 21st capacitor (C21), a 23rd capacitor (C23) and a 13th resistor (R13) with a time constant greater than 100ms, which are sequentially connected in series, and the two capacitors are grounded in the middle, the two resistors have the same resistance value, and the two capacitors have the same value. In this embodiment, the time constant is set to 100k*2.2uF=220ms, and the connection point of the 8th resistor (R8) and the 21st capacitor (C21), and the connection point of the 23rd capacitor (C23) and the 13th resistor (R13) are the output points of the DC current signal; like Figure 3As shown, the voltage signal sampling unit includes a second interference suppression circuit, a signal amplifying circuit (U1), an AC signal pickup circuit and a DC signal pickup circuit (similar to the isolated DC-to-AC circuit and the isolated AC-to-DC circuit of the current signal acquisition unit, and different names are used here to show the difference in function), the output of the second interference suppression circuit is respectively connected to the input (VINP, VINN) of the signal amplifying circuit, and the output (VOUTP, VOUTN) of the signal amplifying circuit is respectively connected to the input (the two ends of the voltage dividing resistors R8, R27 in the figure) of the AC signal pickup circuit and the DC signal pickup circuit after voltage division by at least two series-connected resistors (R8 and R27 in the figure are indispensable voltage dividing resistors, and preferably R73 and R74 can be connected in series for further current limiting and voltage division); the AC signal pickup circuit includes a resistor (R22), a capacitor (C29), a capacitor (C18) and a resistor (R28) which are sequentially connected in series with a time constant of less than 0.1ms, and the middle of the two capacitors is grounded, and the resistance values of the two resistors are The two capacitors have the same value. In this embodiment, the time constant is set to 1k*33nF=0.033ms. The connection point between the 22nd resistor (R22) and the 29th capacitor (C29) and the connection point between the 18th capacitor (C18) and the 28th resistor (R28) are output points of the AC voltage signal. The DC signal pickup circuit includes a 5th resistor (R5), a 3rd capacitor (C3), an 11th capacitor (C11) and a 15th resistor (R15) whose time constant is greater than 100ms and are sequentially connected in series. , and the two capacitors are grounded in the middle, the two resistors have the same resistance value, the two capacitors have the same value, and the time constant is set to 100k*2.2uF=220ms in this embodiment. The connection point between the fifth resistor (R5) and the third capacitor (C3) and the connection point between the eleventh capacitor (C11) and the fifteenth resistor (R15) are the output points of the DC voltage signal. The signal amplification circuit adopts the NSI1300D25-DSWWAR isolation amplifier of Nanochip Micro; the interference suppression circuit can adopt a conventional anti-interference circuit; As shown in the figure, before the signal enters the sampling port, it will be filtered by two RC filter circuits with different parameters. The 1k+33nF circuit is used to filter DC to AC, and the 100k+2.2uF circuit is used to filter AC to DC, and finally realize the AC and DC diversion. So far, different types of signals have entered different sampling ports through the same port. Next, the control unit only needs to process the sampling value of the corresponding sampling port, and output the corresponding transmission current or voltage according to the sampling signal size and the transmission ratio.
[0025] like Figure 4As shown, the circuit forms of the current output switching unit and the voltage output switching unit are consistent. The current control terminal (Ctr1) of the control unit is connected to the 6th photoelectric coupling amplifier (U6) after current limiting by the 22nd resistor (R22), and the voltage control terminal (Ctr2) is connected to the 4th photoelectric coupling amplifier (U4) after current limiting by the 69th resistor (R69). The output of the photoelectric coupling amplifier is the current and voltage output signal after corresponding transmission. In this logic circuit, Ctrl1 and Ctrl2 are output by the single-chip microcomputer at high and low levels. When Ctrl1 is high and Ctrl2 is low, S1 and S2 are turned on, and S4 and S5 are turned off; when Ctrl1 is low and Ctrl2 is high, S1 and S2 are turned off, and S4 and S5 are turned on. By using the method of one on and one off of two lines, the signals after current and voltage transmission are output from the same port.
[0026] Other modules connected to the current output switching units S1 and S2 include PWM (pulse width modulation) current output modules, and modules connected to the voltage output switching units S4 and S5 include PWM voltage modules, both of which can adopt existing technologies, and the specific circuit implementation is omitted in this embodiment.
[0027] Embodiment 2: The difference from Example 1 is that the first interference suppression circuit in this embodiment at least includes a second transient voltage suppression diode (D2, TVS tube) connected in parallel, a second electrostatic discharge diode (U2, ESD tube, dual small signal switch diode) and a plurality of bypass resistors (R3, R4, R28, which play a shunt role). The TVS tube D2 in this embodiment is of model SMBJ36CA, and the ESD electrostatic discharge diode U2 is of model BAV199_HD.
[0028] Preferably, the input end (IN-UA, IN-UN) of the second interference suppression circuit is connected in parallel with a 24th transient voltage suppression diode (D24), a 3rd electrostatic discharge diode (U3, a dual small signal switch diode) and a filter circuit after passing through a plurality of series-connected current limiting resistors (R10, R11, R12, R13, R39, R45, R46, R47), and the output of the filter circuit is the output of the second interference suppression circuit. The filter circuit in this embodiment is composed of a 7th capacitor (C7) and a series-connected The 34th resistor (R34) and the 37th resistor (R37), the 17th resistor (R17) connected in series, the 5th capacitor (C5), the 8th capacitor (C8) and the 49th resistor (R49) are connected in parallel, and the middle connection points of the 34th resistor (R34) and the 37th resistor (R37), the 5th capacitor (C5) and the 8th capacitor (C8) are all grounded; the TVS tube D24 described in this embodiment is SMBJ8.0CA, and the ESD electrostatic discharge diode U3 is BAV199_HD.
[0029] Embodiment 3: The difference from Example 1 is that the transmission circuit described in this embodiment also includes a PWM output unit, which is respectively connected to the current output switching unit, the voltage output switching unit and the output signal terminal, and the PWM output unit includes a PWM current module, a PWM voltage module and a PWM common output module. The control unit outputs the corresponding signal to the corresponding PWM current module or PWM voltage module according to the type and size of the sampling signal, and the signal is output from the same output port of the PWM common output module after power amplification.
[0030] Preferably, Figure 5 As shown, the PWM current module includes a two-stage operational amplifier (IC2A, IC3B) series amplifier circuit, and two triodes (Q1, Q2) series amplifier circuits connected to the output of the final operational amplifier. The two-stage operational amplifiers are connected in series through a field effect tube (Q6, MOS tube), and the final output of the triode is connected to the power signal input (S1) of the current output switching unit. The operational amplifier, field effect tube, triode and other peripheral circuits are conventionally connected to jointly construct a voltage follower and constant current source circuit; as shown Figure 6 As shown, the PWM voltage module includes a first-stage operational amplifier (IC3A) circuit, the output of which is connected to the power signal input (S4) of the voltage output switching unit, and the peripheral circuit belongs to a conventional link.
[0031] The input signal (Vin) of the PWM current module and the PWM voltage module is sent by the single-chip microcomputer of the control unit, and after entering the PWM current and voltage two-way output modules for amplification, S1 and S4 correspond to the power signals connected to the current output switching unit and the voltage output switching unit respectively. Combined with the working principles of the two switching units, due to the action of the above-mentioned logic circuit, in the end only one signal is passed, that is, according to the type and size of the input signal of the transmission circuit, the corresponding transmitted signal is output.
[0032] Preferably, Figure 7As shown, the PWM common output module includes a unidirectional conduction 16th diode (D16), the power signal output (S2) of the current output switching unit is connected to the positive electrode of the 16th diode, the power signal output (S5) of the voltage output switching unit is connected to the negative electrode of the 16th diode, the negative electrode of the 16th diode is connected to the interconnected end of the 4th inductor (L4) and the 63rd capacitor (C63), the other end of the 4th inductor (L4) is connected to the 62nd capacitor (C62) and then continues to be connected in series with the 5th inductor (L5), and then connected to the other end of the 63rd capacitor (C63) and grounded, forming a dual-capacitor inductor filter network; the 62nd capacitor (C62) is connected in parallel with the 3rd transient voltage suppression diode (D3), The connection point of the 62nd capacitor (C62) and the 4th inductor (L4) is simultaneously connected to the interconnection pin (pin 3) of the 17th electrostatic discharge diode (D17), and the independent pins (pins 1 and 2) of the 17th electrostatic discharge diode (D17) are respectively connected to the negative power supply and the positive power supply; the TVS tube D3 in this embodiment is model SMBJ36CA, and the ESD electrostatic discharge diode D17 is model BAV199_HD.
[0033] Embodiment 4: A universal AC / DC transmission output method, such as Figure 8 As shown, for any one of the above AC / DC universal transmission circuits and the transmission device or system constructed by the preferred solution thereof, the transmission output method includes an input signal sampling calibration method, and the input signal sampling calibration method includes the following steps: A1. Reset state function check, including read and write, working mode switching and chip reset function checks. If the check result is normal, the main state is set to reset state and the reset check is ended. Otherwise, the reset check is ended. The read and write functions include whether the chip ID is read successfully and whether the write enable is successful. A2. Parameter setting check, including whether the channel setting parameters are successful, verification and calculation. After the check is completed normally, the main state is set to the normal operation state and the check is ended. Otherwise, it is set to the reset state and the parameter setting check is ended. A3, normal operation check, including judging whether the checksum is successful, if successful, obtaining the sampling value, calculating the input signal value, and running in a loop; if the checksum is unsuccessful, the unsuccessful count is increased by 1, if the unsuccessful count is greater than 3, the main state is set to the reset state, and the operation is terminated; if the unsuccessful count is less than or equal to 3, the operation is terminated directly or continued. This embodiment adopts the termination of the operation; A4. Perform basic circuit input calibration: A41, input zero signal, record the sampled conversion signal as b; A42, input the first signal x a , record the sampled conversion signal as Y a ; A43, input second signal x b , record the sampled conversion signal as Y b ; where x b >x a ; Establish the theoretical linear relationship between input value x and sample conversion value Y: Y=kx+b (Formula 1) Where k=(Y b -Y a ) / ( x b -x a ); A44, calibration completed; The system can calculate the theoretical output value based on the above input-output theoretical linear relationship and the actual input signal value, thereby realizing the universal transmission of AC and DC signals.
[0034] There is no order of precedence for the above steps A41, A42, and A43.
[0035] The first signal is generally a small signal, and the second signal is generally a large signal. The input current range of the transmitter circuit in this embodiment is 0-18A, and the input voltage range is 0-720V. Therefore, corresponding to the current and voltage input, the small signal is set to 1A or 50V, the large current signal is 18A or 15A, and the large voltage signal is 720V or 500V. The main state at least includes a reset state, a parameter setting state, a normal operating state and a calibration state; the above steps or processes are the state machine operation process, and after each operation cycle, the main state ends and waits to enter the next cycle setting state.
[0036] Preferably, the input signal sampling calibration method further includes: A5. The main state is set to the reset state, and the program ends. This step is an operation after the complete calibration is completed. It is not a necessary step for calibration. This embodiment considers that the software integrates system operation and calibration, so this step is designed.
[0037] Embodiment 5: Due to the universal AC / DC transmission output method of the present invention, only one output terminal is needed, and it is necessary to support output of multiple specifications of voltage and current at the same time, specifically including common signal output requirements such as 0-20mA, 4-20mA, 0-10mA, 2-10mA, 0-5V, 1-5V, 0-10V, 2-10V, and other customizations are also supported.
[0038] Generally, the transmitter will establish the boundary relationship and proportional relationship between the input and output according to the corresponding relationship between the input quantization range and the output quantization range, and output in proportion. Since the present invention supports many types of inputs and outputs, the input and output need to be calibrated separately. At the same time, considering the nonlinear problem of PWM, the simple proportional calculation control output will cause a significant gap between the actual PWM output and the ideal value, so a method for compensation calibration of PWM output is proposed. Note that the input signal sampling calibration and PWM output compensation calibration are two independent processes. Without designing a PWM module, the control unit can directly output according to the quantization relationship after passing through the shared module, but it may affect the output load capacity of the transmitter, so a PWM module is usually designed.
[0039] The difference from Example 4 is that the transmission output method of this embodiment also includes a compensation calibration method and an output signal compensation method. The compensation calibration method includes setting the minimum output value y1 and the maximum output value y2 within the output range. n (For example, for 2-10mA output specification, y1=2mA, y n =10mA), at least one more compensation point output signal value y should be calibrated i , the corresponding control unit microcontroller output Vin is marked as z1, z n and z i (For PWM, it can be called input), a corresponding monotonic conversion relationship is established between the two according to the input and output range and the computer numerical storage method. If the nonlinear problem of PWM is not considered, this embodiment uses z i =y i As an example (other conversion relationships are not listed here one by one, only the general case is taken as an example), i=1,2,…n, n is the number of output signal calibration points, z i or i Can be evenly distributed. Without loss of generality, all calibration points are sorted from small to large according to the output and marked in sequence; The control unit successively inputs calibration points z to the PWM i , there can be a corresponding measured output value y i And the theoretical output value y i0 , then the calibration point compensation is recorded as: Δy i =y i -y i0 According to the monotonic conversion relationship between PWM input and output, the corresponding Δz can be obtained i , in this embodiment, Δz i =Δy i ; The above general calibration procedure generally has Δy1=Δy n =0, this is the normal step for initial PWM adjustment; The output signal compensation method comprises: For any output demand y (based on the input quantity collected by the signal acquisition unit and its percentage in the input range and the output range, so as to obtain the value that should be output), the calculation method of the compensation amount Δy includes the linear interpolation method of the compensation amounts of adjacent calibration points or the comprehensive interpolation method of the compensation amounts of all calibration points; then the actual output value of the control unit z=z0-Δz, where z0 is the theoretical output value of the control unit corresponding to the PWM output y, that is, the corresponding compensation amount is deducted in advance when the control unit actually outputs, so that the final output can basically maintain the original linear relationship after PWM power amplification; of course, if there is a conversion relationship between the control unit output and the PWM output, then the corresponding compensation amount Δy also needs to be converted to a corresponding value on the control unit side, which is omitted here.
[0040] The linear interpolation method of adjacent calibration point compensation includes finding the minimum calibration value y greater than y i+1 and less than the maximum calibration value y of y i , then the compensation amount Δy=(y-y i ) ( Δy i+1 - Δy i ) / ( y i+1 -y i )+ Δy i ; Obtain Δz based on the monotonic transformation relationship between y and z; The comprehensive interpolation method for compensation amounts of all calibration points includes a polynomial difference method, a Newton interpolation method, a Lagrange interpolation method, and the like.
[0041] Preferably, Fig. 9 As shown, the transmission output method also includes a PWM calibration and output process, and the PWM calibration and output process includes: B1. Determine whether there is a calibration mark. If not, it means no calibration is required and go to step B2. If yes, go to the PWM calibration procedure, including: B11, boundary value calibration, the control unit outputs the minimum value z1 and the maximum value z n , adjust PWM so that the output corresponds to y1 and y n , there is no order of precedence here; B12, set compensation point z i or i , get the corresponding compensation value Δy i , i=2, 3, …, n-1; B13, store calibration parameters, and the calibration is completed; the calibration parameters include the PWM input signal of the calibration point (including the reference point and the compensation point) and the corresponding output signal value, the monotonic conversion relationship parameter, the adjacent calibration point (including the compensation point and the reference point, the same below) compensation amount calculation slope value ((Δy i+1 - Δy i ) / ( y i+1 -y i )) and / or comprehensive interpolation parameters (such as interpolation parameters of polynomial difference method, Newton interpolation method or Lagrange interpolation method, etc.), which can be stored in ascending order of input values, or can be stored in quantitative relationship according to output type (current or voltage); B2. Obtain the input signal type and input signal value, that is, the voltage or current sampling value; B3, enter the PWM output program; B31. Determine the output type according to the input signal type, and calculate the theoretical output value according to the input signal value; B32, obtain calibration compensation parameters to calculate compensation amount; B33, calculating the control unit output value according to the theoretical output value and the corresponding compensation amount, and in this embodiment writing the value into the control unit CCR register; B34. Control the on and off of the logic circuit (such as the current output switching unit and the voltage output switching unit) according to the output type to execute the transmission output.
[0042] The above steps or processes are also the state machine operation process. After each operation cycle main state ends, it waits to enter the next cycle setting state.
[0043] When designing the program, there is a quantitative relationship between different output range signals (0-5V, 1-5 is 1 times, 0-10, 2-10 is 2 times, 0-20, 4-20 is 4 times), which can save the calibration program and only calibrate one of the ranges.
[0044] The above is only a preferred implementation of the AC / DC universal transmission circuit and transmission output method of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical principles of the present invention, several improvements and modifications can be made, such as simplifying the interference suppression circuit or even not designing the interference suppression circuit, using several resistor series-parallel variation forms for current limiting or voltage division, and switching the current and voltage outputs without optocoupler isolation but general electronic switch switching, etc. These improvements and modifications should also be regarded as the protection scope of the present invention and will not be listed here one by one.
Claims
1. A universal AC / DC transmission circuit, characterized in that: The transmission circuit comprises a control unit, a current signal acquisition unit, a voltage signal sampling unit, a current output switching unit, and a voltage output switching unit. The output end of the current signal acquisition unit is respectively connected to the sampling input port of the control unit, the output end of the voltage signal sampling unit is respectively connected to the sampling input port of the control unit, the current control end (Ctr1) of the current output switching unit and the voltage control end (Ctr2) of the voltage output switching unit are respectively connected to the output port of the control unit; the current signal acquisition unit and the voltage signal sampling unit share an external input terminal, and the current output and voltage output of the transmission circuit share an external output terminal; The current signal acquisition unit includes a first interference suppression circuit, and an isolated direct current to alternating current circuit and an isolated alternating current to direct current circuit connected in parallel therewith, wherein the isolated direct current to alternating current circuit includes a second resistor (R2), a sixth capacitor (C6), a twelfth capacitor (C12) and a sixth resistor (R6) which are sequentially connected in series and have a time constant of less than 0.1 ms, and the two capacitors are grounded in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; the isolated alternating current to direct current circuit includes an eighth resistor (R8), a twenty-first capacitor (C21), a twenty-third capacitor (C23) and a thirteenth resistor (R13) which are sequentially connected in series and have a time constant of greater than 100 ms, and the two capacitors are grounded in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; The voltage signal sampling unit comprises a second interference suppression circuit, a signal amplifying circuit (U1), an AC signal pickup circuit and a DC signal pickup circuit, the output of the second interference suppression circuit is respectively connected to the input (VINP, VINN) of the signal amplifying circuit, and the output (VOUTP, VOUTN) of the signal amplifying circuit is respectively connected to the input of the AC signal pickup circuit and the DC signal pickup circuit after being divided by at least two resistors connected in series; the AC signal pickup circuit comprises a 22nd resistor (R22), a 29th capacitor (C29), an 18th capacitor (C18) and a 28th resistor (R28) connected in series in sequence, with a time constant less than 0.1 ms, and the two capacitors are connected to ground in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; the DC signal pickup circuit comprises a resistor (R5), a capacitor (C3), a capacitor (C11) and a resistor (R15) connected in series in sequence, with a time constant greater than 100 ms, and the two capacitors are connected to ground in the middle, and the two resistors have the same resistance value and the two capacitors have the same value; The circuit forms of the current output switching unit and the voltage output switching unit are consistent. The current control terminal (Ctr1) of the control unit is connected to the sixth photoelectric coupling amplifier (U6) after current limiting by the 22nd resistor (R22), and the voltage control terminal (Ctr2) is connected to the fourth photoelectric coupling amplifier (U4) after current limiting by the 69th resistor (R69).
2. The AC / DC universal transmission circuit according to claim 1, characterized in that: The first interference suppression circuit at least includes a second transient voltage suppression diode (D2), a second electrostatic discharge diode (U2) and a plurality of bypass resistors connected in parallel.
3. The AC / DC universal transmission circuit according to claim 1, characterized in that: The input end of the second interference suppression circuit is connected in parallel with a 24th transient voltage suppression diode (D24), a third electrostatic discharge diode (U3) and a filter circuit respectively after passing through a plurality of series-connected current limiting resistors.
4. The AC / DC universal transmission circuit according to claim 1, characterized in that: The transmission circuit also includes a PWM output unit, which is respectively connected to the current output switching unit, the voltage output switching unit and the output signal terminal, and includes a PWM current module, a PWM voltage module and a PWM common output module.
5. The AC / DC universal transmission circuit according to claim 4, characterized in that: The PWM current module includes a two-stage operational amplifier series amplifier circuit and two triode series amplifier circuits connected to the output of the final operational amplifier, wherein the two-stage operational amplifiers are connected in series via field effect transistors; the PWM voltage module includes a first-stage operational amplifier circuit.
6. The AC / DC universal transmission circuit according to claim 4, characterized in that: The PWM common output module comprises a unidirectional conducting 16th diode (D16), the power signal output (S2) of the current output switching unit is connected to the positive electrode of the 16th diode, the power signal output (S5) of the voltage output switching unit is connected to the negative electrode of the 16th diode, the negative electrode of the 16th diode is connected to one end of the interconnection of the 4th inductor (L4) and the 63rd capacitor (C63), the other end of the 4th inductor (L4) is connected to the 62nd capacitor (C62) and then continues to be connected in series with the 5th inductor (L5), and then connected to the other end of the 63rd capacitor (C63) and grounded; the 62nd capacitor (C62) is connected in parallel with the 3rd transient voltage suppression diode (D3), the connection point between the 62nd capacitor (C62) and the 4th inductor (L4) is simultaneously connected to the interconnection pin of the 17th electrostatic discharge diode (D17), and the independent pins of the 17th electrostatic discharge diode (D17) are respectively connected to the negative power supply and the positive power supply.
7. A universal AC / DC transmission output method, characterized in that: The transmission output method includes an input signal sampling calibration method, and the input signal sampling calibration method includes the following steps: A1. Reset state function check, including read / write, working mode switching and chip reset function check. If the check result is normal, the main state is set to reset state and the reset check is ended, otherwise the reset check is ended; A2. Check parameter settings; A3. Normal operation inspection; A4. Perform basic circuit input calibration: A41, input zero signal, record the sampled conversion signal as b; A42, input the first signal x a , record the sampled conversion signal as Y a ; A43, input second signal x b , record the sampled conversion signal as Y b ; where x b >x a ; Establish the theoretical linear relationship between input value x and sample conversion value Y: Y=kx+b (Formula 1) Where k=(Y b -Y a ) / ( x b -x a ); A44, calibration completed; There is no order of precedence for the above steps A41, A42, and A43.
8. The AC / DC universal transmission and output method according to claim 7, characterized in that: The input signal sampling calibration method further includes: A5. The main state is set to reset state and the program ends.
9. The AC / DC universal transmission and output method according to claim 7, characterized in that: The transmission output method also includes a compensation calibration method and an output signal compensation method. The compensation calibration method includes setting the minimum output value y1 and the maximum output value y1 within the output range. n At least one more compensation point output signal value y should be calibrated i , the corresponding control unit outputs are marked as z1, z n and z i , a corresponding monotonic conversion relationship is established between the two, i=1,2,…n, n is the number of output signal calibration points; The control unit successively inputs calibration points z to the PWM i , with the corresponding measured output value y i And the theoretical output value y i0 , then the calibration point compensation is recorded as Δy i =y i - yes i0 The output signal compensation method comprises: For any output demand y, the calculation method of the compensation amount Δy includes the linear interpolation method of the compensation amounts of adjacent calibration points or the comprehensive interpolation method of the compensation amounts of all calibration points; then the actual output value z of the control unit = z0-Δz, where z0 is the theoretical output value corresponding to the PWM output y; The linear interpolation method of adjacent calibration point compensation includes finding the minimum calibration value y greater than y i+1 and less than the maximum calibration value y of y i , then the compensation amount Δy=( y- y i ) ( Δy i+1 - Δy i ) / ( yes i+1 - yes i )+ Δy i ; Obtain Δz based on the monotonic transformation relationship between y and z; The comprehensive interpolation method for compensation amounts of all calibration points includes a polynomial difference method, a Newton interpolation method or a Lagrange interpolation method.
10. The AC / DC universal transmission and output method according to claim 9, characterized in that: The transmission output method also includes a PWM calibration and output process, and the PWM calibration and output process includes: B1. Determine whether there is a calibration mark. If not, proceed to step B2; if yes, proceed to the PWM calibration procedure, including: B11, boundary value calibration, the control unit outputs the minimum value z1 and the maximum value z n , adjust PWM so that the output corresponds to y1 and y n , there is no order of precedence here; B12, set compensation point z i or i , get the corresponding compensation value Δy i , i=2, 3, …, n-1; B13, store calibration parameters, and the calibration is completed; B2. Get the input signal type and input signal value; B3, enter the PWM output program; B31. Determine the output type according to the input signal type, and calculate the theoretical output value according to the input signal value; B32, obtain calibration compensation parameters to calculate compensation amount; B33, calculating the control unit output value according to the theoretical output value and the corresponding compensation amount; B34. Control the on and off of the logic circuit according to the output type and execute the transmission output.
Citation Information
Patent Citations
Thermal resistance temperature transmitter
CN103616086A
Alternating current and direct current universal real-available-value voltage transmitter
CN104515898A
AC-DC hybrid detection circuit for output load of UPS charger
CN108321923A
Multi-interval power supply output precision calibration method and device and storage medium
CN110413940A
Universal sensor signal acquisition circuit topological structure and using method
CN112764367A