Output circuit and fault diagnosis method
By introducing control and sampling circuits for analog output circuits into the output circuit, and using analog output current and voltage for fault diagnosis, the problem of complex and limited fault detection in existing digital output circuits is solved, and accurate fault diagnosis is achieved.
Patent Information
- Application Number
- CN202511798733.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-06
AI Technical Summary
Existing output circuits cannot effectively detect open-circuit faults in digital output circuits, and the fault detection process is complex and the types of faults are limited.
Design an output circuit, including a digital output circuit and an analog output circuit. Through the control circuit and sampling circuit of the analog output circuit, determine the fault status of the circuit and components of the digital output circuit, and use the analog output current and voltage for fault diagnosis.
It enables accurate diagnosis of line faults and device faults in digital output circuits, simplifies the fault detection process, and expands the types of faults that can be detected.
Smart Images

Figure CN121613288A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of circuit testing technology, specifically to an output circuit and a fault diagnosis method. Background Technology
[0002] Industrial output systems (digital and analog signal output systems) are key components in industrial control systems such as DCS (Distributed Control System) and SIS (Safety Instrumented System). Analog and digital outputs are achieved through output-type I / O modules of different signal types. Since I / O modules of different channel types are not interchangeable, as DCS and SIS scale up, the number of I / O channels required also increases, leading to higher system costs and increased complexity in system components and subsequent maintenance.
[0003] In the process of developing this application, the inventors discovered that an I / O module typically consists of an analog output circuit and a digital output circuit, but... Figure 1 As shown, existing output circuits cannot detect open-circuit faults in digital output circuits. Furthermore, when detecting short-circuit faults in digital output circuits, the high-side power switch protection is required, and an overcurrent fault must be detected before the load current of the analog output circuit can be increased. This not only makes the fault detection process complex but also limits the types of faults that can be detected. Summary of the Invention
[0004] In response to this, this application provides an output circuit and a fault diagnosis method to solve the problems that in the prior art, the output circuit not only has a complex fault detection process, but also has a very limited range of fault types that can be detected.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of this application discloses an output circuit, including: a digital output circuit and N analog output circuits, where N is a positive integer;
[0007] The analog output circuit is located before the digital output circuit;
[0008] The digital output circuit includes at least: peripheral circuits and a number of switching circuits matching the number of analog output circuits, with each analog output circuit matching at least one of the switching circuits;
[0009] The analog output circuit includes at least: a control circuit and a sampling circuit;
[0010] The sampling circuit is used to sample the output current of the analog output circuit and the output voltage of the digital output circuit.
[0011] The control circuit is used to determine the line fault status of the digital output circuit based on the output current of the analog output circuit, and to determine the device fault status of the digital output circuit based on the output voltage of the digital output circuit and the switching status of the switching circuit.
[0012] Optionally, in the above-described output circuit, the peripheral circuit includes: a first diode and a second diode;
[0013] The anode of the first diode is connected to the power supply of the digital output circuit, and the cathode of the first diode is connected to the first input terminal of the switching circuit.
[0014] The anode of the second diode is connected to the output terminal of the switching circuit, and the cathode of the second diode is connected to an external load.
[0015] Optionally, in the above-described output circuit, the switching circuit includes: a third diode, a first resistor, and a switching transistor;
[0016] The anode of the third diode is connected to the gate of the switching transistor, and the connection point serves as the second input terminal of the switching circuit, which is connected to the output terminal of the corresponding analog output circuit.
[0017] The cathode of the third diode is connected to one end of the first resistor;
[0018] The other end of the first resistor is connected to the source of the switching transistor, and the connection point serves as the first input terminal of the switching circuit.
[0019] The drain of the switching transistor serves as the output terminal of the switching circuit.
[0020] Optionally, in the above-described output circuit, the switching circuit further includes: a second resistor and a third resistor;
[0021] One end of the second resistor is connected to the gate of the switching transistor, and the other end of the second resistor is connected to one end of the third resistor. The connection point is connected to the second input terminal of the switching circuit.
[0022] The other end of the third resistor is grounded.
[0023] Optionally, in the above-described output circuit, the digital output circuit further includes a current-limiting protection circuit disposed before the first diode.
[0024] Optionally, in the above-described output circuit, the current limiting protection circuit includes: an electronic fuse, or a resettable fuse.
[0025] Optionally, in the above-described output circuit, the analog output circuit includes: a basic analog output circuit, a sampling resistor, the control circuit, and the sampling circuit;
[0026] The control terminal of the control circuit is connected to the input terminal of the analog output basic circuit;
[0027] The output terminal of the basic analog output circuit is connected to one end of the sampling resistor, and the other end of the sampling resistor serves as the output terminal of the analog output circuit.
[0028] The output current sampling point in the sampling circuit is connected to both ends of the sampling resistor, the analog output voltage sampling point in the sampling circuit is connected to the output terminal of the analog output circuit, and the digital output voltage sampling point in the sampling circuit is connected to the output terminal of the corresponding switch circuit in the digital output circuit.
[0029] The second aspect of this application discloses a fault diagnosis method applied to the control circuit of a digital output circuit in any of the output circuits disclosed in the first aspect, the fault diagnosis method comprising:
[0030] The output current of the analog output circuit and the output voltage of the digital output circuit are obtained respectively.
[0031] Based on the relationship between the output current of the analog output circuit, the preset open-circuit fault current threshold, and the preset short-circuit fault current threshold, the line fault state of the digital output circuit is determined. The preset open-circuit fault current threshold is the sum of the switch drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the open-circuit state. The preset short-circuit fault current threshold is the sum of the switch drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the short-circuit state.
[0032] The device fault state of the digital output circuit is determined based on the output voltage of the digital output circuit and the switching state of the corresponding switching circuit in the output circuit.
[0033] Optionally, in the above fault diagnosis method, determining the line fault state of the digital output circuit based on the relationship between the output current of the analog output circuit, the preset open-circuit fault current threshold, and the preset short-circuit fault current threshold includes:
[0034] If the output current of the analog output circuit is less than the preset open-circuit fault current threshold, then the line fault state of the digital output circuit is determined to be an open-circuit fault.
[0035] If the output current of the analog output circuit is greater than the preset short-circuit fault current threshold, then the line fault state of the digital output circuit is determined to be a short-circuit fault.
[0036] Optionally, in the above fault diagnosis method, determining the device fault state of the digital output circuit based on the output voltage of the digital output circuit and the switching state of the corresponding switching circuit in the output circuit includes:
[0037] Determine whether the output voltage of the digital output circuit matches the switching state of the corresponding switch circuit in the output circuit;
[0038] If it is determined that the output voltage of the digital output circuit does not match the switching state of the corresponding switch circuit in the output circuit, then the device fault state of the digital output circuit is determined to be a device fault.
[0039] Matching the output voltage of the digital output circuit with the switching state of the corresponding switch circuit in the output circuit includes: when the corresponding switch circuit in the output circuit is in the on state, the output voltage of the digital output circuit is equal to the voltage corresponding to the on state; or, when the corresponding switch circuit in the output circuit is in the off state, the output voltage of the digital output circuit is equal to the voltage corresponding to the off state.
[0040] This invention provides an output circuit, comprising: a digital output circuit and N analog output circuits, where N is a positive integer; the analog output circuits are disposed before the digital output circuits; the analog output circuits include at least: a control circuit and a sampling circuit; the sampling circuits are used to sample the output current of the analog output circuits and the output voltage of the digital output circuits; the digital output circuits include at least: peripheral circuits and a number of switching circuits matching the number of analog output circuits, with each analog output circuit matched with at least one switching circuit; the control circuit is used to determine the line fault state of the digital output circuit based on the output current of the analog output circuits, and to determine the device fault state of the digital output circuit based on the output voltage of the digital output circuits and the switching state of the switching circuits, thereby diagnosing line faults and device failures in the digital signal output circuits, solving the problems of existing output circuits having complex fault detection processes and very limited fault types that can be detected. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 A schematic diagram of the existing output circuit provided in this application;
[0043] Figure 2 This is a schematic diagram of an output circuit provided in an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of the structure of a conventional analog output circuit provided in the embodiments of this application;
[0045] Figures 4 to 7 Schematic diagrams of four other output circuits provided in the embodiments of this application;
[0046] Figure 8 This is a flowchart of a fault diagnosis method provided in an embodiment of this application. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] This application provides an output circuit and a fault diagnosis method to solve the problems in the prior art where the fault detection process of the output circuit is not only complicated, but also the types of faults that can be detected are very limited.
[0049] Please see Figure 2 The output circuit mainly includes: a digital output circuit and N analog output circuits, where N is a positive integer.
[0050] The analog output circuit is placed before the digital output circuit.
[0051] In practical applications, since the analog signal output by the analog output circuit can drive a much smaller load current than that of the digital output circuit, in order to meet the needs of scenarios with larger load current, a digital output circuit is usually connected after the analog output circuit. The digital output circuit outputs a digital signal to drive the device with a large current.
[0052] For example, such as Figure 3 As shown, conventional analog output circuits can only drive load currents up to 25mA. Unlike digital output circuits, they cannot drive loads with larger currents such as 100mA, 500mA, or 1A.
[0053] A digital output circuit includes at least: peripheral circuits and a number of switching circuits that match the number of analog output circuits, with each analog output circuit being matched with at least one switching circuit.
[0054] In practical applications, at least one switching circuit is required for each analog output circuit in a digital output circuit. The switching state of this circuit is controlled by the output voltage of the analog output circuit. However, to meet more application scenarios, such as control triggered by safety and reliability, the number of switching circuits for each analog output circuit can be adjusted according to different application scenarios.
[0055] For example, when the number of analog output circuits in the output circuit is 1 or 2, such as Figure 4 and Figure 5 As shown, a switching circuit is set up for each analog output circuit in the digital output circuit, and the switching circuits are connected in series. When the number of analog output circuits in the output circuit is 3, as shown... Figure 6 As shown, the number of switch circuits set for each analog output circuit in the quantity output circuit are 2, 1, and 3 respectively, forming 3 switch circuit branches, and each switch circuit branch includes two switch circuits connected in series.
[0056] It should be noted that the output circuit provided in this application can be applied to multiplexing systems, such as... Figure 5 The dual system shown and Figure 6 The triple system is shown.
[0057] It should also be noted that the peripheral circuit and a switching circuit can form the most basic digital output circuit.
[0058] like Figure 4 As shown, in some embodiments, the peripheral circuit mainly includes: a first diode D1 and a second diode D5.
[0059] The anode of the first diode D1 is connected to the power supply of the digital output circuit, and the cathode of the first diode D1 is connected to the first input terminal of the switching circuit; the anode of the second diode D5 is connected to the output terminal of the switching circuit, and the cathode of the second diode D5 is connected to the external load.
[0060] In practical applications, both diodes D1 and D5 are reverse-current protection diodes. Diode D1 prevents current from flowing back into the power supply of the digital output circuit, such as preventing the output current of the analog output circuit from flowing back into the power supply of the digital output circuit. Diode D5 prevents current from flowing back into the digital output circuit.
[0061] It should be noted that in practice, the first diode D1 and the second diode D5 can be implemented using other anti-backflow circuits, such as oring circuits or control switches. This setup reduces external factors affecting line fault diagnosis and improves the accuracy of fault diagnosis.
[0062] like Figure 4 As shown, in some embodiments, the switching circuit mainly includes: a third diode D2, a first resistor R2, and a switching transistor SW1.
[0063] The anode of the third diode D2 is connected to the gate of the switching transistor SW1, and the connection point serves as the second input terminal of the switching circuit, which is connected to the output terminal of the corresponding analog output circuit. The cathode of the third diode D2 is connected to one end of the first resistor R2. The other end of the first resistor R2 is connected to the source of the switching transistor SW1, and the connection point serves as the first input terminal of the switching circuit. The drain of the switching transistor SW1 serves as the output terminal of the switching circuit.
[0064] It should be noted that the third diode D2 can prevent the input voltage of the power supply of the digital output circuit from flowing back to the driving terminal of the switching transistor SW1, thus avoiding the mis-turn-on of the switching transistor SW1.
[0065] In practical applications, such as Figure 7 As shown, in Figure 4 Based on this, the switching circuit may also include: a second resistor R3 and a third resistor R4.
[0066] One end of the second resistor R3 is connected to the gate of the switching transistor SW1, and the other end of the second resistor R3 is connected to one end of the third resistor R4. The connection point is connected to the second input terminal of the switching circuit; the other end of the third resistor R4 is grounded.
[0067] It should be noted that the second resistor R3 and the third resistor R4 can form a voltage divider circuit to convert the output voltage of the analog output circuit into a driving voltage that can drive the switching transistor SW1.
[0068] It should also be noted that the switching transistor SW1 can be an NMOS, PMOS, transistor, relay, optocoupler, PHOTOMOS, high-side power switch, or other switching devices. This application does not limit the types of devices, and all of them are within the scope of protection of this application.
[0069] like Figure 4 or Figure 7 As shown, in some embodiments, the digital output circuit further includes a current limiting protection circuit disposed before the first diode D1.
[0070] The current limiting protection circuit includes: an electronic fuse or a resettable fuse.
[0071] It should be noted that the current limiting protection circuit can provide current limiting protection when the load is short-circuited, thereby improving the safety and reliability of the circuit.
[0072] Analog output circuits include at least: control circuits and sampling circuits.
[0073] The sampling circuit is used to sample the output current of the analog output circuit and the output voltage of the digital output circuit.
[0074] The control circuit is used to determine the line fault status of the digital output circuit based on the output current of the analog output circuit, and to determine the device fault status of the digital output circuit based on the output voltage of the digital output circuit and the switching status of the switching circuit.
[0075] In practical applications, the control circuit can be a CPU control circuit, with the built-in CPU including the aforementioned fault state judgment logic. The sampling circuit can be an ADC (Analog to Digital Converter) sampling circuit, which includes at least three sampling ports to sample the output current, output voltage, and output voltage of the analog output circuit, respectively.
[0076] It should be noted that the sampling ports used in the sampling circuit to sample the output current and output voltage of the analog output circuit are generally ports set up in the analog output circuit to detect the fault status of its own circuit. However, in order to detect the fault status of the subsequent digital output circuit, this application has added an additional port for sampling the output voltage of the digital output circuit.
[0077] like Figures 3 to 7 As shown, in some embodiments, the analog output circuit mainly includes: a basic analog output circuit, a sampling resistor R1, a control circuit, and a sampling circuit.
[0078] The control terminal of the control circuit is connected to the input terminal of the analog output basic circuit; the output terminal of the analog output basic circuit is connected to one end of the sampling resistor R1, and the other end of the sampling resistor R1 serves as the output terminal of the analog output circuit; the output current sampling point in the sampling circuit is connected to both ends of the sampling resistor R1; the analog output voltage sampling point in the sampling circuit is connected to the output terminal of the analog output circuit; and the digital output voltage sampling point in the sampling circuit is connected to the output terminal of the corresponding switching circuit in the digital output circuit.
[0079] In practical applications, the control circuit can control the output current signal of the analog output basic circuit through the communication line, and receive the output current, output voltage of the analog output circuit and the output voltage of the digital output circuit sampled by the sampling circuit through the communication line.
[0080] Combination Figure 4 , This represents the input voltage of the power supply for the basic analog output circuit. This indicates the input voltage of the power supply for the digital output circuit. This represents the output voltage of a basic analog output circuit. This represents the output voltage of the analog output circuit. This indicates the input voltage of the switching transistor SW1. This represents the output voltage of the digital output circuit. Need to be greater than , The maximum driving voltage is The implementation principle of this scheme is explained as follows (for ease of explanation, it is assumed that the first diode D1, the second diode D5, and the third diode D2 in the output circuit are all ideal diodes with a forward voltage drop of 0V. In actual applications, the influence of the voltage drop of each diode should be considered):
[0081] The control circuit controls the analog output circuit to output a current signal via a communication line. This current signal passes through a sampling resistor R1 and is then output to the switching circuit in the digital output circuit. In the switching circuit, the switching transistor SW1 closes and conducts, causing the digital output circuit to output a digital signal to the external load. The sampling circuit transmits the sampled output current, output voltage, and output voltage of the analog and digital output circuits to the control circuit via the communication line. The control circuit then processes the data.
[0082] Specifically, the output current of the analog output circuit drives the switch SW1 in the switching circuit to close. At this time, the output current of the basic analog output circuit configured by the control circuit program is greater than the output current of the analog output circuit, making the basic analog output circuit in an open-loop state. ,because Therefore, the circuit exists: .
[0083] 1. The detection principle for open circuit faults and short circuit faults in digital output circuits is as follows:
[0084] This application determines the line fault status of the digital output circuit by detecting the output current of the analog output circuit, that is, it determines the line fault status of the digital output circuit based on the current flowing through the sampling resistor R1.
[0085] Depend on Figure 4 It can be seen that the circuit has the following relationship:
[0086] , ;
[0087] According to Ohm's law, the current flowing through the first resistor R2 is:
[0088] Therefore, the circuit has the following relationship:
[0089] .
[0090] in, This indicates the current required to drive the switching transistor SW1. This represents the current flowing through the first resistor R2.
[0091] 1.1: When the load on the digital output circuit is normal, the digital output circuit will normally output ON. , It can be obtained by sampling through a sampling circuit. The specific value (usually a fixed value) can be calculated based on the designed circuit. .
[0092] In summary, when the digital output circuit is driven normally, the output current of the analog output circuit is the current flowing through the first resistor R2:
[0093] ,
[0094] ,
[0095] We can obtain:
[0096] .
[0097] 1.2: When the load of the digital output circuit is open-circuited, the digital output circuit will normally output ON, and the output current of the digital output circuit will... ,at this time The current flowing through the first resistor R2 .
[0098] In summary, when the load of the digital output circuit is open-circuited, the output current of the analog output circuit is the current flowing through the sampling resistor R1.
[0099] ,
[0100] .
[0101] However, in practical applications, an open-circuit fault in the load of a digital output circuit is often not a complete open circuit. When the load impedance of the digital output circuit increases, the output current of the digital output circuit decreases. , so when hour, gradually greater than close to Since the first diode D1 is reverse-biased and cut off, at this time... , .
[0102] According to the formula and We can obtain:
[0103] when hour, ,at this time .
[0104] when hour, .
[0105] At this time, the output current of the analog output circuit is detected by the sampling circuit. ,formula The output current of the digital output circuit can be calculated. Based on the actual application, a current threshold corresponding to an open circuit in the digital output circuit (preset open circuit fault current threshold) is set. The control circuit will then calculate the output current of the digital output circuit. The circuit is compared with a preset open-circuit fault current threshold to determine whether the circuit is open.
[0106] For example, the open-circuit fault output current of the digital output circuit is set to 1mA. At this time, the preset open-circuit fault current threshold is... .
[0107] 1.3: When a load short-circuit fault occurs in the digital output circuit, the digital output circuit normally outputs ON, and the current limiting protection circuit activates its protection function. , ,Right now .
[0108] In summary, according to the formula We can obtain:
[0109] When the load is completely short-circuited, .
[0110] In practical applications, the load impedance will not reach 0Ω, therefore It can be configured according to the application. .
[0111] For example, some applications require that the output voltage be less than 2V when the digital output circuit is OFF. In this case, it can be configured... The corresponding digital output circuit load short-circuit current threshold (preset short-circuit fault current threshold). .
[0112] Based on the above reasoning process, the line fault status of the digital output circuit can be determined based on the output current of the analog output circuit. The specific value of the output current of the analog output circuit can be obtained through the sampling circuit. The sampling circuit sends the sampled output current of the analog output circuit to the control circuit. The control current determines the line fault status of the digital output circuit based on the relationship between the output current of the analog output circuit, the preset open-circuit fault current threshold, and the preset short-circuit fault current threshold.
[0113] It is understandable that the preset open-circuit fault current threshold can be the sum of the switching drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the open-circuit state, and the preset short-circuit fault current threshold can be the sum of the switching drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the short-circuit state.
[0114] 2. The detection principle for component failure in digital output circuits is as follows:
[0115] The sampling circuit can acquire the output voltage of the digital output circuit and send the acquired data to the control circuit via serial port.
[0116] The control circuit has built-in detection logic that compares the output voltage of the digital output circuit with the preset output voltage of the digital output circuit, which can diagnose whether the digital output circuit has a device failure.
[0117] Specifically, the output voltage of the digital output circuit when the switch circuit is in the ON state is used as the comparison condition, or the output voltage of the digital output circuit when the switch circuit is in the OFF state is used as the comparison condition.
[0118] If the output voltage of the digital output circuit corresponding to the switch circuit being in the on state is not equal to the output voltage of the digital output circuit that can be collected by the sampling circuit, and / or, if the output voltage of the digital output circuit corresponding to the switch circuit being in the off state is not equal to the output voltage of the digital output circuit that can be collected by the sampling circuit, a device failure in the digital output circuit can be diagnosed.
[0119] For example, if the input voltage of the power supply for the digital output circuit is 24V, when the digital output circuit is ON, the output voltage of the digital output circuit should be greater than 21V; when the digital output circuit is OFF, the output voltage of the digital output circuit should be less than 11V.
[0120] The output circuit provided in this embodiment includes: a digital output circuit and N analog output circuits, where N is a positive integer; the analog output circuits are arranged in front of the digital output circuits; the analog output circuits include at least: a control circuit and a sampling circuit; the sampling circuits are used to sample the output current of the analog output circuits and the output voltage of the digital output circuits; the digital output circuits include at least: peripheral circuits and a number of switching circuits matching the number of analog output circuits, with each analog output circuit matching at least one switching circuit; the control circuits are used to determine the line fault state of the digital output circuits based on the output current of the analog output circuits, and to determine the device fault state of the digital output circuits based on the output voltage of the digital output circuits and the switching state of the switching circuits, thereby diagnosing line faults and device failures in the digital signal output circuits, solving the problem that in the prior art, the output circuits not only have a complex fault detection process, but also have a very limited range of fault types that can be detected.
[0121] Optionally, based on the output circuit provided in the above embodiments, another embodiment of this application also provides a fault diagnosis method, applied to the control circuit of the digital output circuit in the output circuit of any of the above embodiments, such as... Figure 8 As shown, this fault diagnosis method mainly includes the following steps:
[0122] S101. Obtain the output current of the analog output circuit and the output voltage of the digital output circuit in the output circuit respectively.
[0123] In practical applications, the output current of the analog output circuit and the output voltage of the digital output circuit can be obtained through the sampling circuit in the analog output circuit.
[0124] S102. Determine the line fault status of the digital output circuit based on the relationship between the output current of the analog output circuit, the preset open-circuit fault current threshold, and the preset short-circuit fault current threshold.
[0125] The preset open-circuit fault current threshold is the sum of the switching drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the open-circuit state. The preset short-circuit fault current threshold is the sum of the switching drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the short-circuit state.
[0126] In some embodiments, the specific execution process of step S102, determining the line fault state of the digital output circuit based on the relationship between the output current of the analog output circuit, the preset open-circuit fault current threshold, and the preset short-circuit fault current threshold, is as follows:
[0127] If the output current of the analog output circuit is less than the preset open-circuit fault current threshold, then the line fault state of the digital output circuit is determined to be an open-circuit fault.
[0128] If the output current of the analog output circuit is greater than the preset short-circuit fault current threshold, then the line fault state of the digital output circuit is determined to be a short-circuit fault.
[0129] If the output current of the analog output circuit is between the preset open-circuit fault current threshold and the preset short-circuit fault current threshold, then the line fault state of the digital output circuit is determined to be no fault.
[0130] It should be noted that the specific values of the preset open-circuit fault current threshold and the preset short-circuit fault current threshold can be determined according to the design parameters of the output circuit. This application does not impose specific limitations on them, and they are all within the protection scope of this application.
[0131] S103. Determine the device fault status of the digital output circuit based on the output voltage of the digital output circuit and the switching state of the corresponding switching circuit in the output circuit.
[0132] In practical applications, the specific execution process of step S103, determining the device fault state of the digital output circuit based on the output voltage of the digital output circuit and the switching state of the corresponding switching circuit in the output circuit, is as follows, mainly including steps S201 to S203:
[0133] S201. Determine whether the output voltage of the digital output circuit matches the switching state of the corresponding switch circuit in the output circuit.
[0134] The matching of the output voltage of the digital output circuit with the switching state of the corresponding switch circuit in the output circuit includes: when the corresponding switch circuit in the output circuit is in the on state, the output voltage of the digital output circuit is equal to the voltage corresponding to the on state; or, when the corresponding switch circuit in the output circuit is in the off state, the output voltage of the digital output circuit is equal to the voltage corresponding to the off state.
[0135] If it is determined that the output voltage of the digital output circuit does not match the switching state of the corresponding switch circuit in the output circuit, then step S202 can be executed; if it is determined that the output voltage of the digital output circuit matches the switching state of the corresponding switch circuit in the output circuit, then step S203 can be executed.
[0136] S202. Determine the device fault status of the digital output circuit as a device fault.
[0137] S203. Determine that the device fault status of the digital output circuit is no device fault.
[0138] The fault diagnosis method provided in this embodiment is applied to the control circuit of the digital output circuit in any of the above embodiments. The fault diagnosis method includes: acquiring the output current of the analog output circuit and the output voltage of the digital output circuit in the output circuit respectively; determining the line fault state of the digital output circuit based on the relationship between the output current of the analog output circuit, a preset open-circuit fault current threshold, and a preset short-circuit fault current threshold, wherein the preset open-circuit fault current threshold is the sum of the switching drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the open-circuit state, and the preset short-circuit fault current threshold is the sum of the switching drive current of the corresponding switch circuit in the output circuit and the load current of the digital output circuit in the short-circuit state; and determining the device fault state of the digital output circuit based on the output voltage of the digital output circuit and the switching state of the corresponding switch circuit in the output circuit. This method can diagnose line faults and device failures in digital signal output circuits, solving the problems of complex fault detection processes and limited fault types that can be detected in existing technologies.
[0139] It should be noted that the relevant descriptions of the output circuit can be found in the corresponding embodiments described above, and will not be repeated here.
[0140] For ease of understanding, the output circuit and fault diagnosis method provided in the above embodiments are as follows: Figure 4 As shown, the specific process for fault diagnosis of this output circuit in actual application is as follows:
[0141] In practical applications, digital output circuits can be integrated with analog output circuits into a single control module, or they can be designed as a separate expansion module. This example uses a standalone expansion module as an example; the I / O control module can be paired with the expansion module according to the actual load application.
[0142] When the digital output circuit is ON and the load on the digital output circuit is normal, the control circuit controls the analog output circuit to output 20mA. However, the actual load drive is much less than 20mA, therefore the analog output circuit is in an open-loop state. .
[0143] Therefore, it can be calculated .
[0144] , .
[0145] When the digital output circuit is driven normally, the output current of the analog output circuit is the current flowing through the sampling resistor R1:
[0146] .
[0147] When the digital output circuit experiences an open-circuit fault, according to the formula... , can be obtained .
[0148] When a short circuit occurs in the load of a digital output circuit, according to the formula... , We can obtain:
[0149] .
[0150] In summary, based on practical applications and calculated values, the preset open-circuit fault current threshold can be set to... The preset short-circuit fault current threshold is set to .
[0151] It should be noted that the above is merely a specific example of the application of this application. In practice, adjustments can be made according to the application environment and user needs. As long as the principle is the same as this application, it is within the protection scope of this application.
[0152] The features described in the various embodiments of this specification can be substituted for or combined with each other. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the description of the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort. Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0153] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0154] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. An output circuit, characterized in that, The output circuit comprises: a digital output circuit and N analog output circuits, N being a positive integer; the analog output circuit is arranged in front of the digital output circuit; the digital output circuit comprises at least a peripheral circuit and a switch circuit matched with the analog output circuit, and each analog output circuit is matched with at least one switch circuit; the analog output circuit comprises at least a control circuit and a sampling circuit; the sampling circuit is used for sampling output current of the analog output circuit and output voltage of the digital output circuit; the control circuit is used for judging line fault state of the digital output circuit according to the output current of the analog output circuit, and judging device fault state of the digital output circuit according to the output voltage of the digital output circuit and switch state of the switch circuit.
2. The output circuit according to claim 1, characterized by the peripheral circuit comprises a first diode and a second diode; anode of the first diode is connected to a power supply of the digital output circuit, and cathode of the first diode is connected to a first input end of the switch circuit; anode of the second diode is connected to an output end of the switch circuit, and cathode of the second diode is connected to an external load.
3. The output circuit according to claim 2, characterized by the switch circuit comprises a third diode, a first resistor and a switch tube; anode of the third diode is connected to a gate of the switch tube, and a connection point is used as a second input end of the switch circuit and is connected to an output end of the corresponding analog output circuit; cathode of the third diode is connected to one end of the first resistor; the other end of the first resistor is connected to a source of the switch tube, and a connection point is used as a first input end of the switch circuit; a drain of the switch tube is used as an output end of the switch circuit.
4. The output circuit according to claim 3, characterized by the switch circuit further comprises a second resistor and a third resistor; one end of the second resistor is connected to the gate of the switch tube, the other end of the second resistor is connected to one end of the third resistor, and a connection point is connected to the second input end of the switch circuit; the other end of the third resistor is grounded.
5. The output circuit according to claim 2, characterized by the digital output circuit further comprises a current-limiting protection circuit arranged in front of the first diode.
6. The output circuit according to claim 5, characterized by the current-limiting protection circuit comprises an electronic fuse or a self-recovery fuse.
7. The output circuit according to claim 1, characterized by the analog output circuit comprises an analog output basic circuit, a sampling resistor, the control circuit and the sampling circuit; a control end of the control circuit is connected to an input end of the analog output basic circuit; an output end of the analog output basic circuit is connected to one end of the sampling resistor, and the other end of the sampling resistor is used as an output end of the analog output circuit; an output current sampling point in the sampling circuit is connected to both ends of the sampling resistor, an analog output voltage sampling point in the sampling circuit is connected to the output end of the analog output circuit, and a digital output voltage sampling point in the sampling circuit is connected to the output end of the corresponding switch circuit in the digital output circuit.
8. A failure diagnosis method characterized by comprising: the control circuit applied to the digital output circuit in the output circuit of any one of claims 1-7, and the fault diagnosis method comprises: Obtaining output current of an analog output circuit and output voltage of a digital output circuit in the output circuit respectively; Determining line fault state of the digital output circuit according to size relationship among the output current of the analog output circuit, preset open-circuit fault current threshold and preset short-circuit fault current threshold, wherein the preset open-circuit fault current threshold is sum of switch driving current of corresponding switch circuit in the output circuit and load current of the digital output circuit in open-circuit state, and the preset short-circuit fault current threshold is sum of switch driving current of corresponding switch circuit in the output circuit and load current of the digital output circuit in short-circuit state; Determining device fault state of the digital output circuit according to the output voltage of the digital output circuit and switch state of corresponding switch circuit in the output circuit.
9. The failure diagnosis method according to claim 8, characterized by, Determining line fault state of the digital output circuit according to size relationship among the output current of the analog output circuit, preset open-circuit fault current threshold and preset short-circuit fault current threshold includes: If the output current of the analog output circuit is less than the preset open-circuit fault current threshold, determining that the line fault state of the digital output circuit is open-circuit fault; If the output current of the analog output circuit is greater than the preset short-circuit fault current threshold, determining that the line fault state of the digital output circuit is short-circuit fault.
10. The failure diagnosis method according to claim 8, characterized by, Determining device fault state of the digital output circuit according to the output voltage of the digital output circuit and switch state of corresponding switch circuit in the output circuit includes: Judging whether the output voltage of the digital output circuit matches the switch state of corresponding switch circuit in the output circuit or not; If it is judged that the output voltage of the digital output circuit does not match the switch state of corresponding switch circuit in the output circuit, determining that the device fault state of the digital output circuit is device fault; The output voltage of the digital output circuit matches the switch state of corresponding switch circuit in the output circuit includes: when the corresponding switch circuit in the output circuit is in on state, the output voltage of the digital output circuit is equal to corresponding voltage in the on state; or, when the corresponding switch circuit in the output circuit is in off state, the output voltage of the digital output circuit is equal to corresponding voltage in the off state.